/* ==========================================================================
   一页待办 · 样式
   ========================================================================== */

:root {
  --bg: #f6f2ea;
  --bg-deep: #efe8dc;
  --surface: #fffdf9;
  --surface-2: #faf5ec;
  --surface-3: #f3ece0;
  --ink: #26211b;
  --ink-2: #51483d;
  --muted: #8c8174;
  --faint: #b3a899;
  --line: #e7ded0;
  --line-strong: #d9cdbb;
  --accent: #bd5836;
  --accent-deep: #9c4529;
  --accent-soft: #f4e1d5;
  --accent-glow: rgba(189, 88, 54, 0.16);
  --green: #52775b;
  --green-soft: #e2ecdf;
  --amber: #ad742c;
  --amber-soft: #f5e8cf;
  --danger: #b3443c;
  --danger-soft: #f7e2df;
  --shadow-sm: 0 1px 2px rgba(61, 45, 30, 0.04), 0 4px 12px rgba(61, 45, 30, 0.04);
  --shadow: 0 18px 50px rgba(74, 55, 36, 0.09);
  --shadow-lg: 0 30px 80px rgba(45, 32, 20, 0.18);
  --radius-sm: 11px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --font-sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sidebar-w: 292px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] {
  --bg: #151210;
  --bg-deep: #100e0c;
  --surface: #1e1a16;
  --surface-2: #241f1a;
  --surface-3: #2b251f;
  --ink: #f3ece2;
  --ink-2: #d3c8ba;
  --muted: #a29687;
  --faint: #7d7264;
  --line: #342d26;
  --line-strong: #443a31;
  --accent: #e17b54;
  --accent-deep: #c96440;
  --accent-soft: #3a241b;
  --accent-glow: rgba(225, 123, 84, 0.18);
  --green: #8eb596;
  --green-soft: #253229;
  --amber: #d5a25c;
  --amber-soft: #352b1d;
  --danger: #e08a82;
  --danger-soft: #3a2220;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 620px at 12% -10%, rgba(189, 88, 54, 0.09), transparent 62%),
    radial-gradient(760px 560px at 100% 0%, rgba(150, 130, 95, 0.1), transparent 60%),
    radial-gradient(700px 500px at 60% 110%, rgba(189, 88, 54, 0.05), transparent 65%);
}

html[data-theme="dark"] body::before {
  background:
    radial-gradient(900px 620px at 12% -10%, rgba(225, 123, 84, 0.08), transparent 62%),
    radial-gradient(760px 560px at 100% 0%, rgba(120, 100, 70, 0.09), transparent 60%);
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

::selection {
  background: var(--accent);
  color: #fff9f3;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--ink-2);
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.only-mobile {
  display: none !important;
}

.noscript {
  padding: 40px;
  text-align: center;
  font-size: 16px;
}

/* ==========================================================================
   启动画面
   ========================================================================== */

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--bg);
  transition: opacity 0.55s var(--ease), visibility 0.55s;
}

.boot.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--accent), var(--accent-deep));
  color: #fff8f1;
  box-shadow: 0 16px 38px var(--accent-glow);
  animation: boot-breathe 1.8s ease-in-out infinite;
}

.boot-mark .icon {
  width: 30px;
  height: 30px;
  stroke-width: 2.2;
}

.boot-name {
  font-family: var(--font-serif);
  font-size: 20px;
  letter-spacing: 0.16em;
  color: var(--ink-2);
}

.boot-line {
  width: 96px;
  height: 2px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--line);
}

.boot-line span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  animation: boot-line 1.4s var(--ease) infinite;
}

@keyframes boot-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.03); }
}

@keyframes boot-line {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(360%); }
}

/* ==========================================================================
   登录
   ========================================================================== */

.auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.auth-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(32px, 5vw, 64px);
  color: #f8ede0;
  background:
    radial-gradient(700px 500px at 80% 20%, rgba(240, 168, 118, 0.22), transparent 62%),
    radial-gradient(500px 500px at 10% 90%, rgba(189, 88, 54, 0.35), transparent 60%),
    linear-gradient(152deg, #2a211b 0%, #3b2b21 48%, #58382a 100%);
}

.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.16'/%3E%3C/svg%3E");
}

.auth-visual-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-brand {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: 0.14em;
}

.auth-brand-sub {
  font-size: 9px;
  letter-spacing: 0.34em;
  opacity: 0.5;
  margin-top: 2px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff8f1;
  background: linear-gradient(145deg, var(--accent), var(--accent-deep));
  box-shadow: 0 10px 24px var(--accent-glow);
}

.brand-mark .icon {
  width: 21px;
  height: 21px;
  stroke-width: 2.3;
}

.brand-mark.large {
  width: 48px;
  height: 48px;
  border-radius: 15px;
}

.brand-mark.large .icon {
  width: 25px;
  height: 25px;
}

.auth-art {
  position: relative;
  z-index: 1;
  width: min(430px, 82%);
  aspect-ratio: 1 / 1.04;
  margin: 6vh auto 2vh;
  display: grid;
  place-items: center;
}

.paper {
  position: relative;
  width: 62%;
  aspect-ratio: 0.76;
  padding: 13% 11%;
  border-radius: 6px 18px 18px 6px;
  background: linear-gradient(165deg, #fdf6ea, #f2e5d2);
  box-shadow: 28px 34px 70px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  transform: rotate(-7deg);
  animation: paper-float 7s ease-in-out infinite;
}

.paper::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 11%;
  width: 1px;
  background: rgba(189, 88, 54, 0.24);
}

.paper-line {
  height: 2px;
  margin-bottom: 11%;
  border-radius: 2px;
  background: rgba(84, 67, 50, 0.22);
}

.paper-line.w70 { width: 70%; }
.paper-line.w60 { width: 60%; }
.paper-line.w52 { width: 52%; }
.paper-line.w45 { width: 45%; }
.paper-line.w35 { width: 35%; }

.paper-check {
  width: 25px;
  height: 25px;
  margin: 12% 0 12% 8%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
}

.paper-check .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.6;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(248, 237, 224, 0.2);
  border-radius: 50%;
}

.orbit-a {
  width: 94%;
  height: 94%;
  animation: spin 28s linear infinite;
}

.orbit-b {
  width: 72%;
  height: 72%;
  border-style: dashed;
  opacity: 0.6;
  animation: spin 22s linear infinite reverse;
}

.auth-spark {
  position: absolute;
  top: 7%;
  right: 2%;
  font-size: 26px;
  color: #eab78d;
  animation: sparkle 4s ease-in-out infinite;
}

.auth-quote {
  position: relative;
  z-index: 2;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.4vw, 29px);
  line-height: 1.65;
  letter-spacing: 0.06em;
  color: rgba(250, 241, 230, 0.92);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 40px clamp(24px, 5vw, 72px);
}

.login-card {
  width: min(410px, 100%);
}

.login-mobile-brand {
  display: none;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.login-card h2 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(30px, 3.6vw, 40px);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.login-desc {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
}

.code-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.code-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.code-field > .icon {
  color: var(--faint);
  width: 18px;
  height: 18px;
}

.code-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 10px 0;
  font-family: var(--font-mono);
  font-size: 17px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.code-field input::placeholder {
  color: var(--faint);
  letter-spacing: 0.18em;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 11px;
  padding: 12px 18px;
  color: #fff8f1;
  background: linear-gradient(145deg, var(--accent), var(--accent-deep));
  box-shadow: 0 8px 20px var(--accent-glow);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), filter 0.18s;
}

.login-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.login-btn .icon {
  width: 16px;
  height: 16px;
}

.form-error {
  min-height: 22px;
  margin: 10px 2px 0;
  color: var(--danger);
  font-size: 12.5px;
}

.form-error.is-shaking {
  animation: shake 0.4s;
}

.login-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 8px 2px 0;
  color: var(--faint);
  font-size: 11.5px;
}

.login-note .icon {
  width: 14px;
  height: 14px;
}

.auth-foot {
  margin: 0;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.06em;
}

@keyframes paper-float {
  0%, 100% { transform: rotate(-7deg) translateY(0); }
  50% { transform: rotate(-5.4deg) translateY(-12px); }
}

@keyframes sparkle {
  0%, 100% { opacity: 0.45; transform: scale(0.9) rotate(0); }
  50% { opacity: 1; transform: scale(1.12) rotate(18deg); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ==========================================================================
   应用骨架
   ========================================================================== */

.app {
  display: flex;
  min-height: 100dvh;
}

.app[hidden],
.auth[hidden],
.modal-root[hidden] {
  display: none !important;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  width: var(--sidebar-w);
  flex: none;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 26px 18px 18px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  backdrop-filter: blur(18px) saturate(1.1);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  margin-bottom: 32px;
}

.brand-text {
  min-width: 0;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.brand-sub {
  margin-top: 3px;
  font-size: 8px;
  letter-spacing: 0.32em;
  color: var(--faint);
}

.sidebar-close {
  display: none;
  margin-left: auto;
}

.side-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.side-scroll::-webkit-scrollbar {
  width: 5px;
}

.side-scroll::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 5px;
}

.side-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  margin: 4px 0 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

.mini-btn {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  transition: background 0.18s, color 0.18s;
}

.mini-btn:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.mini-btn .icon {
  width: 15px;
  height: 15px;
}

.list-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 11px;
  color: var(--ink-2);
  background: transparent;
  text-align: left;
  transition: background 0.18s, color 0.18s, transform 0.18s;
}

.nav-item:hover {
  background: var(--surface-2);
}

.nav-item.is-active {
  color: var(--accent-deep);
  background: var(--accent-soft);
}

html[data-theme="dark"] .nav-item.is-active {
  color: var(--accent);
}

.nav-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--dot, var(--accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot, var(--accent)) 15%, transparent);
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.nav-icon .icon {
  width: 17px;
  height: 17px;
}

.nav-item.is-active .nav-icon {
  color: var(--accent);
}

.nav-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 500;
}

.nav-count {
  flex: none;
  font-size: 10.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.nav-item.is-active .nav-count {
  color: var(--accent-deep);
}

.nav-edit {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  color: var(--faint);
  background: transparent;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}

.nav-item:hover .nav-edit,
.nav-item:focus-within .nav-edit {
  opacity: 1;
}

.nav-edit:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}

.nav-edit .icon {
  width: 14px;
  height: 14px;
}

.progress-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 28px 4px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120px 90px at 100% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.ring {
  width: 58px;
  height: 58px;
  flex: none;
  display: grid;
  place-items: center;
}

.ring > * {
  grid-area: 1 / 1;
}

.ring-label {
  place-self: center;
}

.ring svg {
  width: 58px;
  height: 58px;
  transform: rotate(-90deg);
}

.ring circle {
  fill: none;
  stroke-width: 5;
}

.ring .track {
  stroke: var(--line);
}

.ring .value {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s var(--ease);
}

.ring-label {
  place-self: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.progress-copy {
  min-width: 0;
}

.progress-kicker {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.progress-value {
  margin-top: 2px;
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.2;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.progress-note {
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote {
  margin: 26px 12px 10px;
  font-family: var(--font-serif);
  font-size: 12px;
  line-height: 1.9;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.side-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 4px 0;
  border-top: 1px solid var(--line);
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 16%, transparent);
  transition: background 0.25s, box-shadow 0.25s;
}

.sync-pill.is-online {
  color: var(--green);
}

.sync-pill.is-online .sync-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 16%, transparent);
  animation: pulse-dot 3s ease-in-out infinite;
}

.sync-pill.is-offline {
  color: var(--danger);
}

.sync-pill.is-offline .sync-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent);
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 16%, transparent); }
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--green) 6%, transparent); }
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(22px, 5vw, 64px);
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 0 0;
}

.menu-btn {
  display: none;
}

.headline {
  min-width: 0;
}

.date-line {
  margin-bottom: 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

.topbar h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.22;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  transition: color 0.18s, background 0.18s, border-color 0.18s, transform 0.18s;
}

.icon-btn:hover {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: translateY(0);
}

.icon-btn .icon {
  width: 19px;
  height: 19px;
}

.content {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 30px 0 20px;
  flex: 1;
}

/* ==========================================================================
   主视觉 / 统计
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(420px 260px at 100% 0%, var(--accent-soft), transparent 68%),
    linear-gradient(160deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-sm);
}

.hero::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -80px;
  width: 240px;
  height: 240px;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 50%;
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.hero .eyebrow {
  margin-bottom: 8px;
}

.hero h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(23px, 2.8vw, 31px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.hero-sub {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  flex: none;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 40px;
}

.stat strong {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat span {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--faint);
}

.stat-rule {
  width: 1px;
  height: 30px;
  background: var(--line);
}

.stat-ring {
  width: 50px;
  height: 50px;
  margin-left: 2px;
}

.stat-ring svg {
  width: 50px;
  height: 50px;
  transform: rotate(-90deg);
}

.stat-ring circle {
  fill: none;
  stroke-width: 4;
}

.stat-ring .track {
  stroke: var(--line);
}

.stat-ring .value {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.7s var(--ease);
}

/* ==========================================================================
   快速添加
   ========================================================================== */

.composer {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  margin-top: 18px;
  padding: 8px 8px 8px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.composer:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 4px var(--accent-glow), var(--shadow-sm);
  transform: translateY(-1px);
}

.composer-icon {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--accent);
  background: var(--accent-soft);
}

.composer-icon .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

.composer input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
}

.composer input::placeholder {
  color: var(--faint);
}

.add-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 15px;
  border: 0;
  border-radius: 11px;
  color: #fff8f1;
  background: linear-gradient(145deg, var(--accent), var(--accent-deep));
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 7px 16px var(--accent-glow);
  transition: opacity 0.18s, transform 0.18s, filter 0.18s;
}

.add-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.add-btn:disabled {
  opacity: 0.42;
  box-shadow: none;
  cursor: default;
}

.add-btn kbd {
  font-family: var(--font-sans);
  font-size: 11px;
  opacity: 0.62;
}

.composer-hint {
  margin: 7px 0 0 20px;
  font-size: 10.5px;
  color: var(--faint);
  letter-spacing: 0.02em;
}

/* ==========================================================================
   工具栏
   ========================================================================== */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 26px 0 16px;
  flex-wrap: wrap;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.segmented button {
  position: relative;
  height: 30px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  transition: color 0.18s, background 0.18s, box-shadow 0.18s;
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(50, 35, 20, 0.08), 0 3px 8px rgba(50, 35, 20, 0.05);
}

.segmented button span {
  margin-left: 5px;
  font-size: 10px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  animation: search-in 0.22s var(--ease);
}

.search-wrap > .icon {
  width: 15px;
  height: 15px;
  color: var(--faint);
}

.search-wrap input {
  width: 150px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12.5px;
}

.search-clear {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--faint);
  background: var(--surface-3);
}

.search-clear .icon {
  width: 11px;
  height: 11px;
}

@keyframes search-in {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

.sort-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
}

.sort-wrap select {
  appearance: none;
  height: 100%;
  padding: 0 28px 0 11px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}

.sort-wrap .icon {
  position: absolute;
  right: 8px;
  width: 13px;
  height: 13px;
  pointer-events: none;
}

.offline-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--amber) 28%, var(--line));
  border-radius: 11px;
  color: var(--amber);
  background: var(--amber-soft);
  font-size: 12px;
}

.offline-banner .icon {
  width: 15px;
  height: 15px;
}

/* ==========================================================================
   任务列表
   ========================================================================== */

.task-area {
  min-height: 180px;
}

.group {
  margin-bottom: 26px;
  animation: fade-up 0.35s var(--ease) both;
}

.group-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 4px 10px;
}

.group-head h2 {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

.group-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-3);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

.group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 3px 7px;
  border: 0;
  border-radius: 6px;
  color: var(--faint);
  background: transparent;
  font-size: 10px;
}

.group-toggle:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.group-toggle .icon {
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
}

.group.is-collapsed .group-toggle .icon {
  transform: rotate(-90deg);
}

.group.is-collapsed .tasks {
  display: none;
}

.tasks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: flex-start;
  padding: 15px 16px 15px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 1px 1px rgba(60, 44, 28, 0.02);
  transition: border-color 0.18s, box-shadow 0.22s, transform 0.22s, opacity 0.3s;
  animation: task-in 0.32s var(--ease) both;
}

.task:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.task[data-priority="2"]::before,
.task[data-priority="1"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.task[data-priority="1"]::before {
  background: var(--amber);
  opacity: 0.85;
}

.task.is-done {
  opacity: 0.62;
  background: var(--surface-2);
}

.task.is-done .task-title {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--faint);
}

.task.is-pending {
  opacity: 0.7;
}

.task.is-leaving {
  opacity: 0;
  transform: translateX(8px) scale(0.99);
}

.check {
  position: relative;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border: 1.6px solid var(--line-strong);
  border-radius: 50%;
  color: transparent;
  background: transparent;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.2s;
}

.check:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.06);
}

.check .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
  transform: scale(0.5);
  transition: transform 0.22s var(--ease);
}

.task.is-done .check {
  border-color: var(--accent);
  color: #fff8f1;
  background: var(--accent);
}

.task.is-done .check .icon {
  transform: scale(1);
}

.task-main {
  min-width: 0;
  cursor: pointer;
}

.task-title {
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.task-notes {
  margin: 4px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 7px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 10px;
  white-space: nowrap;
}

.chip .icon {
  width: 11px;
  height: 11px;
}

.chip.chip-list {
  color: var(--list-color, var(--muted));
  background: color-mix(in srgb, var(--list-color, var(--muted)) 9%, var(--surface));
}

.chip.chip-due {
  color: var(--muted);
}

.chip.chip-due.is-today {
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.chip.chip-due.is-overdue {
  color: var(--danger);
  background: var(--danger-soft);
}

.chip.chip-priority {
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.chip.chip-priority.medium {
  color: var(--amber);
  background: var(--amber-soft);
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 0.18s, transform 0.18s;
}

.task:hover .task-actions,
.task:focus-within .task-actions {
  opacity: 1;
  transform: translateX(0);
}

.task-action {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--faint);
  background: transparent;
  transition: color 0.15s, background 0.15s;
}

.task-action:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.task-action.danger:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.task-action .icon {
  width: 15px;
  height: 15px;
}

@keyframes task-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 空状态 */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 54px 20px 62px;
  text-align: center;
  animation: fade-up 0.4s var(--ease);
}

.empty-art {
  position: relative;
  width: 96px;
  height: 96px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transform: rotate(-4deg);
}

.empty-art::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
}

.empty-art .icon {
  width: 34px;
  height: 34px;
  color: var(--faint);
  stroke-width: 1.4;
}

.empty h3 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
}

.empty p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.empty .text-btn {
  margin-top: 14px;
}

/* ==========================================================================
   页脚
   ========================================================================== */

.main-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 0 26px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 10.5px;
  letter-spacing: 0.03em;
}

.text-btn {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
}

.text-btn:hover {
  color: var(--accent);
}

/* ==========================================================================
   弹窗
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(28, 21, 15, 0.45);
  backdrop-filter: blur(6px);
  animation: backdrop-in 0.22s ease both;
}

.modal {
  width: min(560px, 100%);
  max-height: min(88dvh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.3s var(--ease) both;
}

.modal.wide {
  width: min(620px, 100%);
}

.modal.small {
  width: min(400px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 22px 14px;
}

.modal-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.modal-head .icon-btn {
  margin-left: auto;
  width: 34px;
  height: 34px;
}

.modal-body {
  padding: 4px 22px 22px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-2);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 500;
  transition: background 0.18s, border-color 0.18s, transform 0.18s, filter 0.18s;
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  border-color: transparent;
  color: #fff8f1;
  background: linear-gradient(145deg, var(--accent), var(--accent-deep));
  box-shadow: 0 6px 16px var(--accent-glow);
}

.btn.primary:hover {
  filter: brightness(1.05);
  background: linear-gradient(145deg, var(--accent), var(--accent-deep));
}

.btn.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 26%, var(--line));
  background: var(--danger-soft);
}

.btn.danger:hover {
  background: color-mix(in srgb, var(--danger-soft) 80%, var(--danger) 8%);
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn .icon {
  width: 15px;
  height: 15px;
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 任务详情 */

.task-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.task-title-input {
  width: 100%;
  padding: 4px 0 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  outline: 0;
  background: transparent;
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.4;
}

.task-title-input::placeholder {
  color: var(--faint);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > label,
.field-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
}

.field textarea,
.field input[type="text"],
.field input[type="date"],
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: var(--surface-2);
  font-size: 13px;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.field textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.7;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.priority-group {
  display: flex;
  gap: 6px;
}

.priority-btn {
  flex: 1;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 12px;
  transition: all 0.18s;
}

.priority-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.priority-btn.is-active {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.task-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.task-form-foot .left {
  display: flex;
  gap: 4px;
}

/* 设置 */

.settings-section {
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.settings-section:first-child {
  padding-top: 6px;
  border-top: 0;
}

.settings-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.settings-title .icon {
  width: 14px;
  height: 14px;
}

.connect-card {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.connect-card + .connect-card {
  margin-top: 8px;
}

.connect-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.connect-head strong {
  font-size: 12px;
  font-weight: 600;
}

.connect-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: 9.5px;
  color: var(--green);
}

.connect-badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.connect-badge.is-waiting {
  color: var(--amber);
}

.connect-badge.is-off {
  color: var(--faint);
}

.connect-url {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 2px 0 9px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.connect-actions {
  display: flex;
  gap: 6px;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface);
  font-size: 10.5px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.chip-btn:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: var(--accent-soft);
}

.chip-btn .icon {
  width: 12px;
  height: 12px;
}

.hint-text {
  margin: 7px 2px 0;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.65;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.theme-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 11.5px;
  transition: all 0.18s;
}

.theme-option:hover {
  color: var(--ink);
}

.theme-option.is-active {
  color: var(--accent-deep);
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  background: var(--accent-soft);
}

.theme-option .icon {
  width: 14px;
  height: 14px;
}

.code-change {
  display: flex;
  gap: 8px;
}

.code-change input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-change input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}

.settings-row .label {
  font-size: 12.5px;
}

.settings-row .value {
  color: var(--faint);
  font-size: 11px;
  font-family: var(--font-mono);
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* 二维码 */

.qr-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 22px 24px;
}

.qr-frame {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffdf8;
  box-shadow: var(--shadow-sm);
}

.qr-frame canvas {
  display: block;
  width: 224px;
  height: 224px;
  image-rendering: pixelated;
}

.qr-url {
  max-width: 100%;
  margin: 14px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  word-break: break-all;
}

.qr-tip {
  margin: 12px 0 0;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
  line-height: 1.7;
}

/* 清单编辑 */

.color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.swatch {
  width: 30px;
  height: 30px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--swatch);
  transition: transform 0.15s, box-shadow 0.15s;
}

.swatch:hover {
  transform: scale(1.08);
}

.swatch.is-active {
  border-color: var(--surface);
  box-shadow: 0 0 0 2px var(--swatch);
}

/* ==========================================================================
   Toast
   ========================================================================== */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 15px;
  border-radius: 999px;
  color: #fff9f2;
  background: rgba(38, 31, 24, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  font-size: 12px;
  line-height: 1.4;
  backdrop-filter: blur(10px);
  animation: toast-in 0.3s var(--ease) both;
}

.toast.is-out {
  animation: toast-out 0.25s ease both;
}

.toast .icon {
  width: 14px;
  height: 14px;
  color: #eab78d;
}

.toast.error .icon {
  color: #f0a19a;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px) scale(0.97); }
}

/* ==========================================================================
   响应式
   ========================================================================== */

@media (max-width: 1080px) {
  :root {
    --sidebar-w: 264px;
  }

  .main {
    padding: 0 32px;
  }

  .hero {
    padding: 24px 26px;
  }
}

@media (max-width: 860px) {
  .only-mobile {
    display: inline-grid !important;
  }

  .desktop-only {
    display: none !important;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 60;
    width: min(310px, 86vw);
    transform: translateX(-104%);
    transition: transform 0.32s var(--ease);
    box-shadow: var(--shadow-lg);
    background: var(--surface);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .scrim {
    display: block;
  }

  .sidebar-close {
    display: grid;
  }

  .scrim {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
    border: 0;
    background: rgba(28, 21, 15, 0.35);
    backdrop-filter: blur(2px);
  }

  .main {
    padding: 0 24px;
  }

  .menu-btn {
    display: grid;
    flex: none;
    margin-right: 2px;
  }

  .topbar {
    align-items: center;
    gap: 12px;
    padding-top: 24px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .top-actions {
    margin-left: auto;
  }

  .content {
    padding-top: 22px;
  }

  .hero {
    align-items: flex-start;
  }

  .hero-stats {
    gap: 12px;
  }

  .stat-ring {
    display: none;
  }

  .main-foot {
    padding-bottom: 18px;
  }
}

@media (max-width: 640px) {
  .toolbar-right {
    justify-content: flex-end;
  }

  .auth {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    display: none;
  }

  .auth-panel {
    position: relative;
    min-height: 100dvh;
    justify-content: center;
    padding: 30px 22px;
    background:
      radial-gradient(340px 300px at 100% 0%, var(--accent-soft), transparent 70%),
      var(--bg);
  }

  .login-mobile-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 34px;
    font-family: var(--font-serif);
    font-size: 18px;
    letter-spacing: 0.1em;
  }

  .login-card h2 {
    font-size: 31px;
  }

  .auth-foot {
    position: absolute;
    bottom: 24px;
  }

  .main {
    padding: 0 18px;
  }

  .topbar {
    padding-top: calc(16px + env(safe-area-inset-top));
  }

  .topbar h1 {
    font-size: 21px;
  }

  .date-line {
    font-size: 9px;
    letter-spacing: 0.12em;
  }

  .top-actions {
    gap: 2px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .content {
    padding-top: 18px;
  }

  .hero {
    flex-direction: column;
    gap: 16px;
    padding: 22px 20px;
    border-radius: var(--radius-lg);
  }

  .hero h2 {
    font-size: 22px;
  }

  .hero-sub {
    font-size: 11.5px;
  }

  .hero-stats {
    align-self: stretch;
    justify-content: flex-start;
    gap: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }

  .stat {
    flex-direction: row;
    align-items: baseline;
    gap: 5px;
  }

  .stat strong {
    font-size: 20px;
  }

  .stat-rule {
    height: 20px;
  }

  .composer {
    min-height: 58px;
    padding: 6px 6px 6px 12px;
    border-radius: 14px;
  }

  .composer input {
    font-size: 16px; /* 避免 iOS 聚焦缩放 */
  }

  .composer-icon {
    width: 26px;
    height: 26px;
  }

  .add-btn {
    height: 44px;
    padding: 0 13px;
  }

  .add-btn kbd {
    display: none;
  }

  .composer-hint {
    display: none;
  }

  .toolbar {
    margin: 20px 0 14px;
    gap: 10px;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
    padding: 0 8px;
  }

  .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .search-wrap {
    flex: 1;
  }

  .search-wrap input {
    width: 100%;
  }

  .task {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 13px 12px;
    border-radius: 13px;
  }

  .task-actions {
    opacity: 1;
    transform: none;
  }

  .task-action {
    width: 28px;
    height: 28px;
  }

  .task-action.delete {
    display: none;
  }

  .task-title {
    font-size: 14px;
  }

  .group {
    margin-bottom: 20px;
  }

  .main-foot {
    display: none;
  }

  .empty {
    padding: 40px 12px 48px;
  }

  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal,
  .modal.wide,
  .modal.small {
    width: 100%;
    max-height: 92dvh;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    animation: sheet-in 0.32s var(--ease) both;
  }

  .modal-head {
    padding: 18px 18px 12px;
  }

  .modal-body {
    padding: 2px 18px 18px;
  }

  .modal-foot {
    padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .toasts {
    bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .qr-frame canvas {
    width: 200px;
    height: 200px;
  }

  @keyframes sheet-in {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* 覆盖组件默认 display，保证 hidden 与桌面/移动端显隐可靠 */
[hidden] {
  display: none !important;
}

.menu-btn {
  display: none !important;
}

.brand-row .sidebar-close {
  display: none !important;
}

@media (max-width: 860px) {
  .menu-btn {
    display: grid !important;
  }

  .brand-row .sidebar-close {
    display: grid !important;
  }
}
