/* 金鼎28 visual system v20261021-emerald2: true gold + vivid emerald + pure white. */
@font-face {
  font-family: "Jinding Serif";
  src: url("/assets/fonts/noto-serif-cjk-sc-regular-jinding28-v2.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Jinding Serif";
  src: url("/assets/fonts/noto-serif-cjk-sc-semibold-jinding28-v2.woff2") format("woff2");
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --paper-2: #ffffff;
  --ink: #043c2b;
  --ink-soft: #2b6a56;
  --gold: #f2b705;
  --gold-soft: #fff2ae;
  --line: #0caf74;
  --danger: #c92a3a;
  --ok: #00794f;
  --shadow: 0 16px 40px rgba(0, 111, 72, .13);
  --emerald-950: #003e2b;
  --emerald-900: #005c3f;
  --emerald-800: #007b52;
  --emerald-700: #009f69;
  --emerald-500: #00bd7b;
  --emerald-100: #d9fff0;
  --white: #ffffff;
  --true-gold: #f2b705;
  --sun-gold: #ffd53d;
  --radius: 16px;
  color-scheme: light;
  font-family: "Jinding Serif", "Songti SC", serif;
}

:root[data-theme="dark"] {
  --paper: #002f22;
  --paper-2: #004532;
  --ink: #ffffff;
  --ink-soft: #b5ffe1;
  --gold: #ffd43b;
  --gold-soft: #624e00;
  --line: #00c982;
  --danger: #ff8b9a;
  --ok: #71ffc1;
  --shadow: 0 18px 46px rgba(0, 18, 12, .34);
  --emerald-950: #001f16;
  --emerald-900: #003d2b;
  --emerald-800: #006044;
  --emerald-700: #00a66d;
  --emerald-500: #00dc91;
  --emerald-100: #075c43;
  --white: #ffffff;
  --true-gold: #ffd43b;
  --sun-gold: #ffe47d;
  color-scheme: dark;
}

html { background: var(--paper); }

body {
  min-width: 280px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Jinding Serif", "Songti SC", serif;
}

button,
input,
textarea,
select { font-family: inherit; }

.site-header {
  border: 0;
  border-top: 5px solid var(--true-gold);
  border-bottom: 2px solid var(--emerald-500);
  background: var(--white);
  box-shadow: 0 8px 24px rgba(0, 109, 71, .11);
  backdrop-filter: none;
}

:root[data-theme="dark"] .site-header { background: var(--emerald-950); }

.header-inner {
  min-height: 66px;
  padding: 6px 0;
  gap: 14px;
}

.header-inner > .brand img { width: 42px; height: 42px; }

.brand { gap: 9px; }

.brand img { filter: drop-shadow(0 5px 10px rgba(0, 99, 65, .21)); }

.brand strong,
.reading-page h1,
.page-heading h1,
.chat-page-heading h1,
.panel-title h2,
.backup-panel h2 {
  font-family: "Jinding Serif", "Songti SC", serif;
  font-weight: 900;
}

.brand strong {
  color: var(--emerald-900);
  font-size: 1.22rem;
  letter-spacing: .12em;
}

.brand small {
  color: #9b7000;
  font-size: .67rem;
  font-weight: 600;
}

:root[data-theme="dark"] .brand strong { color: var(--white); }
:root[data-theme="dark"] .brand small { color: var(--sun-gold); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  overflow: visible;
}

.nav-cluster { display: contents; }
.nav-cluster > span { display: none; }
.nav-cluster__links { display: contents; }

.main-nav .nav-cluster a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--emerald-500);
  border-radius: 10px;
  background: var(--white);
  color: var(--emerald-900);
  font-size: .78rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.main-nav .nav-cluster a::before {
  content: "";
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  background: currentColor;
  -webkit-mask: var(--nav-icon) center / contain no-repeat;
  mask: var(--nav-icon) center / contain no-repeat;
}

.main-nav a[href="/"],
.main-nav a[href="#folders"],
.main-nav a[href="/#folders"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 3h6l2 2h8a2 2 0 0 1 2 2v11a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V5a2 2 0 0 1 2-2Zm2 8v6h12v-6H6Zm2 2h3v2H8v-2Z'/%3E%3C/svg%3E"); }
.main-nav a[href="/scratch/"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v5a3 3 0 0 0 0 6v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3a3 3 0 0 0 0-6V5Zm7 3v8h4V8h-4Z'/%3E%3C/svg%3E"); }
.main-nav a[href="/chat/"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 3h16a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H9l-5 4v-4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Zm3 6v2h10V9H7Zm0 4v2h7v-2H7Z'/%3E%3C/svg%3E"); }
.main-nav a[href="/guide/"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 3h7a3 3 0 0 1 3 3v15a4 4 0 0 0-4-3H4V3Zm16 0h-4v15h4V3Z'/%3E%3C/svg%3E"); }
.main-nav a[href="/rules/"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 3h14v18H5V3Zm3 4v2h8V7H8Zm0 4v2h8v-2H8Zm0 4v2h5v-2H8Z'/%3E%3C/svg%3E"); }
.main-nav a[href="/help/"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm-1 15h2v2h-2v-2Zm1-11a4 4 0 0 1 2 7.46V15h-2v-2.8l.8-.4A2 2 0 1 0 10 10H8a4 4 0 0 1 4-4Z'/%3E%3C/svg%3E"); }

.main-nav .nav-cluster a:hover,
.main-nav .nav-cluster a[aria-current="page"] {
  border-color: var(--emerald-800);
  background: var(--emerald-800);
  color: var(--white);
  box-shadow: 0 7px 17px rgba(0, 126, 82, .22);
}

:root[data-theme="dark"] .main-nav .nav-cluster a {
  border-color: var(--emerald-500);
  background: var(--emerald-900);
  color: var(--white);
}

.theme-button {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: 2px solid var(--true-gold);
  background: var(--emerald-900);
  color: var(--sun-gold);
  box-shadow: none;
}

main {
  width: min(1180px, calc(100% - 28px));
  margin: 14px auto 58px;
}

.live-strip {
  position: relative;
  isolation: isolate;
  min-height: 184px;
  grid-template-columns: 1.05fr 1.35fr .85fr 120px;
  gap: 18px;
  padding: 20px 24px;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background-image: url("/assets/jinding-home-ding-orbit-v2.png");
  background-position: center 52%;
  background-size: cover;
  color: var(--white);
  box-shadow: 0 18px 44px rgba(0, 88, 57, .25);
}

.live-strip::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 49, 33, .95) 0%, rgba(0, 76, 49, .92) 43%, rgba(0, 94, 60, .68) 67%, rgba(0, 65, 43, .45) 100%);
}

.live-strip::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  border: 2px solid rgba(255, 219, 75, .8);
  border-radius: inherit;
  pointer-events: none;
}

.live-strip > * { position: relative; z-index: 1; }

.eyebrow {
  color: #9a7000;
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .15em;
}

.live-strip .eyebrow { color: var(--sun-gold); }

.live-heading h1 {
  display: grid;
  gap: 5px;
  margin: 5px 0 8px;
  color: var(--white);
  font-size: 1.28rem;
  line-height: 1.08;
}

.live-purpose {
  color: var(--sun-gold);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .14em;
}

.live-issue-line b { color: var(--white); font-variant-numeric: tabular-nums; }

.status-pill {
  border-color: rgba(255, 255, 255, .72);
  background: rgba(0, 43, 29, .72);
  color: var(--white);
  font-weight: 700;
}

.status-pill[data-state="ready"] { color: #91ffd1; }
.status-pill[data-state="conflict"] { color: #ffb6bf; }

.live-equation { justify-content: flex-start; }
.equation { font-variant-numeric: tabular-nums; }

.live-strip .equation { gap: 9px; }
.live-strip .equation i { color: var(--white); font-size: 1.2rem; }

.live-strip .number-ball,
.live-strip .sum-ball {
  width: 58px;
  height: 58px;
  border: 3px solid rgba(255, 255, 255, .88);
  background: linear-gradient(145deg, #ffe66c 0%, var(--true-gold) 68%, #c98200 100%);
  color: var(--emerald-950);
  font-size: 1.58rem;
  font-weight: 900;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .22), 0 9px 22px rgba(0, 25, 16, .28);
}

.live-strip .sum-ball {
  background: var(--white);
  color: var(--emerald-900);
  border-color: var(--sun-gold);
}

.live-details { align-self: center; }

.live-strip .live-details p {
  margin: 6px 0;
  color: var(--white);
  font-size: .78rem;
}

.live-strip .live-details p:last-child {
  color: var(--sun-gold);
  font-weight: 900;
}

.countdown-box {
  min-height: 112px;
  grid-template-columns: 1fr;
  place-items: center;
  align-content: center;
  gap: 2px;
  padding: 12px 8px;
  border: 1px solid rgba(255, 255, 255, .48);
  border-radius: 14px;
  background: rgba(0, 50, 34, .72);
  text-align: center;
}

.countdown-box span { color: var(--white); font-size: .7rem; }
.countdown-box b { color: var(--sun-gold); font-size: 1.58rem; }

.countdown-box button {
  grid-column: auto;
  width: 100%;
  min-height: 30px;
  border-top: 1px solid rgba(255, 255, 255, .32);
  color: var(--white);
  text-align: center;
  text-decoration: none;
}

.notebook-grid {
  grid-template-columns: minmax(0, 1.85fr) minmax(285px, .72fr);
  gap: 14px;
  margin-top: 14px;
}

.panel {
  border: 1px solid var(--emerald-700);
  border-radius: 14px;
  background: var(--paper-2);
  box-shadow: var(--shadow);
}

.latest-pane {
  padding: 0;
  overflow: hidden;
}

.latest-pane .panel-title {
  min-height: 48px;
  margin: 0;
  padding: 9px 15px;
  align-items: center;
  background: var(--emerald-900);
  color: var(--white);
}

.latest-pane .panel-title .eyebrow { color: var(--sun-gold); }
.latest-pane .panel-title h2 { margin-top: 0; color: var(--white); font-size: 1.13rem; }

.panel-title { margin-bottom: 12px; }
.panel-title h2 { color: var(--emerald-950); font-size: 1.14rem; }
:root[data-theme="dark"] .panel-title h2 { color: var(--white); }
.panel-title p { display: none; }

.history-list { gap: 0; }

.history-row {
  min-height: 52px;
  grid-template-columns: minmax(148px, 1fr) auto 68px;
  gap: 12px;
  padding: 7px 14px;
  border-top: 1px solid #b5f2d9;
  background: var(--white);
}

.history-row:nth-child(even) { background: #e9fff6; }
:root[data-theme="dark"] .history-row { border-top-color: #087653; background: var(--emerald-950); }
:root[data-theme="dark"] .history-row:nth-child(even) { background: #00563d; }

.history-meta { gap: 1px; }
.history-meta b { color: var(--emerald-900); font-weight: 900; }
.history-meta time { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .history-meta b { color: var(--white); }

.equation.compact .number-ball,
.equation.compact .sum-ball {
  width: 28px;
  height: 28px;
  background: var(--emerald-800);
  color: var(--white);
  font-size: .83rem;
  font-weight: 900;
}

.equation.compact .sum-ball { background: var(--true-gold); color: var(--emerald-950); }
.equation.compact i { color: var(--emerald-900); }
:root[data-theme="dark"] .equation.compact i { color: var(--white); }

.bookmark {
  border: 1px solid var(--emerald-700);
  background: var(--white);
  color: var(--emerald-900);
  font-weight: 800;
}

.bookmark:hover,
.bookmark.saved { border-color: var(--true-gold); background: var(--true-gold); color: var(--emerald-950); }

.records-pane {
  border-color: var(--emerald-900);
  background: linear-gradient(150deg, var(--emerald-900), var(--emerald-700));
  color: var(--white);
}

.records-pane .panel-title h2,
.records-pane .panel-title .eyebrow,
.records-pane .empty-state,
.records-pane .muted,
.records-pane .tag-section h3 { color: var(--white); }
.records-pane .panel-title .eyebrow { color: var(--sun-gold); }
.records-pane .privacy-mark { border-color: var(--sun-gold); color: var(--sun-gold); }
.records-pane .tag-section { border-color: rgba(255, 255, 255, .28); }

.record-card {
  border-color: rgba(255, 255, 255, .34);
  background: rgba(255, 255, 255, .12);
  color: var(--white);
}

.record-card:hover,
.record-card.active { border-color: var(--sun-gold); background: rgba(255, 213, 61, .18); }
.record-card small { color: #caffea; }
.records-pane .tag-chip { border-color: rgba(255, 255, 255, .5); }

.mobile-tabs {
  border-color: var(--emerald-700);
  background: var(--white);
}

.mobile-tabs button { color: var(--emerald-900); }
.mobile-tabs button[aria-pressed="true"] { background: var(--emerald-800); color: var(--white); }

.workspace-grid,
.tool-grid { gap: 14px; margin-top: 14px; }

.editor-panel { border-top: 7px solid var(--emerald-700); }
.folder-panel { border-top: 7px solid var(--true-gold); }
.query-panel { border-top: 7px solid var(--emerald-500); }
.compare-panel-wrap { border-top: 7px solid var(--true-gold); }

.field input,
.field textarea,
.field select,
.inline-form input,
.query-form input,
.query-form select,
.chat-profile input,
.chat-form textarea {
  border-color: var(--emerald-500);
  background: var(--white);
  color: var(--emerald-950);
}

:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field textarea,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .inline-form input,
:root[data-theme="dark"] .query-form input,
:root[data-theme="dark"] .query-form select,
:root[data-theme="dark"] .chat-profile input,
:root[data-theme="dark"] .chat-form textarea { background: var(--emerald-950); color: var(--white); }

.primary-button,
.file-button {
  border-color: var(--emerald-900);
  background: var(--emerald-900);
  color: var(--white);
}

.file-button { border-color: var(--true-gold); background: var(--true-gold); color: var(--emerald-950); }

.folder-card {
  border-color: var(--true-gold);
  background: linear-gradient(145deg, #fff5b8, var(--white));
}

.folder-tab { border-color: var(--true-gold); background: var(--true-gold); color: var(--emerald-950); }
:root[data-theme="dark"] .folder-card { background: linear-gradient(145deg, #6b5700, var(--emerald-950)); }

.backup-panel {
  margin-top: 14px;
  border: 2px solid var(--emerald-700);
  border-left: 10px solid var(--true-gold);
  background: var(--white);
}

:root[data-theme="dark"] .backup-panel { background: var(--emerald-900); }
.backup-panel h2 { color: var(--emerald-950); }
:root[data-theme="dark"] .backup-panel h2 { color: var(--white); }
.public-guide { display: none !important; }

.reading-page h1 { color: var(--emerald-900); }
:root[data-theme="dark"] .reading-page h1 { color: var(--white); }
.reading-page section { border-top-color: var(--emerald-500); }
.back-link { color: var(--emerald-800); }
:root[data-theme="dark"] .back-link { color: var(--sun-gold); }

.scratch-ticket { border-color: var(--true-gold); }
.chat-profile { background: var(--emerald-900); color: var(--white); }
.chat-profile [data-chat-status],
.chat-profile label > span { color: var(--white); }
.chat-announcement { border-left-color: var(--true-gold); }

.site-footer {
  border-top: 5px solid var(--true-gold);
  border-radius: 14px;
  padding: 17px 18px;
  background: var(--emerald-900);
  color: var(--white);
}
.site-footer a { color: var(--white); }
.site-footer .brand strong { color: var(--white); }
.site-footer .brand small { color: var(--sun-gold); }

@media (max-width: 980px) {
  .header-inner { flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; margin: 0; overflow-x: auto; padding-bottom: 2px; }
  .main-nav .nav-cluster a { flex: 0 0 auto; }
  .live-strip { grid-template-columns: 1fr 1.2fr .8fr 110px; }
}

@media (max-width: 720px) {
  .site-header { position: relative; }
  .header-inner { width: calc(100% - 20px); gap: 6px 10px; padding: 5px 0; }
  .header-inner > .brand img { width: 38px; height: 38px; }
  .brand strong { font-size: 1.08rem; }
  .brand small { max-width: 170px; }
  .theme-button { margin-left: auto; }
  .main-nav { gap: 4px; }
  .main-nav .nav-cluster a { min-height: 35px; padding: 6px 9px; font-size: .74rem; }
  .main-nav .nav-cluster a::before { width: 15px; height: 15px; flex-basis: 15px; }
  main { width: calc(100% - 18px); margin-top: 8px; }
  .live-strip {
    min-height: 210px;
    grid-template-columns: minmax(0, 1fr) 94px;
    gap: 8px 10px;
    padding: 14px;
    background-position: 59% center;
  }
  .live-strip::before { background: linear-gradient(90deg, rgba(0, 48, 32, .96), rgba(0, 82, 53, .82)); }
  .live-heading { grid-column: 1; }
  .live-heading h1 { margin: 2px 0 4px; font-size: 1.05rem; }
  .live-purpose { font-size: .62rem; }
  .live-equation { grid-column: 1 / -1; grid-row: 2; }
  .live-strip .number-ball,
  .live-strip .sum-ball { width: 47px; height: 47px; font-size: 1.28rem; }
  .live-strip .equation { gap: 6px; }
  .live-strip .equation i { font-size: .95rem; }
  .live-details { grid-column: 1 / -1; grid-row: 3; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 10px; }
  .live-strip .live-details p { margin: 0; font-size: .7rem; }
  .countdown-box { grid-column: 2; grid-row: 1; min-height: 86px; padding: 7px 5px; }
  .countdown-box b { font-size: 1.24rem; }
  .mobile-tabs { margin: 8px 0; }
  .notebook-grid,
  .workspace-grid,
  .tool-grid { grid-template-columns: minmax(0, 1fr); }
  .notebook-grid { margin-top: 0; }
  .latest-pane .panel-title { min-height: 45px; padding: 7px 12px; }
  .latest-pane .panel-title h2 { font-size: 1.03rem; }
  .history-row {
    min-height: 49px;
    grid-template-columns: minmax(86px, 1fr) auto 51px;
    gap: 5px;
    padding: 5px 8px;
  }
  .history-meta b { font-size: .77rem; }
  .history-meta time { font-size: .66rem; }
  .history-row .equation.compact .number-ball,
  .history-row .equation.compact .sum-ball { width: 24px; height: 24px; font-size: .72rem; }
  .history-row .equation.compact { gap: 2px; }
  .history-row .equation.compact i { font-size: .7rem; }
  .history-row .bookmark { padding: 5px 6px; font-size: .73rem; }
  .panel { padding: 12px; }
  .latest-pane { padding: 0; }
  .records-pane { order: 0; }
  .workspace-grid,
  .tool-grid { margin-top: 12px; }
  .site-footer { width: calc(100% - 18px); }
}

@media (max-width: 360px) {
  .header-inner { width: calc(100% - 16px); }
  .brand small { display: none; }
  .main-nav .nav-cluster a { padding: 6px 8px; }
  main { width: calc(100% - 12px); }
  .live-strip { padding: 12px 10px; }
  .live-strip .number-ball,
  .live-strip .sum-ball { width: 43px; height: 43px; font-size: 1.16rem; }
  .history-row { grid-template-columns: minmax(80px, 1fr) auto 47px; padding-inline: 6px; }
  .history-row .equation.compact .number-ball,
  .history-row .equation.compact .sum-ball { width: 22px; height: 22px; font-size: .66rem; }
  .history-row .bookmark { padding-inline: 4px; }
  .site-footer { width: calc(100% - 12px); }
}

