:root {
  color-scheme: dark;
  --bg: #06101c;
  --panel: rgba(12, 25, 41, 0.9);
  --panel-strong: #0d1b2b;
  --line: rgba(136, 166, 190, 0.16);
  --line-strong: rgba(136, 166, 190, 0.28);
  --text: #e9f0f5;
  --muted: #8297a9;
  --cyan: #42d9d0;
  --violet: #a88bff;
  --red: #ff7184;
  --green: #43dc91;
  font-family: "Stork Chinese Kai", "Stork Chinese Kai Fallback", Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 320px; min-height: 100vh; margin: 0; overflow-x: hidden; color: var(--text); background: var(--bg); }
button, a { color: inherit; font: inherit; }
button { cursor: pointer; }
.ambient { position: fixed; z-index: -1; width: 520px; height: 520px; border-radius: 50%; filter: blur(110px); opacity: .14; }
.ambient-one { top: -220px; right: -100px; background: var(--violet); }
.ambient-two { bottom: -260px; left: -160px; background: var(--cyan); }
.console-shell { width: min(1540px, calc(100% - 48px)); margin: 0 auto; padding-bottom: 36px; }
.console-header { display: flex; align-items: center; justify-content: space-between; min-height: 84px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(66, 217, 208, .25); border-radius: 11px; color: var(--cyan); background: rgba(66, 217, 208, .06); }
.brand-mark svg { width: 30px; fill: currentColor; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .14em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.operator-label { color: #a9bac7; font-size: 13px; }
.secondary-button, .ghost-button, .publish-button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; border-radius: 10px; padding: 0 16px; text-decoration: none; font-size: 13px; }
.secondary-button { border: 1px solid rgba(168, 139, 255, .28); color: #c6baff; background: rgba(168, 139, 255, .07); }
.secondary-button:hover { border-color: rgba(168, 139, 255, .5); background: rgba(168, 139, 255, .13); }
.ghost-button { border: 1px solid var(--line); color: #9eb0be; background: rgba(255, 255, 255, .02); }
.ghost-button:hover { border-color: var(--line-strong); color: var(--text); }
.publish-button { border: 1px solid rgba(66, 217, 208, .42); color: #061619; background: var(--cyan); font-weight: 800; }
.publish-button:hover { background: #68e5de; }
button:disabled { cursor: not-allowed; opacity: .45; }

.intro-panel { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding: 52px 0 30px; }
.eyebrow, .review-toolbar p, .stock-workspace-head p { margin: 0; color: var(--cyan); font-family: "Stork Chinese Kai", "Stork Chinese Kai Fallback", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; letter-spacing: .18em; }
.intro-panel h1 { margin: 12px 0 10px; font-size: calc(clamp(34px, 4vw, 58px) + 2px); letter-spacing: -.055em; }
.intro-panel > div:first-child > p:last-child { max-width: 720px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
.review-state { flex: 0 0 auto; border: 1px solid rgba(66, 217, 208, .25); border-radius: 999px; padding: 11px 16px; color: var(--cyan); background: rgba(66, 217, 208, .06); font-size: 12px; font-weight: 700; }
.review-state.ready { border-color: rgba(67, 220, 145, .26); color: var(--green); background: rgba(67, 220, 145, .06); }
.review-state.loading { color: var(--muted); }

.status-grid { display: grid; grid-template-columns: repeat(6, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.status-grid article { min-width: 0; padding: 20px 22px; border-right: 1px solid var(--line); }
.status-grid article:last-child { border-right: 0; }
.status-grid span, .status-grid small, .status-grid strong { display: block; }
.status-grid span { color: var(--muted); font-size: 11px; }
.status-grid strong { margin: 8px 0 6px; overflow: hidden; font-family: "Stork Chinese Kai", "Stork Chinese Kai Fallback", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 19px; text-overflow: ellipsis; white-space: nowrap; }
.status-grid small { overflow: hidden; color: #627a8e; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.workflow-strip { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 22px 0; color: #70889b; }
.workflow-strip div { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.workflow-strip b { color: var(--violet); font-family: "Stork Chinese Kai", "Stork Chinese Kai Fallback", ui-monospace, SFMono-Regular, Menlo, monospace; }
.workflow-strip i { width: 48px; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }

.review-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 28px 80px rgba(0, 0, 0, .2); }
.review-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.review-toolbar h2 { margin: 5px 0 0; font-size: 20px; }
.toolbar-actions { display: flex; gap: 8px; }
.message-bar { margin: 14px 18px 0; border: 1px solid rgba(255, 113, 132, .25); border-radius: 10px; padding: 11px 13px; color: #ff9caa; background: rgba(255, 113, 132, .06); font-size: 12px; }
.message-bar.success { border-color: rgba(67, 220, 145, .25); color: var(--green); background: rgba(67, 220, 145, .06); }
.workspace { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 560px; }
.strategy-menu { padding: 14px; border-right: 1px solid var(--line); background: rgba(5, 15, 27, .35); }
.strategy-tab { width: 100%; margin-bottom: 9px; border: 1px solid transparent; border-radius: 12px; padding: 14px; text-align: left; background: transparent; }
.strategy-tab:hover { background: rgba(255, 255, 255, .025); }
.strategy-tab.active { border-color: rgba(168, 139, 255, .3); background: rgba(168, 139, 255, .07); }
.strategy-tab span, .strategy-tab small { display: block; }
.strategy-tab span { color: #dce5ec; font-size: 14px; font-weight: 700; }
.strategy-tab small { margin-top: 7px; color: var(--muted); font-size: 11px; }
.strategy-tab em { float: right; color: var(--cyan); font-family: "Stork Chinese Kai", "Stork Chinese Kai Fallback", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-style: normal; }
.stock-workspace { min-width: 0; }
.stock-workspace-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.stock-workspace-head h2 { margin: 5px 0 0; font-size: 18px; }
.active-actions { display: flex; align-items: center; gap: 14px; }
.active-actions span { color: var(--cyan); font-family: "Stork Chinese Kai", "Stork Chinese Kai Fallback", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.text-button { border: 0; padding: 0; color: #a89af2; background: transparent; font-size: 11px; }
.table-wrap { max-height: 560px; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
thead { position: sticky; z-index: 1; top: 0; background: #0e1c2c; }
th { padding: 11px 14px; color: #62798c; font-size: 10px; font-weight: 600; letter-spacing: .05em; text-align: left; }
td { padding: 11px 14px; border-top: 1px solid rgba(136, 166, 190, .09); color: #aabac6; font-size: 12px; }
tbody tr:hover { background: rgba(66, 217, 208, .025); }
.rank { color: #70889a; font-family: "Stork Chinese Kai", "Stork Chinese Kai Fallback", ui-monospace, SFMono-Regular, Menlo, monospace; }
.stock-name { display: flex; align-items: center; gap: 9px; min-width: 150px; }
.stock-name b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--cyan); background: rgba(66, 217, 208, .07); }
.stock-name strong, .stock-name small { display: block; }
.stock-name strong { color: #dce5eb; font-size: 13px; }
.stock-name small { margin-top: 3px; color: #627b8f; font-family: "Stork Chinese Kai", "Stork Chinese Kai Fallback", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.number { font-family: "Stork Chinese Kai", "Stork Chinese Kai Fallback", ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
.positive { color: var(--red); }
.negative { color: var(--green); }
.row-actions { display: flex; gap: 5px; }
.row-actions button { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid var(--line); border-radius: 7px; color: #8ba0b1; background: rgba(255, 255, 255, .02); }
.row-actions button:hover { border-color: var(--line-strong); color: var(--text); }
.row-actions .remove:hover { border-color: rgba(255, 113, 132, .35); color: var(--red); }
.empty { height: 220px; color: var(--muted); text-align: center; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 18px 4px 0; color: #536b7e; font-size: 11px; }
.icp-record-link { color: inherit; text-decoration: none; white-space: nowrap; }
.icp-record-link:hover, .icp-record-link:focus-visible { color: #e5d85f; text-decoration: underline; text-underline-offset: 3px; }
.toast { position: fixed; z-index: 10; right: 24px; bottom: 24px; transform: translateY(20px); border: 1px solid rgba(66, 217, 208, .3); border-radius: 11px; padding: 12px 16px; color: var(--cyan); background: #0c1a2a; font-size: 12px; opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 960px) {
  .status-grid { grid-template-columns: repeat(2, 1fr); }
  .status-grid article:nth-child(even) { border-right: 0; }
  .status-grid article:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .workspace { grid-template-columns: 220px minmax(0, 1fr); }
  th:nth-child(4), td:nth-child(4), th:nth-child(6), td:nth-child(6) { display: none; }
}

@media (max-width: 720px) {
  .console-shell { width: min(100% - 24px, 1540px); }
  .operator-label { display: none; }
  .intro-panel { align-items: flex-start; flex-direction: column; padding-top: 34px; }
  .workflow-strip { align-items: flex-start; flex-direction: column; padding-left: 12px; }
  .workflow-strip i { width: 1px; height: 14px; margin-left: 9px; }
  .review-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; flex-wrap: wrap; }
  .toolbar-actions button { flex: 1 1 130px; }
  .workspace { display: block; }
  .strategy-menu { display: flex; gap: 8px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .strategy-tab { min-width: 180px; margin: 0; }
  .table-wrap { max-height: 520px; }
  th:nth-child(3), td:nth-child(3), th:nth-child(5), td:nth-child(5) { display: none; }
  footer { flex-direction: column; }
}

@media (max-width: 480px) {
  .brand > span:last-child { display: none; }
  .status-grid { grid-template-columns: 1fr; }
  .status-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
  .status-grid article:last-child { border-bottom: 0; }
  .stock-workspace-head { align-items: flex-start; flex-direction: column; }
  th, td { padding-right: 9px; padding-left: 9px; }
}
