/* 纸间 · 手账风设计变量与基础组件
 * 奶油纸底色、墨棕描边、和纸胶带的马卡龙色点缀。深色模式：<html data-theme="dark">。
 */
:root {
  --bg: #f7f0e3;
  --grid: rgba(120, 96, 70, 0.09);
  --panel: #fffdf8;
  --fill: #f0e6d5;
  --fill-hover: #e8dcc7;
  --canvas: #ece2d0;
  --text: #4a3d33;
  --text-2: #7d6e62;
  --text-3: #a39485;
  --ink: #4a3d33;
  --line: rgba(74, 61, 51, 0.16);
  --line-strong: #d9cab3;
  --hover: rgba(74, 61, 51, 0.06);
  --primary: #e07a5f;
  --primary-hover: #d86c50;
  --primary-soft: #fbe3da;
  --success: #7fa37a;
  --danger: #c8553d;
  /* 和纸胶带色 */
  --tape-pink: #f3bfb3;
  --tape-butter: #f6dd98;
  --tape-sage: #c3d8b9;
  --tape-blue: #bdd6e6;
  --shadow-card: 0 1px 0 rgba(74, 61, 51, 0.05), 0 6px 18px rgba(120, 90, 50, 0.1);
  --shadow-lift: 0 2px 4px rgba(74, 61, 51, 0.08), 0 14px 30px rgba(120, 90, 50, 0.18);
  --shadow: 0 -8px 40px rgba(74, 61, 51, 0.22);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font: 'LXGW WenKai', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
  --font-title: 'ZCOOL KuaiLe', 'LXGW WenKai', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #26211c;
  --grid: rgba(255, 236, 205, 0.045);
  --panel: #332c25;
  --fill: #423930;
  --fill-hover: #4d4338;
  --canvas: #1e1a16;
  --text: #f3e9da;
  --text-2: #c7b9a6;
  --text-3: #9c8e7d;
  --ink: #f3e9da;
  --line: rgba(255, 236, 205, 0.16);
  --line-strong: #5a4f43;
  --hover: rgba(255, 236, 205, 0.07);
  --primary: #ee9079;
  --primary-hover: #f29e89;
  --primary-soft: rgba(238, 144, 121, 0.2);
  --success: #9cc296;
  --danger: #f08a73;
  --tape-pink: #b9796c;
  --tape-butter: #b79b4e;
  --tape-sage: #77936d;
  --tape-blue: #6d8ea3;
  --shadow-card: 0 0 0 1px rgba(255, 236, 205, 0.05), 0 6px 18px rgba(0, 0, 0, 0.3);
  --shadow-lift: 0 14px 30px rgba(0, 0, 0, 0.5);
  --shadow: 0 -8px 40px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font-family: var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
::selection { background: rgba(224, 122, 95, 0.25); }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--text-3); }
.tabular { font-variant-numeric: tabular-nums; }

/* 按钮：像贴纸一样有描边和一道硬投影，按下去会「贴」到纸上 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border: 1.5px solid var(--ink); background: var(--panel); color: var(--text); border-radius: 99px; font-weight: 500; box-shadow: 0 2.5px 0 var(--ink); transition: transform 0.12s, box-shadow 0.12s, background 0.15s; }
.btn:active { transform: translateY(2.5px); box-shadow: 0 0 0 var(--ink); }
.btn-primary { background: var(--primary); color: #fff; }
:root[data-theme='dark'] .btn-primary { color: #2a211b; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; background: transparent; border-radius: 50%; color: var(--text-2); transition: background 0.15s, transform 0.15s; }
.icon-btn:active { background: var(--hover); transform: scale(0.9); }
.input { height: 40px; padding: 0 14px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: var(--panel); outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
textarea.input { height: auto; padding: 9px 14px; line-height: 1.5; }
.input:focus { border-style: solid; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.chip { height: 32px; padding: 0 14px; border: 1.5px solid var(--line-strong); background: var(--panel); border-radius: 99px; color: var(--text-2); font-size: 14px; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.chip.active { background: var(--tape-butter); border-color: var(--ink); color: var(--text); }
:root[data-theme='dark'] .chip.active { color: #fff; }
input[type='range'] { accent-color: var(--primary); }
.modal-x { width: 30px; height: 30px; border: 1.5px solid var(--ink); background: var(--panel); border-radius: 50%; color: var(--text); display: flex; align-items: center; justify-content: center; font-size: 13px; }

/* 提示：墨色小纸条 */
.toast-host { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 4000; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: 86vw; }
.toast { display: flex; align-items: center; gap: 9px; background: #4a3d33; color: #fff8ec; padding: 10px 18px 10px 14px; border-radius: 99px; font-size: 14px; box-shadow: 0 10px 30px rgba(74, 61, 51, 0.3); opacity: 0; transform: translateY(-8px) scale(0.96) rotate(-1deg); transition: opacity 0.25s, transform 0.35s var(--spring); }
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--tape-butter); flex: none; }
.toast.show { opacity: 1; transform: none; }
.toast-success::before { background: #a9d3a0; }
.toast-error::before { background: #f08a73; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { transform: scale(0.94); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
