/* ==========================================================
   岩茶杯 2026 ·「黑曜石」报名系统
   克制的液态玻璃 · 日 / 夜双主题
   山水照片铺底，上面压一层主题色薄纱（wash），玻璃面板磨砂通透
   单一低饱和余烬橙作强调；无彩色氛围光、无渐变文字
   正文对比度 ≥ 7:1，次要文字 ≥ 4.5:1，状态色 ≥ 4.5:1（WCAG AA）
   ========================================================== */

/* ---------------- 主题变量 ----------------
   夜间（默认）：深板岩中性底，压深色薄纱看山水剪影
   日间：暖白纸底，压亮色薄纱看山水淡彩 */

:root,
[data-theme="night"] {
  color-scheme: dark;

  --bg:         #0b0c0e;

  --ink:        #e9e7ec;
  --ink-soft:   #a6a3ae;
  --ink-faint:  #767379;

  --line:       rgba(255, 255, 255, .10);
  --line-soft:  rgba(255, 255, 255, .06);

  --paper:      rgba(255, 255, 255, .038);
  --paper-2:    rgba(255, 255, 255, .06);
  --paper-3:    rgba(255, 255, 255, .09);

  --accent:      #d08a4e;
  --accent-soft: rgba(208, 138, 78, .11);
  --accent-line: rgba(208, 138, 78, .34);

  --ok:    #74ac8b;  --ok-soft:   rgba(116, 172, 139, .11);
  --warn:  #c2a05e;  --warn-soft: rgba(194, 160, 94, .11);
  --bad:   #c2807a;  --bad-soft:  rgba(194, 128, 122, .11);

  /* 照片上的薄纱：上浅下深，保证顶栏 / 底栏文字始终可读 */
  --wash-top:    rgba(8, 8, 11, .80);
  --wash-bottom: rgba(8, 8, 11, .88);
  --grain: .035;

  --input-bg:   rgba(0, 0, 0, .30);
  --chrome-bg:  rgba(12, 13, 16, .74);
  --solid:      #15161a;
  --scrim:      rgba(4, 4, 6, .66);
  --num-bg:     #17181c;
  --veil:       rgba(255, 255, 255, .03);

  --btn-bg: #e8e4dc;
  --btn-ink: #1a1917;
  --btn-bg-hover: #f2eee6;

  --shadow:
    0 1px 2px rgba(0, 0, 0, .5),
    0 12px 32px rgba(0, 0, 0, .32);

  --frost: blur(18px) saturate(120%);
}

[data-theme="day"] {
  color-scheme: light;

  --bg:         #f3f1ec;

  --ink:        #26232b;
  --ink-soft:   #55505c;
  --ink-faint:  #7d7787;

  --line:       rgba(38, 35, 43, .14);
  --line-soft:  rgba(38, 35, 43, .09);

  --paper:      rgba(255, 255, 255, .58);
  --paper-2:    rgba(255, 255, 255, .74);
  --paper-3:    rgba(255, 255, 255, .88);

  --accent:      #b0622a;
  --accent-soft: rgba(176, 98, 42, .09);
  --accent-line: rgba(176, 98, 42, .32);

  --ok:    #2f7d5b;  --ok-soft:   rgba(47, 125, 91, .09);
  --warn:  #8f6a0e;  --warn-soft: rgba(143, 106, 14, .10);
  --bad:   #a4443c;  --bad-soft:  rgba(164, 68, 60, .09);

  --wash-top:    rgba(243, 241, 236, .82);
  --wash-bottom: rgba(243, 241, 236, .90);
  --grain: .03;

  --input-bg:   rgba(255, 255, 255, .72);
  --chrome-bg:  rgba(243, 241, 236, .76);
  --solid:      #fbfaf7;
  --scrim:      rgba(58, 50, 40, .38);
  --num-bg:     #ffffff;
  --veil:       rgba(38, 35, 43, .035);

  --btn-bg: #26232b;
  --btn-ink: #f3f1ec;
  --btn-bg-hover: #383440;

  --shadow:
    0 1px 2px rgba(38, 35, 43, .07),
    0 12px 32px rgba(38, 35, 43, .10);

  --frost: blur(18px) saturate(125%);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

/* ---------------- 基底：照片 + 薄纱 + 颗粒 ----------------
   照片和主题薄纱都在同一个 fixed 层，手机端换小图。
   玻璃面板的 backdrop-filter 会磨到这一层，质感来自材质而非彩光。 */

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s ease, color .35s ease;
}

body::before {
  content: "";
  position: fixed; inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, var(--wash-top), var(--wash-bottom)),
    url("bg.webp") center / cover no-repeat fixed;
  transition: background .35s ease;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed; inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

::selection { background: rgba(208, 138, 78, .28); color: var(--ink); }
[data-theme="day"] ::selection { background: rgba(176, 98, 42, .22); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, .35);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(128, 128, 128, .55); border: 2px solid transparent; background-clip: content-box; }

/* ---------------- 日 / 夜切换按钮 ---------------- */

.theme-toggle {
  width: 34px; height: 34px; flex: none;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--accent-line); }
.theme-toggle .ic { width: 16px; height: 16px; display: none; }
[data-theme="night"] .theme-toggle .ic-sun  { display: block; }
[data-theme="day"]   .theme-toggle .ic-moon { display: block; }
[data-theme] .theme-toggle .ic { animation: ic-in .25s ease-out; }
@keyframes ic-in {
  from { transform: rotate(-35deg) scale(.55); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* ---------------- 顶栏（悬浮磨砂） ---------------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--chrome-bg);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  border-bottom: 1px solid var(--line);
}

.topbar-in {
  max-width: 1080px; margin: 0 auto; padding: 0 24px;
  height: 58px; display: flex; align-items: center; gap: 26px;
}

.brand {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--serif); font-size: 18px; font-weight: 700;
  color: var(--ink); text-decoration: none; letter-spacing: .02em;
  flex: none;
}
/* 品牌标记：一颗黑曜石碎块，纯色，不发光 */
.brand::before {
  content: "";
  width: 9px; height: 9px;
  background: var(--accent);
  transform: rotate(45deg);
  flex: none;
}
.brand small {
  font-family: var(--sans); font-size: 11px; font-weight: 400;
  color: var(--ink-faint); letter-spacing: .12em; text-transform: uppercase;
}

.nav { display: flex; gap: 4px; margin-right: auto; }
.nav a {
  color: var(--ink-soft); text-decoration: none; font-size: 14px;
  padding: 5px 11px; border-radius: 6px;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav a.on { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

.userbox { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-faint); }
.userbox a { color: var(--ink-soft); text-decoration: none; white-space: nowrap; }
.userbox a:hover { color: var(--ink); }
.userbox .tag {
  font-family: var(--mono); font-size: 12px; color: var(--ink-soft);
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 2px 9px; border-radius: 99px;
}

/* ---------------- 通用容器 ---------------- */

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

.section { padding: 56px 0; border-top: 1px solid var(--line-soft); }
.section:first-of-type { border-top: 0; }

.kicker {
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em;
  color: var(--accent); text-transform: uppercase; margin: 0 0 10px;
}

h1, h2, h3 { font-family: var(--serif); letter-spacing: .01em; color: var(--ink); }

h1 { font-size: clamp(27px, 4.6vw, 38px); line-height: 1.32; margin: 0 0 18px; font-weight: 700; }
h2 { font-size: clamp(20px, 3vw, 23px); margin: 0 0 22px; font-weight: 700; }
h3 { font-size: 17px; margin: 0 0 8px; font-weight: 700; }

p { margin: 0 0 14px; text-wrap: pretty; }
.lead { font-size: 16px; color: var(--ink-soft); }

.muted { color: var(--ink-faint); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }

/* ---------------- 提示条 ---------------- */

.notice {
  border: 1px solid var(--line);
  border-left: 2px solid var(--ink-faint);
  background: var(--paper);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; color: var(--ink-soft);
  margin: 0 0 18px;
}
.notice.warn { border-left-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.notice.bad  { border-left-color: var(--bad);  background: var(--bad-soft);  color: var(--bad); }
.notice.ok   { border-left-color: var(--ok);   background: var(--ok-soft);   color: var(--ok); }
.notice b { font-weight: 700; }

/* ---------------- 赛程阶段条（OA 式） ---------------- */

.phase-bar {
  display: flex; gap: 8px; margin: 26px 0 16px;
}
.phase-step {
  flex: 1; min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  padding: 12px 14px;
  transition: border-color .15s, background .15s;
}
.phase-step:hover { border-color: rgba(128, 128, 128, .3); }
.phase-step .no {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  color: var(--ink-faint);
}
.phase-step .t { font-weight: 600; font-size: 14.5px; margin-top: 2px; color: var(--ink); }
.phase-step .d { font-size: 12.5px; color: var(--ink-faint); margin-top: 3px; line-height: 1.5; }
.phase-step.current {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.phase-step.current .t,
.phase-step.current .no { color: var(--accent); }
.phase-step.done { opacity: .5; }
.phase-step.done .t { text-decoration: line-through; text-decoration-color: var(--ink-faint); }

@media (max-width: 720px) {
  .phase-bar { flex-direction: column; }
}

/* 后台赛程编辑卡片 */
.phase-edit-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 12px 14px;
}
.phase-edit-card.current {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.phase-edit-card .t { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: var(--ink); }
.phase-edit-card .t .pill { margin-left: 6px; }
.phase-edit-card label { display: block; font-size: 12px; color: var(--ink-faint); margin-top: 6px; }
.phase-edit-card input { width: 100%; margin-top: 2px; font-size: 13px; }
.phase-edit-card .range { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }

/* ---------------- 表单 ---------------- */

.field { margin-bottom: 22px; }

.field label.lbl {
  display: block; font-size: 14px; font-weight: 600;
  color: var(--ink); margin-bottom: 6px;
}
.field .req { color: var(--accent); margin-left: 2px; }

.field .hint { font-size: 12.5px; color: var(--ink-faint); margin: 6px 0 0; line-height: 1.6; }

input[type=text], input[type=email], input[type=password],
input[type=url], input[type=tel], input[type=search],
input[type=datetime-local], textarea, select {
  width: 100%;
  font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  line-height: 1.6;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); opacity: .8; }

textarea { min-height: 130px; resize: vertical; }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input[aria-invalid=true], textarea[aria-invalid=true] {
  border-color: var(--bad);
  background: var(--bad-soft);
}

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 680px) { .row2 { grid-template-columns: 1fr; } }

/* 单选项：低调玻璃卡 */
.opt {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: 8px;
  font-size: 14px;
}
.opt:hover { border-color: rgba(128, 128, 128, .32); }
.opt:has(input:checked) {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.opt input { margin: 4px 0 0; accent-color: var(--accent); flex: none; }
.opt b { font-weight: 600; color: var(--ink); }
.opt .d { display: block; font-size: 12.5px; color: var(--ink-faint); line-height: 1.55; }

.opt-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.opt-row .opt { flex-direction: column; }
@media (max-width: 680px) { .opt-row { grid-template-columns: 1fr; } }

.check {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 14px; color: var(--ink-soft);
  padding: 7px 0; cursor: pointer;
  line-height: 1.7;
}
.check input { margin: 5px 0 0; accent-color: var(--accent); flex: none; }

/* 参赛主题 chips：磨砂小片 */
#themeChips .check {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color .15s, background .15s;
}
#themeChips .check:hover { border-color: rgba(128, 128, 128, .32); }
#themeChips .check:has(input:checked) {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
#themeChips .check b { color: var(--ink); }

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 20px; border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--btn-bg);
  color: var(--btn-ink);
  cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, transform .06s;
}
.btn:hover { background: var(--btn-bg-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn.ghost:hover { background: var(--paper-2); border-color: rgba(128, 128, 128, .38); }

.btn.sm { padding: 5px 13px; font-size: 13px; }
.btn.link {
  background: none; border: none; color: var(--ink-faint);
  padding: 4px 0; font-weight: 400; text-decoration: underline;
}
.btn.link:hover { color: var(--ink); }

.btn-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ---------------- 首页 ---------------- */

.hero { padding: 84px 0 68px; }
.hero .badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px;
  color: var(--ink-soft);
  background: var(--paper-2);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 4px 12px; border-radius: 99px; margin-bottom: 24px;
  letter-spacing: .04em;
}
.hero .badge::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
}
.hero h1 { max-width: 760px; text-wrap: balance; }
/* 纯色强调，不用渐变字 */
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { max-width: 620px; }

.hero-grid {
  display: grid; grid-template-columns: 1fr 300px; gap: 48px; align-items: start;
}
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 28px; } }

/* 玻璃面板（通用） */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: var(--paper);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  box-shadow: var(--shadow);
}
.panel h4 {
  margin: 0 0 12px; font-size: 13px; font-family: var(--sans);
  font-weight: 600; color: var(--ink-faint); letter-spacing: .06em;
}

.dl { margin: 0; font-size: 13.5px; }
.dl div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line-soft); }
.dl div:last-child { border-bottom: 0; }
.dl dt { color: var(--ink-faint); }
.dl dd { margin: 0; font-weight: 600; text-align: right; color: var(--ink); }

/* 时间线 */
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 8px; }
@media (max-width: 860px) { .timeline { grid-template-columns: 1fr 1fr; } }

.tl-item { padding: 0 22px 0 0; position: relative; }
.tl-item .no {
  font-family: var(--mono); font-size: 12px; color: var(--accent);
  border-top: 2px solid var(--accent);
  padding-top: 10px; display: block;
}
.tl-item h3 { margin: 10px 0 2px; font-size: 16px; }
.tl-item .when { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); display: block; margin-bottom: 8px; }
.tl-item p { font-size: 13.5px; color: var(--ink-soft); margin: 0; line-height: 1.7; }
.tl-item.future .no { border-top-color: var(--line); color: var(--ink-faint); }

/* 卡片网格 */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }

.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px;
  background: var(--paper);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  box-shadow: var(--shadow);
  transition: border-color .15s;
}
.card:hover { border-color: rgba(128, 128, 128, .3); }
.card h3 { font-size: 16px; margin-bottom: 6px; }
.card p { font-size: 13.5px; color: var(--ink-soft); margin: 0; }

/* 规则列表 */
.rules { counter-reset: r; list-style: none; padding: 0; margin: 0; }
.rules li {
  counter-increment: r;
  position: relative; padding: 0 0 18px 42px; margin: 0 0 2px;
  border-left: 1px solid var(--line-soft); margin-left: 12px;
}
.rules li:last-child { border-left-color: transparent; padding-bottom: 0; }
.rules li::before {
  content: counter(r);
  position: absolute; left: -13px; top: 1px;
  width: 25px; height: 25px; border-radius: 50%;
  background: var(--num-bg);
  border: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
}
.rules b { display: block; font-size: 15px; margin-bottom: 2px; color: var(--ink); }
.rules p { font-size: 13.5px; color: var(--ink-soft); margin: 0; }

/* 文档清单 */
.docs { list-style: none; padding: 0; margin: 0; }
.docs li {
  display: flex; align-items: baseline; gap: 12px;
  padding: 12px 14px; margin: 0 -14px;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 6px;
  font-size: 14px;
  transition: background .15s;
}
.docs li:hover { background: var(--paper-2); }
.docs li:last-child { border-bottom: 0; }
.docs .doc-name { font-weight: 600; color: var(--ink); }
.docs .doc-desc { font-size: 13px; color: var(--ink-faint); }

/* ---------------- 表单页 ---------------- */

.page-head { padding: 44px 0 28px; border-bottom: 1px solid var(--line-soft); }
.page-head h1 { font-size: clamp(22px, 5vw, 27px); margin-bottom: 6px; }
.page-head p { margin: 0; color: var(--ink-faint); font-size: 14px; }

.form-shell { display: grid; grid-template-columns: 190px 1fr; gap: 48px; padding: 36px 0 80px; }
@media (max-width: 860px) { .form-shell { grid-template-columns: 1fr; gap: 24px; } }

.steps { position: sticky; top: 88px; align-self: start; }
.steps ol {
  list-style: none; margin: 0; padding: 14px;
  counter-reset: st;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.steps li {
  font-size: 13px; color: var(--ink-faint);
  padding: 8px 10px; border-radius: 6px;
  display: flex; align-items: center; gap: 9px;
  counter-increment: st;
  transition: background .15s, color .15s;
}
.steps li::before {
  content: counter(st);
  font-family: var(--mono); font-size: 11px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
}
.steps li:hover { background: var(--paper-2); color: var(--ink-soft); }
.steps li.on {
  color: var(--accent); font-weight: 600;
  background: var(--accent-soft);
}
.steps li.on::before { border-color: var(--accent-line); color: var(--accent); }
.steps li.done { color: var(--ok); }
.steps li.done::before { border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--ok); }
.steps li + li { margin-top: 2px; }

@media (max-width: 860px) {
  .steps { position: static; }
  .steps ol { display: flex; gap: 8px; overflow-x: auto; padding: 10px; }
  .steps li { white-space: nowrap; }
}

fieldset.block {
  border: 0; padding: 0; margin: 0 0 40px;
}
fieldset.block > legend {
  font-family: var(--serif); font-size: 19px; font-weight: 700;
  padding: 0; margin-bottom: 4px;
  display: flex; align-items: center; gap: 9px;
  color: var(--ink);
}
/* 区块标题前的细签 */
fieldset.block > legend::before {
  content: "";
  width: 3px; height: 15px;
  background: var(--accent);
  flex: none;
}
.block-desc { font-size: 13px; color: var(--ink-faint); margin: 0 0 20px; }

/* 成员行 */
.members {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.member {
  display: grid; grid-template-columns: 1.1fr 1fr 150px 34px;
  gap: 0; border-bottom: 1px solid var(--line-soft);
  align-items: stretch;
  transition: background .15s;
}
.member:hover { background: var(--veil); }
.member:last-child { border-bottom: 0; }
.member > div { padding: 9px 12px; display: flex; flex-direction: column; justify-content: center; }
.member input[type=text], .member input[type=email] {
  border: 0; padding: 4px 0; border-radius: 0; font-size: 14px;
  background: transparent;
}
.member input[type=text]:focus, .member input[type=email]:focus {
  box-shadow: none;
  border-bottom: 1px solid var(--accent);
  background: transparent;
}
.member input[readonly] { color: var(--ink-faint); background: none; cursor: default; }
.member-check { font-size: 12px; margin: 4px 0 0; line-height: 1.4; }
.member-check.ok  { color: var(--ok); }
.member-check.bad { color: var(--bad); }
.member .duties { flex-direction: row; gap: 14px; align-items: center; font-size: 13px; color: var(--ink-soft); }
.member .duties label { display: flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; }
.member .duties input { accent-color: var(--accent); margin: 0; }
.member .del {
  border: 0; background: none; color: var(--ink-faint); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 0;
  border-radius: 50%; width: 24px; height: 24px;
  transition: color .15s, background .15s;
}
.member .del:hover { color: var(--bad); background: var(--bad-soft); }
.member .del:disabled { opacity: .25; cursor: not-allowed; }

.member-head {
  display: grid; grid-template-columns: 1.1fr 1fr 150px 34px;
  font-size: 12px; color: var(--ink-faint);
  background: var(--veil);
  border-bottom: 1px solid var(--line);
}
.member-head span { padding: 8px 12px; }

@media (max-width: 720px) {
  .member, .member-head { grid-template-columns: 1fr 1fr; }
  .member-head { display: none; }
  .member { position: relative; padding-right: 36px; }
  .member > div:nth-child(3) { grid-column: 1 / -1; padding-top: 0; }
  .member > div:last-child { position: absolute; top: 9px; right: 10px; padding: 0; }
  .member .owner-line { font-size: 12px; color: var(--ink-faint); }
}

/* 文件上传 */
.drop {
  border: 1px dashed rgba(128, 128, 128, .42);
  border-radius: var(--radius);
  padding: 22px 20px; text-align: center; cursor: pointer;
  background: var(--paper);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.drop .t { font-size: 14px; font-weight: 600; color: var(--ink); }
.drop .s { font-size: 12.5px; color: var(--ink-faint); margin-top: 2px; }
.drop input[type=file] { display: none; }

.file-state {
  margin-top: 8px; font-size: 13px; color: var(--ok);
  display: flex; align-items: center; gap: 8px;
}
.file-state::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok); flex: none;
}
.logo-preview {
  width: 72px; height: 72px; border-radius: 10px; object-fit: cover;
  border: 1px solid var(--line);
  background: var(--paper-3);
}

/* 粘性操作栏（悬浮磨砂） */
.actions {
  position: sticky; bottom: 0; z-index: 15;
  background: var(--chrome-bg);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  border-top: 1px solid var(--line);
  padding: 14px 0;
  display: flex; align-items: center; gap: 14px;
}
.actions .wrap { flex-wrap: wrap; row-gap: 10px; }
.actions .grow { flex: 1; }
.actions .status { font-size: 13px; color: var(--ink-faint); }

/* 进度 */
.bar {
  height: 5px;
  background: var(--veil);
  border-radius: 99px; overflow: hidden;
}
.bar > i {
  display: block; height: 100%;
  background: var(--accent);
  width: 0; transition: width .3s;
  border-radius: 99px;
}

/* ---------------- 后台 ---------------- */

.admin-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.admin-bar input[type=search] { max-width: 280px; }
.admin-bar select { max-width: 160px; }

/* 表格容器：窄屏横向滚动 */
.table-scroll {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.table-scroll > table.tb {
  border: 0; border-radius: 0; box-shadow: none;
}

table.tb {
  width: 100%;
  border-collapse: separate; border-spacing: 0;
  font-size: 13.5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  min-width: 640px;
}
table.tb th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--ink-faint);
  padding: 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap; letter-spacing: .04em;
  background: var(--veil);
}
table.tb td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.tb tbody tr:last-child td { border-bottom: 0; }
table.tb tr { transition: background .12s; }
table.tb tbody tr:hover td { background: var(--veil); }
table.tb .name { font-weight: 600; color: var(--ink); }

.pill {
  display: inline-block; font-size: 11.5px; padding: 2px 10px; border-radius: 99px;
  border: 1px solid transparent; white-space: nowrap;
}
.pill.draft     { background: var(--veil);                  color: var(--ink-soft); border-color: var(--line); }
.pill.submitted { background: var(--warn-soft);             color: var(--warn);      border-color: color-mix(in srgb, var(--warn) 32%, transparent); }
.pill.returned  { background: var(--bad-soft);              color: var(--bad);       border-color: color-mix(in srgb, var(--bad) 32%, transparent); }
.pill.accepted  { background: var(--ok-soft);               color: var(--ok);        border-color: color-mix(in srgb, var(--ok) 32%, transparent); }

/* 弹层 */
.mask {
  position: fixed; inset: 0; z-index: 40;
  background: var(--scrim);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px; overflow: auto;
  animation: mask-in .15s ease-out;
}
.mask[hidden] { display: none; }
@keyframes mask-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--solid);
  border: 1px solid var(--line);
  border-radius: 14px;
  width: 100%; max-width: 680px; padding: 26px 28px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, .45);
  animation: modal-in .18s ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.modal h2 { font-size: 20px; margin-bottom: 4px; }
.modal .body { max-height: 60vh; overflow: auto; margin: 16px 0 20px; }

/* 登录卡片 */
.auth-card {
  max-width: 400px; margin: 70px auto 90px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px 34px 30px;
  background: var(--paper);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 24px; margin-bottom: 4px; }
.auth-card .sub { font-size: 13.5px; color: var(--ink-faint); margin-bottom: 24px; }

.tab-switch {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 22px;
}
.tab-switch button {
  flex: 1;
  background: none; border: 0;
  border-radius: 6px 6px 0 0;
  font-family: inherit; font-size: 14px; color: var(--ink-faint);
  padding: 9px 0; cursor: pointer; margin-bottom: -1px;
  transition: color .15s, background .15s;
}
.tab-switch button:hover { color: var(--ink-soft); background: var(--paper-2); }
.tab-switch button.on {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  font-weight: 600;
}

/* 空状态 */
.empty {
  text-align: center; padding: 60px 20px;
  color: var(--ink-faint); font-size: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.empty .big { font-family: var(--serif); font-size: 20px; color: var(--ink-soft); margin-bottom: 6px; }

/* 页脚 */
.foot {
  border-top: 1px solid var(--line-soft);
  padding: 26px 0 40px;
  font-size: 12.5px; color: var(--ink-faint);
}
.foot .in { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ==========================================================
   手机端适配
   ========================================================== */

@media (max-width: 720px) {
  /* 手机端换小背景图，省流量 */
  body::before {
    background:
      linear-gradient(180deg, var(--wash-top), var(--wash-bottom)),
      url("bg-mobile.webp") center / cover no-repeat;
  }

  /* 顶栏两行：品牌 + 用户 + 切换 / 导航横滑 */
  .topbar-in {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 16px 0;
    gap: 10px;
  }
  .brand { order: 0; }
  .userbox { order: 1; margin-left: auto; font-size: 12px; gap: 8px; }
  .theme-toggle { order: 1; }
  .nav {
    order: 2; width: 100%;
    margin-right: 0;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }

  .wrap { padding: 0 16px; }
  .hero { padding: 52px 0 48px; }
  .hero .badge { margin-bottom: 18px; }
  .section { padding: 40px 0; }
  .panel { padding: 16px; }
  .card { padding: 16px; }
  .auth-card { margin: 40px auto 60px; padding: 26px 22px 24px; border-radius: 12px; }
  .page-head { padding: 32px 0 22px; }
  .form-shell { padding: 28px 0 64px; }

  /* 时间线转竖排：左侧轴线 + 圆点 */
  .timeline { grid-template-columns: 1fr; gap: 0; }
  .tl-item {
    padding: 0 0 22px 20px; margin-left: 5px;
    border-left: 1px solid var(--line);
  }
  .tl-item:last-child { padding-bottom: 0; }
  .tl-item .no { border-top: 0; padding-top: 0; }
  .tl-item::before {
    content: "";
    position: absolute; left: -4.5px; top: 3px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
  }
  .tl-item.future::before { background: var(--ink-faint); }
  .tl-item h3 { margin-top: 6px; }

  /* 弹层贴边 */
  .mask { padding: 16px 10px; }
  .modal { padding: 20px 18px; border-radius: 12px; }

  /* 后台表格窄屏滚动 */
  .table-scroll { overflow-x: auto; }
  .table-scroll > table.tb { min-width: 640px; }
}

/* 触屏设备：放大点击区域 */
@media (pointer: coarse) {
  .btn { padding: 11px 22px; }
  .nav a { padding: 8px 12px; }
  .theme-toggle { width: 38px; height: 38px; }
}

/* 动效敏感用户 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* 打印：白底黑字 */
@media print {
  body { background: #fff; color: #000; }
  body::before, body::after { display: none; }
  .topbar, .actions, .mask, .theme-toggle { display: none; }
  .panel, .card, .auth-card, .modal, .members, .admin-bar, table.tb {
    background: #fff; border-color: #ccc; box-shadow: none; backdrop-filter: none;
  }
  h1, h2, h3, .ink, .name { color: #000; }
}
