/* ============================================================
   释放法 PWA · 应用层样式
   依赖 styles.css 的语义变量，不写死颜色 —— 四套主题自动适配
   ============================================================ */

/* ---------- 覆盖 styles.css 里「底部 tabbar + 520px 单列」的壳 ---------- */
body {
  padding-bottom: 0;
  min-height: 100dvh;
}
main.app-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 16px 48px;
}
@media (min-width: 1024px) {
  main.app-main { max-width: 920px; }
}

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  gap: 8px;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; gap: 4px; min-width: 0; }
.app-name {
  font-weight: 700;
  letter-spacing: 2px;
  white-space: nowrap;
  background: linear-gradient(90deg, var(--accent-2), var(--accent) 60%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.topbar-right { display: flex; align-items: center; gap: 6px; }

/* 顶栏的返回 / 首页 */
.top-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  border: none; background: none; cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 16px; font-family: inherit;
  text-decoration: none;
  transition: background .2s, color .2s;
}
.top-btn:hover { background: var(--surface-2); color: var(--text); }
.app-name { margin-left: 4px; }

/* 窄屏：只留 🌀，文字收起来，给按钮腾地方 */
@media (max-width: 430px) {
  .app-name-text { display: none; }
  .app-name { letter-spacing: 0; }
  .stuck-btn { padding: 7px 11px; }
}

.sidebar-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  flex-shrink: 0;
  border: none; background: none; cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  transition: background .2s, color .2s;
}
.sidebar-toggle-btn:hover { background: var(--surface-2); color: var(--text); }
.sidebar-toggle-icon { display: flex; flex-direction: column; gap: 4px; }
.sidebar-toggle-icon span {
  display: block; width: 18px; height: 2px; border-radius: 2px;
  background: currentColor;
}

.stuck-btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.stuck-btn:hover { border-color: var(--accent); color: var(--text); }

/* ============================================================
   侧边栏
   ============================================================ */
:root { --sb-width: 270px; --sb-ease: cubic-bezier(0.4, 0, 0.2, 1); }

.nav-sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sb-width);
  max-width: calc(100vw - 24px);
  height: 100dvh;
  z-index: 10100;
  display: flex; flex-direction: column;
  background: var(--header-bg-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: translateX(calc(-100% - 12px));
  transition: transform .3s var(--sb-ease);
}
.nav-sidebar.open { transform: translateX(0); }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 14px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-header-title {
  font-weight: 700; letter-spacing: 2px; font-size: 16px;
  text-decoration: none;
  background: linear-gradient(90deg, var(--accent-2), var(--accent) 60%, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sidebar-close-btn {
  border: none; background: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  transition: background .2s, color .2s;
}
.sidebar-close-btn:hover { background: var(--surface-2); color: var(--text); }

.sidebar-nav {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 10px;
  display: flex; flex-direction: column; gap: 2px;
  overscroll-behavior: contain;
}

.sidebar-nav-section {
  font-size: 13px;
  letter-spacing: .09em;
  color: var(--text-muted);
  padding: 12px 12px 4px;
  font-weight: 500;
}

.sidebar-nav-item {
  display: flex; align-items: center; gap: 11px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 16px;
  text-decoration: none;
  position: relative;
  transition: background .2s, color .2s;
}
.sidebar-nav-item:hover { background: var(--hover-bg); }
.sidebar-nav-item.active {
  background: var(--sel-bg);
  color: var(--text);
  font-weight: 600;
}
.sidebar-nav-item.active::before {
  content: ''; position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.sidebar-nav-icon {
  font-size: 18px; width: 24px; text-align: center; flex-shrink: 0;
  filter: grayscale(.35);
  transition: filter .2s, transform .2s;
}
.sidebar-nav-item.active .sidebar-nav-icon { filter: none; transform: scale(1.08); }

.sidebar-nav-divider { height: 1px; margin: 10px 12px; background: var(--border); }

.sidebar-stuck {
  margin: 0 10px max(10px, env(safe-area-inset-bottom, 10px));
  padding: 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 16px; font-family: inherit; text-align: center; cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.sidebar-stuck:hover { border-color: var(--accent); color: var(--text); }

.sidebar-overlay {
  position: fixed; inset: 0; z-index: 10050;
  background: var(--mask-bg);
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }

@media (min-width: 1024px) {
  .nav-sidebar { transform: none; }
  .sidebar-overlay { display: none; }
  body { padding-left: var(--sb-width); }
  .sidebar-toggle-btn { display: none; }
  .topbar { padding-left: 20px; }
}

/* ============================================================
   首页
   ============================================================ */
.hero-line {
  text-align: center;
  font-size: 15px;
  letter-spacing: 3px;
  color: var(--text-muted);
  margin: 10px 0 22px;
}
.tile-grid { display: flex; flex-direction: column; gap: 12px; }
.tile {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: transform .15s, border-color .2s, box-shadow .2s;
}
.tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.tile:active { transform: scale(.985); }
.tile-ico { font-size: 26px; flex-shrink: 0; }
.tile-body { display: block; min-width: 0; }
.tile-name { display: block; font-size: 18px; font-weight: 600; }
.tile-desc { display: block; font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.tile-primary { padding: 22px 18px; }
.tile-primary .tile-name { font-size: 21px; }
.tile-dashed { border-style: dashed; }
.tile-sep {
  font-size: 12px; letter-spacing: .09em; color: var(--text-muted);
  padding: 12px 4px 0;
}

/* ============================================================
   引导对话框
   形态对齐参考站：问题 + 答案按钮，不是全屏大字
   ============================================================ */
.gp-overlay {
  position: fixed; inset: 0;
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: var(--mask-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
  animation: gpFade .2s ease;
}
.gp-overlay[hidden] { display: none; }
@keyframes gpFade { from { opacity: 0; } to { opacity: 1; } }

.gp-dialog {
  display: flex; flex-direction: column;
  width: min(560px, 100%);
  max-height: min(86vh, 720px);
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: gpIn .25s ease;
}
@keyframes gpIn {
  from { opacity: 0; transform: translateY(12px) scale(.99); }
  to { opacity: 1; transform: none; }
}

/* 头部 */
.gp-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.gp-head-left { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.gp-hbtn {
  width: 36px; height: 36px; flex-shrink: 0;
  border: none; background: transparent;
  color: var(--text-muted);
  font-size: 16px; font-family: inherit;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s, opacity .2s;
}
.gp-hbtn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.gp-hbtn:disabled { opacity: .3; cursor: default; }
.gp-phase {
  flex: 1; min-width: 0;
  text-align: center;
  font-size: 14px; font-weight: 500;
  color: var(--text-muted);
  letter-spacing: .01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gp-close {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%; border: none;
  background: transparent; color: var(--text-muted);
  font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
}
.gp-close:hover { background: var(--surface-2); color: var(--text); }

/* 主体 */
.gp-body {
  flex: 1; min-height: 0; overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px 22px 20px;
  display: flex; flex-direction: column; gap: 14px;
}

.gp-q {
  text-align: center;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  margin: 0;
  animation: gpText .28s ease;
}
@keyframes gpText {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.gp-q:empty { display: none; }

/* 恭喜页 */
.gp-q.is-done {
  font-size: 23px;
  color: var(--accent);
  padding-top: 6px;
}
.gp-sub.is-done {
  margin-top: 0;
  font-size: 15px;
  color: var(--text-dim);
}
.gp-note {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin: -6px 0 0;
}
.gp-note:empty { display: none; }

.gp-sub {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.75;
  margin: -6px 0 0;
  animation: gpText .28s ease;
}
.gp-sub:empty { display: none; }

/* 控制区 */
.gp-ctl { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }

/* 选项按钮（两列） */
.gp-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.gp-choice {
  min-height: 54px;
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 16px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s, transform .15s;
}
.gp-choice:hover {
  border-color: var(--accent);
  background: var(--hover-bg);
  color: var(--text);
}
.gp-choice:active { transform: scale(.97); }
.gp-choice.is-yes {
  border-color: var(--accent);
  background: var(--sel-bg);
  color: var(--accent);
}

/* 主按钮 */
.gp-continue {
  display: block; width: 100%;
  min-height: 54px;
  padding: 15px 24px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff;
  font-size: 16px; font-family: inherit; font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: filter .2s, transform .15s;
}
.gp-continue:hover { filter: brightness(1.05); }
.gp-continue:active { transform: scale(.98); }
.gp-continue.is-ghost {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-weight: 400;
  box-shadow: none;
}
.gp-continue.is-ghost:hover {
  filter: none;
  border-color: var(--accent);
  color: var(--text);
}
/* KK 步骤的主按钮，金色收尾，和普通「继续」区分开 */
.gp-continue.kk-open {
  background: linear-gradient(135deg, var(--accent), var(--gold));
  letter-spacing: .06em;
}

/* 次要补充选项 */
.gp-extra {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.gp-extra-btn {
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px; font-family: inherit;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.gp-extra-btn:hover { border-color: var(--accent); color: var(--text); }

/* 回答后的消息 */
.gp-msg {
  text-align: center;
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.75;
  padding: 4px 0;
  animation: gpText .28s ease;
}

.gp-msg.is-good { color: var(--accent); font-weight: 500; }

/* 打分（1–10） */
.gp-score { display: flex; flex-direction: column; gap: 8px; }
.gp-score-scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.gp-score-btn {
  min-height: 52px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 17px;
  font-family: inherit;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s, transform .15s;
}
.gp-score-btn:hover {
  border-color: var(--accent);
  background: var(--hover-bg);
  color: var(--text);
}
.gp-score-btn:active { transform: scale(.96); }
.gp-score-btn.active {
  border-color: var(--accent);
  background: var(--sel-bg);
  color: var(--accent);
}
.gp-score-ends {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-muted);
}

/* 输入 */
.gp-input {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  font-size: 17px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}
.gp-input:focus { outline: none; border-color: var(--accent); }
.gp-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.gp-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 14px; font-family: inherit;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.gp-chip:hover, .gp-chip.active {
  border-color: var(--accent); background: var(--sel-bg); color: var(--text);
}

/* 底部 */
.gp-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 10px 14px calc(env(safe-area-inset-bottom, 0px) + 10px);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface-solid);
}
.gp-round {
  font-size: 13px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.gp-actions { display: flex; gap: 6px; }
.gp-finish {
  min-height: 38px;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 14px; font-family: inherit;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.gp-finish:hover { border-color: var(--accent); color: var(--accent); background: var(--sel-bg); }
.gp-finish.is-primary {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--sel-bg);
  font-weight: 500;
}

/* 移动端：底部抽屉 */
@media (max-width: 700px) {
  .gp-overlay { padding: 0; align-items: flex-end; }
  .gp-dialog {
    width: 100%; max-width: none;
    max-height: 92vh;
    max-height: 92dvh;
    border: none;
    border-top: 1px solid var(--border-strong);
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .gp-body { padding: 22px 18px 16px; }
  .gp-q { font-size: 20px; }
  .gp-choice { min-height: 58px; }
}

/* KK 模式：圆形按钮，点一下记一次 */
.gp-kk {
  position: fixed; inset: 0; z-index: 210;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 22px;
  background: var(--bg);
  padding: 24px;
  text-align: center;
}
.gp-kk[hidden] { display: none; }

/* 顶部横幅：现在在释放什么（拉里的练习没有，就不显示） */
.kk-banner {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 22px);
  left: 50%;
  transform: translateX(-50%);
  max-width: min(88vw, 32em);
  padding: 0 16px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}
.kk-banner:empty { display: none; }

.kk-circle {
  position: relative;
  width: min(58vw, 240px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: radial-gradient(circle at 50% 38%, var(--sel-bg), var(--surface-2) 72%);
  color: var(--accent);
  font-family: inherit;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .16s ease, box-shadow .2s ease;
  box-shadow: 0 6px 22px var(--shadow-glow);
}
.kk-circle:hover { box-shadow: 0 8px 28px var(--shadow-glow); }
.kk-circle:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }

.kk-word {
  font-size: clamp(30px, 10vw, 46px);
  font-weight: 700;
  letter-spacing: .04em;
  pointer-events: none;
}

/* 点击反馈：一圈扩散 */
.kk-ring {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  pointer-events: none;
}
.kk-circle.is-hit .kk-ring { animation: kkRipple .52s ease-out; }
@keyframes kkRipple {
  from { opacity: .65; transform: scale(1); }
  to   { opacity: 0;   transform: scale(1.32); }
}

/* 点击反馈：按下回弹 */
.kk-circle.is-hit { animation: kkHit .26s ease; }
@keyframes kkHit {
  0%   { transform: scale(.93); }
  55%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.kk-count {
  font-size: 15px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}
.kk-hint {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 20em;
  line-height: 1.75;
}
.gp-kk .gp-continue { max-width: 200px; }

/* ============================================================
   页面通用
   ============================================================ */
.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 24px; font-weight: 700; }
.page-head p { font-size: 14px; color: var(--text-dim); margin-top: 6px; line-height: 1.7; }
.page-back {
  display: inline-flex; align-items: center; gap: 4px;
  margin-bottom: 10px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 13px; text-decoration: none;
  transition: border-color .2s, color .2s, background .2s;
}
.page-back:hover { border-color: var(--accent); color: var(--text); background: var(--hover-bg); }

.start-row { display: flex; gap: 10px; margin-top: 16px; }
.start-row .gp-continue { flex: 1; }

.note {
  font-size: 13px; color: var(--text-muted); line-height: 1.8;
  margin-top: 14px;
}

/* 设置页主题网格：四套主题排 2×2 */
.theme-grid { grid-template-columns: repeat(2, 1fr); }
.theme-opt .swatch { display: flex; align-items: center; justify-content: center; }
.swatch-dot { width: 12px; height: 12px; border-radius: 50%; }

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

/* 练习记录 */
.stats-list { display: flex; flex-direction: column; gap: 10px; }
.stats-list > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.stats-list > div:last-child { border-bottom: none; padding-bottom: 0; }
.stats-list dt { font-size: 14px; color: var(--text-dim); }
.stats-list dd {
  font-size: 17px; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.home-stats {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px;
  margin-top: 22px;
  padding: 22px 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.home-stats[hidden] { display: none; }

.hs-label {
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--text-muted);
}
.hs-value {
  display: flex; align-items: baseline; gap: 6px;
  line-height: 1.1;
  margin: 4px 0 6px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent) 70%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hs-value b {
  font-size: 46px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.hs-value em {
  font-size: 17px;
  font-style: normal;
  font-weight: 600;
}
.hs-sub {
  font-size: 13px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 360px) {
  .hs-value b { font-size: 38px; }
}

/* ============================================================
   目标与欲望
   ============================================================ */
.goal-new { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.goal-new input {
  flex: 1 1 12ch;          /* 太窄时自动换行，而不是把输入框压没 */
  min-width: 0; min-height: 46px;
  padding: 12px 14px;
  font-size: 15px; font-family: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.goal-new input:focus { outline: none; border-color: var(--accent); }
.goal-new button {
  flex: 0 0 auto;
  width: auto;             /* 必须覆盖 .gp-continue 的 width:100% */
  min-height: 46px;
  padding: 0 20px;
}
/* 窄屏：输入框一行，按钮换到下一行占满 */
@media (max-width: 420px) {
  .goal-new input  { flex: 1 1 100%; }
  .goal-new button { flex: 1 1 100%; }
}

.goal-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.goal-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.goal-row-main { flex: 1; min-width: 0; }
.goal-row-text {
  display: block; font-size: 16px; font-weight: 600; color: var(--text);
  overflow-wrap: anywhere;
}
.goal-row-meta {
  display: block; margin-top: 4px;
  font-size: 12px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.goal-del {
  flex-shrink: 0; width: 36px; height: 36px;
  border: none; background: none; cursor: pointer;
  color: var(--text-muted); font-size: 15px;
  border-radius: var(--radius-sm);
  transition: color .2s, background .2s;
}
.goal-del:hover { color: var(--danger); background: var(--hover-bg); }

/* 四宫格 */
.quad {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.quad-cell {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 14px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-family: inherit; text-align: left;
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}
.quad-cell:hover { border-color: var(--accent); background: var(--hover-bg); color: var(--text); }
.quad-cell.active {
  border-color: var(--accent);
  background: var(--sel-bg);
  color: var(--text);
}
.quad-label { font-size: 15px; font-weight: 600; }
.quad-mood { font-size: 12px; color: var(--text-muted); }
.quad-count {
  margin-top: 6px; font-size: 20px; font-weight: 700;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.quad-count small { font-size: 12px; font-weight: 400; color: var(--text-muted); margin-left: 3px; }

/* 展开的那一格 */
.cell-panel { margin-top: 14px; }
.cell-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 4px;
}
.cell-head h3 { font-size: 16px; font-weight: 600; }
.cell-head span { font-size: 13px; color: var(--text-muted); }

.desire-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.desire-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}
.desire-row.done { opacity: .62; }
.desire-text {
  flex: 1; min-width: 0; font-size: 15px; color: var(--text);
  overflow-wrap: anywhere;
}
.desire-row.done .desire-text::after {
  content: ' ✓'; color: var(--accent); font-weight: 700;
}
.desire-go {
  flex-shrink: 0; min-height: 36px; padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--sel-bg);
  color: var(--accent);
  font-size: 14px; font-family: inherit; font-weight: 500;
  cursor: pointer;
}
.desire-go:hover { filter: brightness(.97); }
.desire-del {
  flex-shrink: 0; width: 32px; height: 32px;
  border: none; background: none; cursor: pointer;
  color: var(--text-muted); border-radius: var(--radius-sm);
}
.desire-del:hover { color: var(--danger); background: var(--hover-bg); }

.empty-hint {
  font-size: 13px; color: var(--text-muted); line-height: 1.8;
  padding: 14px 0 2px;
}

@media (max-width: 380px) {
  .quad { gap: 8px; }
  .quad-cell { padding: 12px 10px 10px; }
  .quad-label { font-size: 14px; }
}

/* ============================================================
   安装引导
   ============================================================ */
[data-install] { display: block; }
[data-install][hidden] { display: none; }
/* 放在 .card 里时，卡片自己不带内边距，交给内部元素 */
.card[data-install] { padding: 0; }

.install-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 16px 4px;
}
.install-ico { font-size: 24px; line-height: 1.2; flex-shrink: 0; }
.install-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.install-title { font-size: 16px; font-weight: 600; color: var(--text); }
.install-desc { font-size: 13px; line-height: 1.7; color: var(--text-dim); }
.inline-ico {
  display: inline-block;
  padding: 0 3px;
  font-size: 14px;
  color: var(--accent);
}

.install-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 16px 16px;
}
.install-actions .gp-continue { min-height: 46px; padding: 12px 16px; font-size: 15px; }
.install-actions:has(> :only-child) { grid-template-columns: 1fr; }

/* 首页那块：和上面的入口留点距离，整体包成一张卡 */
main.app-main > [data-install="prompt"] {
  margin-top: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .gp-q, .gp-sub, .gp-msg { animation: none; }
  .gp-dialog, .gp-overlay { animation: none; }
  .kk-circle.is-hit, .kk-circle.is-hit .kk-ring { animation-duration: .01s; }
}
