:root {
  --bg:            #0b0a14;
  --bg-2:          #12101f;
  --panel:         rgba(255,255,255,0.038);
  --panel-solid:   #171528;
  --panel-hi:      rgba(255,255,255,0.07);
  --line:          rgba(255,255,255,0.09);
  --line-hi:       rgba(255,255,255,0.16);
  --text:          #ece9f6;
  --text-2:        #a49fbd;
  --text-3:        #6f6a89;
  --accent:        #b18cff;
  --accent-2:      #7ce0d3;
  --gold:          #ffcf70;
  --danger:        #ff7b93;
  --radius:        16px;
  --radius-sm:     11px;
  --shadow:        0 8px 30px rgba(0,0,0,0.45);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 15% -5%,  rgba(177,140,255,0.16), transparent 60%),
    radial-gradient(700px 450px at 90% 8%,   rgba(124,224,211,0.09), transparent 60%),
    radial-gradient(800px 600px at 50% 105%, rgba(255,160,210,0.07), transparent 60%);
}

button, input, textarea, select {
  font-family: inherit; font-size: inherit; color: inherit;
}
button { cursor: pointer; border: none; background: none; }
a { color: var(--accent); }

/* ---------- 布局 ---------- */
.app { max-width: 1180px; margin: 0 auto; padding: 0 14px 96px; }

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 2px 12px;
}
.brand { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.brand h1 {
  font-size: 19px; margin: 0; letter-spacing: .3px; font-weight: 650;
  background: linear-gradient(92deg, #fff 10%, var(--accent) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.brand span { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.topbar .spacer { flex: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px;
  font-size: 12.5px; color: var(--text-2); white-space: nowrap;
}
.chip b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.chip.gold b { color: var(--gold); }

/* 导航 */
nav.tabs {
  position: sticky; top: 0; z-index: 30;
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  padding: 8px 0 10px;
  background: linear-gradient(var(--bg) 62%, rgba(11,10,20,0.6));
  backdrop-filter: blur(12px);
  margin-bottom: 6px;
}
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs button {
  flex: 0 0 auto; padding: 8px 15px; border-radius: 999px;
  font-size: 13.5px; color: var(--text-2);
  border: 1px solid transparent; transition: .16s;
}
nav.tabs button:hover { color: var(--text); background: var(--panel); }
nav.tabs button[aria-selected="true"] {
  color: #17122a; font-weight: 650;
  background: linear-gradient(96deg, #cbb2ff, var(--accent-2));
}

/* 面板 */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  backdrop-filter: blur(8px);
}
.card + .card { margin-top: 12px; }
.grid { display: grid; gap: 12px; }
@media (min-width: 860px) {
  .grid.c2 { grid-template-columns: 1.35fr 1fr; align-items: start; }
  .grid.c3 { grid-template-columns: repeat(3, 1fr); }
  .grid.c2-even { grid-template-columns: 1fr 1fr; }
}

.sec-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--text-3); margin: 0 0 12px;
}
.sec-title .rest { flex: 1; height: 1px; background: var(--line); }
.sec-title em { font-style: normal; color: var(--text-2); letter-spacing: 0; text-transform: none; font-size: 12.5px; }

.muted { color: var(--text-2); }
.dim   { color: var(--text-3); font-size: 12.5px; }
.mono  { font-variant-numeric: tabular-nums; }

/* ---------- 今日规则 ---------- */
.today-rule {
  position: relative; overflow: hidden;
  border-radius: var(--radius); padding: 22px 20px;
  border: 1px solid rgba(177,140,255,0.28);
  background:
    radial-gradient(120% 130% at 8% 0%, rgba(177,140,255,0.20), transparent 62%),
    radial-gradient(100% 120% at 100% 100%, rgba(124,224,211,0.12), transparent 60%),
    var(--panel-solid);
}
.today-rule .kicker {
  font-size: 11.5px; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.ifthen { display: grid; gap: 10px; }
.ifthen .row { display: flex; gap: 11px; align-items: flex-start; }
.ifthen .tag {
  flex: 0 0 auto; margin-top: 3px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  padding: 2px 8px; border-radius: 6px;
}
.ifthen .tag.if   { background: rgba(255,207,112,0.15); color: var(--gold); }
.ifthen .tag.then { background: rgba(124,224,211,0.15); color: var(--accent-2); }
.ifthen .txt { font-size: 17px; line-height: 1.5; }
.today-rule footer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px; font-size: 13.5px; font-weight: 550;
  background: var(--panel-hi); border: 1px solid var(--line-hi);
  color: var(--text); transition: .15s;
}
.btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.26); }
.btn.primary {
  background: linear-gradient(96deg, #c2a6ff, #8fe4d8);
  color: #16122a; font-weight: 680; border-color: transparent;
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: none; border-color: var(--line); color: var(--text-2); }
.btn.ghost:hover { color: var(--text); }
.btn.danger { color: var(--danger); border-color: rgba(255,123,147,0.3); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- 今日回路 ---------- */
.loop { display: grid; gap: 8px; }
.loop-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border-radius: var(--radius-sm);
  background: var(--panel); border: 1px solid var(--line); transition: .15s;
}
.loop-item.done { opacity: .5; }
.loop-item.done .label { text-decoration: line-through; }
.loop-item .box {
  flex: 0 0 auto; width: 19px; height: 19px; border-radius: 6px;
  border: 1.5px solid var(--line-hi); display: grid; place-items: center;
  font-size: 12px; color: #16122a;
}
.loop-item.done .box { background: var(--accent-2); border-color: var(--accent-2); }
.loop-item .label { flex: 1; font-size: 13.5px; }
.loop-item .xp { font-size: 11.5px; color: var(--gold); font-weight: 650; }

/* ---------- 规则卡 ---------- */
.rule-list { display: grid; gap: 10px; }
@media (min-width: 720px) { .rule-list.two { grid-template-columns: 1fr 1fr; } }

.rule {
  position: relative; padding: 14px 15px 13px 18px;
  border-radius: var(--radius-sm); overflow: hidden;
  background: var(--panel); border: 1px solid var(--line);
  transition: .15s;
}
.rule::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: hsl(var(--h) 70% 62%);
}
.rule:hover { border-color: var(--line-hi); background: var(--panel-hi); }
.rule.retired { opacity: .48; }
.rule .head { display: flex; align-items: flex-start; gap: 10px; }
.rule .name { flex: 1; font-size: 14.5px; font-weight: 620; line-height: 1.4; }
.rule .body { margin-top: 9px; display: grid; gap: 5px; font-size: 13px; }
.rule .body .l { color: var(--text-2); }
.rule .body .l b { color: var(--text); font-weight: 550; }
.rule .meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 11px; font-size: 11.5px; color: var(--text-3);
}
.rule .acts { display: flex; gap: 6px; margin-top: 11px; flex-wrap: wrap; }

.pill {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text-2); white-space: nowrap;
}
.pill.dom { border-color: hsl(var(--h) 60% 55% / .45); color: hsl(var(--h) 65% 76%); }
.pill.active { border-color: rgba(124,224,211,0.4); color: var(--accent-2); }
.pill.candidate { border-color: rgba(255,207,112,0.35); color: var(--gold); }
.pill.internalized { border-color: rgba(177,140,255,0.45); color: #cbb2ff; }
.pill.inbox { border-color: rgba(255,255,255,0.16); color: var(--text-3); }
.pill.retired { border-color: rgba(255,123,147,0.3); color: var(--danger); }

.rule .inbox-note {
  margin-top: 10px; padding: 8px 11px; border-radius: 9px;
  background: rgba(255,255,255,0.035); border: 1px dashed var(--line-hi);
  font-size: 12px; color: var(--text-3); line-height: 1.6;
}

.stars { font-size: 12px; letter-spacing: 1.5px; color: var(--gold); white-space: nowrap; }
.stars i { color: rgba(255,255,255,0.14); font-style: normal; }

/* ---------- 搜索 ---------- */
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel-solid); border: 1px solid var(--line-hi);
  border-radius: 12px; padding: 11px 14px;
}
.search input { flex: 1; background: none; border: none; outline: none; font-size: 15px; }
.search input::placeholder { color: var(--text-3); }

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.filters button {
  padding: 5px 11px; border-radius: 999px; font-size: 12.5px;
  border: 1px solid var(--line); color: var(--text-2);
}
.filters button[data-on="1"] { background: var(--panel-hi); color: var(--text); border-color: var(--line-hi); }

/* ---------- 领域 ---------- */
.dom-grid { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
@media (min-width: 760px) { .dom-grid { grid-template-columns: repeat(4, 1fr); } }
.dom-card {
  padding: 14px; border-radius: var(--radius-sm); text-align: left;
  border: 1px solid hsl(var(--h) 55% 55% / .28);
  background: linear-gradient(165deg, hsl(var(--h) 60% 55% / .13), transparent 75%), var(--panel);
  transition: .15s; width: 100%;
}
.dom-card:hover { border-color: hsl(var(--h) 60% 60% / .55); transform: translateY(-2px); }
.dom-card .ico { font-size: 20px; }
.dom-card .nm { font-size: 13.5px; font-weight: 600; margin-top: 6px; }
.dom-card .lv { font-size: 11.5px; color: hsl(var(--h) 65% 74%); margin-top: 2px; }
.bar { height: 4px; border-radius: 99px; background: rgba(255,255,255,0.09); margin-top: 9px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: hsl(var(--h) 70% 62%); }

/* ---------- 复盘 ---------- */
.log {
  display: grid; gap: 5px; padding: 12px 14px;
  border-left: 2px solid var(--line-hi); margin-left: 4px;
}
.log:hover { border-left-color: var(--accent); }
.log .when { font-size: 11.5px; color: var(--text-3); }
.log .sit { font-size: 13.5px; }
.log .note { font-size: 12.5px; color: var(--text-2); }
.worked { font-size: 11px; padding: 1px 7px; border-radius: 999px; }
.worked.yes    { background: rgba(124,224,211,0.15); color: var(--accent-2); }
.worked.partly { background: rgba(255,207,112,0.15); color: var(--gold); }
.worked.no     { background: rgba(255,123,147,0.15); color: var(--danger); }

.insight {
  display: flex; gap: 11px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: rgba(177,140,255,0.08); border: 1px solid rgba(177,140,255,0.2);
  font-size: 13px;
}
.insight + .insight { margin-top: 8px; }
.insight .i { flex: 0 0 auto; }

/* ---------- 书架 ---------- */
.book {
  padding: 14px 15px; border-radius: var(--radius-sm);
  background: var(--panel); border: 1px solid var(--line);
}
.book.must { border-color: rgba(255,207,112,0.32); background: linear-gradient(165deg, rgba(255,207,112,0.07), transparent 70%), var(--panel); }
.book .t { font-size: 14.5px; font-weight: 620; }
.book .a { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.book .n { font-size: 12.5px; color: var(--text-2); margin-top: 9px; line-height: 1.62; }
.book .f { display: flex; align-items: center; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.book select {
  background: var(--panel-hi); border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 8px; font-size: 12px; outline: none;
}

/* ---------- 弹层 ---------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(6,5,12,0.72); backdrop-filter: blur(6px);
  display: grid; place-items: end center; padding: 0;
  overflow-y: auto;
}
@media (min-width: 720px) { .modal-bg { place-items: center; padding: 24px; } }
.modal {
  width: 100%; max-width: 560px;
  background: var(--panel-solid); border: 1px solid var(--line-hi);
  border-radius: 20px 20px 0 0; padding: 20px 18px 24px;
  box-shadow: var(--shadow); max-height: 92vh; overflow-y: auto;
}
@media (min-width: 720px) { .modal { border-radius: 20px; padding: 24px; } }
.modal h3 { margin: 0 0 4px; font-size: 17px; }
.modal .sub { font-size: 12.5px; color: var(--text-3); margin-bottom: 18px; }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.field label b { color: var(--accent); font-weight: 600; }
.field .hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; line-height: 1.5; }
.field input, .field textarea, .field select {
  width: 100%; background: rgba(0,0,0,0.28); border: 1px solid var(--line-hi);
  border-radius: 10px; padding: 10px 12px; outline: none; transition: .15s; resize: vertical;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field textarea { min-height: 62px; }
.modal .acts { display: flex; gap: 9px; margin-top: 20px; }
.modal .acts .spacer { flex: 1; }

.seg { display: flex; gap: 6px; }
.seg button {
  flex: 1; padding: 8px; border-radius: 9px; font-size: 12.5px;
  border: 1px solid var(--line); color: var(--text-2);
}
.seg button[data-on="1"] { background: var(--panel-hi); color: var(--text); border-color: var(--line-hi); }

/* ---------- 其他 ---------- */
.empty { text-align: center; padding: 34px 16px; color: var(--text-3); font-size: 13.5px; }
.cap-warn {
  font-size: 12.5px; padding: 10px 13px; border-radius: 10px;
  background: rgba(255,207,112,0.09); border: 1px solid rgba(255,207,112,0.24);
  color: var(--gold); margin-bottom: 12px; line-height: 1.6;
}
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 200; padding: 11px 18px; border-radius: 999px;
  background: #221d3a; border: 1px solid var(--line-hi); box-shadow: var(--shadow);
  font-size: 13.5px; animation: rise .22s ease;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } }

.xp-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,0.08); overflow: hidden; }
.xp-bar > i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { text-align: center; padding: 12px 6px; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--line); }
.stat .v { font-size: 21px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.quote { font-size: 13px; color: var(--text-2); line-height: 1.75; font-style: italic; }
.quote cite { display: block; margin-top: 7px; font-style: normal; font-size: 11.5px; color: var(--text-3); }

/* ==========================================================
   Life Quest 3.0 · 梦幻人生地图
   ========================================================== */
:root {
  --bg: #0b0912;
  --bg-2: #100d18;
  --panel: rgba(31, 25, 43, .84);
  --panel-solid: #181320;
  --panel-hi: rgba(255, 255, 255, .075);
  --line: rgba(226, 205, 255, .105);
  --line-hi: rgba(235, 214, 255, .21);
  --text: #f4eff8;
  --text-2: #b9afc7;
  --text-3: #766d84;
  --accent: #cf7cff;
  --accent-2: #ffa9cc;
  --gold: #ffd67a;
  --danger: #ff769d;
  --font: "Quicksand", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", serif;
}

html { background: #09070e; }
body {
  min-height: 100vh;
  background:
    radial-gradient(900px 700px at 48% -12%, rgba(121, 67, 162, .15), transparent 70%),
    #09070e;
}
body::before {
  background-image:
    radial-gradient(circle at 14% 15%, rgba(255, 207, 137, .3) 0 1px, transparent 1.5px),
    radial-gradient(circle at 88% 24%, rgba(213, 157, 255, .35) 0 1px, transparent 1.5px);
  background-size: 84px 84px, 122px 122px;
  opacity: .25;
}

.app { max-width: none; width: 100%; padding: 0 18px 60px; }
.topbar {
  min-height: 76px;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 7, 14, .86);
  backdrop-filter: blur(22px);
}
.brand {
  flex: 0 0 220px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand > div { display: grid; gap: 0; }
.brand h1 {
  font-family: "Quicksand", sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .3px;
  background: none;
  color: #fff;
  line-height: 1.2;
}
.brand span { color: #9f94ac; font-size: 11px; letter-spacing: .4px; }
.brand-orbit {
  width: 39px;
  height: 39px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff1a9 !important;
  font-size: 22px !important;
  background: radial-gradient(circle at 50% 50%, #c678ff 0 30%, #7950bd 31% 50%, rgba(121,80,189,.1) 52%);
  box-shadow: 0 0 24px rgba(204, 119, 255, .5);
  position: relative;
}
.brand-orbit::after {
  content: "";
  position: absolute;
  width: 54px;
  height: 16px;
  border: 1px solid rgba(255,213,122,.5);
  border-radius: 50%;
  transform: rotate(-18deg);
}

nav.tabs {
  position: static;
  flex: 1;
  justify-content: center;
  gap: 10px;
  padding: 0;
  margin: 0;
  overflow: visible;
  background: none;
  backdrop-filter: none;
}
nav.tabs button {
  min-width: 78px;
  padding: 8px 12px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  gap: 2px;
  color: #918798;
  transition: .2s ease;
}
nav.tabs button i { font-size: 21px; }
nav.tabs button span { font-size: 11px; }
nav.tabs button:hover { color: #fff; background: rgba(255,255,255,.04); }
nav.tabs button[aria-selected="true"] {
  color: #f7dbff;
  background: linear-gradient(180deg, rgba(206,124,255,.16), rgba(206,124,255,.03));
  box-shadow: inset 0 -1px rgba(221,148,255,.45), 0 14px 24px rgba(80,35,104,.16);
}

.top-resources { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.top-resources .chip {
  min-width: 72px;
  padding: 7px 11px;
  border: none;
  background: rgba(255,255,255,.045);
}
.top-resources .chip i { color: #b88cff; font-size: 17px; }
.top-resources .chip.gold i,
.top-resources .chip.gold b { color: var(--gold); }
.top-resources .chip span { font-size: 10px; color: var(--text-3); }
.profile-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  padding: 4px 6px;
  border-radius: 12px;
}
.profile-chip:hover { background: rgba(255,255,255,.045); }
.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(145deg, #d39aff, #7350ad);
  border: 1px solid rgba(255,211,231,.45);
}
.profile-chip > span:not(.profile-avatar) { display: grid; text-align: left; line-height: 1.2; }
.profile-chip b { font-size: 12px; }
.profile-chip small { color: var(--text-3); font-size: 10px; }

#view { padding-top: 16px; }
#view > .grid,
#view > .card { max-width: 1180px; margin-left: auto; margin-right: auto; }

.quest-dashboard {
  display: grid;
  grid-template-columns: minmax(220px, .85fr) minmax(620px, 2.1fr) minmax(300px, 1fr);
  gap: 14px;
  align-items: start;
}
.quest-left,
.quest-center,
.quest-right { display: grid; gap: 14px; min-width: 0; }

.quest-panel,
.portrait-panel,
.world-panel,
.core-rule-panel {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(35, 28, 48, .94), rgba(16, 13, 24, .92));
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .22);
}
.quest-panel > header,
.world-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.quest-panel > header h3,
.world-head h2 { margin: 0; font-size: 14px; font-weight: 650; }
.quest-panel > header span,
.world-head span { color: var(--text-3); font-size: 10.5px; }

.portrait-panel {
  height: 372px;
  position: relative;
  border-color: rgba(255, 177, 214, .14);
}
.portrait-panel > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 53%;
  display: block;
}
.portrait-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10,7,14,.2) 58%, #0d0a12 100%);
}
.portrait-copy { position: absolute; inset: auto 15px 15px; }
.room-script {
  position: absolute;
  bottom: 158px;
  left: 0;
  color: #ff9ed8;
  font-family: cursive;
  font-size: 18px;
  transform: rotate(-4deg);
  text-shadow: 0 0 16px rgba(255, 96, 196, .55);
}
.portrait-copy h2 { margin: 0; font-family: var(--serif); font-size: 21px; }
.portrait-copy h2 i { color: #ffd47c; font-size: 14px; }
.portrait-copy p { margin: 2px 0 12px; color: #bcb0c5; font-size: 11px; }
.portrait-copy small { color: #7f7488; font-size: 9px; }
.mini-progress { height: 4px; border-radius: 9px; background: rgba(255,255,255,.12); overflow: hidden; }
.mini-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ca75fc, #ff9dc6);
  box-shadow: 0 0 8px #d882ff;
}

.mood-panel,
.attribute-panel,
.companion-panel { padding: 13px; }
.mood-panel { border-color: rgba(255, 205, 123, .12); }
.mood-panel header i { color: var(--gold); }
.mood-panel strong {
  display: block;
  font-family: var(--serif);
  font-size: 12px;
  color: #e7d9ec;
  margin-top: 12px;
}
.mood-panel p { color: var(--text-3); font-size: 10.5px; margin: 4px 0 0; line-height: 1.7; }
.attribute-list { display: grid; gap: 7px; margin-top: 12px; }
.attribute-list button {
  display: grid;
  grid-template-columns: 20px 70px 1fr 28px;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  text-align: left;
}
.attribute-list button > span { color: #dca4ff; font-size: 14px; }
.attribute-list button b { font-size: 9.5px; font-weight: 550; }
.attribute-list button i {
  height: 3px;
  border-radius: 8px;
  background: linear-gradient(90deg, #ae76f1 var(--p), rgba(255,255,255,.08) var(--p));
}
.attribute-list button small { color: var(--text-3); font-size: 8px; }
.companion-panel {
  min-height: 182px;
  position: relative;
  display: grid;
  grid-template-columns: 48% 1fr;
  align-items: end;
}
.companion-panel header { grid-column: 1 / -1; align-self: start; }
.companion-panel img {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: 50%;
  margin: 6px 0 -6px -4px;
  box-shadow: 0 0 34px rgba(191, 116, 255, .25);
}
.companion-panel > div h3 { margin: 0; font-size: 14px; }
.companion-panel > div h3 i { color: var(--gold); }
.companion-panel > div p { color: var(--text-3); font-size: 9px; line-height: 1.5; margin: 5px 0 8px; }

.world-panel { position: relative; min-height: 520px; border-color: rgba(181, 128, 245, .16); }
.world-head { padding: 17px 18px 10px; position: relative; z-index: 2; }
.world-head > div { display: flex; align-items: baseline; gap: 10px; }
.world-head h2 { font-family: var(--serif); font-size: 19px; }
.world-whisper {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.035);
}
.world-stage { height: 405px; position: relative; overflow: hidden; }
.world-stage > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.world-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 30px 50px rgba(10,7,16,.55), inset 0 -70px 60px rgba(10,7,16,.64);
}
.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 88px;
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  color: #f4eaf7;
  background: rgba(22, 15, 28, .72);
  backdrop-filter: blur(7px);
  box-shadow: 0 5px 16px rgba(0,0,0,.35);
  display: grid;
  grid-template-columns: 15px 1fr;
  align-items: center;
  gap: 4px;
  z-index: 2;
}
.map-pin > i { color: #ffd87c; font-size: 12px; }
.map-pin span { font-size: 9.5px; font-weight: 650; }
.map-pin small { grid-column: 2; color: #a998b2; font-size: 8px; margin-top: -4px; }
.map-pin:hover { border-color: #e5a0ff; transform: translate(-50%, -53%); }
.explore-btn {
  position: absolute;
  right: 22px;
  bottom: 13px;
  z-index: 3;
  padding: 10px 21px;
  border-radius: 12px;
  background: linear-gradient(92deg, #b968ec, #8c66e8);
  color: white;
  font-weight: 650;
  box-shadow: 0 9px 24px rgba(151, 85, 224, .35);
}
.quest-intake {
  min-height: 78px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(14, 10, 20, .92);
}
.quest-intake > div { display: grid; gap: 3px; }
.intake-label { color: #c995ec; font-size: 9px; letter-spacing: .5px; }
.quest-intake input {
  border: 0;
  outline: 0;
  background: transparent;
  color: white;
  width: 100%;
  font-size: 12px;
}
.quest-intake input::placeholder { color: #685e72; }
.quest-intake > button {
  padding: 10px 14px;
  border-radius: 10px;
  color: white;
  font-size: 11px;
  font-weight: 650;
  background: linear-gradient(92deg, #b761e9, #e676bd);
}

.wisdom-panel { padding: 14px; }
.wisdom-panel > header > div span { display: block; margin-top: 2px; }
.wisdom-panel > header button { color: #9d8aaa; font-size: 10px; }
.wisdom-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.wisdom-card {
  height: 205px;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid hsla(var(--h), 65%, 70%, .28);
  background: #17121f;
}
.wisdom-card > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wisdom-card:nth-child(2) > img { object-position: 50% 45%; }
.wisdom-card:nth-child(3) > img,
.wisdom-card:nth-child(4) > img { object-position: center 40%; }
.wisdom-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9,7,14,.05) 22%, rgba(9,7,14,.96) 77%);
}
.wisdom-domain {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 7px;
  border-radius: 7px;
  background: rgba(24,17,31,.74);
  color: #edddf3;
  font-size: 8px;
}
.wisdom-copy { position: absolute; inset: auto 10px 9px; }
.wisdom-copy h4 { font-family: var(--serif); margin: 0 0 4px; font-size: 12px; }
.wisdom-copy p {
  margin: 0 26px 4px 0;
  font-size: 9px;
  color: #b5a8bd;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wisdom-copy small { font-size: 7.5px; color: #6d6477; }
.wisdom-copy button {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: white;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  background: rgba(198,110,240,.28);
}

.mainline-panel { padding: 14px 16px; }
.mainline-panel header b { color: var(--gold); font-size: 9px; }
.mainline-path {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 18px;
  position: relative;
}
.mainline-path::before {
  content: "";
  position: absolute;
  top: 17px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, #d49b55, #af75ef 52%, rgba(255,255,255,.12) 53%);
}
.mainline-path > div { display: grid; justify-items: center; gap: 4px; position: relative; z-index: 1; }
.mainline-path > div > span {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #62596a;
  background: #2a2530;
  border: 1px solid rgba(255,255,255,.09);
}
.mainline-path > div.reached > span {
  color: #f7d77d;
  border-color: rgba(255,212,118,.55);
  background: #3a2c35;
  box-shadow: 0 0 20px rgba(242, 171, 84, .16);
}
.mainline-path b { font-size: 8px; }
.mainline-path small { color: var(--text-3); font-size: 7px; }

.howto-panel,
.action-panel,
.energy-panel { padding: 14px; }
.howto-panel {
  border-color: rgba(218, 126, 255, .24);
  box-shadow: inset 0 0 30px rgba(156, 76, 195, .055);
}
.howto-panel header > div span { display: block; margin-top: 2px; }
.howto-panel header > i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #d9a6ed;
  background: rgba(190, 111, 222, .11);
}
.howto-steps {
  display: grid;
  gap: 7px;
  margin: 12px 0;
}
.howto-steps > div,
.howto-steps > button {
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 7px 8px;
  text-align: left;
  border-radius: 9px;
  color: inherit;
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.045);
}
.howto-steps > button:hover {
  border-color: rgba(217, 158, 239, .24);
  background: rgba(192, 99, 236, .075);
}
.howto-steps > div > span,
.howto-steps > button > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  font-size: 8px;
  font-weight: 800;
  color: #e3b5f4;
  background: rgba(184, 98, 218, .13);
}
.howto-steps b,
.howto-steps small { display: block; }
.howto-steps b { font-size: 9px; color: #e5dce8; }
.howto-steps small { margin-top: 2px; font-size: 7.5px; color: var(--text-3); }
.howto-start {
  width: 100%;
  padding: 8px;
  border-radius: 9px;
  color: #e8cafa;
  font-size: 9.5px;
  background: rgba(177, 96, 216, .14);
  border: 1px solid rgba(210, 135, 248, .15);
}

.action-panel header b { color: #dfb5fa; font-size: 10px; }
.action-list { margin-top: 8px; }
.action-list > button {
  width: 100%;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  text-align: left;
  gap: 8px;
  padding: 9px 0;
  color: #c9bdcf;
  border-bottom: 1px solid rgba(255,255,255,.055);
}
.action-list > button > span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #6f6579;
  background: rgba(255,255,255,.04);
}
.action-list > button b { font-size: 9.5px; font-weight: 550; line-height: 1.45; }
.action-list > button small { color: var(--gold); font-size: 7.5px; }
.action-list > button.done { opacity: .62; }
.action-list > button.done b { text-decoration: line-through; }
.action-list > button.done > span { color: #f6d57a; background: rgba(255,210,113,.12); }
.record-action {
  width: 100%;
  margin-top: 11px;
  padding: 9px;
  border-radius: 9px;
  color: white;
  font-size: 9px;
  background: linear-gradient(92deg, #9e5ddd, #c662b2);
}

.core-rule-panel {
  padding: 16px;
  min-height: 178px;
  position: relative;
  border-color: rgba(238, 128, 199, .28);
  background:
    radial-gradient(220px 140px at 100% 100%, rgba(120, 63, 139, .26), transparent 70%),
    linear-gradient(145deg, rgba(112, 50, 87, .7), rgba(42, 25, 51, .95));
}
.core-rule-panel > span { font-size: 9px; color: #e4b7da; }
.core-rule-panel h3 { margin: 14px 0 6px; font-family: var(--serif); font-size: 18px; line-height: 1.45; }
.core-rule-panel p { margin: 0; color: #c9adc2; font-size: 9.5px; line-height: 1.7; }
.core-rule-panel small { display: block; margin-top: 8px; color: #8f7188; font-size: 8px; }
.core-rule-panel button {
  margin-top: 12px;
  padding: 7px 10px;
  color: #f3dced;
  font-size: 8px;
  border-radius: 8px;
  background: rgba(255,255,255,.07);
}

.energy-panel {
  min-height: 154px;
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  gap: 4px;
}
.energy-panel img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(210, 121, 255, .16);
}
.energy-panel span { color: #8f829b; font-size: 9px; }
.energy-panel h3 { margin: 5px 0; font-size: 11px; }
.energy-panel p { margin: 0; color: #706778; font-size: 8.5px; line-height: 1.5; }

@media (max-width: 1370px) {
  .quest-dashboard { grid-template-columns: 220px minmax(560px, 1fr) 278px; }
  .brand { flex-basis: 190px; }
  nav.tabs { gap: 2px; }
  nav.tabs button { min-width: 66px; padding-inline: 7px; }
  .top-resources .chip span { display: none; }
}

@media (max-width: 1100px) {
  .quest-dashboard { grid-template-columns: minmax(590px, 1fr) 290px; }
  .quest-left { display: none; }
  .topbar { position: relative; flex-wrap: wrap; }
  .brand { flex-basis: 180px; }
  nav.tabs { order: 3; flex-basis: 100%; justify-content: space-between; }
}

@media (max-width: 820px) {
  .app { padding-inline: 10px; }
  .topbar { gap: 6px; }
  .brand { flex: 1; }
  .profile-chip, .top-resources .chip:not(.gold) { display: none; }
  nav.tabs button span { display: none; }
  nav.tabs button { min-width: auto; flex: 1; }
  .quest-dashboard { display: block; }
  .quest-center, .quest-right { display: grid; margin-bottom: 12px; }
  .quest-right { grid-template-columns: 1fr 1fr; margin-top: 14px; }
  .action-panel { grid-row: span 2; }
  .world-stage { height: 330px; }
  .map-pin { min-width: 0; padding: 6px; grid-template-columns: 1fr; }
  .map-pin span, .map-pin small { display: none; }
  .quest-intake { grid-template-columns: 1fr; }
  .quest-intake > button { width: 100%; }
}

@media (max-width: 560px) {
  .quest-right, .wisdom-row { grid-template-columns: 1fr 1fr; }
  .howto-panel, .action-panel { grid-column: 1 / -1; }
  .world-head { align-items: flex-start; }
  .world-whisper { display: none; }
  .world-stage { height: 280px; }
  .wisdom-card { height: 180px; }
  .mainline-path b, .mainline-path small { display: none; }
}

/* ================================================================
   间隔重复版新增样式（v4）
   ================================================================ */

.hud { display: flex; gap: 8px; flex-wrap: wrap; }
.hud-item {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 11px;
  font-size: 12.5px; color: var(--text-2); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

nav.tabs button .badge {
  display: inline-block; margin-left: 5px; padding: 0 6px;
  background: var(--accent); color: #1a1030; border-radius: 999px;
  font-size: 11px; font-weight: 700; font-style: normal;
  font-variant-numeric: tabular-nums;
}

/* ---------- 会话卡 ---------- */

.center-card { text-align: center; padding: 32px 22px; }
.center-card h2 { margin: 6px 0 8px; font-size: 21px; }
.big-emoji { font-size: 40px; line-height: 1; }

.progress-bar {
  height: 3px; background: var(--line); border-radius: 999px;
  overflow: hidden; margin: 4px 0 12px;
}
.progress-bar span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .25s ease;
}

.sess-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-3); margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}

.qcard {
  border-left: 3px solid hsl(var(--h) 70% 66% / .8);
  padding: 26px 24px 28px;
}
.q-label {
  font-size: 11.5px; letter-spacing: .12em; color: var(--text-3);
  text-transform: uppercase; margin-bottom: 6px;
}
.q-text {
  font-size: 22px; line-height: 1.5; font-weight: 600;
  color: var(--text); letter-spacing: .2px;
}
.q-prompt { margin: 20px 0 0; color: var(--text-3); font-size: 13.5px; }
.q-divider {
  height: 1px; background: var(--line); margin: 22px 0 18px;
}
.a-text {
  font-size: 19px; line-height: 1.55; font-weight: 550;
  color: hsl(var(--h) 62% 78%);
}
.q-title {
  margin-top: 18px; font-size: 14px; font-weight: 650; color: var(--text-2);
}
.q-src { margin-top: 3px; font-size: 12.5px; color: var(--text-3); }
.q-note {
  margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  font-size: 13px; color: var(--text-2); line-height: 1.6;
}

/* ---------- 评分 ---------- */

.rate-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin: 14px 0 12px;
}
.rate {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 13px 6px; border-radius: var(--radius-sm);
  background: var(--panel); border: 1px solid var(--line);
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.rate:hover { transform: translateY(-2px); background: var(--panel-hi); }
.rate b { font-size: 14px; font-weight: 650; }
.rate span { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.rate.r0 { border-color: rgba(255,123,147,0.35); } .rate.r0 b { color: var(--danger); }
.rate.r1 { border-color: rgba(255,207,112,0.32); } .rate.r1 b { color: var(--gold); }
.rate.r2 { border-color: rgba(124,224,211,0.32); } .rate.r2 b { color: var(--accent-2); }
.rate.r3 { border-color: rgba(177,140,255,0.42); } .rate.r3 b { color: var(--accent); }
.rate.mini {
  display: inline-flex; flex-direction: row; padding: 2px 10px;
  border-radius: 999px; font-size: 12px; min-width: 62px; justify-content: center;
}

/* ---------- 预测柱状图 ---------- */

.forecast {
  display: flex; align-items: flex-end; gap: 4px; height: 68px; margin-top: 12px;
}
.fbar {
  flex: 1; display: flex; flex-direction: column; justify-content: flex-end;
  align-items: center; height: 100%; gap: 4px;
}
.fbar span {
  width: 100%; min-height: 2px; border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--accent), rgba(177,140,255,0.28));
}
.fbar i {
  font-style: normal; font-size: 10px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.bar-stack {
  display: flex; height: 9px; border-radius: 999px; overflow: hidden;
  background: var(--line);
}
.bar-stack span { display: block; }
.bar-stack .r0 { background: var(--danger); }
.bar-stack .r1 { background: var(--gold); }
.bar-stack .r2 { background: var(--accent-2); }
.bar-stack .r3 { background: var(--accent); }

/* ---------- 领域 / 书架进度条 ---------- */

.dom-row {
  display: grid; grid-template-columns: 1fr 2fr auto;
  align-items: center; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.dom-row:last-child { border-bottom: none; }
.dom-name { font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.dom-bar {
  height: 6px; background: var(--line); border-radius: 999px; overflow: hidden;
}
.dom-bar span {
  display: block; height: 100%; border-radius: 999px;
  background: hsl(var(--h, 262) 65% 66%);
}
.dom-num {
  font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums;
  min-width: 46px; text-align: right;
}

.book { padding: 12px 0; border-bottom: 1px solid var(--line); }
.book:last-child { border-bottom: none; }
.book-head {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 7px;
}
.book-head b { font-size: 14.5px; }
.book-head .dim { font-size: 12px; }
.book-n {
  margin-left: auto; font-size: 12px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.book p.dim { margin: 8px 0; font-size: 12.5px; }

.rules-table { display: grid; gap: 7px; margin-top: 10px; }
.rules-table > div {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--text-2);
}

/* ---------- 规则卡状态 ---------- */

.pill.new       { border-color: var(--line-hi); color: var(--text-3); }
.pill.learning  { border-color: rgba(255,207,112,0.4);  color: var(--gold); }
.pill.review    { border-color: rgba(124,224,211,0.4);  color: var(--accent-2); }
.pill.mastered  { border-color: rgba(177,140,255,0.5);  color: var(--accent); }
.pill.core      { border-color: rgba(255,255,255,0.3);  color: var(--text); }

.rule .head { display: flex; align-items: flex-start; gap: 10px; }
.rule .head .name { flex: 1; }
.star {
  font-size: 17px; line-height: 1; color: var(--text-3);
  padding: 2px 4px; transition: color .12s ease, transform .12s ease;
}
.star:hover { transform: scale(1.15); }
.star.on { color: var(--gold); }
.rule .body .note { color: var(--text-3); font-size: 12.5px; }

.searchbar { display: flex; gap: 8px; align-items: center; }
.searchbar input { flex: 1; }

@media (max-width: 600px) {
  .rate-row { grid-template-columns: repeat(2, 1fr); }
  .q-text { font-size: 19px; }
  .a-text { font-size: 17px; }
  .dom-row { grid-template-columns: 1fr auto; }
  .dom-row .dom-bar { grid-column: 1 / -1; }
  .searchbar { flex-direction: column; align-items: stretch; }
}

/* 导航选中态（app.js 用 data-on 渲染） */
nav.tabs button[data-on="1"] {
  color: #17122a; font-weight: 650;
  background: linear-gradient(96deg, #cbb2ff, var(--accent-2));
}
nav.tabs button[data-on="1"] .badge { background: #17122a; color: #cbb2ff; }

/* ---------- 学习模式（第一次见到一条规则） ---------- */

.qcard.learn { padding: 24px 24px 26px; }

.learn-tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: hsl(var(--h) 60% 60% / .16);
  border: 1px solid hsl(var(--h) 60% 66% / .38);
  color: hsl(var(--h) 62% 78%);
  font-size: 11.5px; letter-spacing: .06em; font-weight: 600;
}
.learn-title {
  margin: 14px 0 18px; font-size: 24px; line-height: 1.35;
  font-weight: 680; letter-spacing: .2px;
}

.learn-ifthen { display: grid; gap: 11px; }
.learn-ifthen .row { display: flex; gap: 11px; align-items: flex-start; }
.learn-ifthen .tag {
  flex: 0 0 auto; margin-top: 4px;
  font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 6px;
}
.learn-ifthen .tag.if   { background: rgba(255,207,112,0.16); color: var(--gold); }
.learn-ifthen .tag.then { background: rgba(124,224,211,0.16); color: var(--accent-2); }
.learn-ifthen .row > span:last-child { font-size: 17px; line-height: 1.55; }

.learn-why {
  margin-top: 20px; padding: 15px 16px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.035); border: 1px solid var(--line);
}
.learn-why p {
  margin: 6px 0 0; font-size: 14.5px; line-height: 1.75; color: var(--text-2);
}
.qcard.learn .q-src { margin-top: 16px; }

/* 折叠的「为什么」（复习时可展开） */
.why-fold { margin-top: 12px; }
.why-fold summary {
  cursor: pointer; list-style: none;
  font-size: 12.5px; color: var(--text-3);
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
}
.why-fold summary::-webkit-details-marker { display: none; }
.why-fold summary::before { content: '?'; opacity: .7; }
.why-fold summary:hover { color: var(--text-2); border-color: var(--line-hi); }
.why-fold[open] summary { color: var(--text-2); }
.why-fold p {
  margin: 10px 0 0; font-size: 13.5px; line-height: 1.7; color: var(--text-2);
  padding-left: 2px;
}

.pill.skipped { border-color: var(--line); color: var(--text-3); opacity: .8; }

@media (max-width: 600px) {
  .learn-title { font-size: 20px; }
  .learn-ifthen .row > span:last-child { font-size: 15.5px; }
  .learn-why p { font-size: 13.5px; }
}

/* ---------- PWA / 云同步 / 实践反馈 ---------- */

.section-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; margin-bottom: 14px;
}
.section-head h3 { margin-bottom: 4px; }
.section-head p { margin: 0; }
.status-pill,
.sync-status {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  min-height: 26px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line-hi); background: rgba(255,255,255,.035);
  color: var(--text-3); font-size: 11.5px; white-space: nowrap;
}
.sync-status::before,
.cloud-hud::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-3); display: inline-block; margin-right: 5px;
}
.sync-status[data-state="synced"]::before,
.cloud-hud[data-state="synced"]::before { background: var(--accent-2); }
.sync-status[data-state="saving"]::before,
.cloud-hud[data-state="saving"]::before { background: var(--gold); }
.sync-status[data-state="error"]::before,
.cloud-hud[data-state="error"]::before { background: var(--danger); }
.sync-status[data-state="offline"]::before,
.cloud-hud[data-state="offline"]::before { background: var(--text-3); }
.ios-install { margin-top: 12px; }
.practice-stats { margin-top: 16px; }
.practice-note { margin: 12px 0 0; font-size: 12.5px; }
.practice-modal h3 { margin-top: 14px; }
.practice-rule {
  margin: 14px 0 6px; padding: 14px; border-radius: var(--radius-sm);
  background: rgba(177,140,255,.09); border: 1px solid rgba(177,140,255,.22);
  color: var(--text); font-size: 16px; line-height: 1.5;
}
.practice-acts { display: grid; grid-template-columns: 1fr; margin-top: 18px; }

@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top); }
  .app { min-height: calc(100vh - env(safe-area-inset-top)); }
}

@media (max-width: 600px) {
  .topbar {
    min-height: 0;
    padding: 13px 4px 10px;
    position: relative;
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
  }
  .brand { flex: none; width: 100%; }
  .brand span { overflow: hidden; text-overflow: ellipsis; }
  .topbar .spacer { display: none; }
  .hud {
    width: 100%;
    gap: 5px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .hud::-webkit-scrollbar { display: none; }
  .hud-item { padding: 4px 9px; font-size: 11.5px; }
  nav.tabs {
    position: sticky;
    top: 0;
    z-index: 45;
    justify-content: flex-start;
    gap: 4px;
    padding: 8px 0 10px;
    margin-bottom: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    background: rgba(9, 7, 14, .9);
    backdrop-filter: blur(18px);
  }
  nav.tabs button {
    flex: 0 0 auto;
    min-width: 72px;
    padding: 8px 12px;
    white-space: nowrap;
  }
  .section-head { flex-direction: column; gap: 8px; }
  .cloud-hud { display: none; }
  .status-pill, .sync-status { align-self: flex-start; }
}
