:root {
  --bg: #f5f6f8; --surface: #fff; --surface-2: #f8f9fb;
  --separator: #e1e5ea; --text-1: #20262e; --text-2: #626d7c;
  --text-3: #768292; --accent: #176e61; --accent-soft: #e9f4f0;
  --active-bg: #f0f8f5; --status-on: #16705a; --danger: #bb3f4b;
}
* { letter-spacing: 0 !important; }
body { height: auto; min-height: 100%; font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; }
button, input, select { transition: background .15s, border-color .15s, box-shadow .15s; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
svg { width: 18px; height: 18px; flex-shrink: 0; }
.brand-icon { display: grid; place-items: center; width: 42px; height: 42px; background: var(--accent); color: #fff; border-radius: 8px; }
.brand-icon svg { width: 23px; height: 23px; }
#login { min-height: 100dvh; }
.login-card { width: 400px; padding: 36px; border-radius: 8px; text-align: left; box-shadow: 0 8px 32px #20262e08; }
.login-card .brand-icon { margin-bottom: 24px; }
.login-card h1 { font-size: 26px; }
.login-card .subtitle { margin: 6px 0 30px; }
.login-label { display: block; font-size: 13px; font-weight: 600; }
.login-error { margin: 4px 0; font-size: 12px; min-height: 18px; }
.login-card input[type=password] { height: 46px; background: var(--surface); border-radius: 6px; }
.login-card .btn-primary { display: flex; align-items: center; justify-content: center; gap: 10px; color: #fff; height: 46px; border-radius: 6px; }
#app { max-width: 1180px; padding: 32px 32px 72px; }
.app-head { align-items: center; margin: 0 0 28px; }
.app-brand { display: flex; align-items: center; gap: 12px; }
.app-head h1 { font-size: 21px; line-height: 1.25; }
.app-brand p { margin-top: 3px; color: var(--text-2); font-size: 12px; }
.app-head .ghost { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--separator); background: var(--surface); }
.segmented { display: flex; border: 0; border-bottom: 1px solid var(--separator); border-radius: 0; background: none; padding: 0; gap: 24px; width: 100%; margin: 0; }
.seg { position: relative; border-radius: 0; padding: 12px 4px 15px; min-width: 72px; }
.seg.active { color: var(--accent); background: none; box-shadow: none; }
.seg.active::after { position: absolute; content: ''; bottom: -1px; height: 3px; left: 0; right: 0; background: var(--accent); }
.workspace-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.4fr); gap: 32px; align-items: start; }
.workspace-current { position: sticky; top: 20px; min-width: 0; }
.workspace-presets { min-width: 0; }
.label { height: 62px; margin: 0; font-size: 13px; font-weight: 600; color: var(--text-1); align-items: center; gap: 12px; }
.label > span { display: flex; align-items: center; gap: 8px; text-transform: none; }
.count { font-family: var(--mono); font-size: 11px; color: var(--text-2); font-weight: 400; }
.group { border-radius: 0; border: 0; border-top: 2px solid var(--accent); box-shadow: none; }
.current-group .group-row { padding: 20px 0; background: var(--bg); }
.current-group .row-fields { gap: 16px; }
.current-group .field { display: grid; grid-template-columns: 1fr; gap: 3px; }
.current-group .field-key { font-size: 12px; }
.current-group .row-actions { justify-content: flex-start; margin-top: 24px; }
.config-path { padding-top: 12px; border-top: 1px solid var(--separator); font-size: 11px; font-family: var(--mono); color: var(--text-3); overflow-wrap: anywhere; }
.preset-list { display: grid; gap: 12px; }
.preset-list > .group-row { border: 1px solid var(--separator); background: var(--surface); border-radius: 8px; padding: 18px 20px 12px; }
.preset-list > .group-row[data-active=true] { border-color: #a7cdc0; background: var(--surface); }
.group-row[data-active=true]::before { top: 20px; bottom: 20px; width: 3px; }
.row-title { font-size: 15px; overflow-wrap: anywhere; min-width: 0; }
.row-head { align-items: center; margin-bottom: 14px; }
.row-status { font-size: 11px; color: var(--status-on); background: var(--accent-soft); padding: 3px 8px; border-radius: 4px; }
.field { font-size: 12px; gap: 12px; }
.field-key { min-width: 64px; }
.field-val { font-size: 12px; min-width: 0; }
.row-fields { gap: 7px; }
.row-actions { border-top: 1px solid var(--separator); padding-top: 10px; margin-top: 16px; gap: 6px; align-items: center; }
.row-btn { min-height: 34px; }
.row-btn.primary { background: var(--accent-soft); color: var(--accent); padding: 6px 14px; }
.icon-btn { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; }
.icon-btn svg { width: 16px; height: 16px; }
.row-btn.danger:hover { background: #bb3f4b12; }
.group-row--add { width: auto; border: 0; padding: 7px 10px; border-radius: 6px; gap: 6px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 500; }
.group-row--add:hover { background: var(--accent); color: #fff; opacity: .9; }
.group-row--add svg { width: 15px; height: 15px; }
.empty-state { padding: 48px 12px; text-align: center; color: var(--text-3); border-top: 1px solid var(--separator); }
.modal { border-radius: 8px; }
.modal input { min-width: 0; }
.btn-primary { color: #fff; }
.toast { border-radius: 8px; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #16191d; --surface: #1f2329; --surface-2: #272c33; --separator: #353c45; --text-1: #e9edf1; --text-2: #aab3bf; --text-3: #8894a3; --accent: #65c8ac; --accent-soft: #253d36; --status-on: #7dd4b7; --danger: #f18b92; }
  .brand-icon, .group-row--add, .btn-primary, .login-card .btn-primary { color: #102c24; }
  .preset-list > .group-row[data-active=true] { border-color: #477a68; }
}
@media (max-width: 760px) {
  #app { padding: 24px 20px 48px; }
  .workspace-grid { grid-template-columns: 1fr; gap: 4px; }
  .workspace-current { position: static; }
  .current-group .row-fields { gap: 10px; }
  .current-group .field { grid-template-columns: 70px minmax(0, 1fr); gap: 12px; }
  .current-group .row-actions { margin-top: 14px; }
  .current-group .group-row { padding: 16px 0; }
}
@media (max-width: 480px) {
  #app { padding: 20px 16px calc(40px + env(safe-area-inset-bottom)); }
  .app-head { margin-bottom: 20px; }
  .segmented { gap: 20px; }
  .seg { flex: 1; }
  .label { flex-wrap: nowrap; margin: 0; height: 62px; align-items: center; }
  .preset-list > .group-row { padding: 16px 14px 10px; }
  .row-head { flex-direction: row; gap: 8px; }
  .row-status { white-space: nowrap; }
  .row-actions { display: flex; }
  .row-btn { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .group-row--add { min-height: 40px; }
  .login-card { padding: 28px 24px; }
  .modal-overlay { align-items: center; }
}
