/* 设计语言参照 iOS / macOS：系统字体、分组列表、毛玻璃栏、iMessage 气泡。颜色都走下面的变量，深色模式只改变量。 */
:root {
  color-scheme: light dark;
  --bg: #f2f2f7;
  --bg-chat: #ffffff;
  --card: #ffffff;
  --fill: rgba(120, 120, 128, .12);
  --fill-strong: rgba(120, 120, 128, .2);
  --label: #000000;
  --label-2: rgba(60, 60, 67, .6);
  --label-3: rgba(60, 60, 67, .3);
  --separator: rgba(60, 60, 67, .22);
  --blue: #007aff;
  --red: #ff3b30;
  --green: #34c759;
  --orange: #ff9500;
  --purple: #af52de;
  --teal: #30b0c7;
  --indigo: #5856d6;
  --gray: #8e8e93;
  --bubble-in: #e9e9eb;
  --bubble-in-text: #000000;
  --bar: rgba(249, 249, 249, .78);
  --sidebar: rgba(242, 242, 247, .92);
  --popover: rgba(246, 246, 248, .9);
  --warn-fill: rgba(255, 149, 0, .14);
  --glass-fill: rgba(255, 255, 255, .24);
  --glass-strong: rgba(250, 250, 252, .46);
  --glass-tone: saturate(210%) brightness(1.08);
  --glass-filter: blur(26px) var(--glass-tone);
  --glass-rim-1: rgba(255, 255, 255, .95);
  --glass-rim-2: rgba(255, 255, 255, .28);
  --glass-shadow: 0 8px 26px rgba(0, 0, 0, .12), 0 1px 3px rgba(0, 0, 0, .08);
  --tail-bg: var(--bg-chat);
  --radius-card: 12px;
  --ease-ios: cubic-bezier(.32, .72, 0, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --chat-font-size: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --top-h: 52px;
  --dock-h: 96px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-chat: #000000;
    --card: #1c1c1e;
    --fill: rgba(118, 118, 128, .24);
    --fill-strong: rgba(118, 118, 128, .36);
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, .6);
    --label-3: rgba(235, 235, 245, .3);
    --separator: rgba(84, 84, 88, .65);
    --blue: #0a84ff;
    --red: #ff453a;
    --green: #30d158;
    --orange: #ff9f0a;
    --purple: #bf5af2;
    --teal: #40c8e0;
    --indigo: #5e5ce6;
    --gray: #98989d;
    --bubble-in: #262629;
    --bubble-in-text: #ffffff;
    --bar: rgba(22, 22, 24, .72);
    --sidebar: rgba(28, 28, 30, .92);
    --popover: rgba(44, 44, 46, .88);
    --warn-fill: rgba(255, 159, 10, .18);
    --glass-fill: rgba(70, 70, 76, .24);
    --glass-strong: rgba(36, 36, 40, .52);
    --glass-tone: saturate(190%) brightness(.82);
    --glass-rim-1: rgba(255, 255, 255, .42);
    --glass-rim-2: rgba(255, 255, 255, .08);
    --glass-shadow: 0 8px 26px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4);
  }
}
/* 手机窄屏预留状态栏（App 外壳里 safe-area 可能是 0） */
@media (max-width: 680px) {
  :root { --safe-top: max(24px, env(safe-area-inset-top, 0px)); }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--label);
  font: 17px/1.42 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
svg { display: block; }
a { color: var(--blue); text-decoration: none; }

/* ---------- 按钮 ---------- */
button {
  border: 0; border-radius: 12px; min-height: 44px; padding: 10px 18px; cursor: pointer;
  background: var(--blue); color: #fff; font-weight: 600; font-size: 16px;
  transition: opacity .15s, transform .38s var(--ease-spring), background-color .2s;
}
button:active:not(:disabled) { transform: scale(.94); transition-duration: .12s; }
.setting-row:active:not(:disabled), .chat-item:active:not(:disabled), .days button:active:not(:disabled) { transform: scale(.98); }
button:disabled { opacity: .4; cursor: default; }
button.secondary { background: var(--fill); color: var(--blue); }
button.plain { background: none; color: var(--blue); font-weight: 400; padding: 8px 4px; min-height: 36px; }
button:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible, .switch-input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 2px;
}
.icon-btn {
  flex: 0 0 auto; width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%;
  display: grid; place-items: center; background: var(--fill); color: var(--blue);
}

/* ---------- 输入 ---------- */
input, textarea, select {
  width: 100%; padding: 11px 14px; border: 0; border-radius: 10px; background: var(--fill); outline: none;
}
input::placeholder, textarea::placeholder { color: var(--label-3); }
textarea { resize: vertical; line-height: 1.45; }
input:focus, textarea:focus { box-shadow: inset 0 0 0 1.5px var(--blue); }
select {
  appearance: none; -webkit-appearance: none; width: auto; padding-right: 30px; cursor: pointer; color: var(--blue);
  background: var(--fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%238e8e93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E") no-repeat right 10px center;
}
.switch-input {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto; position: relative; width: 51px; height: 31px; padding: 0;
  border-radius: 16px; background: var(--fill-strong); cursor: pointer; transition: background-color .25s; box-shadow: none !important;
}
.switch-input::after, .switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2), 0 0 1px rgba(0, 0, 0, .15); transition: transform .28s var(--ease-ios);
}
.switch-input:checked { background: var(--green); }
.switch-input:checked::after { transform: translateX(20px); }
.switch-input:disabled { opacity: .5; }
.switch { flex: 0 0 auto; position: relative; width: 51px; height: 31px; border-radius: 16px; background: var(--fill-strong); transition: background-color .25s; }
[aria-pressed="true"] > .switch { background: var(--green); }
[aria-pressed="true"] > .switch::after { transform: translateX(20px); }

/* ---------- 文字 ---------- */
.error { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 8px; }
.error:empty { display: none; }
.muted { color: var(--label-2); font-size: 13px; }
.saved { color: var(--green); font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- 分组卡片 ---------- */
.group { margin-bottom: 28px; }
.group > h2 { font-size: 13px; font-weight: 400; color: var(--label-2); margin: 0 16px 6px; }
.footnote { font-size: 13px; color: var(--label-2); margin: 6px 16px 0; line-height: 1.38; }
.card { background: var(--card); border-radius: var(--radius-card); overflow: hidden; }
.card.padded { padding: 14px 16px; }
.card textarea { display: block; background: none; border-radius: 0; padding: 12px 16px; font-size: 16px; }
.card textarea:focus { box-shadow: none; }
.field { display: block; position: relative; }
.field + .field::before, .setting-row + .setting-row::before, .setting-row + .field::before, a.setting-row + .setting-row::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--separator);
}
.field input { background: none; border-radius: 0; padding: 12px 16px; min-height: 44px; }
.field input:focus { box-shadow: none; }
.setting-row {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  min-height: 44px; padding: 7px 16px; background: none; color: var(--label); font-weight: 400; font-size: 16px;
  border-radius: 0; text-align: left;
}
.setting-row.danger { color: var(--red); justify-content: center; }
a.setting-row { text-decoration: none; box-sizing: border-box; }
.setting-row > label { flex: 1; margin: 0; }
.setting-row select { background-color: transparent; color: var(--label-2); padding: 4px 26px 4px 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; padding: 0 2px; }
.actions .grow { flex: 1 1 140px; }

/* ---------- 登录 / 初始化 ---------- */
.auth-page {
  background:
    radial-gradient(60vmax 44vmax at 12% 8%, color-mix(in srgb, var(--blue) 26%, transparent), transparent 70%),
    radial-gradient(54vmax 44vmax at 92% 30%, color-mix(in srgb, var(--purple) 20%, transparent), transparent 70%),
    radial-gradient(60vmax 40vmax at 40% 104%, color-mix(in srgb, var(--teal) 20%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
.auth .card { border-radius: 22px; background: var(--glass-fill); box-shadow: var(--glass-shadow); -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter); }
.auth { min-height: 100%; max-width: 400px; margin: 0 auto; padding: calc(var(--safe-top) + 10vh) 20px 40px; text-align: center; animation: rise .5s var(--ease-ios); }
.app-mark {
  width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 18px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(160deg, #5ac8fa, #007aff 62%, #5856d6);
  box-shadow: 0 8px 22px rgba(0, 122, 255, .28), inset 0 .5px 0 rgba(255, 255, 255, .5);
}
.auth h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.auth .subtitle { color: var(--label-2); font-size: 15px; margin: 6px 12px 0; }
.auth form { margin-top: 26px; text-align: left; }
.auth button[type="submit"] { width: 100%; height: 52px; margin-top: 16px; font-size: 17px; border-radius: 26px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 20px color-mix(in srgb, var(--blue) 35%, transparent); }
.auth .error { text-align: center; margin-top: 12px; }

/* 操作表和系统风格弹窗 */
dialog { color: var(--label); }
dialog::backdrop { background: rgba(0, 0, 0, .35); animation: fade .2s ease; }
.action-sheet {
  position: fixed; inset: auto 0 0 0; width: min(100%, 440px); max-width: 100%; margin: 0 auto; padding: 0 10px calc(10px + var(--safe-bottom));
  border: 0; background: none; animation: sheet-up .36s var(--ease-ios);
}
.action-sheet .sheet-group { border-radius: 22px; overflow: hidden; }
.action-sheet button { display: block; width: 100%; min-height: 56px; border-radius: 0; background: none; color: var(--blue); font-size: 19px; font-weight: 400; }
.action-sheet .sheet-group button + button { box-shadow: 0 -.5px 0 var(--separator); }
.action-sheet button.destructive { color: var(--red); }
.action-sheet .sheet-cancel { margin-top: 8px; border-radius: 22px; font-weight: 600; }
.alert {
  width: 272px; padding: 0; border: 0; border-radius: 26px; overflow: hidden; text-align: center;
  animation: alert-in .3s var(--ease-spring);
}
.alert-body { padding: 18px 16px 16px; }
.alert-body h3 { font-size: 17px; font-weight: 600; }
.alert-body p { font-size: 13px; margin-top: 3px; line-height: 1.35; }
.alert-body input { margin-top: 12px; padding: 8px 10px; font-size: 15px; background: var(--bg-chat); border-radius: 8px; }
.alert-actions { display: flex; box-shadow: 0 -.5px 0 var(--separator); }
.alert-actions button { flex: 1; min-height: 44px; border-radius: 0; background: none; color: var(--blue); font-size: 17px; font-weight: 400; padding: 8px; }
.alert-actions button + button { box-shadow: -.5px 0 0 var(--separator); }
.alert-actions button.primary { font-weight: 600; }
.alert-actions button.destructive { color: var(--red); }


.help-card { align-self: stretch; background: var(--warn-fill); border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.help-card strong { display: block; margin-bottom: 3px; font-weight: 600; }

/* ---------- 打卡 ---------- */
.tasks-page { background: var(--bg); }
.tasks { max-width: 640px; margin: 0 auto; padding: calc(var(--safe-top) + 10px) 16px calc(96px + var(--safe-bottom)); }
.tasks-head { height: 44px; display: flex; align-items: center; justify-content: flex-end; }
.admin-head { justify-content: flex-start; }
.tasks-head a { text-decoration: none; }
.tasks h1 { font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-top: 8px; }
.tasks-date { color: var(--label-2); font-size: 15px; margin: 2px 0 18px; }
.tasks-progress { margin-bottom: 24px; }
.tasks-progress-text { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; color: var(--label-2); margin-bottom: 8px; }
.tasks-progress-text strong { font-size: 17px; font-weight: 600; color: var(--label); }
.progress-track { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: 4px; background: var(--green); transition: width .45s var(--ease-ios); }
.tasks-empty { text-align: center; color: var(--label-2); font-size: 15px; margin: 18vh 24px 0; }
.task-row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 9px 8px 9px 14px; }
.task-row + .task-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--separator); }
.task-check {
  flex: 0 0 auto; width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: 50%; display: grid; place-items: center;
  background: none; color: var(--label-2); font-size: 11px; font-weight: 600; box-shadow: inset 0 0 0 2px var(--label-3);
}
.task-check.done { background: var(--green); color: #fff; box-shadow: none; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.task-row.done .task-title { color: var(--label-2); }
.task-sub { font-size: 12px; color: var(--label-2); margin-top: 2px; }
.task-delete { flex: 0 0 auto; width: 34px; height: 34px; min-height: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; background: none; color: var(--label-3); }
.task-delete:hover { color: var(--red); }
.task-row.draft input { padding: 4px 0; background: none; border-radius: 0; font-size: 16px; box-shadow: none; }
.add-task {
  position: fixed; left: 50%; bottom: calc(18px + var(--safe-bottom)); translate: -50% 0; z-index: 3; display: inline-flex; align-items: center; gap: 7px;
  min-height: 50px; padding: 12px 24px; border-radius: 25px; color: var(--blue); white-space: nowrap;
}
.task-sheet {
  position: fixed; inset: auto 0 0 0; width: min(100%, 560px); max-width: 100%; max-height: 88dvh; margin: 0 auto; padding: 12px 16px calc(16px + var(--safe-bottom));
  border: 0; border-radius: 26px 26px 0 0; overflow-y: auto; animation: sheet-up .38s var(--ease-ios);
}
.task-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.task-sheet-head strong { font-size: 17px; font-weight: 600; }
.task-sheet-head button, .task-sheet-spacer { width: 56px; text-align: left; }
.task-sheet textarea { display: block; background: var(--fill); border-radius: 14px; font-size: 16px; resize: none; }
.task-sheet .footnote { margin: 0 2px 10px; }
.task-sheet .card { background: var(--fill); border-radius: 16px; max-height: 46dvh; overflow-y: auto; }
.task-sheet .help-card { margin-top: 12px; }
.sheet-action { width: 100%; min-height: 50px; margin-top: 14px; border-radius: 25px; font-size: 17px; }
.sheet-back { display: block; width: 100%; margin-top: 6px; text-align: center; }


/* ---------- 主界面 ---------- */
.tasks { padding-bottom: calc(156px + var(--safe-bottom)); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-top: 6px; }
.page-head h1 { margin-top: 0; }
.page-head .tasks-date { margin-bottom: 16px; min-height: 20px; }
.avatar {
  flex: 0 0 auto; width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%; color: var(--blue); font-size: 16px; font-weight: 600;
}
.tabbar {
  position: fixed; left: 50%; bottom: calc(14px + var(--safe-bottom)); translate: -50% 0; z-index: 4; display: flex; gap: 2px;
  width: min(360px, calc(100% - 32px)); padding: 5px; border-radius: 32px;
}
.tabbar button {
  position: relative; flex: 1; min-height: 50px; padding: 3px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: none; color: var(--label-2); font-size: 10px; font-weight: 500; border-radius: 26px;
}
.tabbar button.active { background: color-mix(in srgb, var(--blue) 16%, transparent); color: var(--blue); }
.tabbar .badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 16px; padding: 0 4px; font-size: 11px; line-height: 16px; border-radius: 8px; background: var(--red); color: #fff; }
.fab {
  position: fixed; right: max(16px, calc(50% - 320px)); bottom: calc(90px + var(--safe-bottom)); z-index: 4;
  width: 52px; height: 52px; min-height: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; color: var(--blue);
}
.tasks-empty { margin-top: 12vh; }

.study-card { margin-bottom: 24px; text-align: center; }
.study-label { font-size: 13px; color: var(--label-2); }
.study-time { font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; margin-top: 2px; }
.study-sub { font-size: 13px; color: var(--label-2); margin-top: 2px; }
.study-sub.running { color: var(--green); }
.study-button { width: 100%; min-height: 50px; margin-top: 14px; border-radius: 25px; font-size: 17px; }
.study-button.stop { background: var(--red); }

.task-sub.overdue { color: var(--red); }
.task-sub.warn { color: var(--orange); }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 4px 16px; position: relative; font-size: 16px; }
.form-row + .form-row::before, .form-row + .field::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--separator); }
.form-row input { width: auto; min-width: 0; padding: 6px 8px; background: none; text-align: right; color: var(--blue); }
.form-row input:focus { box-shadow: none; }
.task-sheet input[type="checkbox"] { width: 51px; }
.task-sheet .group { margin-bottom: 18px; }
.task-sheet .group > h2 { margin-left: 4px; }
.task-sheet .sheet-action { margin-top: 10px; }
.task-sheet select { max-width: 60%; }

.cal-card { margin-bottom: 20px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-head button { min-width: 44px; min-height: 36px; font-size: 24px; line-height: 1; padding: 0; text-align: center; }
.cal-head strong { font-size: 16px; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.cal-week { font-size: 12px; color: var(--label-2); margin-bottom: 4px; }
.cal-day { display: flex; flex-direction: column; align-items: center; min-height: 46px; padding: 3px 0 2px; background: none; color: var(--label); font-weight: 400; font-size: 16px; border-radius: 10px; }
.cal-num { width: 30px; height: 30px; line-height: 30px; border-radius: 50%; }
.cal-day.today .cal-num { color: var(--blue); font-weight: 600; }
.cal-day.selected .cal-num { background: var(--blue); color: #fff; font-weight: 600; }
.cal-dots { display: flex; gap: 3px; height: 6px; margin-top: 2px; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; }
.cal-dots .todo { background: var(--orange); }
.cal-dots .log { background: var(--blue); }
.day-title { font-size: 20px; font-weight: 700; margin: 0 4px 12px; }
.tl { padding: 16px 16px 10px; }
.tl-item {
  display: grid; grid-template-columns: 68px minmax(0, 1fr); column-gap: 16px; width: 100%; min-height: 72px; padding: 0;
  background: none; color: var(--label); font-weight: 400; text-align: left; border-radius: 0;
}
.tl-item:active:not(:disabled) { transform: none; opacity: .6; }
.tl-item:last-child { min-height: 0; }
.tl-item:last-child .tl-main { padding-bottom: 6px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; }
.tl-time {
  width: 68px; padding: 4px 0; border-radius: 13px; background: var(--fill); color: var(--label-2);
  font-size: 14px; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
}
.tl-line { flex: 1; width: 3px; min-height: 22px; margin: 6px 0; border-radius: 2px; background: var(--blue); }
.tl-main { padding: 1px 0 16px; min-width: 0; }
.tl-title { font-size: 17px; line-height: 24px; overflow-wrap: anywhere; }
.tl-sub { font-size: 12px; color: var(--label-2); margin-top: 1px; }
.tl-note { font-size: 14px; line-height: 1.4; color: var(--label-2); margin-top: 3px; overflow-wrap: anywhere; white-space: pre-wrap; }
.danger-text { color: var(--red); }
.card .muted.pad { display: block; padding: 14px 16px; }
.member-row { justify-content: space-between; }
.chevron { width: 8px; height: 8px; border-right: 2px solid var(--label-3); border-top: 2px solid var(--label-3); transform: rotate(45deg); }
.back-link { display: block; margin: -6px 0 8px -2px; font-size: 16px; }
.day-nav { margin: 0 2px 6px; }
.board-input textarea { resize: none; }
.board { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.board-item { padding: 8px 10px 10px 14px; }
.board-item.mine { background: color-mix(in srgb, var(--blue) 13%, var(--card)); }
.board-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--label-2); min-height: 30px; }
.board-meta strong { color: var(--label); font-size: 14px; font-weight: 600; }
.board-meta .task-delete { margin-left: auto; width: 28px; height: 28px; }
.board-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; padding-right: 6px; }
.admin-page { padding-bottom: 48px; }
.admin-page .switch-input { width: 51px; }
#groupForm > .card:nth-of-type(2) { margin-top: 10px; }

/* ---------- 玻璃材质：只用于悬浮控件，内容层（气泡、分组卡片）保持实色 ---------- */
:where(.glass:not(dialog)) { position: relative; }
.glass {
  background: var(--glass-fill); box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter);
}
/* 边缘反光：一圈 1px 的渐变描边 */
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(145deg, var(--glass-rim-1), var(--glass-rim-2) 38%, transparent 58%, var(--glass-rim-2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

/* 系统要求降低透明度或增强对比度时，改回实色 */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .glass, .tabs, .auth .card {
    background: var(--card) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  }
  .glass::after { display: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .tabs, .auth .card { background: var(--card); }
}

@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes slide-in { from { transform: translateX(calc(-100% - 12px)); } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes alert-in { from { opacity: 0; transform: scale(.9); } }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, dialog::backdrop { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.pw-sheet { position: fixed; width: min(92vw, 360px); margin: auto; padding: 16px; border: 0; border-radius: 26px; animation: alert-in .3s var(--ease-spring); }
.pw-sheet h3 { font-size: 17px; font-weight: 600; text-align: center; margin-bottom: 12px; }
.pw-sheet .card { background: var(--fill); }
.pw-sheet .actions { justify-content: stretch; }
.pw-sheet .actions button { flex: 1; }
