:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #657068;
  --paper: #f4f1e9;
  --card: #fffdf8;
  --line: #d9d4c8;
  --green: #175c46;
  --green-dark: #0f4635;
  --amber: #be7c2b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "PingFang SC", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 10% 0%, #e3eee6, transparent 35%), var(--paper); }
button, input, textarea { font: inherit; min-width: 0; }
button { border: 1px solid var(--line); border-radius: 10px; padding: .65rem .9rem; background: #fff; cursor: pointer; color: var(--ink); }
button:hover { border-color: var(--green); }
button.primary { color: #fff; background: var(--green); border-color: var(--green); }
button.primary:hover { background: var(--green-dark); }
button.danger-light { color: #9a3434; border-color: #e2c5c5; background: #fff7f5; }
.shell { width: min(1320px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0 64px; }
header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-family: Georgia, "Songti SC", serif; font-size: clamp(2rem, 5vw, 4.6rem); letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 1.05rem; }
.subtitle, .muted { color: var(--muted); }
.eyebrow { margin-bottom: 6px; color: var(--green); text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; font-weight: 750; }
.badge { padding: .45rem .75rem; border-radius: 999px; color: var(--muted); background: #ebe7dc; }
.badge.online { color: #fff; background: var(--green); }
.card { min-width: 0; background: color-mix(in srgb, var(--card) 94%, transparent); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 48px rgba(30, 40, 33, .06); padding: 20px; }
.auth-row { display: grid; grid-template-columns: auto minmax(180px, 1fr) auto; gap: 12px; align-items: center; margin-bottom: 14px; }
input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; background: #fff; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(310px, .75fr); gap: 18px; }
.stack { min-width: 0; display: grid; gap: 18px; align-content: start; }
.section-title { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 14px; }
.section-title.compact { margin-top: 18px; margin-bottom: 8px; }
.refresh-note { margin: 5px 0 0; color: var(--muted); font-size: .78rem; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.helper { margin: 6px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.theme-workbench { min-width: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; align-items: start; }
.theme-sidebar { min-width: 0; position: sticky; top: 16px; display: grid; gap: 10px; }
.mini-title { color: var(--green); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.theme-list { display: grid; gap: 8px; }
.theme-tab { width: 100%; text-align: left; border-radius: 13px; background: #fff; }
.theme-tab.active { color: #fff; background: var(--green); border-color: var(--green); }
.theme-tab strong, .theme-tab span { display: block; }
.theme-tab span { margin-top: 4px; color: var(--muted); font-size: .78rem; }
.theme-tab.active span { color: rgba(255,255,255,.78); }
.theme-form { display: grid; gap: 14px; min-width: 0; }
.empty-editor { border: 1px dashed var(--line); border-radius: 14px; padding: 24px; background: #fff; }
.form-section { min-width: 0; display: grid; gap: 12px; border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: #fff; overflow: hidden; }
.form-section h3, .layer-card h4 { margin: 0; }
.subsection-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.form-row { display: grid; gap: 10px; }
.form-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { min-width: 0; display: grid; gap: 6px; color: var(--muted); font-size: .82rem; font-weight: 700; }
.field input, .field textarea { color: var(--ink); font-weight: 450; }
.field-hint { color: #879188; font-weight: 500; }
.check-field { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .86rem; font-weight: 750; }
.check-field input { width: auto; }
.form-textarea { width: 100%; min-height: 92px; resize: vertical; border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; background: #fff; line-height: 1.5; }
.symbol-list, .layer-list { display: grid; gap: 10px; }
.symbol-row { min-width: 0; display: grid; grid-template-columns: minmax(110px, .8fr) minmax(150px, 1fr) minmax(160px, 1.2fr) auto; gap: 9px; align-items: end; border: 1px solid #ece6d9; border-radius: 13px; padding: 10px; background: #fffdf8; }
.layer-card { min-width: 0; display: grid; gap: 12px; border: 1px solid #e5dfd2; border-radius: 14px; padding: 14px; background: #fffdf8; }
.advanced-json { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff; }
.advanced-json summary { cursor: pointer; color: var(--green); font-weight: 800; }
textarea#theme-json { width: 100%; min-height: 420px; resize: vertical; border: 1px solid #c8c2b4; border-radius: 12px; padding: 16px; background: #1d2621; color: #eef6f0; line-height: 1.55; font-family: "SFMono-Regular", Consolas, monospace; font-size: .87rem; tab-size: 2; }
.inline-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 12px; }
.output { max-height: 260px; overflow: auto; white-space: pre-wrap; background: #efede5; border-radius: 10px; padding: 12px; color: #38423b; }
.list { display: grid; gap: 9px; }
.list-item { min-width: 0; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 11px; padding: 11px; background: #fff; }
.list-item strong, .list-item span { display: block; }
.list-item span { margin-top: 4px; color: var(--muted); font-size: .82rem; }
.list-item button { margin-top: 8px; padding: .35rem .6rem; font-size: .8rem; }
.list-item small.meta-line { display: block; margin-top: 7px; color: #78827a; font-size: .76rem; line-height: 1.45; }
.list-item small.error-text { color: #9a3434; }
.list-item a { display: inline-block; margin-top: 8px; color: var(--green); font-size: .82rem; text-decoration: none; }
.list-item a:hover { text-decoration: underline; }
.news-box { min-width: 0; overflow-wrap: anywhere; display: grid; gap: 6px; border: 1px dashed var(--line); border-radius: 12px; padding: 12px; background: #fff; }
.news-box strong, .news-box span, .news-box small { display: block; }
.news-box span, .news-box small { color: var(--muted); }
.news-box small { font-size: .78rem; }
.message { position: sticky; bottom: 12px; margin: 18px auto 0; width: fit-content; max-width: 100%; padding: .7rem 1rem; border-radius: 999px; color: #fff; background: var(--green); opacity: 0; transition: opacity .2s; }
.message.visible { opacity: 1; }
.message.error { background: #9a3434; }
@media (max-width: 1180px) {
  .shell { width: min(100% - 20px, 1040px); }
  .grid { grid-template-columns: 1fr; }
  .stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stack section:last-child { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .shell { width: min(100% - 20px, 720px); padding-top: 22px; }
  header { align-items: start; }
  .stack { grid-template-columns: 1fr; }
  .stack section:last-child { grid-column: auto; }
  .theme-workbench { grid-template-columns: 1fr; }
  .theme-sidebar { position: static; }
  .form-row.two, .form-row.three, .form-row.four, .symbol-row { grid-template-columns: 1fr; }
  .auth-row { grid-template-columns: 1fr auto; }
  .auth-row label { grid-column: 1 / -1; }
  textarea#theme-json { min-height: 360px; }
  .inline-actions { grid-template-columns: 1fr; }
}
