/* =====================================================================
   components.css —— 组件库
   全部颜色来自 design-tokens.js 注入的变量；无渐变、无彩色阴影。
   ===================================================================== */

/* =====================================================================
   1. Buttons
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  padding: 0 22px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; pointer-events: none; }

.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-press); }

.btn.ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--muted); }

.btn.text { background: transparent; padding: 0 8px; color: var(--primary); font-weight: 600; }
.btn.text:hover { background: var(--primary-soft); }

.btn.block { display: flex; width: 100%; }
.btn.sm { height: 36px; padding: 0 15px; font-size: 0.8125rem; }
.btn.big { height: 50px; padding: 0 28px; font-size: 1rem; }
.btn.soft { background: var(--primary-soft); color: var(--primary); }
.btn.done { background: var(--surface-2); color: var(--muted); border-color: var(--border); pointer-events: none; }

/* 旧结构兼容 */
.icon-btn, .iconbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; min-width: 40px; padding: 0 12px;
  border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--muted);
  font-size: 0.8125rem; font-weight: 500;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.icon-btn:hover, .iconbtn:hover { background: var(--surface-2); color: var(--text); }

/* =====================================================================
   2. Inputs
   ===================================================================== */
.input, .textarea, select.input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 1rem;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.textarea { min-height: 128px; resize: vertical; line-height: 1.65; }
label.fld { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--text-2); margin: 18px 2px 8px; }
.searchbar { display: flex; gap: 10px; }
.searchbar .input { flex: 1; }

/* =====================================================================
   3. Chips & Segmented
   ===================================================================== */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 36px; padding: 0 15px;
  display: inline-flex; align-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  border-radius: var(--r-pill);
  font-size: 0.8125rem; font-weight: 600; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.chip:hover { background: var(--surface-2); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* 分级筛选块：各自使用阶段色（柔和底 → 选中实色） */
.chip.tint {
  background: var(--c-soft, var(--surface-2));
  color: var(--c, var(--text-2));
  border-color: transparent;
  font-weight: 600;
}
.chip.tint:hover { background: var(--c-soft, var(--surface-2)); border-color: var(--c, var(--border-strong)); filter: none; }
.chip.tint.on {
  background: var(--c, var(--primary));
  color: #fff;
  border-color: var(--c, var(--primary));
  box-shadow: none;
}
.chip.tint:not(.on) { opacity: 1; }

.chip-pick {
  height: 38px; padding: 0 16px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--r-pill); font-size: 0.875rem; font-weight: 500;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.chip-pick:hover { border-color: var(--muted); }
.chip-pick.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: var(--r-pill); }
.seg button { height: 32px; padding: 0 16px; border-radius: var(--r-pill); font-weight: 600; font-size: 0.8125rem; color: var(--muted); transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }

/* =====================================================================
   4. Panels & Stats
   ===================================================================== */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
}
.kv { display: flex; gap: 14px; font-size: 0.9375rem; margin: 10px 0; }
.kv .k { flex: none; width: 72px; color: var(--muted); font-weight: 500; }
.warnbox {
  margin-top: 12px; padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.875rem;
}

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-card {
  padding: 18px 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
}
.stat-card .n { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-card .l { font-size: 0.75rem; color: var(--muted); font-weight: 500; margin-top: 2px; }

.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width var(--dur-slow) var(--ease); }

/* =====================================================================
   5. Avatar
   ===================================================================== */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; flex: none;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-2);
  font-weight: 600; font-size: 0.9375rem;
  overflow: hidden;
}
.avatar.sm { width: 30px; height: 30px; font-size: 0.8125rem; }
.avatar.lg { width: 76px; height: 76px; font-size: 1.75rem; }
.avatar.xl { width: 96px; height: 96px; font-size: 2.25rem; }

/* =====================================================================
   6. Tags
   ===================================================================== */
.tag {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text-2);
  font-size: 0.75rem; font-weight: 500;
  text-shadow: none;
}
.tag.soft { background: var(--surface-2); color: var(--muted); }
.tag.big { font-size: 0.8125rem; padding: 5px 13px; }

.age-chip {
  display: inline-block; margin-left: 6px;
  padding: 1px 8px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--muted);
  font-size: 0.6875rem; font-weight: 500; vertical-align: middle;
}
.age-chip.tiny { font-size: 0.625rem; padding: 1px 6px; }

/* 统一的分级标签：色点 + 「A · 名称」，全站配色一致 */
.stage-badge {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%;
  padding: 2px 9px; border-radius: var(--r-pill);
  background: var(--sc-soft, var(--surface-2));
  color: var(--sc, var(--text-2));
  font-size: 0.6875rem; font-weight: 600; line-height: 1.6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  vertical-align: middle;
}
.stage-badge .sb-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sc, currentColor); flex: none; }
.wall-src + .stage-badge { margin-left: 6px; }

/* =====================================================================
   7. Cover  &  Work card
   ===================================================================== */
.cover {
  position: relative;
  aspect-ratio: 2 / 3;
  padding: 14px;
  color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
}
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0) 60%); pointer-events: none; }
.cover > * { position: relative; z-index: 1; }
.cover .emoji { font-size: 30px; }
.cover .title { font-weight: 600; font-size: 0.9375rem; line-height: 1.3; letter-spacing: -0.01em; }
.cover .meta { font-size: 0.75rem; opacity: 0.9; margin-top: 3px; font-weight: 400; }
.cover .off { position: absolute; top: 10px; left: 10px; z-index: 2; background: rgba(0, 0, 0, 0.5); color: #fff; border-radius: 6px; padding: 2px 7px; font-size: 0.625rem; font-weight: 500; }

/* 自动文字封面：柔和低饱和底 */
.cover.letter {
  display: flex; align-items: center; justify-content: center;
  background: var(--sc-soft, var(--surface-2));
}
.cover.letter .letter-char {
  font-size: 58px; font-weight: 700;
  color: var(--sc, var(--text-2));
  letter-spacing: -0.04em; line-height: 1;
  opacity: 0.9;
}
.cover.letter.lg .letter-char { font-size: 100px; }
.cover.letter .cover-type { position: absolute; top: 14px; left: 14px; font-size: 17px; opacity: 0.7; }
.cover.letter.has-img .letter-char { display: none; }
.cover.letter::after { display: none; }

/* 旧渐变封面占位 → 中性 */
.cover.g0 { background: #5B6B7C; }
.cover.g1 { background: #4A7C6F; }
.cover.g2 { background: #8A6B5C; }
.cover.g3 { background: #5C6B8A; }
.cover.g4 { background: #8A5C6F; }
.cover.g5 { background: #4A4A52; }

/* 作品卡片：Apple Books 式，封面 + 标题 + 一句价值 */
.grid-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
.work-card {
  display: flex; flex-direction: column;
  gap: 10px;
  text-align: left;
  transition: transform var(--dur) var(--ease-spring);
}
.work-card:active { transform: scale(0.985); }
.work-card .cover {
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  box-shadow: var(--sh-1);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease-spring);
}
.work-card:hover .cover { box-shadow: var(--sh-3); transform: translateY(-2px); }
.work-card .body { display: flex; flex-direction: column; gap: 5px; padding: 0 2px; }
.work-card .body .stage-badge { align-self: flex-start; }
.work-card .t { font-weight: 600; font-size: 0.9375rem; line-height: 1.35; letter-spacing: -0.01em; }
.work-card .r { display: flex; align-items: center; gap: 6px; }
.work-card .goal-mini { color: var(--muted); font-size: 0.8125rem; font-weight: 400; line-height: 1.4; }
.work-card .val-tag { color: var(--muted); font-size: 0.8125rem; line-height: 1.4; }
.work-card .stage-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

/* 一句话介绍：默认隐藏在封面下 1/3，悬停上滑显示并压暗封面 */
.cover-intro {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 33%;
  display: flex; align-items: flex-end;
  padding: 14px 13px;
  color: #fff; font-size: 0.8125rem; line-height: 1.45; font-weight: 500;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.28) 72%, rgba(0, 0, 0, 0));
  transform: translateY(100%);
  opacity: 0;
  transition: transform var(--dur) var(--ease-spring), opacity var(--dur) var(--ease);
  z-index: 2; pointer-events: none;
}
.work-card:hover .cover-intro { transform: translateY(0); opacity: 1; }
.work-card .cover .letter-char,
.work-card .cover .cover-type,
.work-card .cover .emoji,
.work-card .cover .title,
.work-card .cover .meta { transition: opacity var(--dur) var(--ease); }
.work-card:hover .cover .letter-char,
.work-card:hover .cover .cover-type,
.work-card:hover .cover .emoji,
.work-card:hover .cover .title,
.work-card:hover .cover .meta { opacity: 0.2; }
@media (hover: none) {
  .cover-intro { transform: translateY(0); opacity: 1; }
  .work-card .cover .letter-char { opacity: 0.35; }
}

/* 作品卡上的阶段小标签（克制） */
.pill { border-radius: var(--r-pill); padding: 2px 8px; font-size: 0.625rem; font-weight: 600; }
.pill.stage { color: var(--muted); background: var(--surface-2); }

/* =====================================================================
   8. Review card (.rc)
   ===================================================================== */
.card-list { display: flex; flex-direction: column; gap: 12px; }
.rc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--uc, var(--border));
  border-radius: var(--r-lg);
  padding: 18px;
  animation: rise-in var(--dur-slow) var(--ease) both;
}
.rc-head { display: flex; align-items: center; gap: 11px; }
.rc-head .who { font-weight: 600; font-size: 0.875rem; }
.rc-head .when { font-size: 0.75rem; color: var(--muted); font-weight: 400; }
.rc-mood { margin-left: auto; font-size: 22px; line-height: 1; }
.rc-work {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 10px 0 8px; padding: 4px 11px;
  border-radius: var(--r-pill); background: var(--surface-2);
  font-size: 0.8125rem; font-weight: 500; color: var(--text-2);
}
.rc-work:hover { color: var(--primary); background: var(--primary-soft); }
.rc-char { font-size: 0.875rem; color: var(--text-2); margin: 6px 0; }
.rc-body { font-size: 0.9375rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word; color: var(--text); }
.rc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rc-voice { width: 100%; margin-top: 10px; }
.rc-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.react {
  display: inline-flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 12px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--r-pill); font-size: 0.875rem;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.react:hover { background: var(--surface-2); }
.react.mine { background: var(--primary-soft); border-color: var(--primary); }
.react .c { font-size: 0.75rem; font-weight: 600; color: var(--muted); }

/* =====================================================================
   9. 分享墙 / 时间线
   ===================================================================== */
.wall { display: grid; grid-template-columns: 1fr; gap: 12px; }
.wall-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--uc, var(--border));
  border-radius: var(--r-lg);
  padding: 18px;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease-spring), background var(--dur-fast) var(--ease);
}
.wall-card.clickable { cursor: pointer; }
.wall-card.clickable:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.wall-card.clickable:active { transform: translateY(0) scale(0.995); }
.wall-head { display: flex; align-items: center; gap: 10px; }
.wall-who { font-weight: 600; font-size: 0.875rem; }
.wall-mood { margin-left: auto; font-size: 20px; }
.wall-quote { margin-top: 10px; font-size: 0.9375rem; line-height: 1.7; color: var(--text); }
.wall-src { font-weight: 600; color: var(--primary); }
.wall-body { color: var(--text-2); }

.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 14px; padding: 11px 0; position: relative; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 16px; top: 40px; bottom: -6px; width: 1px; background: var(--border); }
.tl-dot { width: 33px; height: 33px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 15px; flex: none; z-index: 1; }
.tl-label { font-weight: 500; font-size: 0.875rem; }
.tl-meta { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

/* =====================================================================
   10. 成长档案 / 进度环
   ===================================================================== */
.growth-profile {
  border-radius: var(--r-xl);
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.gp-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.gp-id { min-width: 0; }
.p-name { font-weight: 700; font-size: 1.375rem; letter-spacing: -0.02em; }
.gp-sub { opacity: 1; font-size: 0.8125rem; margin-top: 2px; color: var(--muted); }
.gp-title { font-weight: 600; font-size: 0.9375rem; margin-top: 4px; color: var(--primary); }
.gp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 24px; }
.gp-stats .n { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.gp-stats .l { font-size: 0.6875rem; color: var(--muted); }
.gp-tags { margin-top: 18px; }
.gp-tags-l { font-size: 0.6875rem; font-weight: 600; color: var(--muted); display: block; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.06em; }
.xp-bar { margin-top: 22px; }
.xp-meta { display: flex; justify-content: space-between; font-weight: 600; font-size: 0.8125rem; margin-bottom: 7px; color: var(--text-2); }
.xp-next { font-size: 0.75rem; color: var(--muted); margin-top: 7px; }
.growth-profile .btn.ghost { background: transparent; border-color: var(--border-strong); }

/* 成长环（Apple Fitness 风格） */
.rings { display: flex; gap: 26px; flex-wrap: wrap; align-items: center; }
.ring { position: relative; width: 108px; height: 108px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .ring-track { fill: none; stroke: var(--surface-3); stroke-width: 9; }
.ring .ring-arc { fill: none; stroke: var(--ring-c, var(--primary)); stroke-width: 9; stroke-linecap: round; }
.ring .ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .ring-label b { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.ring .ring-label span { font-size: 0.6875rem; color: var(--muted); margin-top: 1px; }

/* =====================================================================
   11. 徽章（Apple Fitness Awards 式圆形金属）
   ===================================================================== */
.badge-cat { font-weight: 600; font-size: 0.8125rem; margin: 22px 2px 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 14px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 6px 2px; }
.badge-medal {
  width: 76px; height: 76px; border-radius: 50%;
  display: grid; place-items: center; font-size: 30px;
  background: radial-gradient(circle at 32% 26%, var(--surface), var(--surface-3));
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.7), var(--sh-1);
  filter: grayscale(1); opacity: 0.5;
}
.badge.earned .badge-medal {
  filter: none; opacity: 1;
  background: radial-gradient(circle at 32% 26%, #FFF4D6, #E2B84E 72%, #B98F2E);
  border-color: #D9B45A;
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.8), 0 6px 16px rgba(185, 143, 46, 0.28);
}
.badge-n { font-weight: 600; font-size: 0.8125rem; line-height: 1.25; }
.badge-d { font-size: 0.6875rem; color: var(--muted); line-height: 1.35; }
.badge-bar { width: 100%; max-width: 88px; }
.badge-bar > i { display: block; height: 4px; border-radius: 999px; background: var(--primary); transition: width var(--dur-slow) var(--ease); }
.badge-bar > span { font-size: 0.625rem; color: var(--muted); display: block; margin-top: 4px; }
.badge-got { font-size: 0.6875rem; font-weight: 600; color: var(--ok); }

/* 徽章详情 */
.badge-detail { text-align: center; padding: 12px 8px 4px; }
.bd-emoji { font-size: 64px; }
.bd-name { font-size: 1.375rem; font-weight: 700; margin-top: 10px; letter-spacing: -0.02em; }
.bd-user { font-size: 0.8125rem; color: var(--muted); margin-top: 3px; }
.bd-badge { display: inline-block; margin-top: 10px; padding: 4px 14px; border-radius: var(--r-pill); background: var(--ok); color: #fff; font-weight: 600; font-size: 0.8125rem; }
.bd-progress { display: inline-block; margin-top: 10px; padding: 4px 14px; border-radius: var(--r-pill); background: var(--surface-2); font-weight: 600; font-size: 0.8125rem; }
.bd-meta { font-size: 0.75rem; color: var(--muted); margin-top: 6px; }
.bd-desc { font-size: 0.9375rem; color: var(--text-2); margin-top: 14px; line-height: 1.65; }
.bd-block { text-align: left; margin-top: 20px; }
.bd-label { font-size: 0.6875rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.06em; }
.bd-works { display: flex; gap: 12px; flex-wrap: wrap; }
.bd-work { width: 84px; text-align: center; font-size: 0.75rem; font-weight: 500; }
.bd-work .cover { border-radius: var(--r-sm); aspect-ratio: 2/3; }
.bd-work .cover .letter-char { font-size: 26px; }
.bd-work .cover .cover-type { display: none; }
.bd-quote { font-size: 0.9375rem; line-height: 1.7; color: var(--text-2); }

/* =====================================================================
   12. 图表（低饱和、极简）
   ===================================================================== */
.chart-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.chart-card { display: flex; flex-direction: column; align-items: center; }
.chart-title { font-weight: 600; font-size: 0.875rem; align-self: flex-start; margin-bottom: 14px; }
.chart-radar, .chart-donut { width: 100%; max-width: 300px; height: auto; }
.chart-line { width: 100%; height: 180px; }
.chart-hint { font-size: 0.75rem; color: var(--muted); margin-top: 10px; text-align: center; }
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; }
.legend { display: flex; flex-direction: column; gap: 7px; font-size: 0.8125rem; font-weight: 500; }
.legend-item { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.legend-item i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* 关键词：极简标签，不做彩色词云 */
.wordcloud { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px; }
.wordcloud .wc {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 6px 13px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text-2);
  font-weight: 500; font-size: 0.875rem !important;
}
.wordcloud .wc i { font-style: normal; font-size: 0.6875rem; color: var(--muted); font-weight: 400; }

/* 横向条形（驾驶舱） */
.bar-row { display: grid; grid-template-columns: 100px 1fr auto; align-items: center; gap: 12px; margin: 12px 0; font-size: 0.8125rem; }
.bar-label { font-weight: 500; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar-track > i { display: block; height: 100%; border-radius: 999px; background: var(--primary); transition: width var(--dur-slow) var(--ease); }
.bar-value { font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.75rem; }
.hot-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.hot-row:last-child { border-bottom: 0; }
.hot-title { font-weight: 500; }
.suggest { padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); margin: 8px 0; font-size: 0.875rem; color: var(--text-2); }

/* 开关 */
.switch { width: 50px; height: 30px; border-radius: 999px; background: var(--surface-3); position: relative; transition: background var(--dur) var(--ease); flex: none; }
.switch > i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform var(--dur) var(--ease); }
.switch.on { background: var(--ok); }
.switch.on > i { transform: translateX(20px); }

/* =====================================================================
   13. 心情 / 感觉 / 角色 / 原因 / 联系自己
   ===================================================================== */
.mood-row { display: flex; gap: 6px; }
.mood { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: var(--r); transition: background var(--dur) var(--ease); }
.mood:hover { background: var(--surface-2); }
.mood .e { font-size: 30px; line-height: 1; filter: grayscale(0.4); transition: transform var(--dur) var(--ease-spring), filter var(--dur) var(--ease); }
.mood:hover .e { filter: none; }
.mood.on { background: var(--primary-soft); }
.mood.on .e { transform: scale(1.16); filter: none; }
.mood .l { font-size: 0.6875rem; font-weight: 500; color: var(--muted); }
.mood.on .l { color: var(--primary); font-weight: 600; }

.feel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 4px; }
.feel {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.feel:hover { background: var(--surface-3); }
.feel.on { border-color: var(--primary); background: var(--primary-soft); }
.feel-e { font-size: 26px; line-height: 1; }
.feel-l { font-weight: 500; font-size: 0.9375rem; }

.char-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.char-card {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.char-card:hover { background: var(--surface-3); }
.char-card.on { border-color: var(--primary); background: var(--primary-soft); }
.char-avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-size: 20px; flex: none; }
.char-name { font-weight: 600; font-size: 0.9375rem; }
.char-desc { font-size: 0.8125rem; color: var(--muted); margin-top: 1px; }

.reason-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.self-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.self-card {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 16px; border-radius: var(--r); background: var(--surface-2); border: 1px solid transparent;
  font-size: 0.9375rem; font-weight: 500;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.self-card:hover { background: var(--surface-3); }
.self-card.on { border-color: var(--primary); background: var(--primary-soft); }
.self-dot { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex: none; }
.self-card.on .self-dot { border-color: var(--primary); background: var(--primary); box-shadow: inset 0 0 0 3px var(--surface); }

/* =====================================================================
   14. 沉浸式引导（compose）
   ===================================================================== */
.guide-immersive { min-height: 60vh; display: flex; flex-direction: column; }
.guide-loading { padding: 40px 0; }
.guide-head { display: flex; align-items: flex-start; gap: 12px; }
.guide-work { font-weight: 700; font-size: 1.0625rem; }
.guide-q { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; margin-bottom: 20px; }
.guide-nav { display: flex; align-items: center; gap: 10px; margin-top: 22px; }
.guide-progress { margin-top: 12px; }
.guide-body { flex: 1; padding-top: 20px; }
.starters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.starter { padding: 8px 13px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-2); font-size: 0.8125rem; font-weight: 500; transition: background var(--dur-fast) var(--ease); }
.starter:hover { background: var(--surface-3); }
.tags-pick { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.ai-preview { margin-top: 14px; padding: 16px; border-radius: var(--r); background: var(--surface-2); }
.ai-tag { font-size: 0.6875rem; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.ai-text { font-size: 0.9375rem; line-height: 1.7; color: var(--text-2); }

.steps { display: flex; gap: 6px; margin: 12px 0 4px; }
.step-pip { flex: 1; height: 4px; border-radius: 999px; background: var(--surface-3); transition: background var(--dur) var(--ease); }
.step-pip.on { background: var(--primary); }

/* 年龄段选择 */
.age-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.age-card { text-align: left; padding: 16px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid transparent; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.age-card:hover { border-color: var(--primary); }
.age-emoji { font-size: 22px; }
.age-title { font-weight: 600; margin-top: 8px; }
.age-sub { font-size: 0.75rem; color: var(--primary); margin-top: 2px; font-weight: 500; }
.age-desc { font-size: 0.75rem; color: var(--muted); margin-top: 6px; }

/* =====================================================================
   15. Sheet / Toast / Empty / Skeleton
   ===================================================================== */
.sheet-wrap { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.sheet-back { position: absolute; inset: 0; background: var(--scrim); animation: fade-in var(--dur) var(--ease) both; }
.sheet {
  position: relative; width: 100%; max-width: 620px; max-height: 92dvh; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 4px 22px calc(24px + var(--safe-b));
  box-shadow: var(--sh-pop);
  animation: sheet-up var(--dur-slow) var(--ease-spring) both;
  touch-action: pan-y;
}
.sheet-handle { padding: 12px 0 8px; display: flex; justify-content: center; cursor: grab; touch-action: none; }
.sheet-handle:active { cursor: grabbing; }
.sheet-grip { width: 44px; height: 5px; border-radius: 999px; background: var(--border-strong); }
.sheet h2 { font-size: 1.3125rem; font-weight: 700; letter-spacing: -0.02em; margin: 4px 42px 8px 0; }
.sheet-close {
  position: absolute; top: 12px; right: 14px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2); font-size: 15px;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.sheet-close:hover { background: var(--surface-3); color: var(--text); }

/* PC / iPad 横屏：右侧滑入抽屉，便于快速查看 */
@media (min-width: 834px) {
  .sheet-wrap { align-items: stretch; justify-content: flex-end; }
  .sheet {
    width: min(520px, 46vw); max-width: none; height: 100%; max-height: none;
    margin: 0; border-radius: 0; border-top: 0; border-right: 0; border-bottom: 0;
    padding: 26px 28px calc(26px + var(--safe-b));
    animation: sheet-in-right var(--dur-slow) var(--ease-spring) both;
  }
  .sheet-handle { display: none; }
}

.toast {
  position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%);
  z-index: 130; padding: 12px 20px; border-radius: var(--r-pill);
  background: var(--text); color: var(--bg);
  font-size: 0.875rem; font-weight: 500; box-shadow: var(--sh-3);
  animation: scale-in var(--dur) var(--ease) both;
}
.toast.good { background: var(--ok); color: #fff; }
.toast.bad { background: var(--danger); color: #fff; }
.fx { position: fixed; inset: 0; z-index: 140; pointer-events: none; }

.empty { text-align: center; color: var(--muted); padding: 60px 16px; font-size: 0.9375rem; }
.empty .big { display: block; font-size: 42px; margin-bottom: 12px; }
.spinner { width: 26px; height: 26px; margin: 44px auto; border: 2.5px solid var(--surface-3); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
.skel { border-radius: var(--r-sm); background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }

/* 锁面板 */
.lock-panel { text-align: center; padding: 40px 20px; border-radius: var(--r-lg); background: var(--surface-2); }
.lock-emoji { font-size: 38px; }
.lock-title { font-weight: 700; font-size: 1.0625rem; margin: 10px 0 4px; }

/* =====================================================================
   16. 作品详情（Apple TV 式）
   ===================================================================== */
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 22px; }
.detail-cover { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--sh-2); }
.detail-cover .cover { aspect-ratio: 2 / 3; }
.detail-title { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.12; }
.detail-theme { font-size: 1.0625rem; color: var(--text-2); margin-top: 10px; line-height: 1.6; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.meta-pill { padding: 4px 12px; border-radius: var(--r-pill); background: var(--surface-2); font-size: 0.75rem; font-weight: 500; color: var(--text-2); }

/* 详情信息块（非卡片，改为编辑排版） */
.detail-block { margin-top: 26px; }
.detail-block .label { font-size: 0.6875rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 8px; }
.detail-block .prose { font-size: 1rem; line-height: 1.75; color: var(--text); }
.detail-block .path {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8125rem; line-height: 1.6; color: var(--text-2);
  word-break: break-all;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 10px 12px;
}

/* 今天思考 */
.think-card {
  margin-top: 24px; padding: 22px 24px; border-radius: var(--r-lg);
  background: var(--primary-soft);
}
.think-card .label { font-size: 0.6875rem; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: 0.07em; }
.think-card .q { font-size: 1.25rem; font-weight: 600; line-height: 1.45; margin-top: 8px; letter-spacing: -0.01em; }

/* =====================================================================
   17. 分享卡
   ===================================================================== */
.share-sheet { text-align: center; }
.share-preview { margin-top: 14px; border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-2); }
.share-canvas { width: 100%; max-width: 380px; height: auto; display: block; margin: 0 auto; border-radius: var(--r); }

/* 旧结构兼容 */
.why-card, .goal-card { margin-top: 18px; padding: 18px; border-radius: var(--r); background: var(--surface-2); border: 0; }
.why-label, .goal-label { font-size: 0.75rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.goal-word { font-size: 1.125rem; font-weight: 600; }
.goal-desc { font-size: 0.875rem; color: var(--text-2); margin-top: 6px; }

/* =====================================================================
   18. 作品详情弹层 / 用户专属颜色选择
   ===================================================================== */
.work-sheet-head { display: flex; gap: 16px; align-items: flex-start; }
.work-sheet-cover { width: 96px; flex: none; }
.work-sheet-cover .cover { border-radius: var(--r-sm); border: 1px solid var(--border); }
.work-sheet-cover .cover .letter-char { font-size: 40px; }
.work-sheet-info { min-width: 0; }
.work-sheet-info h2 { font-size: 1.25rem; letter-spacing: -0.02em; }

.color-pick { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--c, var(--surface-2));
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.swatch:hover { transform: scale(1.08); }
.swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.swatch.none { display: grid; place-items: center; color: var(--muted); background: var(--surface-2); font-size: 14px; }
