/* 晴天壁纸·手机版：底下铺一层模糊的当前壁纸，上面是天空蓝 + 磨砂玻璃，和电脑版小球一个味道 */
:root {
  --sky: #3e8ef0;
  --sky-2: #7cc4ff;
  --sun: #ffc94a;
  --ink: #fff;
  --ink-2: rgba(255, 255, 255, 0.78);
  --glass: rgba(255, 255, 255, 0.18);
  --glass-line: rgba(255, 255, 255, 0.34);
  --panel: #f6f9ff;
  --panel-ink: #1b2a44;
  --panel-ink-2: #5a6a86;
  --soft: #e6eefb;
  --line: #d7e2f4;
  --good: #e9f7ee;
  --good-ink: #1f7a44;
  --bad: #fdecec;
  --bad-ink: #b23b3b;
  --r: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --sky: #2a5fae;
    --sky-2: #1d3a68;
    --panel: #16202f;
    --panel-ink: #eef3fb;
    --panel-ink-2: #9aa9c2;
    --soft: #223047;
    --line: #2c3c56;
    --good: #18352a;
    --good-ink: #8fe0b0;
    --bad: #3a1f24;
    --bad-ink: #f3a2a2;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --sky: #2a5fae;
  --sky-2: #1d3a68;
  --panel: #16202f;
  --panel-ink: #eef3fb;
  --panel-ink-2: #9aa9c2;
  --soft: #223047;
  --line: #2c3c56;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
  color: var(--ink);
  background: linear-gradient(170deg, var(--sky-2), var(--sky));
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
#bg {
  position: fixed; inset: -40px; z-index: -1;
  background: center / cover no-repeat;
  filter: blur(28px) saturate(1.25);
  opacity: 0.85;
  transition: background-image 0.4s;
}
#bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 50, 100, 0.35), rgba(20, 40, 80, 0.55)); }
#app { padding: calc(env(safe-area-inset-top) + 12px) 16px calc(env(safe-area-inset-bottom) + 24px); max-width: 560px; margin: 0 auto; }
.boot { min-height: 80vh; display: grid; place-items: center; font-size: 22px; font-weight: 600; opacity: 0.8; }
h1 { margin: 0; font-size: 26px; letter-spacing: 0.5px; }
code { font: 12px/1.4 ui-monospace, Menlo, monospace; background: rgba(0, 0, 0, 0.18); padding: 1px 5px; border-radius: 6px; word-break: break-all; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:disabled { opacity: 0.45; }

/* 按钮 */
.btn { display: block; width: 100%; padding: 12px 14px; border-radius: 14px; font-weight: 600; transition: transform 0.12s, background 0.2s; }
.btn:active { transform: scale(0.97); }
.btn.big { padding: 15px; font-size: 17px; }
.btn.small { width: auto; padding: 6px 12px; font-size: 13px; }
.btn.primary { background: linear-gradient(180deg, #ffd86b, var(--sun)); color: #4a3300; box-shadow: 0 6px 18px rgba(255, 190, 40, 0.35); }
.btn.glass { background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.btn.glass.on, .btn.soft.on { color: #ff6b8a; }
.btn.soft { background: var(--soft); color: var(--panel-ink); }
.btn.ghost { color: var(--panel-ink-2); font-weight: 500; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--glass); border: 1px solid var(--glass-line); font-size: 20px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }

/* 配对 */
.pair { min-height: 82vh; display: flex; flex-direction: column; justify-content: center; gap: 14px; text-align: center; }
.pair .sun { width: 78px; height: 78px; margin: 0 auto 6px; border-radius: 50%; background: radial-gradient(circle at 40% 38%, #fff3c4, var(--sun) 60%, #ffae2b); box-shadow: 0 0 0 14px rgba(255, 210, 90, 0.18), 0 0 60px rgba(255, 200, 60, 0.6); }
.pair .sub { margin: -6px 0 6px; color: var(--ink-2); }
.pair input { text-align: center; font-size: 26px; letter-spacing: 8px; }
.note { background: var(--glass); border: 1px solid var(--glass-line); border-radius: 14px; padding: 10px 12px; font-size: 14px; text-align: left; }
.field { display: grid; gap: 6px; text-align: left; font-size: 13px; color: var(--ink-2); }
.field em { font-style: normal; opacity: 0.8; margin-left: 6px; }
input { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--glass-line); background: rgba(255, 255, 255, 0.2); color: inherit; outline: none; }
.panel input { border-color: var(--line); background: var(--soft); color: var(--panel-ink); }
.hint { font-size: 13px; color: var(--ink-2); margin: 4px 0; }

/* 顶部 + 当前壁纸 */
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.meta { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-2); }
.now { display: grid; grid-template-columns: 42% 1fr; gap: 16px; align-items: end; margin-bottom: 20px; }
.phone { position: relative; aspect-ratio: 9 / 19.5; border-radius: 22px; overflow: hidden; border: 3px solid rgba(255, 255, 255, 0.85); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35); background: rgba(255, 255, 255, 0.12); }
.phone img { width: 100%; height: 100%; object-fit: cover; display: block; }
.phone.blank { display: grid; place-items: center; font-size: 13px; color: var(--ink-2); }
.actions { display: grid; gap: 10px; align-self: end; align-content: end; }
.badge { position: absolute; right: 6px; top: 6px; font-style: normal; color: #ff6b8a; font-size: 14px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }
.tag { position: absolute; left: 6px; top: 6px; font-style: normal; font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 6px; background: rgba(0, 0, 0, 0.45); }

/* 分组 + 网格 */
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); margin-bottom: 12px; position: sticky; top: calc(env(safe-area-inset-top) + 6px); z-index: 2; }
.tabs button { padding: 8px 0; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.tabs button small { margin-left: 4px; font-weight: 500; opacity: 0.75; }
.tabs button.on { background: rgba(255, 255, 255, 0.92); color: #1b2a44; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cell { position: relative; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden; background: rgba(255, 255, 255, 0.1); padding: 0; }
.cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cell.seen img { opacity: 0.55; }
.cell.cur { outline: 3px solid var(--sun); outline-offset: -3px; }
.none { grid-column: 1 / -1; text-align: center; color: var(--ink-2); font-size: 14px; padding: 30px 10px; }

/* 底部弹层 */
#sheet { position: fixed; inset: 0; z-index: 10; }
.scrim { position: absolute; inset: 0; background: rgba(8, 18, 36, 0.45); opacity: 0; transition: opacity 0.2s; }
.panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; background: var(--panel); color: var(--panel-ink); border-radius: 22px 22px 0 0; padding: 8px 16px calc(env(safe-area-inset-bottom) + 20px); transform: translateY(100%); transition: transform 0.22s ease-out; max-width: 560px; margin: 0 auto; }
#sheet.open .scrim { opacity: 1; }
#sheet.open .panel { transform: none; }
.grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 2px auto 12px; }
.panel .hint, .panel .meta { color: var(--panel-ink-2); }
.panel code { background: var(--soft); }
.item { display: grid; gap: 12px; }
.preview { width: 62%; margin: 0 auto; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 16px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25); display: block; }
.item .meta { text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span, .chips button { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--soft); color: var(--panel-ink-2); }
.chips.good button { background: var(--good); color: var(--good-ink); }
.chips.bad button { background: var(--bad); color: var(--bad-ink); }
.link { text-align: center; font-size: 13px; color: var(--sky); }
.settings { display: grid; gap: 10px; }
.settings h2 { margin: 14px 0 0; font-size: 18px; }
.settings h2:first-child { margin-top: 0; }
.settings h3 { margin: 6px 0 0; font-size: 15px; }
.settings .field { color: var(--panel-ink-2); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; font-size: 14px; }
.copy { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.copy code { flex: 1; min-width: 0; padding: 8px; font-size: 11px; }
.warn { display: block; font-size: 12px; color: var(--bad-ink); margin-top: 4px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--soft); border-radius: 12px; }
.seg.four { grid-template-columns: repeat(4, 1fr); }
.seg.five { grid-template-columns: repeat(5, 1fr); }
.seg.five button { font-size: 12.5px; }
.seg button { padding: 8px 0; border-radius: 9px; font-size: 13.5px; color: var(--panel-ink-2); }
.seg button.on { background: var(--panel); color: var(--panel-ink); font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.linkish { color: var(--sky); text-decoration: underline; font-size: 13px; }
.log { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--panel-ink-2); display: grid; gap: 4px; }
.log time { margin-right: 8px; font-variant-numeric: tabular-nums; }

#toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 28px); transform: translateX(-50%); z-index: 20; background: rgba(20, 30, 50, 0.88); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; max-width: calc(100vw - 32px); text-align: center; }
