:root {
  color-scheme: dark;
  --bg: #090d14;
  --bg-elev: #0e1420;
  --bg-panel: rgba(12, 17, 28, 0.92);
  --bg-panel-soft: rgba(16, 22, 34, 0.88);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f1e8;
  --text-soft: #a8b0bf;
  --text-faint: #667085;
  --gold: #d7b24a;
  --gold-deep: #a17a1a;
  --amber: #e0a84b;
  --green: #2dc28f;
  --red: #ef5a5a;
  --cyan: #4dc4ff;
  --violet: #8b7cff;
  --surface-highlight: rgba(215, 178, 74, 0.12);
  --surface-selected: rgba(215, 178, 74, 0.18);
  --radius: 8px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(17, 24, 38, 0.92), rgba(9, 13, 20, 1)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: auto, 32px 32px, 32px 32px;
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC",
    "Noto Sans TC", "Helvetica Neue", Arial, sans-serif;
}

body {
  min-height: 100dvh;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100dvh;
}

.auth-screen {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
}

.auth-shell {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 18px;
  align-items: center;
}

.auth-copy {
  min-width: 0;
  padding: 12px 6px;
}

.auth-kicker {
  margin-top: 18px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-copy h1 {
  margin: 10px 0 10px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
}

.auth-subline {
  max-width: 36ch;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.65;
}

.auth-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.field-input {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  outline: 0;
}

.field-input::placeholder {
  color: var(--text-faint);
}

.field-input:focus {
  border-color: rgba(215, 178, 74, 0.42);
  box-shadow: 0 0 0 2px rgba(215, 178, 74, 0.12);
}

.auth-message {
  min-height: 1.4em;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.4;
}

.auth-message.is-error {
  color: var(--red);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: rgba(7, 11, 17, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(215, 178, 74, 0.24), rgba(215, 178, 74, 0.08));
  border: 1px solid rgba(215, 178, 74, 0.35);
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 0;
}

.brand-copy {
  min-width: 0;
}

.brand-eyebrow {
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-title {
  font-size: 18px;
  font-weight: 750;
  white-space: nowrap;
}

.topbar-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.pill-muted {
  color: var(--text);
}

.pill-user {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill-source-d1 {
  border-color: rgba(45, 194, 143, 0.35);
  background: rgba(45, 194, 143, 0.1);
  color: #a8f0d5;
}

.pill-source-sample {
  border-color: rgba(224, 168, 75, 0.35);
  background: rgba(224, 168, 75, 0.1);
  color: #ffd98c;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.icon-button svg,
.search-wrap svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.clock {
  min-width: 100px;
  text-align: right;
  color: var(--gold);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
}

.subnav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px 0;
  overflow-x: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.subnav-item {
  flex: 0 0 auto;
  padding: 12px 16px;
  border: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--text-soft);
  font-weight: 650;
}

.subnav-item.is-active {
  background: linear-gradient(180deg, rgba(215, 178, 74, 0.18), rgba(215, 178, 74, 0.08));
  color: var(--gold);
}

.page {
  width: min(1600px, calc(100% - 24px));
  margin: 0 auto;
  padding: 14px 0 24px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(320px, 1.45fr) minmax(230px, 0.8fr);
  gap: 16px;
  align-items: stretch;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 24, 38, 0.74), rgba(10, 14, 20, 0.85));
  box-shadow: var(--shadow);
}

.hero-copy {
  min-width: 0;
}

.hero-kicker {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.hero h1 {
  margin: 6px 0 8px;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-subline {
  color: var(--text-soft);
  font-size: 13px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.stat {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-height: 108px;
  padding: 14px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.stat-value {
  font-size: clamp(24px, 2.2vw, 36px);
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0;
}

.stat-label {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

.stat-total .stat-value {
  color: var(--gold);
}

.stat-important .stat-value {
  color: var(--red);
}

.stat-deep .stat-value {
  color: var(--green);
}

.stat-pending .stat-value {
  color: var(--cyan);
}

.hero-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.panel-label {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

.mini-chart {
  min-height: 118px;
}

.featured {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}

.featured-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 16px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
}

.featured-item:last-child {
  border-right: 0;
}

.featured-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.featured-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.featured-code {
  color: var(--red);
  font-size: 18px;
  font-weight: 850;
}

.featured-stock {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

.featured-title {
  min-height: 2.6em;
  font-size: 19px;
  font-weight: 750;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.featured-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-soft);
  font-size: 12px;
}

.featured-brief {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.95fr);
  align-items: start;
}

.list-column {
  min-width: 0;
}

.toolbar {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text-soft);
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-wrap input::placeholder {
  color: var(--text-faint);
}

.select-wrap {
  flex: 0 0 auto;
}

.select-wrap select {
  min-width: 124px;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  outline: 0;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 0;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-weight: 700;
}

.tab.is-active {
  border-color: rgba(215, 178, 74, 0.35);
  background: rgba(215, 178, 74, 0.18);
  color: #ffe1a6;
}

.tab-count {
  color: inherit;
  opacity: 0.8;
}

.list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 16px 6px;
  color: var(--text-soft);
  font-size: 12px;
}

.notice-list {
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.notice-item {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: inherit;
  text-align: left;
}

.notice-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.notice-item.is-selected {
  background: var(--surface-selected);
  box-shadow: inset 2px 0 0 var(--gold);
}

.notice-code {
  color: var(--gold);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.1;
}

.notice-stock {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
}

.notice-body {
  min-width: 0;
}

.notice-title {
  font-size: 17px;
  font-weight: 760;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.notice-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 12px;
}

.notice-arrow {
  justify-self: end;
  color: var(--text-faint);
  font-size: 18px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.tag-importance-high {
  border-color: rgba(239, 90, 90, 0.4);
  background: rgba(239, 90, 90, 0.12);
  color: #ffb1b1;
}

.tag-importance-medium {
  border-color: rgba(224, 168, 75, 0.38);
  background: rgba(224, 168, 75, 0.12);
  color: #ffd98c;
}

.tag-importance-low {
  border-color: rgba(82, 101, 128, 0.45);
  background: rgba(82, 101, 128, 0.16);
  color: #c2cbe0;
}

.tag-synced {
  border-color: rgba(45, 194, 143, 0.38);
  background: rgba(45, 194, 143, 0.12);
  color: #a8f0d5;
}

.tag-pending {
  border-color: rgba(76, 196, 255, 0.38);
  background: rgba(76, 196, 255, 0.12);
  color: #b8eaff;
}

.tag-pdf {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
}

.detail-pane {
  position: sticky;
  top: 126px;
  min-width: 0;
  min-height: calc(100dvh - 150px);
  padding: 18px;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 21, 33, 0.88), rgba(10, 14, 20, 0.95));
}

.detail-empty {
  display: grid;
  place-items: center;
  min-height: 72vh;
  gap: 14px;
  color: var(--text-soft);
  text-align: center;
}

.detail-empty-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.03);
}

.detail-empty-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-empty-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 750;
}

.detail-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.detail-code {
  color: var(--gold);
  font-size: 22px;
  font-weight: 850;
  line-height: 1.1;
}

.detail-stock {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
}

.detail-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-field {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.detail-field-label {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.detail-field-value {
  margin-top: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 2px;
}

.section-label {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.detail-summary,
.detail-full {
  margin: 0;
  color: var(--text);
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.detail-summary {
  color: #f0e5c9;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-weight: 700;
}

.action-button.primary {
  border-color: rgba(215, 178, 74, 0.38);
  background: rgba(215, 178, 74, 0.16);
  color: #ffe1a6;
}

.action-button[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.action-button.disabled,
.action-button[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.action-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-list {
  padding: 30px 16px;
  color: var(--text-soft);
}

.empty-list strong {
  color: var(--text);
}

.detail-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.progress-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #ffd98c);
}

.progress.green > span {
  background: linear-gradient(90deg, var(--green), #9fe7c9);
}

.progress.red > span {
  background: linear-gradient(90deg, var(--red), #ff9090);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1260px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .detail-pane {
    position: static;
    min-height: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .featured {
    grid-template-columns: 1fr;
  }

  .featured-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .featured-item:last-child {
    border-bottom: 0;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .notice-item {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .notice-arrow {
    display: none;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-meta {
    justify-content: space-between;
  }

  .page {
    width: min(100% - 16px, 1600px);
  }

  .hero,
  .featured-item,
  .toolbar,
  .detail-pane {
    padding-left: 14px;
    padding-right: 14px;
  }

  .notice-item {
    grid-template-columns: 1fr;
  }

  .notice-code {
    font-size: 17px;
  }

  .detail-title {
    font-size: 24px;
  }
}
