/* GM 共享设计系统 —— 对齐 codex 同事的 winter-settings 面板
 * 来源：analysis_runs/gm_zqdr_glass_gm_menu_20261119/preview/winter-settings.css
 * 两套主题：winter（经典雪境·深色）/ snowcity（雪城新生·浅色）
 * 服务端 CSP 是 style-src 'self'，禁止内联样式。
 */

:root {
  color-scheme: dark;
  --page: #091728;
  --solid: #12253d;
  --paper: #09172973;
  --glass: #10213963;
  --field: #a1c7f017;
  --ink: #f7faff;
  --muted: #d3dfef;
  --edge: #c3dcff42;
  --line: #dceaff2b;
  --highlight: #e3f1ff31;
  --sheen: #e3f1ff20;
  --accent: #c3e6ff;
  --on-accent: #0e314e;
  --active: #c4e3ff2b;
  --shadow: #00091861;
  --label-shadow: 0 1px 10px #000c24c7, 0 1px 3px #000b1e99;
  --control-blur: blur(22px) saturate(1.35);
  --reading-blur: blur(10px) saturate(1.16);
  --art: url("/static/themes/classic-winter.png");
  --photo-position: center 21%;
  --wash: linear-gradient(90deg, #071329c9, #0a173a38 49%, #09172800 84%),
          linear-gradient(0deg, #06102288, #08152a12 64%, #030d1e56);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei UI", sans-serif;
  line-height: 1.5;
  background: var(--page);
  color: var(--ink);
  font-synthesis: none;
}

:root[data-theme="snowcity"] {
  color-scheme: light;
  --page: #dae6f4;
  --solid: #ecf4fc;
  --paper: #ebf5ff82;
  --glass: #eff6ff70;
  --field: #f8fbff49;
  --ink: #122943;
  --muted: #2e455e;
  --edge: #ffffffbf;
  --line: #243b6224;
  --highlight: #ffffffcf;
  --sheen: #ffffff34;
  --accent: #165487;
  --on-accent: #fff;
  --active: #ffffff78;
  --shadow: #18335633;
  --label-shadow: 0 1px 12px #f6faff, 0 1px 3px #eef6fdbf;
  --art: url("/static/themes/snowcity.png");
  --photo-position: center 45%;
  --wash: linear-gradient(90deg, #e7f2fbbd, #ecf5ff27 54%, #e7f2fb00 88%),
          linear-gradient(0deg, #dce8f46e, #e5effb00 44%, #e7f2fb4b);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100vh; }
body { isolation: isolate; }

/* 壁纸 + 渐变压暗，跟设置面板同一套（使用物理定位兼容 Android 10 WebView / Chromium 83） */
body::before {
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--wash), var(--art) var(--photo-position) / cover no-repeat;
}

button, select, input { font: inherit; color: inherit; }
button, select, input[type="checkbox"] { cursor: pointer; }
button:disabled { cursor: default; }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.page-width { width: calc(100% - 2rem); max-width: 72rem; margin-left: auto; margin-right: auto; }

/* ---------- 毛玻璃容器 ---------- */
.glass,
.appearance, .reading-mode, nav.categories, .filters, .footer-inner {
  background: linear-gradient(145deg, var(--sheen), transparent 59%), var(--glass);
  border: 1px solid var(--edge);
  box-shadow: inset 0 1px 0 var(--highlight), 0 12px 30px var(--shadow);
  -webkit-backdrop-filter: var(--control-blur);
  backdrop-filter: var(--control-blur);
}

/* 内容块用较轻的纸面玻璃 */
.paper, .rows, .notice, .panel {
  background: linear-gradient(150deg, var(--sheen), transparent 58%), var(--paper);
  border: 1px solid var(--edge);
  box-shadow: inset 0 1px 0 var(--highlight), 0 7px 23px var(--shadow);
  -webkit-backdrop-filter: var(--reading-blur);
  backdrop-filter: var(--reading-blur);
}

/* ---------- Hero 大标题区 ---------- */
.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 6.5rem;
  padding-top: 1.5rem;
  padding-bottom: 1.1rem;
}
.hero-title { align-self: center; text-shadow: var(--label-shadow); }
.hero-title > p { font-size: .813rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.hero-title > p span { padding-left: .25rem; padding-right: .25rem; color: var(--muted); }
h1 {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.18;
  margin-top: .25rem;
  letter-spacing: -.015em;
}
.appearance-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.appearance-controls > * + * { margin-left: .5rem; }
.appearance {
  display: flex; align-items: center;
  border-radius: 2rem; padding: .15rem .35rem .15rem .8rem;
  min-height: 2.5rem;
}
.appearance label { font-size: .78rem; color: var(--muted); margin-right: .25rem; white-space: nowrap; }
.appearance select {
  border: 0; background: transparent; padding: .35rem .45rem;
  border-radius: 1.6rem; font-size: .84rem; font-weight: 600;
  min-height: 2.1rem; box-shadow: none;
}

/* ---------- 工作区：左分类 + 右内容 ---------- */
.workspace {
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  padding-bottom: 2rem;
}
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
}

nav.categories, .side-nav {
  border-radius: 1.15rem;
  padding: .6rem;
  position: sticky;
  top: 1rem;
}
@media (max-width: 900px) { nav.categories, .side-nav { position: static; } }

.cat-item {
  display: flex; align-items: center; gap: .6rem;
  width: 100%; border: 0; border-radius: .8rem;
  padding: .78rem .9rem;
  background: transparent; color: var(--ink);
  text-align: left; font-size: .938rem; font-weight: 600;
  transition: background 160ms ease;
}
.cat-item:hover { background: var(--active); }
.cat-item[aria-current="true"] {
  background: var(--active);
  box-shadow: inset 0 1px 0 var(--highlight);
}
.cat-item .badge {
  margin-left: auto; font-size: .75rem; font-weight: 700;
  color: var(--muted);
}

/* ---------- 主区标题 ---------- */
.workspace-heading {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: .8rem;
}
.workspace-heading h2 { font-size: 1.375rem; font-weight: 700; letter-spacing: -.01em; }
.workspace-heading p { font-size: .813rem; color: var(--muted); margin-top: .3rem; }
.workspace-heading > div, .group h3, .result-info { text-shadow: var(--label-shadow); }
.workspace-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: .4rem; }

/* ---------- 按钮 ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem; min-height: 2.75rem;
  padding: .55rem .95rem;
  border-radius: .8rem;
  border: 1px solid var(--edge);
  background: linear-gradient(145deg, var(--sheen), transparent 59%), var(--glass);
  box-shadow: inset 0 1px 0 var(--highlight), 0 6px 18px var(--shadow);
  -webkit-backdrop-filter: var(--control-blur);
  backdrop-filter: var(--control-blur);
  font-size: .875rem; font-weight: 600; white-space: nowrap;
  text-decoration: none;
  transition: filter 160ms ease, transform 120ms ease;
}
.button:hover { filter: brightness(1.08); }
.button:active { transform: translateY(1px); }
.button:disabled { color: var(--muted); border-color: var(--line); opacity: .6; }
.button.primary {
  background: var(--accent); color: var(--on-accent);
  border-color: transparent;
  box-shadow: inset 0 1px 0 var(--highlight), 0 8px 22px var(--shadow);
}
.button.primary:hover { filter: brightness(1.05); }
.button.primary:disabled { background: var(--field); color: var(--muted); border-color: var(--line); }
.button.danger { color: #ffb4c0; border-color: #ff8fa04d; }
:root[data-theme="snowcity"] .button.danger { color: #b4384b; border-color: #b4384b4d; }

/* ---------- 表单 ---------- */
.button, select, input:not([type="file"]):not([type="checkbox"]) {
  border: 1px solid var(--edge);
  background: linear-gradient(145deg, var(--sheen), transparent 59%), var(--glass);
  box-shadow: inset 0 1px 0 var(--highlight), 0 6px 18px var(--shadow);
}
input:not([type="file"]):not([type="checkbox"]), select {
  min-height: 2.75rem;
  padding: .5rem .8rem;
  border-radius: .8rem;
  font-size: .875rem;
}
input::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

.field { display: flex; flex-direction: column; gap: .4rem; }
.field > span { font-size: .813rem; font-weight: 600; color: var(--muted); }

/* ---------- 搜索条 ---------- */
.filters {
  display: flex; align-items: center; gap: .75rem;
  border-radius: 1rem; padding: .35rem .35rem .35rem .9rem;
  margin-bottom: 1rem; flex-wrap: wrap;
}
.filters .search { flex: 1 1 14rem; display: flex; align-items: center; gap: .6rem; }
.filters input[type="search"] {
  border: 0; background: transparent; box-shadow: none; flex: 1;
  min-height: 2.5rem;
}
.filter-modified {
  display: flex; align-items: center; gap: .45rem;
  font-size: .813rem; color: var(--muted); padding-right: .6rem;
}

/* ---------- 底部固定操作栏 ---------- */
.footer {
  position: sticky;
  bottom: .75rem;
  z-index: 2;
  margin-bottom: .75rem;
  margin-top: 1rem;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 1.25rem;
  padding: .5rem .65rem .5rem 1rem;
}
.footer-actions { display: flex; flex-wrap: wrap; }
.footer-actions > * + * { margin-left: .5rem; }
.save-status { font-size: .813rem; color: var(--muted); margin-right: .75rem; }

/* ---------- 状态标签 ---------- */
.pill {
  display: inline-flex; align-items: center;
  padding: .2rem .6rem; border-radius: 1rem;
  font-size: .75rem; font-weight: 700;
  border: 1px solid var(--line);
  background: var(--field);
}
.pill.on { color: #8ce8bd; border-color: #8ce8bd44; }
.pill.off { color: var(--muted); }
.pill.skip { color: #ffd08a; border-color: #ffd08a44; }
:root[data-theme="snowcity"] .pill.on { color: #137c58; border-color: #137c5844; }
:root[data-theme="snowcity"] .pill.skip { color: #9a6500; border-color: #9a650044; }

/* ---------- 状态框 ---------- */
.status-bar {
  margin-top: .75rem; padding: .7rem .9rem;
  border-radius: .8rem;
  background: var(--field);
  border: 1px solid var(--line);
  font-size: .813rem; color: var(--muted);
  line-height: 1.7; word-break: break-word;
}

.hidden { display: none !important; }
