/* 基础：重置、手机列、信纸底纹、通用卡片、提示条、占位页 */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #E9E2DA; }
body { font-family: var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 手机列：电脑上居中一条，手机上铺满 */
#app { position: relative; max-width: var(--app-max); height: 100dvh; margin: 0 auto; overflow: hidden; }
.page { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }

/* 细纹信纸 */
.paper {
  background-color: var(--paper);
  background-image: radial-gradient(rgba(129, 118, 111, .045) 1px, transparent 1px), radial-gradient(rgba(255, 255, 255, .6) 1px, transparent 1px);
  background-size: 5px 5px, 7px 7px; background-position: 0 0, 2px 3px;
}

/* 两边的蕾丝（跟着页面一起滚） */
.lace-edge { position: absolute; top: 0; bottom: 0; width: 18px; pointer-events: none;
  background: url(../assets/lace.png) repeat-y; background-size: 18px auto; filter: drop-shadow(1px 1px 1px rgba(81, 75, 74, .16)); }
.lace-edge.l { left: 0; }
.lace-edge.r { right: 0; transform: scaleX(-1); }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--lace); box-shadow: var(--shadow); border-radius: var(--radius); }

/* 小装饰：菱形分隔 */
.orn { display: block; }
.orn .l { stroke: var(--mauve-pale); stroke-width: .9; fill: none; }
.orn .d { fill: var(--mauve); }

/* 图标统一描边 */
.ico { flex: none; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }

/* 提示条 */
.toast { position: absolute; left: 50%; top: calc(var(--status-h) + 56px); z-index: 50; transform: translateX(-50%);
  max-width: 84%; padding: 9px 16px; border-radius: 20px; background: rgba(252, 250, 246, .96); border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(81, 75, 74, .14); font-size: 13px; color: var(--ink); pointer-events: none; animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -6px) } }

/* 确认框 */
.sheet-mask { position: absolute; inset: 0; z-index: 60; background: rgba(46, 56, 62, .32); display: flex; align-items: center; justify-content: center; padding: 28px; animation: toast-in .15s ease-out; }
.sheet { width: 100%; max-width: 300px; padding: 20px 18px 14px; border-radius: 18px; text-align: center; }
.sheet h3 { margin: 0; font-size: 16px; font-weight: 600; }
.sheet p { margin: 8px 0 0; font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.sheet .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.btn { height: 40px; border-radius: 20px; border: 1px solid var(--line); background: var(--paper); font-size: 14px; color: var(--ink); }
.btn.pri { background: var(--mauve-btn); border-color: var(--mauve-btn); color: var(--paper); }
.btn.danger { background: #9A6560; border-color: #9A6560; color: var(--paper); }

/* 还没做的页 */
.stub { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 40px; text-align: center; }
.stub b { font-family: var(--font-script); font-weight: 400; font-size: 40px; color: var(--mauve-btn); }
.stub span { font-size: 13px; color: var(--ink-2); line-height: 1.8; }
.stub a { margin-top: 6px; padding: 8px 20px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); font-size: 13px; color: var(--mauve-deep); }

/* 键盘聚焦描边用主题色 */
a:focus-visible, button:focus-visible { outline: 1.5px solid var(--mauve-btn); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition: none !important; } }
