:root {
  --bg: #0b0e14; --panel: rgba(255,255,255,.02); --line: rgba(255,255,255,.08);
  --text: #e6eaf2; --muted: #8a94a6; --cyan: #42d9d0; --violet: #a88bff; --green: #43dc91;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh; color: var(--text); background: var(--bg);
  font-size: 18px;
  font-family: "Stork Chinese Kai", "Stork Chinese Kai Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC",
    "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased;
}
.ambient { position: fixed; z-index: -1; width: 520px; height: 520px; border-radius: 50%; filter: blur(110px); opacity: .14; pointer-events: none; }
.ambient-one { top: -220px; right: -100px; background: var(--violet); }
.ambient-two { bottom: -260px; left: -160px; background: var(--cyan); }
.config-page { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 0 0 64px; }
.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; }
.locale-button { min-height: 34px; padding: 0 11px; border: 1px solid rgba(66,217,208,.3); border-radius: 9px; color: var(--cyan); background: rgba(66,217,208,.06); cursor: pointer; font: 700 13px/1 "Stork Chinese Kai", "Stork Chinese Kai Fallback", ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
.locale-button:hover { border-color: rgba(66,217,208,.6); background: rgba(66,217,208,.12); }
.locale-button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.secondary-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; 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); }
.secondary-button svg { width: 16px; height: 16px; margin-right: 6px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.intro-panel { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding: 52px 0 30px; }
.eyebrow { 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.loading { color: var(--muted); }
.env-note { font-size: 14px; color: var(--muted); border-left: 3px solid rgba(125,211,200,.4); padding: 10px 14px; margin: 22px 0; background: rgba(125,211,200,.05); }
.env-note code { background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.config-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 24px; }
.config-sidebar { position: sticky; top: 18px; border: 1px solid var(--line); border-radius: 14px; padding: 16px 12px; background: rgba(8,11,17,.82); }
.sidebar-kicker { margin: 0 8px 12px; color: var(--cyan); font: 12px/1.2 "Stork Chinese Kai", "Stork Chinese Kai Fallback", ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .15em; }
.config-nav { display: grid; gap: 5px; }
.config-nav button { width: 100%; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; padding: 10px 11px; text-align: left; font: inherit; font-size: 14px; transition: .16s ease; }
.config-nav button:hover { color: var(--text); background: rgba(255,255,255,.04); }
.config-nav button.active { color: var(--text); border-color: rgba(66,217,208,.3); background: rgba(66,217,208,.09); }
.config-nav button .nav-count { float: right; color: var(--muted); font-size: 12px; }
.sidebar-hint { margin: 18px 8px 2px; color: #657082; font-size: 12px; line-height: 1.65; }
.config-workspace { min-width: 0; }
.section-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; min-height: 55px; margin-bottom: 8px; }
.section-header h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.section-header p { max-width: 520px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; text-align: right; }
.config-section { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; margin: 14px 0; }
.config-section h2 { font-size: 17px; margin: 0 0 4px; letter-spacing: .4px; }
.config-section .desc { font-size: 14.5px; color: var(--muted); margin: 0 0 16px; }
.cfg-row { display: grid; grid-template-columns: minmax(160px,240px) minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.05); }
.cfg-row:first-of-type { border-top: none; }
.cfg-label { font-size: 15px; font-weight: 600; }
.cfg-unit { font-size: 13px; color: var(--muted); margin-top: 2px; }
.cfg-row input { width: 100%; padding: 8px 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; background: rgba(0,0,0,.25); color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.cfg-row input:focus { outline: none; border-color: #7dd3c8; }
.cfg-row select { width: 100%; padding: 8px 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; background: rgba(0,0,0,.25); color: var(--text); font-size: 15px; }
.cfg-row select:focus { outline: none; border-color: #7dd3c8; }
.cfg-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--cyan); justify-self: start; }
.cfg-row input[type="number"] { font-variant-numeric: tabular-nums; }
.cfg-row.has-error input { border-color: #ff7a7a; }
.cfg-row.has-error select { border-color: #ff7a7a; }
.cfg-error { font-size: 13px; color: #ff9d9d; margin-top: 4px; display: none; }
.cfg-row.has-error .cfg-error { display: block; }
.cfg-meta { display: flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.cfg-badge { display: inline-flex; border-radius: 999px; padding: 3px 7px; color: #95a1b4; background: rgba(255,255,255,.06); font-size: 11px; }
.cfg-badge.hot { color: var(--green); background: rgba(67,220,145,.09); }
.cfg-badge.restart { color: #ffcf78; background: rgba(255,193,92,.1); }
.cfg-badge.secret { color: #c7b7ff; background: rgba(168,139,255,.1); }
.entity-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 12px; }
.entity-card { min-width: 0; border: 1px solid rgba(255,255,255,.09); border-radius: 11px; padding: 15px; background: rgba(255,255,255,.018); }
.entity-card h3 { margin: 0 0 4px; font-size: 16px; }
.entity-card .entity-note { margin: 0 0 11px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.entity-card .cfg-row { grid-template-columns: minmax(95px, 1fr) minmax(90px, 1.35fr) auto; padding: 8px 0; }
.entity-card .cfg-label { font-size: 13px; }
.entity-card .cfg-unit { display: none; }
.entity-card .cfg-meta { display: none; }
.provider-status { display: flex; gap: 7px; align-items: center; margin: 8px 0 3px; color: var(--muted); font-size: 12px; }
.provider-dot { width: 7px; height: 7px; border-radius: 50%; background: #657082; }
.provider-dot.ready { background: var(--green); box-shadow: 0 0 10px rgba(67,220,145,.4); }
.provider-dot.warn { background: #ffcf78; }
.empty-state { border: 1px dashed rgba(255,255,255,.13); border-radius: 10px; padding: 28px; color: var(--muted); font-size: 14px; text-align: center; }
.save-bar { display: flex; align-items: center; gap: 14px; margin-top: 28px; }
.save-bar button { background: #7dd3c8; color: #0b0e14; border: none; border-radius: 8px; padding: 10px 22px; font-size: 16px; font-weight: 700; cursor: pointer; }
.save-bar button:disabled { opacity: .5; cursor: default; }
#saveMsg { font-size: 15px; }
#saveMsg.ok { color: #7dd3c8; }
#saveMsg.err { color: #ff9d9d; }
@media (max-width: 720px) {
  .config-page { width: min(100% - 24px, 1180px); }
  .operator-label { display: none; }
  .intro-panel { align-items: flex-start; flex-direction: column; padding-top: 34px; }
  .brand > span:last-child { display: none; }
  .config-layout { grid-template-columns: 1fr; gap: 12px; }
  .config-sidebar { position: static; }
  .config-nav { display: flex; overflow-x: auto; padding-bottom: 2px; }
  .config-nav button { min-width: max-content; }
  .sidebar-hint { display: none; }
  .section-header { align-items: flex-start; flex-direction: column; }
  .section-header p { text-align: left; }
  .cfg-row, .entity-card .cfg-row { grid-template-columns: 1fr; gap: 6px; }
  .cfg-meta { justify-content: flex-start; }
}
