/* 家空间 Demo —— 公共样式：设计变量、基础排版、通用组件
 * 字体只用系统自带的中文字体，不加载任何境外资源。 */
:root {
  --ink: #14202B;
  --forest: #0B3D2E;
  --forest-2: #14553F;
  --leaf: #1F7A5A;
  --mint: #E6EEEA;
  --cream: #F5F6F5;
  --paper: #FFFFFF;
  --sand: #E4E7E5;
  --amber: #9C6B1A;
  --amber-soft: #F4EEE2;
  --coral: #B23A2A;
  --muted: #5C6770;
  --line: rgba(20, 32, 43, .12);
  --sans: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --num: "Bahnschrift", "DIN Alternate", "Helvetica Neue", Arial, sans-serif;
  --r: 14px;
  --shadow: 0 1px 2px rgba(20, 32, 43, .06), 0 10px 28px rgba(20, 32, 43, .08);
  --bar: 36px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; padding-top: var(--bar);
  font-family: var(--sans); font-size: 16px; line-height: 1.65;
  color: var(--ink); background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
svg { display: block; }
.ic { flex: none; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: 0; }
:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 演示导航条 */
.demobar {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--bar);
  display: flex; align-items: center; gap: 4px; padding: 0 12px;
  background: var(--ink); color: rgba(255, 255, 255, .72); font-size: 13px;
  overflow-x: auto; white-space: nowrap;
}
.demobar__tag { margin-right: 8px; padding: 1px 8px; border-radius: 3px; background: var(--amber); color: #fff; font-size: 12px; }
.demobar a, .demobar button { padding: 4px 10px; border-radius: 6px; color: inherit; }
.demobar a:hover, .demobar button:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.demobar a.is-on { color: #fff; background: rgba(255, 255, 255, .16); }
.demobar__sp { flex: 1; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px; border-radius: 3px;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: background .18s, color .18s, transform .18s, box-shadow .18s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--forest); color: #fff; }
.btn--primary:hover { background: var(--forest-2); }
.btn--ghost { box-shadow: inset 0 0 0 1.500px var(--line); background: transparent; }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.500px var(--forest); color: var(--forest); }
.btn--light { background: var(--cream); color: var(--forest); }
.btn--light:hover { background: #fff; }
.btn--line { color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45); }
.btn--line:hover { box-shadow: inset 0 0 0 1px #fff; background: rgba(255, 255, 255, .08); }
.btn--amber { background: var(--amber); color: #fff; }
.btn--sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn--block { width: 100%; }
.btn[disabled] { background: var(--sand); color: var(--muted); cursor: not-allowed; box-shadow: none; }

/* 标签与积分 */
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 3px; font-size: 12px; font-weight: 600; background: var(--mint); color: var(--forest); white-space: nowrap; }
.tag--amber { background: var(--amber-soft); color: #6E4A0E; }
.tag--coral { background: #F3E3DF; color: #8A2C1E; }
.tag--gray { background: var(--sand); color: var(--muted); }
.pts { font-family: var(--num); font-weight: 700; color: var(--amber); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 36px; padding: 0 16px; border-radius: 3px; font-size: 14px; background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); transition: background .18s, color .18s; }
.chip:hover { color: var(--ink); }
.chip.is-on { background: var(--ink); color: var(--cream); box-shadow: none; }

.bar { height: 8px; border-radius: 3px; background: var(--sand); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--leaf); transition: width .6s cubic-bezier(.2, .7, .2, 1); }

.scene { width: 100%; height: 100%; }

/* 轻提示 */
.toast {
  position: fixed; left: 50%; bottom: 40px; z-index: 200; transform: translate(-50%, 12px);
  width: max-content; max-width: min(88%, 360px); padding: 10px 18px; border-radius: 6px;
  background: var(--ink); color: var(--cream); font-size: 14px; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
