:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: rgba(13, 27, 46, 0.82);
  --panel-strong: #0e1d31;
  --line: rgba(145, 177, 220, 0.16);
  --text: #f3f7ff;
  --muted: #8fa3bd;
  --blue: #5c8dff;
  --violet: #8c6cff;
  --cyan: #45d6ff;
  --green: #56dda6;
  --amber: #ffc66d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(circle at 50% -20%, #142a52 0, #07111f 46%, #050b14 100%); }
.glow { position: absolute; width: 40rem; height: 40rem; border-radius: 50%; filter: blur(100px); opacity: .22; }
.glow-one { top: -18rem; left: -12rem; background: #3976ff; }
.glow-two { right: -18rem; top: 12rem; background: #7047ff; }
.stars { position: absolute; inset: 0; opacity: .42; background-image: radial-gradient(circle, rgba(255,255,255,.75) 0 1px, transparent 1.5px); background-size: 52px 52px; mask-image: linear-gradient(to bottom, black, transparent 75%); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 76px; padding: 14px max(24px, calc((100vw - 1260px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(5, 13, 24, .72); backdrop-filter: blur(20px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid rgba(108,149,255,.48); border-radius: 14px; background: linear-gradient(145deg, rgba(91,141,255,.24), rgba(116,73,255,.1)); color: #a9c2ff; box-shadow: inset 0 0 18px rgba(91,141,255,.16); }
.brand h1 { margin: 0; font-size: 18px; letter-spacing: .04em; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.mode-badge { padding: 7px 11px; border: 1px solid rgba(86,221,166,.25); border-radius: 999px; background: rgba(86,221,166,.08); color: #80edbd; font-size: 12px; }
.ghost-button, .refresh-button, .icon-button { border: 1px solid var(--line); background: rgba(255,255,255,.035); color: #c9d6e8; }
.ghost-button, .refresh-button { padding: 8px 12px; border-radius: 10px; font-size: 13px; }
.ghost-button:hover, .refresh-button:hover, .icon-button:hover { background: rgba(255,255,255,.08); color: white; }

.page-shell { width: min(1260px, calc(100% - 32px)); margin: 30px auto 70px; }
.hero-panel {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: 1.35fr .65fr; align-items: center; min-height: 300px;
  padding: clamp(30px, 5vw, 62px);
  border: 1px solid rgba(129,166,255,.2); border-radius: 28px;
  background: linear-gradient(135deg, rgba(18,43,78,.92), rgba(12,23,43,.9) 54%, rgba(32,24,72,.88));
  box-shadow: var(--shadow);
}
.hero-panel::after { content: ""; position: absolute; width: 420px; height: 420px; right: -120px; top: -170px; border: 1px solid rgba(120,158,255,.14); border-radius: 50%; box-shadow: 0 0 0 60px rgba(93,128,255,.03), 0 0 0 130px rgba(93,128,255,.025); z-index: -1; }
.eyebrow, .drawer-kicker { color: #7ca2ff; font-size: 11px; font-weight: 700; letter-spacing: .2em; }
.hero-copy h2 { max-width: 760px; margin: 16px 0; font-size: clamp(30px, 4.2vw, 54px); line-height: 1.15; letter-spacing: -.04em; }
.hero-copy p { max-width: 680px; margin: 0; color: #a9b8cc; font-size: 16px; line-height: 1.8; }

.constellation { position: relative; width: 330px; height: 190px; justify-self: end; opacity: .96; }
.node { position: absolute; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(141,177,255,.58); border-radius: 50%; background: #10284b; color: #d8e5ff; font-size: 12px; box-shadow: 0 0 24px rgba(73,129,255,.42); z-index: 2; }
.n1{left:12px;top:54px}.n2{left:74px;top:20px}.n3{left:130px;top:65px}.n4{left:190px;top:38px}.n5{left:224px;top:100px}.n6{left:276px;top:78px}.n7{left:292px;top:148px}
.line { position: absolute; height: 1px; transform-origin: left center; background: linear-gradient(90deg, #6c9cff, rgba(108,156,255,.25)); box-shadow: 0 0 7px rgba(108,156,255,.6); }
.l1{width:70px;left:40px;top:70px;transform:rotate(-28deg)}.l2{width:72px;left:101px;top:49px;transform:rotate(39deg)}.l3{width:68px;left:159px;top:78px;transform:rotate(-24deg)}.l4{width:70px;left:214px;top:69px;transform:rotate(63deg)}.l5{width:61px;left:252px;top:115px;transform:rotate(-23deg)}.l6{width:74px;left:301px;top:109px;transform:rotate(77deg)}

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.stats article { padding: 20px 22px; border: 1px solid var(--line); border-radius: 18px; background: rgba(12,25,43,.72); backdrop-filter: blur(12px); }
.stats span { display: block; color: var(--muted); font-size: 13px; }
.stats strong { display: block; margin-top: 8px; font-size: 28px; letter-spacing: -.04em; }

.workspace { padding: 22px; border: 1px solid var(--line); border-radius: 24px; background: rgba(8,18,32,.74); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.search-box { position: relative; display: flex; align-items: center; flex: 1; max-width: 570px; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.035); }
.search-box > span { color: #8295ad; font-size: 22px; transform: rotate(-15deg); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 0 36px 0 10px; background: transparent; color: white; }
.search-box input::placeholder { color: #667b96; }
.search-box button { position: absolute; right: 11px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(255,255,255,.08); color: #aab7c8; }
.tabs { display: flex; gap: 6px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); }
.tab { min-width: 76px; border: 0; border-radius: 9px; padding: 8px 14px; background: transparent; color: #8498b1; font-size: 13px; }
.tab.active { background: linear-gradient(135deg, #4e7df5, #6f52e8); color: white; box-shadow: 0 8px 24px rgba(74,107,237,.28); }
.result-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 28px 2px 17px; }
.result-head h3 { margin: 0; font-size: 18px; }
.result-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.content-card { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 260px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(20,38,63,.96), rgba(12,25,44,.96)); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; cursor: pointer; }
.content-card::before { content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 2px; background: linear-gradient(90deg, transparent, rgba(90,139,255,.9), transparent); opacity: .65; }
.content-card:hover { transform: translateY(-4px); border-color: rgba(114,153,255,.38); box-shadow: 0 20px 45px rgba(0,0,0,.24); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border-radius: 999px; font-size: 11px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.status.pending { background: rgba(255,198,109,.09); color: var(--amber); }
.status.pending::before { background: var(--amber); box-shadow: 0 0 8px rgba(255,198,109,.7); }
.status.scheduled { background: rgba(86,221,166,.09); color: var(--green); }
.status.scheduled::before { background: var(--green); box-shadow: 0 0 8px rgba(86,221,166,.7); }
.card-index { color: #50647e; font-size: 11px; letter-spacing: .12em; }
.content-card h4 { margin: 20px 0 13px; font-size: 19px; line-height: 1.55; letter-spacing: -.015em; }
.card-viewpoint { display: -webkit-box; overflow: hidden; margin: 0; color: #9cb0c8; font-size: 13px; line-height: 1.7; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 20px; }
.direction { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 5px 9px; border: 1px solid rgba(94,137,214,.18); border-radius: 8px; background: rgba(74,116,190,.08); color: #83a9ec; font-size: 11px; }
.open-hint { color: #6d8098; font-size: 12px; }
.empty-state { grid-column: 1 / -1; padding: 74px 20px; border: 1px dashed rgba(139,171,214,.18); border-radius: 18px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; margin-bottom: 8px; color: #d8e3f2; font-size: 17px; }
.loading-card { min-height: 260px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: rgba(17,32,53,.7); }
.loading-card span { display: block; height: 14px; margin-bottom: 18px; border-radius: 8px; background: linear-gradient(90deg, rgba(255,255,255,.035), rgba(255,255,255,.1), rgba(255,255,255,.035)); background-size: 200% 100%; animation: pulse 1.4s infinite; }
.loading-card span:nth-child(2){height:58px}.loading-card span:nth-child(3){width:55%}
@keyframes pulse { to { background-position: -200% 0; } }

.drawer-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.58); backdrop-filter: blur(4px); }
.drawer { position: fixed; top: 0; right: 0; z-index: 50; display: flex; flex-direction: column; width: min(620px, 100%); height: 100dvh; border-left: 1px solid var(--line); background: #091526; box-shadow: -30px 0 80px rgba(0,0,0,.44); transform: translateX(102%); transition: transform .28s ease; }
.drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 25px 26px 20px; border-bottom: 1px solid var(--line); }
.drawer-header h2 { margin: 8px 0 0; font-size: 23px; line-height: 1.45; }
.icon-button { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; font-size: 24px; line-height: 1; }
.drawer-scroll { flex: 1; overflow-y: auto; padding: 22px 26px 32px; }
.detail-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.detail-mode { color: #61748d; font-size: 12px; }
.star-block { position: relative; margin-bottom: 12px; padding: 15px 16px 15px 18px; border: 1px solid rgba(123,158,211,.13); border-radius: 13px; background: rgba(255,255,255,.028); }
.star-block::before { content: ""; position: absolute; left: 0; top: 13px; bottom: 13px; width: 3px; border-radius: 3px; background: linear-gradient(var(--blue), var(--violet)); }
.star-name { margin-bottom: 7px; color: #7fa7ff; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.star-value { color: #d5dfed; font-size: 14px; line-height: 1.75; white-space: pre-wrap; }
.script-title { display: flex; align-items: center; gap: 8px; margin: 25px 0 10px; font-size: 14px; }
.full-script { padding: 18px; border: 1px solid rgba(123,158,211,.13); border-radius: 14px; background: rgba(255,255,255,.025); color: #cdd9e8; font-size: 14px; line-height: 1.9; white-space: pre-wrap; }
.drawer-actions { display: grid; grid-template-columns: 1fr 1.15fr; gap: 10px; padding: 16px 24px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(9,21,38,.96); }
.secondary-button, .primary-button { min-height: 48px; border-radius: 13px; font-weight: 700; }
.secondary-button { border: 1px solid var(--line); background: rgba(255,255,255,.04); color: #d3deec; }
.primary-button { border: 0; background: linear-gradient(135deg, #4c83ff, #7656e9); color: white; box-shadow: 0 12px 28px rgba(80,101,236,.28); }
.primary-button:disabled { cursor: not-allowed; opacity: .52; box-shadow: none; }
.toast { position: fixed; left: 50%; bottom: 34px; z-index: 100; max-width: calc(100% - 32px); padding: 12px 18px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(5,12,21,.94); color: white; box-shadow: 0 18px 50px rgba(0,0,0,.42); opacity: 0; transform: translate(-50%, 18px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) {
  .hero-panel { grid-template-columns: 1fr; }
  .constellation { display: none; }
  .card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .topbar { min-height: 68px; padding: 11px 16px; }
  .brand p { display: none; }
  .brand-mark { width: 38px; height: 38px; }
  .top-actions .ghost-button { display: none; }
  .page-shell { width: min(100% - 20px, 1260px); margin-top: 14px; }
  .hero-panel { min-height: 230px; padding: 28px 24px; border-radius: 21px; }
  .hero-copy h2 { font-size: 31px; }
  .hero-copy p { font-size: 14px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .stats article { padding: 16px; }
  .stats strong { font-size: 24px; }
  .workspace { padding: 13px; border-radius: 19px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-box { max-width: none; }
  .tabs { display: grid; grid-template-columns: repeat(3, 1fr); }
  .tab { min-width: 0; padding-inline: 7px; }
  .card-grid { grid-template-columns: 1fr; }
  .content-card { min-height: 230px; }
  .drawer-header, .drawer-scroll { padding-left: 18px; padding-right: 18px; }
  .drawer-actions { padding-left: 14px; padding-right: 14px; }
}
