@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Nunito:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --primary: #c2410c;
  --primary-hover: #9a3412;
  --primary-soft: #fff4e8;
  --primary-faint: #fffaf5;
  --accent: #1d4ed8;
  --ink: #2c1810;
  --ink-soft: #5f463a;
  --muted: #80695e;
  --bg: #f8f5f2;
  --card: #ffffff;
  --line: #eadfd8;
  --line-strong: #d9c7bc;
  --danger: #b91c1c;
  --success: #16744a;
  --shadow-xs: 0 1px 2px rgb(55 31 19 / 0.04);
  --shadow-sm: 0 8px 24px rgb(55 31 19 / 0.06);
  --shadow-md: 0 18px 48px rgb(55 31 19 / 0.1);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --ease: 180ms cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% -5%, rgb(249 115 22 / .1), transparent 28rem),
    radial-gradient(circle at 100% 40%, rgb(251 146 60 / .055), transparent 24rem),
    var(--bg);
  color: var(--ink);
  font: 500 16px/1.6 Nunito, "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.shell {
  width: min(100%, 860px);
  min-height: 100dvh;
  margin-inline: auto;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

.top {
  position: sticky;
  top: 0;
  z-index: 15;
  padding: calc(15px + env(safe-area-inset-top)) 22px 15px;
  background: rgb(255 255 255 / .88);
  border-bottom: 1px solid rgb(234 223 216 / .8);
  color: var(--ink);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.brand { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--ink);
  font: 700 25px/1 Fredoka, "Microsoft YaHei", sans-serif;
  letter-spacing: -.025em;
}

.brand h1::before {
  content: "";
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 3px solid #fff;
  border-radius: 50%;
  outline: 2px solid var(--primary);
  background: conic-gradient(#c2410c 0 60deg, #f97316 60deg 120deg, #fdba74 120deg 180deg, #1d4ed8 180deg 240deg, #60a5fa 240deg 300deg, #fb923c 300deg);
  box-shadow: 0 5px 14px rgb(194 65 12 / .16);
}

.account-actions { display: flex; align-items: center; gap: 10px; }
.user { max-width: 14ch; overflow: hidden; color: var(--ink-soft); font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.logout-button {
  appearance: none;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
  transition: color var(--ease), border-color var(--ease), background var(--ease), transform var(--ease);
  touch-action: manipulation;
}
.logout-button:hover { border-color: var(--line-strong); background: var(--primary-faint); color: var(--primary); }
.logout-button:active { transform: translateY(1px); }
.logout-button:disabled { cursor: not-allowed; opacity: .5; }

.content { padding: 28px 22px 36px; }
.content > h2, .content > .split:first-child h2 { letter-spacing: -.025em; }
.card {
  margin: 0 0 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}
.card h2, .card h3, .hero h2 { margin: 0 0 9px; font-family: Fredoka, "Microsoft YaHei", sans-serif; line-height: 1.25; letter-spacing: -.02em; }
.card h2 { font-size: clamp(23px, 4vw, 29px); }
.card h3 { font-size: 19px; }
.card p { margin-block: 7px 14px; }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(24px, 5vw, 38px);
  border: 0;
  background: linear-gradient(135deg, #9a3412 0%, #c2410c 55%, #ea580c 100%);
  color: #fff;
  box-shadow: 0 18px 45px rgb(154 52 18 / .2);
}
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; border: 1px solid rgb(255 255 255 / .18); border-radius: 50%; }
.hero::before { width: 220px; height: 220px; top: -145px; right: -45px; }
.hero::after { width: 130px; height: 130px; top: -92px; right: 15px; }
.hero h2 { max-width: 14ch; color: #fff; font-size: clamp(28px, 6vw, 38px); }
.hero > .muted { max-width: 46ch; color: rgb(255 255 255 / .82); font-size: 15px; }
.muted { color: var(--muted); font-size: 14px; }
.hero .muted { color: rgb(255 255 255 / .82); }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 24px 0 0; }
.stat, .stats .stat {
  appearance: none;
  width: 100%;
  min-height: 96px;
  padding: 14px 15px;
  border: 1px solid rgb(255 255 255 / .25);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / .96);
  color: var(--ink-soft);
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgb(94 32 11 / .09);
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease);
  touch-action: manipulation;
}
.stat b, .stats .stat b { display: block; margin-bottom: 4px; color: var(--primary); font: 700 29px/1 Fredoka, sans-serif; letter-spacing: -.03em; }
.stat span, .stats .stat span { display: block; }
.stats .stat:hover { transform: translateY(-2px); background: #fff; box-shadow: 0 12px 26px rgb(94 32 11 / .14); }
.stats .stat:active { transform: translateY(0); }

.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid var(--primary);
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font: 800 14px/1.35 Nunito, "Microsoft YaHei", sans-serif;
  letter-spacing: .01em;
  box-shadow: 0 6px 16px rgb(194 65 12 / .15);
  transition: transform var(--ease), background var(--ease), border-color var(--ease), box-shadow var(--ease), color var(--ease), opacity var(--ease);
  touch-action: manipulation;
}
.btn:hover { border-color: var(--primary-hover); background: var(--primary-hover); box-shadow: 0 9px 22px rgb(154 52 18 / .21); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); box-shadow: 0 3px 10px rgb(154 52 18 / .14); }
.btn:disabled { cursor: not-allowed; opacity: .46; transform: none; box-shadow: none; }
.btn.full { width: 100%; }
.btn.secondary { border-color: var(--line); background: var(--card); color: var(--primary); box-shadow: var(--shadow-xs); }
.btn.secondary:hover { border-color: #f2c5a9; background: var(--primary-soft); color: var(--primary-hover); box-shadow: 0 7px 16px rgb(55 31 19 / .07); }
.btn.blue { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgb(29 78 216 / .15); }
.btn.blue:hover { border-color: #1e40af; background: #1e40af; }
.btn.danger { border-color: #fee2e2; background: #fff5f5; color: var(--danger); box-shadow: none; }
.btn.danger:hover { border-color: #fecaca; background: #fee2e2; }

.btn:focus-visible, .logout-button:focus-visible, .task-tab:focus-visible, .nav button:focus-visible, .row:focus-visible, .file:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgb(37 99 235 / .58); outline-offset: 3px; }

.nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 8px max(12px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  border-top: 1px solid rgb(234 223 216 / .85);
  background: rgb(255 255 255 / .92);
  box-shadow: 0 -12px 30px rgb(55 31 19 / .055);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}
.navin { display: grid; grid-template-columns: repeat(4, 1fr); width: min(100%, 680px); }
.nav button { position: relative; appearance: none; min-width: 64px; min-height: 56px; padding: 7px 8px 5px; border: 0; border-radius: 13px; background: transparent; color: var(--muted); font: 800 11px/1.2 Nunito, sans-serif; transition: color var(--ease), background var(--ease), transform var(--ease); touch-action: manipulation; }
.nav button:hover { background: var(--primary-faint); color: var(--primary); }
.nav button:active { transform: translateY(1px); }
.nav button.active { background: var(--primary-soft); color: var(--primary); }
.nav button.active::after { content: ""; position: absolute; right: 22%; bottom: 5px; left: 22%; height: 2px; border-radius: 2px; background: var(--primary); }
.nav .ico { display: block; width: 22px; height: 22px; margin: 0 auto 4px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.list { display: grid; gap: 11px; }
.row { appearance: none; width: 100%; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--card); color: inherit; box-shadow: var(--shadow-xs); transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease), background var(--ease); }
button.row:hover { border-color: #efc8b0; background: var(--primary-faint); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
button.row:active { transform: translateY(0); }
.row h3 { margin: 0; color: var(--ink); font-size: 18px; }
.row p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.row > .btn { margin-top: 8px; }
.split { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.split > :first-child { min-width: 0; }

.tag { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 10px; border: 1px solid #fed7aa; border-radius: 999px; background: #fff7ed; color: #9a3412; font-size: 12px; font-weight: 800; white-space: nowrap; }
.tag.blue { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.tag.green { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.tag.gray { border-color: #e5e7eb; background: #f8fafc; color: #596474; }

label { display: block; margin: 18px 0 7px; color: var(--ink-soft); font-size: 14px; font-weight: 800; }
input, textarea, select { appearance: none; width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 12px; background-color: var(--card); color: var(--ink); font-size: 15px; transition: border-color var(--ease), box-shadow var(--ease), background var(--ease); }
select { padding-right: 42px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23c2410c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
input:hover, textarea:hover, select:hover { border-color: #cbb5a7; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); background-color: #fff; box-shadow: 0 0 0 4px rgb(194 65 12 / .1); }
textarea { min-height: 100px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #a59186; }

input[type="file"] { height: auto; min-height: 52px; padding: 5px; color: var(--muted); }
input[type="file"]::file-selector-button { min-height: 40px; margin-right: 10px; padding: 8px 14px; border: 0; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font: 800 13px Nunito, sans-serif; cursor: pointer; transition: background var(--ease), color var(--ease); }
input[type="file"]::file-selector-button:hover { background: var(--primary); color: #fff; }

.check { display: flex; align-items: flex-start; gap: 12px; margin: 8px 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); cursor: pointer; transition: border-color var(--ease), background var(--ease), box-shadow var(--ease); }
.check:hover { border-color: #efc8b0; background: var(--primary-faint); }
.check:has(input:checked) { border-color: #f0b98f; background: var(--primary-soft); box-shadow: inset 3px 0 var(--primary); }
.check input[type="checkbox"], .check input[type="radio"] { appearance: none; display: grid; place-content: center; width: 20px; min-width: 20px; height: 20px; min-height: 20px; margin: 2px 0 0; padding: 0; border: 1.5px solid #bca79b; border-radius: 6px; background: #fff; }
.check input[type="radio"] { border-radius: 50%; }
.check input::before { content: ""; width: 9px; height: 9px; transform: scale(0); transition: transform 120ms ease; }
.check input[type="checkbox"]::before { clip-path: polygon(14% 44%, 0 59%, 40% 100%, 100% 20%, 84% 7%, 39% 67%); background: #fff; }
.check input[type="radio"]::before { border-radius: 50%; background: #fff; }
.check input:checked { border-color: var(--primary); background: var(--primary); }
.check input:checked::before { transform: scale(1); }
.check span { min-width: 0; font-weight: 800; line-height: 1.45; }
.check small { display: block; margin-top: 2px; font-weight: 500; }

.task-tabs { display: flex; gap: 5px; margin: 18px 0 0; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: #eee8e4; }
.task-tab { appearance: none; flex: 1 1 0; min-width: 0; min-height: 42px; padding: 8px 7px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: 800 13px Nunito, sans-serif; transition: background var(--ease), color var(--ease), box-shadow var(--ease), transform var(--ease); touch-action: manipulation; }
.task-tab:hover { color: var(--primary); }
.task-tab[aria-selected="true"] { background: var(--primary); color: #fff; box-shadow: 0 5px 14px rgb(154 52 18 / .18); }
.task-tab:active { transform: translateY(1px); }

.wheel-wrap { padding: 18px 0 24px; text-align: center; }
.wheel { position: relative; display: grid; place-items: center; width: min(245px, 72vw); aspect-ratio: 1; margin: 2px auto 20px; border: 10px solid #fff; border-radius: 50%; outline: 2px solid #f1b087; background: conic-gradient(#c2410c 0 60deg, #f97316 60deg 120deg, #fed7aa 120deg 180deg, #1d4ed8 180deg 240deg, #60a5fa 240deg 300deg, #fb923c 300deg); box-shadow: 0 18px 38px rgb(67 32 17 / .18), inset 0 0 0 1px rgb(255 255 255 / .5); transition: transform 1.3s cubic-bezier(.18, .75, .12, 1); }
.wheel::after { content: "抽"; display: grid; place-items: center; width: 70px; height: 70px; border: 7px solid rgb(255 255 255 / .65); border-radius: 50%; background: var(--primary); color: #fff; font: 700 26px Fredoka, sans-serif; box-shadow: 0 5px 15px rgb(55 31 19 / .2); }
.pointer { position: relative; z-index: 2; margin-bottom: -7px; color: var(--primary); font-size: 27px; filter: drop-shadow(0 2px 2px rgb(55 31 19 / .14)); }

.login { width: min(100% - 36px, 460px); margin: 0 auto; padding: max(9vh, 62px) 0 42px; }
.login::before { content: ""; position: fixed; z-index: -1; top: -110px; left: 50%; width: 440px; height: 250px; transform: translateX(-50%); border-radius: 50%; background: rgb(249 115 22 / .09); filter: blur(28px); }
.login .mark { width: 58px; height: 58px; margin: 0 0 20px; border: 5px solid #fff; border-radius: 50%; outline: 2px solid var(--primary); background: conic-gradient(#c2410c 0 60deg, #f97316 60deg 120deg, #fdba74 120deg 180deg, #1d4ed8 180deg 240deg, #60a5fa 240deg 300deg, #fb923c 300deg); box-shadow: 0 12px 28px rgb(154 52 18 / .18); font-size: 0; }
.login h1 { margin: 0; color: var(--ink); font: 700 clamp(31px, 7vw, 38px)/1.2 Fredoka, "Microsoft YaHei", sans-serif; letter-spacing: -.03em; }
.login > .muted { margin: 9px 0 24px; color: var(--muted); line-height: 1.65; }
.login form { margin-top: 25px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgb(255 255 255 / .92); box-shadow: var(--shadow-sm); }
.login form + .muted { margin-top: 18px; padding-inline: 4px; font-size: 13px; }

.empty { padding: 42px 24px; border-style: dashed; background: rgb(255 255 255 / .62); color: var(--muted); text-align: center; box-shadow: none; }
.file { appearance: none; display: inline-flex; min-height: 38px; align-items: center; padding: 6px 10px; border: 1px solid #bfdbfe; border-radius: 9px; background: #eff6ff; color: var(--accent); font-size: 13px; font-weight: 800; text-decoration: none; cursor: pointer; }

#toast { position: fixed; z-index: 120; left: 50%; bottom: calc(94px + env(safe-area-inset-bottom)); max-width: min(90%, 480px); padding: 11px 15px; transform: translateX(-50%) translateY(12px); border: 1px solid rgb(255 255 255 / .12); border-radius: 12px; background: #2c1810; color: #fff; box-shadow: var(--shadow-md); opacity: 0; text-align: center; font-size: 14px; font-weight: 700; transition: opacity var(--ease), transform var(--ease); pointer-events: none; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.media-preview { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgb(20 12 8 / .7); backdrop-filter: blur(7px); }
.media-preview__panel { width: min(760px, 100%); max-height: calc(100dvh - 40px); overflow: auto; padding: 13px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: 0 26px 75px rgb(0 0 0 / .32); }
.media-preview__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 2px 13px; }
.media-preview__bar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-preview__close { min-width: 68px; }
.media-preview__media { display: block; width: 100%; max-height: 72dvh; object-fit: contain; border-radius: 13px; background: #100b09; }

.lazy-footer { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; margin: 16px 0 4px; color: var(--muted); font-size: 13px; text-align: center; }
.lazy-footer .btn { min-height: 42px; white-space: nowrap; }
.spin-item-selection, .direct-item-selection { margin: 0 0 9px; }
.spin-item-options { display: grid; gap: 8px; }
.spin-item-options .check { margin: 0; }
.spin-item-pager { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 9px; margin-top: 13px; color: var(--muted); font-size: 13px; text-align: center; }
.spin-item-pager .btn { min-width: 0; padding-inline: 10px; }
.secondary-heading { display: flex; align-items: center; gap: 14px; margin: 0 0 15px; }
.secondary-heading h2 { margin: 0; font: 700 clamp(23px, 4vw, 28px)/1.2 Fredoka, "Microsoft YaHei", sans-serif; letter-spacing: -.025em; }
.secondary-heading .btn { flex: 0 0 auto; }
hr { border-color: var(--line) !important; }
[hidden] { display: none !important; }

@media (min-width: 700px) {
  .top { margin: 14px 14px 0; border: 1px solid rgb(234 223 216 / .82); border-radius: 18px; box-shadow: var(--shadow-xs); }
  .content { padding: 34px 32px 46px; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .card { padding: 26px; }
  .hero { padding: 38px; }
  .login { padding-top: max(10vh, 78px); }
  .nav { bottom: 14px; left: 50%; width: min(calc(100% - 36px), 520px); transform: translateX(-50%); border: 1px solid rgb(234 223 216 / .88); border-radius: 20px; box-shadow: 0 15px 38px rgb(55 31 19 / .14); }
}

@media (max-width: 420px) {
  .top { padding-inline: 16px; }
  .content { padding: 22px 16px 30px; }
  .brand h1 { font-size: 23px; }
  .brand h1::before { width: 27px; height: 27px; }
  .account-actions { gap: 6px; }
  .user { max-width: 8ch; font-size: 13px; }
  .logout-button { min-height: 38px; padding-inline: 10px; }
  .card { padding: 18px; }
  .hero { padding: 24px 20px; }
  .hero h2 { font-size: 29px; }
  .actions { grid-template-columns: 1fr 1fr; }
  .split { align-items: flex-start; }
  .secondary-heading { align-items: flex-start; flex-direction: column; gap: 11px; }
  .task-tabs { gap: 3px; padding: 4px; }
  .task-tab { padding-inline: 4px; font-size: 12px; }
}

@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --primary: #fb923c; --primary-hover: #fdba74; --primary-soft: #422517; --primary-faint: #2b1b15; --ink: #fff8f2; --ink-soft: #ead9d0; --muted: #c7aea2; --bg: #18110e; --card: #241915; --line: #49332a; --line-strong: #68483a; }
  body { background: radial-gradient(circle at 8% -5%, rgb(234 88 12 / .16), transparent 28rem), var(--bg); }
  .top, .nav { background: rgb(36 25 21 / .88); border-color: var(--line); }
  .brand h1 { color: var(--ink); }
  .logout-button, .row, input, textarea, select, .check { background-color: var(--card); }
  .stat, .stats .stat { background: #fffaf7; color: #594035; }
  .stats .stat:hover { background: #fff; }
  .task-tabs { background: #120d0b; }
  .task-tab[aria-selected="true"] { background: #c2410c; color: #fff; }
  .tag { border-color: #7c3b16; background: #3c2115; color: #fdba74; }
  .tag.blue { border-color: #1e3a8a; background: #172554; color: #bfdbfe; }
  .tag.green { border-color: #14532d; background: #052e16; color: #bbf7d0; }
  .tag.gray { border-color: #475569; background: #1e293b; color: #cbd5e1; }
  .btn { border-color: #c2410c; background: #c2410c; color: #fff; }
  .btn:hover { border-color: #9a3412; background: #9a3412; color: #fff; }
  .btn.secondary { border-color: var(--line); background: var(--card); color: #fdba74; }
  .login form { background: rgb(36 25 21 / .92); }
  input:focus, textarea:focus, select:focus { background-color: #2c1e19; }
}

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