/* 玄枢视觉系统 v2：现代夜色研究台 */
:root {
  --ink: #f3efe7;
  --ink-soft: #17181f;
  --paper: #0d0e12;
  --paper-deep: #121319;
  --muted: #9b9aa4;
  --line: rgba(255, 255, 255, 0.09);
  --red: #d46f62;
  --red-dark: #bd5d52;
  --jade: #79a89b;
  --ochre: #d0ad72;
  --white: #1a1b22;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
  --radius: 22px;
  --font: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}

body {
  min-width: 320px;
  background:
    radial-gradient(circle at 82% 7%, rgba(111, 78, 151, 0.13), transparent 28%),
    radial-gradient(circle at 48% 100%, rgba(60, 103, 90, 0.08), transparent 33%),
    var(--paper);
  color: var(--ink);
  font-family: var(--font);
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: radial-gradient(rgba(255, 255, 255, 0.22) 0.5px, transparent 0.5px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, black, transparent 55%);
}

.shell { grid-template-columns: 216px 1fr; }

.sidebar {
  width: 216px;
  padding: 26px 16px 22px;
  background: rgba(13, 14, 18, 0.88);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(24px);
}

.sidebar::before { display: none; }

.brand { padding: 0 10px 34px; gap: 11px; }
.brand-mark {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 11px;
  color: #171319;
  background: linear-gradient(145deg, #e0c08d, #a67e49);
  font: 600 20px/1 var(--font);
  transform: none;
  box-shadow: 0 8px 28px rgba(197, 158, 100, 0.14);
}
.brand strong { font: 600 18px/1.2 var(--font); letter-spacing: 0.14em; }
.brand small { margin-top: 5px; color: #777780; letter-spacing: 0.08em; }

.nav-list { gap: 5px; }
.nav-item {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #85858f;
  font-size: 12px;
  font-weight: 500;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.05); }
.nav-item.active {
  color: #f5f1e9;
  background: linear-gradient(90deg, rgba(212, 111, 98, 0.16), rgba(212, 111, 98, 0.04));
  box-shadow: inset 2px 0 #d46f62;
}
.nav-icon { color: #c4a978; font: 600 14px var(--font); }
.sidebar-foot { border-color: var(--line); padding: 20px 10px 0; }
.sidebar-foot p { font: 500 12px var(--font); letter-spacing: 0.18em; }
.sidebar-foot small { color: #66666f; }
.moon-orbit { opacity: 0.55; }

.main { grid-column: 2; max-width: 1520px; width: 100%; margin-inline: auto; padding: 32px clamp(28px, 4vw, 68px) 70px; }
.topbar { margin-bottom: 30px; }
.eyebrow { color: #b89769; font-size: 10px; letter-spacing: 0.12em; }
.topbar h1 { font: 600 25px/1.3 var(--font); letter-spacing: 0.06em; }
.top-actions { gap: 10px; }
.icon-button {
  width: 40px;
  height: 40px;
  color: #bdbac2;
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}
.primary-button {
  padding: 11px 17px;
  border-radius: 11px;
  background: linear-gradient(135deg, #d9786b, #b75047);
  box-shadow: 0 10px 30px rgba(183, 80, 71, 0.2);
  font-size: 12px;
  font-weight: 600;
}
.primary-button:hover { box-shadow: 0 14px 34px rgba(183, 80, 71, 0.3); }

.hero-card {
  min-height: 342px;
  grid-template-columns: minmax(0, 1.55fr) minmax(250px, 0.65fr);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.035), transparent 45%),
    linear-gradient(145deg, #1b1c24, #13141a);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 26px;
  box-shadow: var(--shadow);
}
.hero-card::before {
  opacity: 1;
  background:
    radial-gradient(circle at 78% 20%, rgba(198, 156, 94, 0.12), transparent 28%),
    radial-gradient(circle at 15% 100%, rgba(138, 76, 100, 0.11), transparent 34%);
}
.hero-copy { padding: 46px clamp(32px, 4vw, 62px); }
.seal {
  border: 0;
  border-radius: 99px;
  padding: 6px 10px;
  color: #dda49b;
  background: rgba(212, 111, 98, 0.1);
  letter-spacing: 0.1em;
}
.hero-kicker { margin-top: 24px; color: #8e8e98; }
.hero-copy h2 {
  max-width: 720px;
  margin-top: 8px;
  font: 600 clamp(28px, 3.1vw, 46px)/1.35 var(--font);
  letter-spacing: -0.02em;
}
.hero-description { max-width: 650px; color: #97969f; line-height: 1.8; }
.text-button { color: #d8b37a; font-weight: 600; }

.compass { opacity: 0.72; }
.compass::before {
  content: "";
  position: absolute;
  width: 270px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(195, 145, 97, 0.13), transparent 64%);
  filter: blur(3px);
}
.compass-ring { width: 205px; border-color: rgba(214, 185, 137, 0.17); }
.compass-ring::before, .compass-ring::after { border-color: rgba(214, 185, 137, 0.09); }
.compass-ring::after { background: rgba(191, 101, 91, 0.08); }
.compass-ring span { color: #aca28e; font: 400 12px var(--font); }
.compass-ring b { color: #cf8378; font: 500 30px var(--font); }

.section-heading { margin: 38px 0 18px; }
.section-heading span, .panel-title span { color: #b89769; letter-spacing: 0.12em; }
.section-heading h2, .panel-title h3 { font: 600 20px var(--font); letter-spacing: 0.02em; }
.section-heading p { color: #7e7e87; }

.discipline-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
.discipline-card {
  min-height: 162px;
  padding: 24px 25px 22px 82px;
  color: var(--ink) !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  border-color: var(--line);
  border-radius: 18px;
}
.discipline-card:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(208, 173, 114, 0.28); }
.discipline-card::after { display: none; }
.card-symbol {
  position: absolute;
  left: 22px;
  top: 24px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: #d0ad72;
  font: 600 18px var(--font);
}
.discipline-card.jade .card-symbol { color: #83b5a7; }
.discipline-card.ochre .card-symbol { color: #d69e69; }
.discipline-card.ink .card-symbol { color: #c192b5; }
.count { right: 22px; top: 22px; color: #62626c; }
.discipline-card h3 { margin: 0 0 8px; color: var(--ink); font: 600 16px var(--font); }
.discipline-card p { max-width: 470px; color: #8f8f98; line-height: 1.65; }
.card-link { margin-top: 13px; color: #b9a074; font-size: 10px; }

.lower-grid { gap: 14px; margin-top: 14px; }
.panel {
  padding: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.042), rgba(255, 255, 255, 0.018));
  border-color: var(--line);
  border-radius: 18px;
}
.quiet-button, .record-row time, .record-row small { color: #777781; }
.record-row, .principles-panel li { border-color: var(--line); }
.record-avatar { background: rgba(121, 168, 155, 0.14); color: #94c4b6; }
.principles-panel li b { color: #d27a6e; font-family: var(--font); }
.seal-outline { border-color: rgba(212, 111, 98, 0.5); color: #d57b70 !important; border-radius: 9px; font-family: var(--font) !important; }

.module-intro { margin-top: 12px; }
.module-number {
  border: 0;
  border-radius: 18px;
  color: #d0ad72;
  background: rgba(208, 173, 114, 0.08);
  font: 500 23px var(--font);
}
.module-intro h2 { font: 600 clamp(28px, 4vw, 42px) var(--font); letter-spacing: -0.02em; }
.module-intro p:last-child { color: #898993; line-height: 1.8; }

input, select, textarea {
  color: #ece8e1;
  border-color: var(--line);
  background: rgba(7, 8, 11, 0.38);
}
input::placeholder, textarea::placeholder { color: #65656e; }
input:focus, select:focus, textarea:focus { border-color: rgba(208, 173, 114, 0.5); background: rgba(7, 8, 11, 0.55); }
select { color-scheme: dark; }
label > span { color: #c9c6c1; font-weight: 500; }
label small, .required-note { color: #71717a !important; }
.check-list li, .observation-steps > div { border-color: var(--line); }
.check-list li > span { border-color: var(--line); color: #d27a6e; }
.check-list p, .observation-steps small { color: #7f7f89; }
.notice { background: rgba(121, 168, 155, 0.07); }
.saved-profile-loader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 20px;
  padding: 14px;
  border: 1px solid rgba(208, 173, 114, 0.18);
  border-radius: 12px;
  background: rgba(208, 173, 114, 0.045);
}
.saved-profile-loader label { gap: 6px; }
.saved-profile-loader label > span { color: #c6a971; font-size: 10px; }
.load-profile-button {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(208, 173, 114, 0.28);
  border-radius: 9px;
  color: #dfbf89;
  background: rgba(208, 173, 114, 0.07);
  cursor: pointer;
  font-size: 11px;
}

.chart-output { margin-top: 18px; scroll-margin-top: 24px; }
.chart-output[hidden] { display: none; }
.chart-meta {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  margin: 22px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
}
.chart-meta > span { display: grid; gap: 5px; padding: 13px 14px; background: #15161c; }
.chart-meta small { color: #777781; font-size: 9px; }
.chart-meta strong { color: #e9e4dc; font-size: 12px; font-weight: 600; }
.pillar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pillar-card {
  display: grid;
  justify-items: center;
  padding: 18px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}
.pillar-card small { margin-bottom: 12px; color: #a58a63; font-size: 10px; }
.pillar-card b { font-size: 29px; line-height: 1.25; color: #eee9e1; }
.pillar-card b:nth-of-type(2) { color: #d17d71; }
.pillar-card span { margin-top: 10px; color: #777781; font-size: 10px; }
.calculation-note { margin: 17px 0 0; padding-left: 12px; border-left: 2px solid #7aa89b; color: #777781; font-size: 10px; }
.ziwei-summary { margin-top: 0; }
.ziwei-summary .empty-state { grid-column: 1 / -1; background: #15161c; }
.ziwei-plate {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(158px, auto));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(208, 173, 114, 0.28);
  border-radius: 18px;
  background: rgba(208, 173, 114, 0.22);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.22);
}
.ziwei-palace, .ziwei-center { background: #121319; }
.ziwei-palace { display: flex; flex-direction: column; min-width: 0; padding: 13px; }
.ziwei-palace header { display: flex; align-items: center; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.055); }
.ziwei-palace h3 { margin: 0; color: #e8dfd3; font: 600 13px var(--font); }
.ziwei-palace header span { margin-left: auto; color: #8b7962; font-size: 10px; }
.ziwei-palace header em { padding: 2px 5px; border: 1px solid rgba(209,125,113,.35); border-radius: 99px; color: #d17d71; font-size: 8px; font-style: normal; }
.major-stars { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 5px; margin-top: 10px; line-height: 1.3; }
.major-stars b { color: #e5bd76; font-size: 12px; font-weight: 650; }
.major-stars i { padding: 1px 3px; border-radius: 3px; color: #f0dad6; background: rgba(209,125,113,.19); font-size: 8px; font-style: normal; }
.major-stars small { color: #6e9f92; font-size: 8px; }
.ziwei-palace > p { margin: 9px 0 8px; color: #777781; font-size: 9px; line-height: 1.55; }
.ziwei-palace footer { margin-top: auto; color: #65656e; font-size: 8px; }
.ziwei-center { grid-area: 2 / 2 / 4 / 4; display: grid; align-content: center; justify-items: center; padding: 24px; text-align: center; background: radial-gradient(circle at 50% 40%, rgba(209,125,113,.12), transparent 55%), #15151b; }
.plate-seal { padding: 5px 10px; border: 1px solid rgba(208,173,114,.28); border-radius: 99px; color: #c9a86f; font-size: 9px; letter-spacing: .12em; }
.ziwei-center h3 { margin: 14px 0 5px; color: #eee7dd; font: 600 22px var(--font); }
.ziwei-center > p { margin: 0 0 15px; color: #777781; font-size: 10px; }
.ziwei-center dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; margin: 0; border-top: 1px solid rgba(255,255,255,.06); }
.ziwei-center dl div { display: grid; grid-template-columns: 42px 1fr; gap: 7px; padding: 7px 5px; border-bottom: 1px solid rgba(255,255,255,.05); text-align: left; }
.ziwei-center dt { color: #706f78; font-size: 8px; }
.ziwei-center dd { min-width: 0; margin: 0; color: #c5bbaa; font-size: 9px; overflow-wrap: anywhere; }
.plate-note { margin: 13px 2px 0; color: #686871; font-size: 9px; line-height: 1.6; }
.palace-card.calculated { min-height: 180px; }
.palace-card.calculated header { display: flex; justify-content: space-between; align-items: center; }
.palace-card.calculated header span { font-size: 13px; }
.palace-card.calculated header em { color: #d17d71; font-size: 9px; font-style: normal; border: 1px solid rgba(209,125,113,.4); border-radius: 99px; padding: 3px 7px; }
.palace-card.calculated strong { display: block; min-height: 38px; color: #e7d4ae; font-size: 11px; line-height: 1.65; }
.palace-card.calculated small { color: #696973; font-size: 9px; }
.open-chart-button {
  width: 100%; margin-top: 16px; padding: 9px 12px; border: 1px solid rgba(208,173,114,.26); border-radius: 9px;
  color: #d4b37d; background: rgba(208,173,114,.06); cursor: pointer; font-size: 10px;
}
.incomplete-note { display: block; margin-top: 14px; color: #686871; }

.study-grid { grid-template-columns: repeat(3, 1fr); }
.palace-card {
  min-height: 142px;
  background: rgba(255, 255, 255, 0.025);
  border-color: var(--line);
  border-radius: 16px;
}
.palace-card:hover { border-color: rgba(208, 173, 114, 0.28); background: rgba(255, 255, 255, 0.04); }
.palace-card span { color: #d0ad72; font: 500 18px var(--font); }
.palace-card h3 { font: 600 14px var(--font); }
.palace-card p { color: #81818a; }

.observation-card h3 { font: 600 24px var(--font); }
.observation-steps > div { background: rgba(255, 255, 255, 0.025); }
.observation-steps b { color: #d27a6e; font-family: var(--font); }
.archive-card, .note-item {
  background: rgba(255, 255, 255, 0.025);
  border-color: var(--line);
  border-radius: 16px;
}
.archive-card h3 { font: 600 15px var(--font); }
.archive-card dt, .note-item p { color: #81818a; }
.archive-card .tag { color: #83b5a7; }
.delete-button { color: #707079; }
.empty-state { border-color: var(--line); color: #777781; }
.toast { background: #eee9df; color: #17181f; }

body.light-theme {
  --ink: #24231f;
  --ink-soft: #252620;
  --paper: #f4f0e7;
  --paper-deep: #ebe4d7;
  --muted: #77746b;
  --line: rgba(36, 35, 31, 0.12);
  --white: #fffdf8;
  background: #f4f0e7;
}
body.light-theme::before { opacity: 0.08; }
body.light-theme .main { color: var(--ink); }
body.light-theme .panel,
body.light-theme .discipline-card,
body.light-theme .palace-card,
body.light-theme .archive-card,
body.light-theme .note-item { background: rgba(255, 253, 248, 0.7); }
body.light-theme .discipline-card h3,
body.light-theme .panel-title h3,
body.light-theme .section-heading h2,
body.light-theme .module-intro h2,
body.light-theme .archive-card h3 { color: var(--ink); }
body.light-theme input, body.light-theme select, body.light-theme textarea { color: var(--ink); background: rgba(255, 255, 255, 0.55); color-scheme: light; }
body.light-theme .chart-meta > span, body.light-theme .ziwei-summary .empty-state { background: rgba(255, 253, 248, 0.75); }
body.light-theme .chart-meta strong, body.light-theme .pillar-card b { color: var(--ink); }
body.light-theme .ziwei-palace, body.light-theme .ziwei-center { background: rgba(255, 253, 248, .92); }
body.light-theme .ziwei-center { background: radial-gradient(circle at 50% 40%, rgba(209,125,113,.10), transparent 55%), #f8f3e9; }
body.light-theme .ziwei-palace h3, body.light-theme .ziwei-center h3 { color: var(--ink); }
body.light-theme .ziwei-center dd { color: #514d45; }

@media (max-width: 1100px) {
  .study-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  body::before { opacity: 0.12; }
  .main { padding: 21px 15px 90px; }
  .topbar { align-items: center; margin-bottom: 22px; }
  .topbar h1 { font-size: 21px; letter-spacing: 0.02em; }
  .top-actions .primary-button { width: 40px; height: 40px; }
  .hero-card { min-height: auto; border-radius: 21px; }
  .hero-copy { padding: 29px 24px 10px; }
  .hero-kicker { margin-top: 20px; }
  .hero-copy h2 { font-size: 29px; line-height: 1.38; }
  .hero-description { font-size: 12px; }
  .compass { min-height: 205px; margin-top: -5px; }
  .compass-ring { width: 165px; }
  .section-heading { margin-top: 31px; }
  .discipline-grid { grid-template-columns: 1fr; }
  .discipline-card { min-height: 148px; padding: 22px 20px 20px 76px; }
  .card-symbol { left: 20px; top: 22px; }
  .module-intro { grid-template-columns: 46px 1fr; }
  .module-number { width: 44px; height: 44px; border-radius: 13px; font-size: 17px; }
  .module-intro h2 { font-size: 27px; }
  .study-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-meta { grid-template-columns: repeat(2, 1fr); }
  .pillar-grid { grid-template-columns: repeat(4, 1fr); gap: 7px; }
  .pillar-card { padding: 14px 7px; }
  .pillar-card b { font-size: 24px; }
  .chart-output .panel-title { align-items: flex-start; flex-direction: column; }
  .ziwei-plate { grid-template-rows: repeat(4, minmax(126px, auto)); border-radius: 13px; }
  .ziwei-palace { padding: 8px 7px; }
  .ziwei-palace header { gap: 3px; padding-bottom: 6px; }
  .ziwei-palace h3 { font-size: 10px; }
  .ziwei-palace header span { font-size: 8px; }
  .ziwei-palace header em { padding: 1px 3px; font-size: 7px; }
  .major-stars { gap: 2px 3px; margin-top: 7px; }
  .major-stars b { font-size: 9px; }
  .major-stars i, .major-stars small { font-size: 7px; }
  .ziwei-palace > p { margin: 6px 0; font-size: 7px; line-height: 1.45; }
  .ziwei-palace footer { font-size: 7px; }
  .ziwei-center { padding: 12px 9px; }
  .plate-seal { padding: 3px 7px; font-size: 7px; }
  .ziwei-center h3 { margin: 8px 0 3px; font-size: 16px; }
  .ziwei-center > p { margin-bottom: 8px; font-size: 8px; }
  .ziwei-center dl div { grid-template-columns: 30px 1fr; gap: 3px; padding: 4px 2px; }
  .ziwei-center dt, .ziwei-center dd { font-size: 7px; }
  .saved-profile-loader { grid-template-columns: 1fr; }
  .load-profile-button { width: 100%; }
  .mobile-nav {
    height: 70px;
    background: rgba(13, 14, 18, 0.94);
    border-color: var(--line);
    backdrop-filter: blur(20px);
  }
  .mobile-nav a { color: #73737c; }
  .mobile-nav a.active { color: #e2bd84; }
  .mobile-nav a span { font-family: var(--font); font-size: 15px; }
  body.light-theme .mobile-nav { background: rgba(24, 24, 22, 0.94); }
}

@media (max-width: 420px) {
  .hero-copy h2 { font-size: 26px; }
  .study-grid { grid-template-columns: 1fr; }
}
