/* ============================================================
   仙途阁 · XDDQ 信息大全
   纯静态站点样式 · 无第三方依赖
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
    --font-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", "STSong", "SimSun", serif;

    --bg: #f5f2ea;
    --bg-deep: #ece5d6;
    --surface: #fffdf8;
    --surface-2: #faf7ef;
    --surface-3: #f1ebe0;
    --text: #182722;
    --text-soft: #40524a;
    --muted: #6e7f76;
    --line: #e4ddcf;
    --line-strong: #cfc5b2;

    --jade: #0f7a5a;
    --jade-deep: #0b3d2e;
    --jade-bright: #1aa87c;
    --jade-soft: #e4f1eb;

    --gold: #b0883c;
    --gold-bright: #d2ac62;
    --gold-soft: #f5ecd8;

    --danger: #b34e3a;
    --danger-soft: #f8e8e3;

    --shadow-xs: 0 1px 2px rgb(24 39 34 / 6%);
    --shadow-sm: 0 2px 10px -4px rgb(24 39 34 / 12%);
    --shadow-md: 0 18px 48px -24px rgb(24 39 34 / 28%);
    --shadow-lg: 0 36px 90px -36px rgb(24 39 34 / 38%);

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --header-h: 70px;
    --header-h-safe: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    --page-max: 1200px;
    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #0b1411;
    --bg-deep: #09110e;
    --surface: #121e19;
    --surface-2: #16241e;
    --surface-3: #1b2c25;
    --text: #eef1e8;
    --text-soft: #c3cdc4;
    --muted: #8fa197;
    --line: #23352c;
    --line-strong: #344a3f;

    --jade: #45c39a;
    --jade-deep: #082018;
    --jade-bright: #5ad6ad;
    --jade-soft: #163b2f;

    --gold: #d6b46d;
    --gold-bright: #e8ca8b;
    --gold-soft: #2c2617;

    --danger: #e08a76;
    --danger-soft: #382019;

    --shadow-xs: 0 1px 2px rgb(0 0 0 / 30%);
    --shadow-sm: 0 2px 12px -4px rgb(0 0 0 / 40%);
    --shadow-md: 0 20px 50px -24px rgb(0 0 0 / 60%);
    --shadow-lg: 0 36px 90px -30px rgb(0 0 0 / 70%);
    color-scheme: dark;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.65;
    color: var(--text);
    background:
        radial-gradient(1100px 620px at 88% -8%, rgb(26 168 124 / 10%), transparent 62%),
        radial-gradient(900px 520px at -10% 32%, rgb(176 136 60 / 7%), transparent 60%),
        var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: radial-gradient(rgb(24 39 34 / 4.5%) 0.55px, transparent 0.55px);
    background-size: 17px 17px;
    mask-image: linear-gradient(to bottom, black, transparent 78%);
}

[data-theme="dark"] body {
    background:
        radial-gradient(1100px 620px at 88% -8%, rgb(69 195 154 / 8%), transparent 62%),
        radial-gradient(900px 520px at -10% 32%, rgb(214 180 109 / 4%), transparent 60%),
        var(--bg);
}

[data-theme="dark"] body::before {
    background-image: radial-gradient(rgb(255 255 255 / 4%) 0.55px, transparent 0.55px);
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
strong { font-weight: 700; }
::selection { background: rgb(15 122 90 / 22%); color: var(--text); }

:focus-visible {
    outline: 2px solid var(--jade);
    outline-offset: 3px;
    border-radius: 4px;
}

[hidden] { display: none !important; }

.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;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--jade-deep);
    color: #f4eddc;
    transform: translateY(-160%);
    transition: transform 0.2s ease;
}
.skip-link:focus { transform: translateY(0); }

.muted { color: var(--muted); }
.text-jade { color: var(--jade); }
.fineprint { color: var(--muted); font-size: 12.5px; line-height: 1.7; }

/* ---------- Shared atoms ---------- */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--jade);
}

.eyebrow-line {
    width: 26px;
    height: 1px;
    background: linear-gradient(90deg, var(--gold), transparent);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.tag-gold { background: var(--gold-soft); border-color: rgb(176 136 60 / 28%); color: var(--gold); }
.tag-jade { background: var(--jade-soft); border-color: rgb(15 122 90 / 22%); color: var(--jade); }
.tag-light { background: rgb(255 255 255 / 10%); border-color: rgb(255 255 255 / 22%); color: #f3e8cf; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    padding: 0 21px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 650;
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 13px; border-radius: 10px; }

.btn-primary {
    background: linear-gradient(135deg, #138a65, var(--jade-deep));
    color: #f6f1e3;
    box-shadow: 0 12px 26px -14px rgb(11 61 46 / 80%), inset 0 1px 0 rgb(255 255 255 / 16%);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 32px -14px rgb(11 61 46 / 90%), inset 0 1px 0 rgb(255 255 255 / 20%); }

.btn-ghost {
    border-color: var(--line-strong);
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    color: var(--text);
    box-shadow: var(--shadow-xs);
}
.btn-ghost:hover { border-color: var(--jade); color: var(--jade); background: var(--surface); }

.btn-gold {
    background: linear-gradient(135deg, #e4c68a, #bd9145);
    color: #2a200c;
    box-shadow: 0 14px 28px -16px rgb(0 0 0 / 46%), inset 0 1px 0 rgb(255 255 255 / 30%);
}
.btn-gold:hover { transform: translateY(-1px); }

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    filter: saturate(0.72);
}
.btn:disabled:hover,
.btn[aria-disabled="true"]:hover {
    transform: none;
    box-shadow: none;
}

.btn-danger { background: var(--danger); color: #fff7f2; }
.btn-danger:hover { filter: brightness(1.05); }

.btn-danger-ghost { border-color: rgb(179 78 58 / 30%); background: var(--danger-soft); color: var(--danger); }
.btn-danger-ghost:hover { border-color: var(--danger); }

.text-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px;
    border: 0;
    background: none;
    color: var(--jade);
    font-size: 13px;
    font-weight: 650;
}
.text-btn:hover { color: var(--jade-bright); }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    color: var(--text-soft);
    font-size: 20px;
    line-height: 1;
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.icon-btn:hover { border-color: var(--jade); color: var(--jade); }
.icon-btn svg { width: 19px; height: 19px; }

svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.avatar {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 22%, rgb(255 255 255 / 26%), transparent 50%),
        linear-gradient(140deg, var(--jade-bright), var(--jade-deep));
    color: #f4eddb;
    font-family: var(--font-serif);
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 18%), 0 6px 14px -8px rgb(11 61 46 / 70%);
}
.avatar-sm { width: 32px; height: 32px; font-size: 14px; }
.avatar-lg { width: 72px; height: 72px; font-size: 30px; border-radius: 24px; }

.panel {
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.section-head h2 { font-family: var(--font-serif); font-size: clamp(22px, 2.4vw, 28px); line-height: 1.25; letter-spacing: -0.01em; }
.section-head.compact { align-items: center; margin-bottom: 16px; }
.section-head.compact h2, .section-head.compact h3 { margin: 0; font-family: var(--font-serif); font-size: 20px; }
.section-head.compact .eyebrow { margin-bottom: 6px; }
.section-head .eyebrow { margin-bottom: 6px; }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    padding-top: env(safe-area-inset-top, 0px);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(18px) saturate(1.3);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.site-header.is-scrolled {
    border-color: var(--line);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    box-shadow: 0 10px 30px -24px rgb(24 39 34 / 45%);
}
[data-theme="dark"] .site-header { background: color-mix(in srgb, var(--bg) 80%, transparent); }
[data-theme="dark"] .site-header.is-scrolled { background: color-mix(in srgb, var(--bg) 94%, transparent); }

.header-inner {
    display: flex;
    align-items: center;
    gap: 30px;
    width: min(100%, var(--page-max));
    height: var(--header-h);
    margin: 0 auto;
    padding: 0 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    border-radius: 12px;
}
.brand-seal {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgb(210 172 98 / 48%);
    background:
        radial-gradient(circle at 30% 22%, rgb(255 255 255 / 14%), transparent 55%),
        linear-gradient(145deg, #14553f, #0a2e22);
    color: #ecd9ae;
    font-family: var(--font-serif);
    font-size: 21px;
    font-weight: 700;
    box-shadow: inset 0 0 0 3px rgb(8 32 24 / 55%), 0 6px 16px -8px rgb(11 61 46 / 65%);
    transform: rotate(-3deg);
}
.brand-seal-sm { width: 34px; height: 34px; font-size: 17px; border-radius: 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--font-serif); font-size: 18px; letter-spacing: 0.08em; }
.brand-text small { margin-top: 3px; font-size: 10px; letter-spacing: 0.12em; color: var(--muted); }

.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-link {
    position: relative;
    padding: 9px 14px;
    border-radius: 9px;
    color: var(--text-soft);
    font-size: 13.5px;
    font-weight: 600;
    transition: color 0.18s ease, background 0.18s ease;
}
.nav-link::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 3px;
    height: 2px;
    border-radius: 2px;
    background: var(--jade);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.22s ease;
}
.nav-link:hover { color: var(--text); background: rgb(15 122 90 / 6%); }
.nav-link.is-active { color: var(--jade); }
.nav-link.is-active::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.search-box { position: relative; display: inline-flex; align-items: center; }
.search-box > kbd { position: absolute; right: 8px; pointer-events: none; }
.search-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 62px 0 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    color: var(--muted);
    font-size: 12.5px;
    transition: border-color 0.18s ease, color 0.18s ease;
}
.search-trigger:hover { border-color: var(--jade); color: var(--jade); }
.search-trigger svg { width: 16px; height: 16px; }
kbd {
    display: inline-block;
    padding: 2px 6px;
    border: 1px solid var(--line);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: var(--surface-2);
    color: var(--muted);
    font-family: var(--font-sans);
    font-size: 10px;
    line-height: 1.4;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 12px 0 5px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 12.5px;
    font-weight: 600;
    transition: border-color 0.18s ease, background 0.18s ease;
}
.profile-chip:hover { border-color: var(--jade); background: var(--surface-2); }
.profile-chip-name { max-width: 110px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---------- Layout / pages ---------- */
main { display: block; }
.page {
    width: min(100%, var(--page-max));
    margin: 0 auto;
    padding: 0 28px 72px;
}
.page:not(.is-active) { display: none; }
.page.is-active { animation: page-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 54px 0 30px;
}
.page-head h1 {
    font-family: var(--font-serif);
    font-size: clamp(34px, 5vw, 52px);
    line-height: 1.12;
    letter-spacing: -0.02em;
}
.page-desc { max-width: 620px; margin-top: 12px; color: var(--text-soft); font-size: 14px; }
.page-head .tag { margin-bottom: 8px; }

.page-home { padding-top: 0; }

/* ---------- Hero ---------- */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
    gap: 36px;
    align-items: center;
    padding: 68px 0 44px;
}
.hero-copy h1 {
    font-family: var(--font-serif);
    font-size: clamp(44px, 5.9vw, 76px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.035em;
    margin-bottom: 22px;
}
.hero-copy h1 em {
    position: relative;
    font-style: normal;
    color: var(--jade);
}
.hero-copy h1 em::after {
    content: "";
    position: absolute;
    left: 2%;
    right: 2%;
    bottom: 2px;
    z-index: -1;
    height: 10px;
    background: linear-gradient(90deg, rgb(210 172 98 / 42%), rgb(210 172 98 / 8%));
    border-radius: 2px;
    transform: skewX(-8deg);
}
.hero-copy .lead {
    max-width: 34em;
    color: var(--text-soft);
    font-size: clamp(14px, 1.4vw, 16px);
    line-height: 1.8;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 28px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 9px 18px; margin-top: 28px; }
.hero-badges li { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.hero-badges li span { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }

.hero-visual { position: relative; display: flex; justify-content: center; }
.orbit-system {
    position: relative;
    width: min(100%, 470px);
    aspect-ratio: 1;
    margin-inline: auto;
}
.orbit-system::before {
    content: "";
    position: absolute;
    inset: 7%;
    border-radius: 50%;
    background: radial-gradient(circle at 36% 28%, rgb(26 168 124 / 22%), transparent 62%);
    filter: blur(24px);
}
.orbit-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    pointer-events: none;
}
.ring-a {
    inset: 0;
    border-style: dashed;
    opacity: 0.7;
    animation: orbit-spin 110s linear infinite;
}
.ring-a::before,
.ring-b::before,
.ring-c::before {
    content: "";
    position: absolute;
    top: -3.5px;
    left: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 4px rgb(210 172 98 / 12%);
}
.ring-b {
    inset: 9%;
    border-color: color-mix(in srgb, var(--jade) 28%, var(--line));
    animation: orbit-spin-rev 80s linear infinite;
}
.ring-b::before { background: var(--jade-bright); box-shadow: 0 0 0 4px rgb(26 168 124 / 12%); }
.ring-c {
    inset: 21%;
    border-style: dashed;
    opacity: 0.6;
    animation: orbit-spin 60s linear infinite;
}
.ring-c::before { background: var(--muted); }

.orbit-core {
    position: absolute;
    inset: 30%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 24%, rgb(70 180 143 / 34%), transparent 54%),
        radial-gradient(circle at 50% 80%, rgb(6 28 21 / 80%), transparent 75%),
        linear-gradient(150deg, #14553f, #08281d);
    color: #f2e4c4;
    box-shadow:
        0 40px 80px -32px rgb(8 40 29 / 65%),
        inset 0 0 0 1px rgb(255 255 255 / 14%),
        inset 0 -30px 60px rgb(0 0 0 / 24%);
}
.orbit-core::before {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgb(210 172 98 / 40%);
    border-radius: 50%;
}
.orbit-core::after {
    content: "";
    position: absolute;
    inset: 18px;
    border: 1px dashed rgb(240 223 182 / 16%);
    border-radius: 50%;
}
.core-seal {
    font-family: var(--font-serif);
    font-size: clamp(54px, 7vw, 84px);
    line-height: 1;
    color: #efdcb2;
    text-shadow: 0 4px 20px rgb(0 0 0 / 35%);
}
.orbit-core small {
    margin-top: 12px;
    font-size: 9px;
    letter-spacing: 0.28em;
    color: rgb(239 220 178 / 66%);
}
.orbit-mark {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--line-strong);
}
.mark-a { top: 26%; left: 4%; }
.mark-b { bottom: 18%; right: 8%; }
.mark-c { top: 54%; right: 1%; }

.orbit-chip {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    color: var(--text-soft);
    font-size: 11.5px;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    animation: float 7s ease-in-out infinite;
}
.orbit-chip strong { color: var(--text); }
.chip-a { top: 9%; right: -2%; }
.chip-b { bottom: 14%; left: -4%; animation-delay: 1.1s; }
.chip-c { top: 50%; right: -8%; animation-delay: 2.2s; }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--jade-bright); box-shadow: 0 0 0 4px rgb(26 168 124 / 12%); }
.chip-star { color: var(--gold); font-size: 13px; line-height: 1; }

/* ---------- Stat strip ---------- */
.stat-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 8px 0 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 22px 26px;
    border-right: 1px solid var(--line);
}
.stat-item:last-child { border-right: 0; }
.stat-item strong {
    font-family: var(--font-serif);
    font-size: clamp(26px, 3vw, 34px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.stat-item span { font-size: 11.5px; color: var(--muted); letter-spacing: 0.05em; }
.stat-text { font-size: clamp(18px, 2.2vw, 24px) !important; padding-top: 5px; color: var(--jade); }

/* ---------- Home sections ---------- */
.home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: 20px;
    margin-bottom: 42px;
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.panel-head time { font-size: 11.5px; letter-spacing: 0.08em; color: var(--muted); }
.notice-panel { position: relative; overflow: hidden; }
.notice-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, var(--gold), transparent 80%);
}
.notice-panel h2 {
    font-family: var(--font-serif);
    font-size: clamp(21px, 2.4vw, 27px);
    line-height: 1.35;
    margin-bottom: 10px;
}
.notice-panel > p { max-width: 60ch; color: var(--text-soft); font-size: 13.5px; }
.notice-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px dashed var(--line);
}
.notice-foot .muted { font-size: 11.5px; }

.today-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 26px;
    border-radius: var(--radius-lg);
    color: #f3ead6;
    background:
        radial-gradient(480px 260px at 90% 8%, rgb(90 214 173 / 24%), transparent 60%),
        radial-gradient(300px 200px at 0% 100%, rgb(210 172 98 / 14%), transparent 70%),
        linear-gradient(150deg, #13543e, #08271d);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.today-panel::before {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px solid rgb(240 223 182 / 14%);
    border-radius: 16px;
    pointer-events: none;
}
.today-top {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 10.5px;
    letter-spacing: 0.16em;
    color: rgb(243 234 214 / 55%);
    text-transform: uppercase;
}
.today-panel h2 {
    position: relative;
    z-index: 1;
    margin-top: 30px;
    font-family: var(--font-serif);
    font-size: clamp(24px, 2.8vw, 31px);
    font-weight: 500;
    color: #f2e3bd;
}
.today-panel > p {
    position: relative;
    z-index: 1;
    margin-top: 8px;
    font-size: 12.5px;
    color: rgb(243 234 214 / 68%);
}
.today-action {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    margin-top: auto;
    padding-top: 26px;
    font-size: 12.5px;
    font-weight: 600;
    color: #e5cb95;
}
.today-action:hover { color: #f3e3bd; }
.today-ornament {
    position: absolute;
    right: 18px;
    bottom: -24px;
    font-family: var(--font-serif);
    font-size: 130px;
    line-height: 1;
    color: rgb(240 223 182 / 5%);
    pointer-events: none;
}

.home-section { margin-bottom: 42px; }
.entry-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.entry-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.entry-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--jade) 34%, var(--line));
    box-shadow: var(--shadow-md);
}
.entry-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--jade-soft);
    color: var(--jade);
}
.entry-icon svg { width: 21px; height: 21px; }
.entry-body { display: flex; flex-direction: column; gap: 5px; }
.entry-body strong { font-size: 14.5px; }
.entry-body small { color: var(--muted); font-size: 12px; line-height: 1.55; }
.entry-arrow { margin-top: auto; color: var(--muted); font-size: 15px; transition: transform 0.2s ease, color 0.2s ease; }
.entry-card:hover .entry-arrow { transform: translateX(4px); color: var(--jade); }

.cta-band {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 20px;
    padding: 44px;
    border-radius: var(--radius-xl);
    background:
        radial-gradient(600px 320px at 88% 10%, rgb(90 214 173 / 16%), transparent 60%),
        linear-gradient(140deg, #123f30, #071b14);
    color: #f1e9d8;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.cta-band::before {
    content: "";
    position: absolute;
    top: -60%;
    right: -8%;
    width: 460px;
    height: 460px;
    border: 1px solid rgb(240 223 182 / 10%);
    border-radius: 50%;
    box-shadow:
        0 0 0 34px rgb(240 223 182 / 3%),
        0 0 0 68px rgb(240 223 182 / 2%);
    pointer-events: none;
}
.cta-copy { position: relative; z-index: 1; max-width: 660px; }
.cta-copy h2 {
    margin: 14px 0 12px;
    font-family: var(--font-serif);
    font-size: clamp(24px, 3.2vw, 34px);
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: -0.01em;
}
.cta-copy p { max-width: 60ch; font-size: 12.5px; color: rgb(241 233 216 / 62%); }
.cta-band .btn { position: relative; z-index: 1; flex: 0 0 auto; }

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.footer-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 22px 30px;
    width: min(100%, var(--page-max));
    margin: 0 auto;
    padding: 34px 28px 40px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand div { display: flex; flex-direction: column; line-height: 1.3; }
.footer-brand strong { font-family: var(--font-serif); font-size: 15px; letter-spacing: 0.08em; }
.footer-brand small { font-size: 9.5px; letter-spacing: 0.12em; color: var(--muted); }
.footer-note { align-self: center; color: var(--muted); font-size: 11.5px; }
.footer-links {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 22px;
    padding-top: 18px;
    border-top: 1px dashed var(--line);
    color: var(--muted);
    font-size: 11.5px;
}
.footer-links a:hover { color: var(--jade); }

/* ---------- Bottom nav ---------- */
.bottom-nav { display: none; }

/* ============================================================
   Roles
   ============================================================ */
.toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    padding: 14px 16px;
    border-radius: var(--radius);
}
.search-field {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1 1 240px;
    min-width: 0;
    height: 42px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--muted);
    transition: border-color 0.18s ease, background 0.18s ease;
}
.search-field:focus-within { border-color: var(--jade); background: var(--surface); }
.search-field svg { width: 16px; height: 16px; flex: 0 0 auto; }
.search-field input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 13px;
    color: var(--text);
}
.search-field input::placeholder { color: var(--muted); }

.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    transition: all 0.18s ease;
}
.chip span { font-size: 10.5px; opacity: 0.8; }
.chip:hover { border-color: var(--jade); color: var(--jade); }
.chip.is-active { border-color: var(--jade-deep); background: var(--jade-deep); color: #f0e8d6; }
[data-theme="dark"] .chip.is-active { border-color: var(--jade); background: var(--jade); color: #06110d; }

.select-field select {
    height: 38px;
    padding: 0 32px 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background-color: var(--surface-2);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e7f76' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    color: var(--text-soft);
    font-size: 12px;
    appearance: none;
    cursor: pointer;
}
.select-field select:focus { outline: 2px solid var(--jade); outline-offset: 2px; }

.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.role-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.role-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--jade) 26%, var(--line));
    box-shadow: var(--shadow-md);
}
.role-card-top { display: flex; align-items: flex-start; gap: 12px; }
.role-avatar {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    border-radius: 14px;
    border: 1px solid rgb(15 122 90 / 18%);
    background:
        radial-gradient(circle at 34% 22%, rgb(255 255 255 / 55%), transparent 55%),
        linear-gradient(145deg, var(--jade-soft), var(--surface-3));
    color: var(--jade);
    font-family: var(--font-serif);
    font-size: 21px;
    font-weight: 700;
}
.role-identity { min-width: 0; flex: 1; }
.role-identity h3 {
    font-family: var(--font-serif);
    font-size: 19px;
    line-height: 1.3;
    letter-spacing: 0.01em;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.role-identity p { margin-top: 3px; font-size: 11.5px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: 0.03em;
}
.status-pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pill.is-on { background: var(--jade-soft); color: var(--jade); }
.status-pill.is-on i { box-shadow: 0 0 0 3px rgb(15 122 90 / 14%); animation: pulse 2.4s ease-in-out infinite; }
.status-pill.is-off { background: var(--surface-3); color: var(--muted); }
[data-theme="dark"] .status-pill.is-on { background: rgb(69 195 154 / 14%); }

.role-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 18px 0 16px;
    border-top: 1px dashed var(--line);
    border-bottom: 1px dashed var(--line);
}
.role-metric { padding: 12px 6px; border-right: 1px dashed var(--line); }
.role-metric:first-child { padding-left: 0; }
.role-metric:last-child { border-right: 0; }
.role-metric span { display: block; font-size: 10px; letter-spacing: 0.08em; color: var(--muted); }
.role-metric strong { display: block; margin-top: 3px; font-size: 14px; font-weight: 650; }

.role-progress { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.role-progress-top { display: flex; justify-content: space-between; gap: 10px; font-size: 10.5px; color: var(--muted); }
.role-progress-top span:last-child { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--jade), var(--jade-bright)); transition: width 0.5s ease; }
.progress-light { background: rgb(255 255 255 / 15%); }
.progress-light > span { background: linear-gradient(90deg, #e6c98e, #c59a4b); }

.role-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--line);
}
.role-card-actions button {
    flex: 1;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 600;
    transition: all 0.18s ease;
}
.role-card-actions button:hover { border-color: var(--jade); color: var(--jade); background: var(--surface); }
.role-card-actions .btn-sim { background: var(--jade-deep); border-color: var(--jade-deep); color: #f1e8d5; }
.role-card-actions .btn-sim:hover { background: var(--jade); border-color: var(--jade); color: #fff; }
[data-theme="dark"] .role-card-actions .btn-sim { background: var(--jade); border-color: var(--jade); color: #06110d; }
.role-fineprint { margin-top: 20px; }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.empty-seal {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-bottom: 18px;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    color: var(--muted);
    font-family: var(--font-serif);
    font-size: 24px;
    transform: rotate(-4deg);
}
.empty-state h2 { font-family: var(--font-serif); font-size: 24px; margin-bottom: 6px; }
.empty-state p { color: var(--muted); font-size: 13px; }
.empty-state .btn { margin-top: 20px; }

/* ============================================================
   Sheet & dialogs
   ============================================================ */
dialog {
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}
dialog::backdrop {
    background: rgb(6 20 16 / 55%);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
dialog[open] { animation: dialog-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

.dialog {
    width: min(560px, calc(100vw - 32px));
    max-height: min(88dvh, 820px);
    overflow-y: auto;
    padding: 26px;
}
.dialog-sm { width: min(420px, calc(100vw - 32px)); }
.dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}
.dialog-head h2 { font-family: var(--font-serif); font-size: 25px; line-height: 1.3; }
.dialog-head .eyebrow { margin-bottom: 5px; }
.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px dashed var(--line);
}
.confirm-text { color: var(--text-soft); font-size: 13.5px; line-height: 1.75; }

.dialog.sheet {
    width: min(520px, 100vw);
    max-width: 520px;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0 0 0 auto;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    animation: sheet-in 0.36s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.sheet-inner { display: flex; flex-direction: column; min-height: 100%; }
.sheet-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 24px 26px 18px;
    border-bottom: 1px solid var(--line);
}
.sheet-head h2 { font-family: var(--font-serif); font-size: 24px; line-height: 1.3; }
.sheet-head .eyebrow { margin-bottom: 4px; }
.sheet-body { flex: 1; padding: 22px 26px 32px; overflow-y: auto; }

/* Detail content */
.rd-hero { display: flex; align-items: center; gap: 14px; padding-bottom: 20px; border-bottom: 1px dashed var(--line); }
.rd-avatar {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: linear-gradient(145deg, var(--jade-soft), var(--surface-3));
    border: 1px solid rgb(15 122 90 / 18%);
    color: var(--jade);
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 700;
}
.rd-hero h2 { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-family: var(--font-serif); font-size: 24px; line-height: 1.3; }
.rd-hero p { margin-top: 4px; font-size: 12px; color: var(--muted); }

.rd-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--line); overflow: hidden; }
.rd-metric { padding: 12px 14px; background: var(--surface-2); }
.rd-metric span { display: block; font-size: 10px; letter-spacing: 0.07em; color: var(--muted); }
.rd-metric strong { display: block; margin-top: 2px; font-size: 14px; }

.rd-section { margin-top: 22px; }
.rd-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.rd-section-head h3 { font-family: var(--font-serif); font-size: 17px; }
.rd-section-head .text-btn { font-size: 11.5px; }
.rd-progress { display: flex; flex-direction: column; gap: 7px; }
.rd-progress-top { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.rd-progress-top strong { color: var(--text); }

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}
.switch-row:last-child { border-bottom: 0; }
.switch-row-text strong { display: block; font-size: 13px; font-weight: 600; }
.switch-row-text small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.switch {
    position: relative;
    flex: 0 0 auto;
    width: 40px;
    height: 23px;
    border-radius: 999px;
    background: var(--surface-3);
    border: 1px solid var(--line-strong);
    transition: background 0.2s ease, border-color 0.2s ease;
}
.switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 1px 3px rgb(0 0 0 / 22%);
    transition: transform 0.2s ease;
}
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row input:checked + .switch { background: var(--jade); border-color: var(--jade); }
.switch-row input:checked + .switch::after { transform: translateX(17px); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--jade); outline-offset: 2px; }

.log-view {
    max-height: 230px;
    overflow-y: auto;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
    font-family: var(--font-sans);
    font-size: 11.5px;
    line-height: 1.8;
}
.log-line { display: flex; gap: 10px; padding: 3px 0; color: var(--text-soft); }
.log-line time { flex: 0 0 auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.log-line.is-new { animation: log-in 0.4s ease both; }
.log-empty { color: var(--muted); font-size: 11.5px; }

.rd-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--line); }
.rd-actions .btn { flex: 1 1 auto; min-height: 42px; font-size: 13px; }
.rd-actions .btn-danger-ghost { flex: 0 0 auto; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span { font-size: 11.5px; font-weight: 650; letter-spacing: 0.03em; color: var(--text-soft); }
.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 13.5px;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.field textarea { min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.65; }
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: 0;
    border-color: var(--jade);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgb(15 122 90 / 10%);
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e7f76' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    background-size: 14px;
    padding-right: 32px;
    cursor: pointer;
}
#roleForm .fineprint { margin-top: 16px; }

/* ============================================================
   Tools
   ============================================================ */
.tools-shell {
    display: grid;
    grid-template-columns: 274px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}
.tool-nav {
    position: sticky;
    top: calc(var(--header-h-safe) + 22px);
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    box-shadow: var(--shadow-xs);
}
.tool-tab {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    text-align: left;
    color: var(--text-soft);
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.tool-tab:hover { background: var(--surface-2); border-color: var(--line); }
.tool-tab-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--muted);
    transition: all 0.18s ease;
}
.tool-tab-icon svg { width: 18px; height: 18px; }
.tool-tab > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.tool-tab strong { font-size: 12.5px; font-weight: 650; }
.tool-tab small { margin-top: 3px; font-size: 10.5px; color: var(--muted); }
.tool-tab.is-active {
    border-color: var(--jade-deep);
    background: var(--jade-deep);
    color: #f1e8d6;
    box-shadow: 0 12px 26px -16px rgb(11 61 46 / 70%);
}
.tool-tab.is-active .tool-tab-icon { background: rgb(255 255 255 / 10%); border-color: rgb(255 255 255 / 14%); color: #eddfc0; }
.tool-tab.is-active small { color: rgb(241 232 214 / 58%); }
[data-theme="dark"] .tool-tab.is-active { background: var(--jade); border-color: var(--jade); color: #06110d; }
[data-theme="dark"] .tool-tab.is-active .tool-tab-icon { background: rgb(0 0 0 / 12%); border-color: rgb(0 0 0 / 10%); color: #06110d; }
[data-theme="dark"] .tool-tab.is-active small { color: rgb(0 0 0 / 55%); }

.tool-stage {
    min-width: 0;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.tool-panel { display: none; }
.tool-panel.is-active { display: block; animation: fade-up 0.35s ease both; }
.tool-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--line);
}
.tool-head h2 { font-family: var(--font-serif); font-size: clamp(24px, 2.6vw, 30px); line-height: 1.25; }
.tool-head p:not(.eyebrow) { max-width: 56ch; margin-top: 7px; color: var(--muted); font-size: 12.5px; }
.tool-head .eyebrow { margin-bottom: 6px; }
.tool-head .tag { margin-top: 2px; }

.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 18px; align-items: stretch; }
.calc-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-2);
}
.calc-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
.calc-form-grid .field:last-child { grid-column: span 2; }
.calc-form .field input { background: var(--surface); }

.result-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 24px;
    border-radius: var(--radius);
    background:
        radial-gradient(440px 240px at 90% 0%, rgb(90 214 173 / 20%), transparent 62%),
        linear-gradient(145deg, #135540, #08281e);
    color: #f2ead8;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.result-card::after {
    content: "";
    position: absolute;
    right: -50px;
    bottom: -80px;
    width: 210px;
    height: 210px;
    border: 1px solid rgb(240 223 182 / 10%);
    border-radius: 50%;
    box-shadow: 0 0 0 24px rgb(240 223 182 / 3%);
    pointer-events: none;
}
.result-label { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: rgb(242 234 216 / 56%); }
.result-big {
    position: relative;
    z-index: 1;
    margin: 8px 0 20px;
    font-family: var(--font-serif);
    font-size: clamp(30px, 4vw, 42px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #f0ddb0;
    word-break: break-all;
}
.result-split {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid rgb(240 223 182 / 14%);
}
.result-split small { display: block; font-size: 10px; letter-spacing: 0.06em; color: rgb(242 234 216 / 52%); }
.result-split b { display: block; margin-top: 3px; font-size: 16px; font-weight: 650; color: #f4ecdc; font-variant-numeric: tabular-nums; }
.result-note { position: relative; z-index: 1; margin-top: auto; padding-top: 16px; font-size: 11px; line-height: 1.65; color: rgb(242 234 216 / 58%); }
.spark { margin-top: auto; padding-top: 18px; }
.spark svg { width: 100%; height: 74px; overflow: visible; }
.meter { position: relative; z-index: 1; height: 5px; margin-top: 18px; border-radius: 999px; background: rgb(255 255 255 / 12%); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #e8ca8b, #c1954a); transition: width 0.4s ease; }
.tree-track { position: relative; z-index: 1; display: flex; gap: 3px; margin-top: 18px; }
.tree-track span { flex: 1; height: 5px; border-radius: 2px; background: rgb(255 255 255 / 12%); }
.tree-track span.is-filled { background: linear-gradient(90deg, #e8ca8b, #c1954a); }

.calc-form .field input[type="number"] { font-variant-numeric: tabular-nums; }

/* Week calendar */
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 9px; }
.week-day {
    position: relative;
    min-height: 178px;
    padding: 12px 11px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-2);
    transition: border-color 0.18s ease, background 0.18s ease;
}
.week-day.is-today { border-color: var(--jade); background: var(--jade-soft); box-shadow: inset 0 0 0 1px var(--jade); }
[data-theme="dark"] .week-day.is-today { background: rgb(69 195 154 / 10%); }
.week-day-head { display: flex; flex-direction: column; gap: 1px; padding-bottom: 9px; margin-bottom: 9px; border-bottom: 1px dashed var(--line); }
.week-day-head strong { font-size: 11.5px; }
.week-day-head small { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.week-day.is-today .week-day-head small { color: var(--jade); font-weight: 700; }
.week-events { display: flex; flex-direction: column; gap: 8px; }
.week-event { display: flex; flex-direction: column; gap: 1px; font-size: 10.5px; line-height: 1.4; }
.week-event time { font-size: 9.5px; color: var(--gold); font-weight: 650; letter-spacing: 0.03em; }
.week-event span { color: var(--text-soft); }
.week-day.is-today .week-event span { color: var(--text); }
.today-badge {
    position: absolute;
    top: -7px;
    right: 8px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--jade);
    color: #f2ecdc;
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
}
.today-focus { margin-top: 22px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); }
.event-list { display: flex; flex-direction: column; gap: 1px; }
.event-list li { display: flex; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.event-list li:last-child { border-bottom: 0; }
.event-list time { flex: 0 0 48px; font-size: 11px; font-weight: 650; color: var(--gold); font-variant-numeric: tabular-nums; }
.event-list .event-note { margin-left: auto; color: var(--muted); font-size: 10.5px; }
.event-empty { color: var(--muted); font-size: 12px; }

/* Achievements */
.ach-summary { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.ach-summary > div:first-child { flex: 0 0 auto; display: flex; flex-direction: column; }
.ach-summary span { font-family: var(--font-serif); font-size: 22px; line-height: 1.2; }
.ach-summary small { font-size: 10.5px; color: var(--muted); }
.ach-summary .progress { flex: 1; height: 8px; }
.ach-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ach-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 15px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    cursor: pointer;
    transition: background 0.18s ease;
}
.ach-row:last-child { border-bottom: 0; }
.ach-row:hover { background: var(--surface); }
.ach-row input { width: 19px; height: 19px; flex: 0 0 auto; accent-color: var(--jade); cursor: pointer; }
.ach-row-text { flex: 1; min-width: 0; }
.ach-row-text strong { display: block; font-size: 12.5px; font-weight: 600; }
.ach-row-text small { display: block; margin-top: 1px; font-size: 10.5px; color: var(--muted); }
.ach-reward { flex: 0 0 auto; font-size: 10.5px; color: var(--gold); font-weight: 650; }
.ach-row.is-done .ach-row-text strong { color: var(--muted); text-decoration: line-through; text-decoration-color: rgb(110 127 118 / 45%); }
.ach-row.is-done .ach-row-text small { opacity: 0.65; }
#resetAchBtn { margin-top: 16px; }

/* ============================================================
   Fortune
   ============================================================ */
.fortune-layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
.fortune-drawer {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 34px 30px 26px;
    border-radius: var(--radius-xl);
    background:
        radial-gradient(420px 260px at 80% 4%, rgb(90 214 173 / 18%), transparent 62%),
        radial-gradient(300px 220px at 0% 100%, rgb(210 172 98 / 12%), transparent 70%),
        linear-gradient(155deg, #145640, #08241b);
    color: #f2e9d6;
    text-align: center;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.fortune-drawer::before {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px solid rgb(240 223 182 / 12%);
    border-radius: 20px;
    pointer-events: none;
}
.fortune-drawer .eyebrow { color: #d5b477; }
.fortune-drawer h2 { margin-top: 4px; font-family: var(--font-serif); font-size: 27px; font-weight: 500; color: #f2e2bb; }
.drawer-note { margin: 6px 0 20px; font-size: 12px; color: rgb(242 233 214 / 58%); }
.fortune-drawer .btn { min-width: 170px; }
.countdown { margin-top: 14px; font-size: 10.5px; letter-spacing: 0.04em; color: rgb(242 233 214 / 48%); font-variant-numeric: tabular-nums; }
.drawer-pattern {
    position: absolute;
    right: -70px;
    bottom: -80px;
    width: 240px;
    height: 240px;
    border: 1px solid rgb(240 223 182 / 9%);
    border-radius: 50%;
    box-shadow: 0 0 0 26px rgb(240 223 182 / 3%), 0 0 0 52px rgb(240 223 182 / 2%);
    pointer-events: none;
}

.bamboo { position: relative; width: 150px; height: 190px; margin: 0 auto 16px; }
.tube {
    position: absolute;
    left: 50%;
    bottom: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 108px;
    height: 122px;
    border-radius: 14px 14px 20px 20px;
    background:
        linear-gradient(90deg, rgb(255 255 255 / 16%), transparent 26%, transparent 70%, rgb(0 0 0 / 18%)),
        linear-gradient(150deg, #d2a45f, #a97736 55%, #815424);
    color: #4c2f0e;
    font-family: var(--font-serif);
    font-size: 35px;
    font-weight: 700;
    transform: translateX(-50%);
    box-shadow: inset 0 2px 0 rgb(255 255 255 / 22%), 0 18px 30px -16px rgb(0 0 0 / 60%);
}
.tube::before {
    content: "";
    position: absolute;
    inset: 7px;
    border: 1px solid rgb(76 47 14 / 22%);
    border-radius: 10px 10px 15px 15px;
}
.tube::after {
    content: "";
    position: absolute;
    top: -5px;
    left: 7px;
    right: 7px;
    height: 9px;
    border-radius: 50%;
    background: linear-gradient(180deg, #e2b978, #9b6d31);
    box-shadow: inset 0 2px 3px rgb(255 255 255 / 25%);
}
.stick {
    position: absolute;
    bottom: 100px;
    left: 50%;
    width: 8px;
    height: 96px;
    border-radius: 4px 4px 2px 2px;
    background: linear-gradient(180deg, #f5e5c2, #d9bf8d);
    box-shadow: 0 2px 6px rgb(0 0 0 / 18%);
    transform-origin: bottom center;
}
.stick::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 0;
    right: 0;
    height: 12px;
    border-radius: 3px;
    background: #a53f2e;
}
.stick-1 { transform: translateX(-50%) rotate(-13deg); height: 88px; }
.stick-2 { transform: translateX(-50%) rotate(-6deg); height: 102px; }
.stick-3 { transform: translateX(-50%) rotate(1deg); height: 94px; }
.stick-4 { transform: translateX(-50%) rotate(8deg); height: 100px; }
.stick-5 { transform: translateX(-50%) rotate(15deg); height: 86px; }
.bamboo.is-shaking .stick-1 { animation: stick-shake 0.55s ease-in-out; }
.bamboo.is-shaking .stick-2 { animation: stick-shake 0.6s ease-in-out 0.04s; }
.bamboo.is-shaking .stick-3 { animation: stick-shake 0.52s ease-in-out 0.08s; }
.bamboo.is-shaking .stick-4 { animation: stick-shake 0.58s ease-in-out 0.12s; }
.bamboo.is-shaking .stick-5 { animation: stick-shake 0.54s ease-in-out 0.16s; }

.fortune-result {
    position: relative;
    min-height: 520px;
    scroll-margin-top: calc(var(--header-h-safe) + 18px);
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(500px 300px at 100% 0%, rgb(210 172 98 / 8%), transparent 60%),
        var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.fortune-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 450px;
    text-align: center;
}
.placeholder-seal {
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    margin-bottom: 24px;
    border: 1px solid var(--line-strong);
    border-radius: 28px;
    color: var(--line-strong);
    font-family: var(--font-serif);
    font-size: 44px;
    transform: rotate(-4deg);
}
.fortune-placeholder h2 { font-family: var(--font-serif); font-size: 28px; margin-bottom: 8px; }
.fortune-placeholder p { color: var(--muted); font-size: 12.5px; line-height: 1.9; }

.fortune-reveal { position: relative; animation: fade-up 0.6s ease both; }
.fortune-result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.fortune-level {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}
.fortune-level::before { content: "✦"; font-size: 10px; }
.tone-great { background: var(--gold-soft); color: var(--gold); border: 1px solid rgb(176 136 60 / 26%); }
.tone-good { background: var(--jade-soft); color: var(--jade); border: 1px solid rgb(15 122 90 / 22%); }
.tone-mid { background: var(--surface-3); color: var(--text-soft); border: 1px solid var(--line-strong); }
.fortune-date { font-size: 11px; letter-spacing: 0.08em; color: var(--muted); }
.fortune-title {
    font-family: var(--font-serif);
    font-size: clamp(38px, 5vw, 52px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin-bottom: 20px;
}
.fortune-poem { display: flex; flex-direction: column; gap: 2px; padding-left: 18px; border-left: 2px solid var(--gold); }
.fortune-poem p { font-family: var(--font-serif); font-size: clamp(17px, 2vw, 20px); line-height: 1.75; letter-spacing: 0.06em; color: var(--text-soft); }
.fortune-read { margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--line); }
.fortune-read h3 { margin-bottom: 6px; font-size: 11px; letter-spacing: 0.16em; color: var(--gold); font-weight: 700; }
.fortune-read p { max-width: 62ch; font-size: 13px; line-height: 1.9; color: var(--text-soft); }
.fortune-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin-top: 22px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--line);
    overflow: hidden;
}
.fortune-meta > div { padding: 10px 12px; background: var(--surface-2); }
.fortune-meta small { display: block; font-size: 9.5px; letter-spacing: 0.06em; color: var(--muted); }
.fortune-meta strong { display: block; margin-top: 2px; font-size: 12.5px; }
.fortune-yiji { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.fortune-yiji > div { display: flex; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.fortune-yiji .yiji-mark { display: grid; place-items: center; flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; background: var(--jade-soft); color: var(--jade); font-family: var(--font-serif); font-size: 14px; font-weight: 700; }
.fortune-yiji .is-ji .yiji-mark { background: var(--danger-soft); color: var(--danger); }
.fortune-yiji ul { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--text-soft); align-self: center; }
.fortune-yiji li { position: relative; padding-left: 9px; }
.fortune-yiji li::before { content: "·"; position: absolute; left: 0; color: var(--muted); }
.fortune-advice { margin-top: 18px; padding: 13px 15px; border-radius: 12px; background: var(--gold-soft); color: #6d5221; font-size: 12px; line-height: 1.7; }
[data-theme="dark"] .fortune-advice { color: #e6cfa0; }
.fortune-watermark {
    position: absolute;
    right: -14px;
    top: 40px;
    font-family: var(--font-serif);
    font-size: 190px;
    line-height: 1;
    color: rgb(24 39 34 / 3.5%);
    pointer-events: none;
}
[data-theme="dark"] .fortune-watermark { color: rgb(255 255 255 / 3.5%); }

.fortune-history { margin-top: 40px; }
.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.history-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}
.history-card small { font-size: 10px; letter-spacing: 0.06em; color: var(--muted); }
.history-card strong { font-family: var(--font-serif); font-size: 18px; }
.history-card .history-level { align-self: flex-start; margin-top: 4px; padding: 2px 8px; border-radius: 999px; font-size: 9.5px; font-weight: 700; background: var(--gold-soft); color: var(--gold); }
.history-empty { grid-column: 1 / -1; padding: 26px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); font-size: 12px; }

/* ============================================================
   Profile
   ============================================================ */
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.profile-card {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    grid-template-areas: "identity form" "stats form";
    gap: 20px 34px;
    align-items: center;
    padding: 30px;
}
.profile-identity { grid-area: identity; display: flex; align-items: center; gap: 16px; }
.profile-identity h2 { font-family: var(--font-serif); font-size: 26px; line-height: 1.3; }
.profile-identity p { margin-top: 3px; font-size: 12px; color: var(--muted); }
.profile-identity #profileTitle { color: var(--gold); font-weight: 650; }
.profile-stats {
    grid-area: stats;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px dashed var(--line);
}
.profile-stats > div { display: flex; flex-direction: column; gap: 2px; padding-top: 14px; }
.profile-stats strong { font-family: var(--font-serif); font-size: 24px; line-height: 1.2; }
.profile-stats span { font-size: 10.5px; color: var(--muted); }
.profile-form { grid-area: form; display: flex; flex-direction: column; gap: 14px; }
.profile-form .btn { align-self: flex-start; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.theme-option {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
    text-align: left;
    transition: border-color 0.18s ease, background 0.18s ease;
}
.theme-option:hover { border-color: var(--line-strong); }
.theme-option.is-active { border-color: var(--jade); background: var(--jade-soft); box-shadow: inset 0 0 0 1px var(--jade); }
.theme-option strong { margin-top: 6px; font-size: 12px; }
.theme-option small { font-size: 9.5px; color: var(--muted); }
.theme-swatch { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 7px; }
.swatch-light { background: linear-gradient(135deg, #fffdf8 50%, #e9e2d4 50%); }
.swatch-dark { background: linear-gradient(135deg, #121e19 50%, #0b1411 50%); }
.swatch-system { background: linear-gradient(135deg, #fffdf8 50%, #121e19 50%); }

.panel-text { color: var(--text-soft); font-size: 12.5px; line-height: 1.8; }
.data-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.data-actions .btn { min-height: 40px; font-size: 12.5px; }
.install-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px dashed var(--line);
}
.install-row strong { display: block; font-size: 12.5px; }
.install-row small { display: block; margin-top: 1px; font-size: 10.5px; color: var(--muted); }

.feedback-form { display: flex; flex-direction: column; gap: 12px; }
.feedback-form .btn { align-self: flex-start; }
.ticket-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.ticket-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.ticket-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.ticket-meta span { font-size: 9.5px; color: var(--muted); }
.ticket-cat { display: inline-flex; padding: 1px 7px; border-radius: 999px; background: var(--jade-soft); color: var(--jade) !important; font-weight: 650; }
.ticket-item p { font-size: 12px; line-height: 1.65; color: var(--text-soft); word-break: break-word; }
.ticket-empty { margin-top: 16px; padding: 18px; border: 1px dashed var(--line); border-radius: 11px; text-align: center; color: var(--muted); font-size: 11.5px; }

.about-list { display: flex; flex-direction: column; margin: 16px 0; border-top: 1px dashed var(--line); }
.about-list li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 11.5px; }
.about-list li span { color: var(--muted); }
.about-list li strong { font-weight: 600; text-align: right; }

/* ============================================================
   Search, notices, toast
   ============================================================ */
.search-dialog {
    width: min(620px, calc(100vw - 28px));
    max-height: min(78dvh, 680px);
    margin-top: max(6dvh, 26px);
    padding: 0;
    border-radius: 18px;
    overflow: hidden;
}
.search-input-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}
.search-input-row svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--jade); }
.search-input-row input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 15px;
    color: var(--text);
}
.search-input-row input::placeholder { color: var(--muted); }
.search-results { max-height: min(56dvh, 480px); overflow-y: auto; padding: 6px; }
.search-group-label { padding: 10px 12px 6px; font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.search-result {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    text-align: left;
    color: var(--text);
}
.search-result:hover, .search-result.is-active { background: var(--surface-2); }
.search-result-icon { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; background: var(--jade-soft); color: var(--jade); font-family: var(--font-serif); font-size: 13px; font-weight: 700; }
.search-result-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.search-result-text strong { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-text small { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-type { flex: 0 0 auto; font-size: 9.5px; color: var(--muted); }
.search-empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 12.5px; }
.search-cancel {
    display: none;
    flex: 0 0 auto;
    padding: 6px 4px;
    border: 0;
    background: transparent;
    color: var(--jade);
    font-size: 12px;
    font-weight: 600;
}
.search-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 10px;
}

.notice-list { display: flex; flex-direction: column; gap: 12px; }
.notice-item { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.notice-item-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.notice-item h3 { font-family: var(--font-serif); font-size: 17px; line-height: 1.4; }
.notice-item time { flex: 0 0 auto; font-size: 9.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.notice-item p { font-size: 12px; line-height: 1.75; color: var(--text-soft); }

.toast-stack {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 120;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 9px;
    max-width: 340px;
    padding: 11px 15px;
    border: 1px solid rgb(255 255 255 / 12%);
    border-radius: 11px;
    background: color-mix(in srgb, var(--jade-deep) 94%, transparent);
    color: #f2ecdd;
    font-size: 12.5px;
    line-height: 1.5;
    box-shadow: var(--shadow-md);
    animation: toast-in 0.3s ease both;
    pointer-events: auto;
}
.toast::before { content: "✦"; color: var(--gold-bright); font-size: 11px; }
.toast.is-error { background: color-mix(in srgb, #5b241b 94%, transparent); }
.toast.is-error::before { content: "!"; font-weight: 800; color: #f0b09f; }
.toast.is-leaving { animation: toast-out 0.25s ease both; }

/* ============================================================
   Motion
   ============================================================ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.is-visible { opacity: 1; transform: none; }

@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes sheet-in { from { opacity: 0.5; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes orbit-spin { to { transform: rotate(360deg); } }
@keyframes orbit-spin-rev { to { transform: rotate(-360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes stick-shake {
    0%, 100% { margin-left: 0; }
    20% { margin-left: -4px; }
    40% { margin-left: 5px; }
    60% { margin-left: -3px; }
    80% { margin-left: 3px; }
}
@keyframes log-in { from { opacity: 0; background: rgb(15 122 90 / 8%); } to { opacity: 1; background: transparent; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1120px) {
    .hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 20px; }
    .orbit-system { max-width: 410px; }
    .chip-c { display: none; }
    .week-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .week-day { min-height: 150px; }
    .tools-shell { grid-template-columns: 250px minmax(0, 1fr); }
    .tool-stage { padding: 24px; }
}

@media (max-width: 980px) {
    :root { --header-h: 62px; }

    .main-nav { display: none; }
    .header-inner { padding: 0 20px; gap: 16px; }
    .bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 70;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--line);
        background: color-mix(in srgb, var(--surface) 92%, transparent);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        box-shadow: 0 -12px 30px -24px rgb(24 39 34 / 48%);
    }
    .bottom-nav a {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        padding: 4px 2px 2px;
        border-radius: 10px;
        color: var(--muted);
        font-size: 10px;
        font-weight: 600;
        transition: color 0.18s ease;
    }
    .bottom-nav svg { width: 21px; height: 21px; }
    .bottom-nav a.is-active { color: var(--jade); }
    .bottom-nav a.is-active::before {
        content: "";
        position: absolute;
        top: -7px;
        width: 20px;
        height: 2px;
        border-radius: 999px;
        background: var(--jade);
    }
    .page { padding: 0 20px 60px; }
    .site-footer { margin-bottom: 70px; }
    .toast-stack { bottom: calc(82px + env(safe-area-inset-bottom)); right: 16px; left: 16px; align-items: center; }
    .toast { width: 100%; max-width: 420px; }

    .hero { grid-template-columns: 1fr; gap: 18px; padding: 48px 0 36px; }
    .hero-copy { max-width: 680px; }
    .hero-copy h1 { font-size: clamp(42px, 8vw, 64px); }
    .hero-visual { margin-top: 4px; }
    .orbit-system { max-width: 370px; }
    .home-grid { grid-template-columns: 1fr; }
    .today-panel { min-height: 220px; }
    .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cta-band { flex-direction: column; align-items: flex-start; padding: 34px; }
    .footer-inner { grid-template-columns: 1fr; }
    .footer-note { align-self: start; }
    .page-head { padding: 44px 0 24px; flex-wrap: wrap; }

    .tools-shell { grid-template-columns: 1fr; }
    .tool-nav {
        position: static;
        flex-direction: row;
        gap: 6px;
        padding: 6px;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .tool-nav::-webkit-scrollbar { display: none; }
    .tool-tab { flex: 0 0 auto; min-width: 172px; grid-template-columns: 30px minmax(0, 1fr); padding: 8px; }
    .tool-tab-icon { width: 30px; height: 30px; }
    .tool-tab-icon svg { width: 16px; height: 16px; }
    .tool-tab small { display: none; }
    .tool-stage { padding: 22px; }

    .fortune-layout { grid-template-columns: 1fr; }
    .fortune-drawer { padding: 30px 24px 24px; }
    .fortune-result { min-height: 0; }
    .fortune-placeholder { min-height: 320px; }

    .profile-grid { grid-template-columns: 1fr; }
    .profile-card {
        grid-template-columns: 1fr;
        grid-template-areas: "identity" "stats" "form";
        gap: 18px;
        padding: 24px;
    }
    .profile-form { margin-top: 4px; }
}

@media (max-width: 760px) {
    .header-inner { padding: 0 16px; }
    .page { padding: 0 16px 54px; }
    .page-head { padding: 36px 0 22px; gap: 16px; align-items: flex-start; flex-direction: column; }
    .page-head h1 { font-size: clamp(30px, 8vw, 40px); }
    .page-desc { margin-top: 8px; font-size: 13px; }
    .toolbar { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
    .search-field { flex: 0 0 auto; height: 44px; }
    .filter-chips { justify-content: flex-start; overflow-x: auto; padding-bottom: 2px; }
    .select-field select { width: 100%; height: 42px; }
    .role-grid { grid-template-columns: 1fr; }
    .role-grid .role-card { padding: 18px; }
    .role-fineprint { font-size: 11.5px; }
    .stat-strip { margin-bottom: 28px; }
    .stat-item { padding: 17px 18px; }
    .stat-item strong { font-size: 26px; }
    .home-grid { margin-bottom: 32px; }
    .home-section { margin-bottom: 32px; }
    .panel { padding: 20px; }
    .notice-panel, .today-panel { padding: 22px; }
    .section-head { align-items: flex-start; }
    .entry-grid { gap: 10px; }
    .entry-card { padding: 16px; gap: 12px; }
    .cta-band { padding: 26px; border-radius: var(--radius-lg); }
    .cta-band .btn { width: 100%; }
    .footer-inner { padding: 26px 16px 30px; }
    .footer-links { gap: 8px 16px; }

    .tool-stage { padding: 18px; }
    .tool-head { margin-bottom: 18px; padding-bottom: 16px; }
    .calc-grid { grid-template-columns: 1fr; }
    .result-card { min-height: 280px; }
    .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .week-day { min-height: 0; }
    .ach-summary { align-items: flex-start; }
    .form-grid { grid-template-columns: 1fr; }
    .dialog { padding: 22px; }
    .dialog.sheet { width: 100vw; max-width: 100vw; height: 94dvh; margin-top: auto; margin-bottom: 0; border-radius: 20px 20px 0 0; border: 1px solid var(--line); border-bottom: 0; animation: sheet-up 0.34s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
    .sheet-head { padding: 20px 20px 16px; }
    .sheet-body { padding: 18px 20px calc(28px + env(safe-area-inset-bottom)); }
    .fortune-result { padding: 24px; }
    .fortune-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fortune-yiji { grid-template-columns: 1fr; }
    .profile-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .field-row { grid-template-columns: 1fr; }
    .theme-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .theme-option { padding: 9px; }
    .theme-swatch { height: 26px; }
    .data-actions .btn { flex: 1 1 auto; }
    .toast-stack { bottom: calc(78px + env(safe-area-inset-bottom)); }
}

@media (max-width: 540px) {
    .header-actions { gap: 6px; }
    .brand-text small { display: none; }
    .brand-text strong { font-size: 16px; }
    .brand-seal { width: 36px; height: 36px; font-size: 19px; }
    .search-trigger { width: 40px; padding: 0; justify-content: center; }
    .search-trigger .search-label, .search-box > kbd { display: none; }
    .profile-chip { padding: 0 4px; border-color: transparent; background: transparent; }
    .profile-chip-name { display: none; }
    .hero { padding-top: 36px; }
    .hero-copy h1 { font-size: clamp(38px, 11vw, 52px); }
    .hero-actions .btn { flex: 1 1 auto; font-size: 13px; }
    .hero-badges { gap: 7px 13px; }
    .orbit-system { max-width: 300px; }
    .orbit-chip { font-size: 10px; padding: 7px 10px; }
    .chip-a { right: -1%; }
    .chip-b { left: -1%; }
    .core-seal { font-size: 58px; }
    .orbit-core small { font-size: 7px; letter-spacing: 0.2em; }
    .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-item:nth-child(2) { border-right: 0; }
    .stat-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .stat-item:nth-child(4) { border-right: 0; }
    .entry-grid { grid-template-columns: 1fr; }
    .entry-card { flex-direction: row; align-items: center; }
    .entry-body { flex: 1; }
    .entry-arrow { margin-top: 0; }
    .notice-foot { flex-direction: column; align-items: flex-start; gap: 10px; }
    .today-panel { min-height: 0; }
    .today-panel h2 { margin-top: 22px; }
    .today-action { padding-top: 22px; }
    .cta-band { padding: 22px; }
    .cta-copy h2 { font-size: 23px; }
    .footer-brand { margin-bottom: 5px; }
    .bottom-nav { padding-inline: 6px; }
    .bottom-nav a { font-size: 9.5px; }

    .tool-head { flex-direction: column; gap: 10px; }
    .tool-head .tag { align-self: flex-start; }
    .tool-stage { padding: 16px; border-radius: var(--radius); }
    .tool-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
        border-radius: var(--radius);
    }
    .tool-tab { min-width: 0; }
    .calc-form { padding: 14px; }
    .result-card { padding: 20px; }
    .result-big { font-size: 30px; }
    .week-grid { grid-template-columns: 1fr; }
    .week-day { min-height: 0; }
    .week-events { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ach-row { padding: 11px 12px; gap: 10px; }
    .ach-reward { font-size: 9.5px; }
    .fortune-drawer { padding: 26px 18px 22px; }
    .fortune-result { padding: 20px; border-radius: var(--radius-lg); }
    .fortune-title { font-size: 36px; }
    .fortune-poem p { font-size: 16px; }
    .fortune-watermark { display: none; }
    .history-grid { grid-template-columns: 1fr; }
    .profile-card { padding: 20px; }
    .profile-identity { gap: 12px; }
    .avatar-lg { width: 60px; height: 60px; font-size: 25px; border-radius: 19px; }
    .profile-identity h2 { font-size: 22px; }
    .theme-options { grid-template-columns: 1fr; }
    .theme-option { flex-direction: row; align-items: center; gap: 10px; }
    .theme-swatch { width: 34px; height: 26px; flex: 0 0 auto; }
    .theme-option strong { margin-top: 0; }
    .theme-option small { margin-left: auto; }
    .dialog { width: calc(100vw - 22px); padding: 20px; border-radius: 18px; }
    .dialog-actions { flex-direction: column-reverse; }
    .dialog-actions .btn { width: 100%; }
    .search-dialog { width: calc(100vw - 24px); margin-top: 9dvh; }
    .search-input-row { padding: 13px 14px; }
    .search-input-row kbd, .search-foot { display: none; }
    .search-cancel { display: inline-flex; }
    .search-results { max-height: min(66dvh, 520px); }
    .sheet-head h2 { font-size: 21px; }
    .rd-hero h2 { font-size: 21px; }
    .toast-stack { right: 12px; left: 12px; }
}

@media (max-width: 390px) {
    .week-events { grid-template-columns: 1fr; }
    .hero-badges li { font-size: 11px; }
    .stat-item { padding: 14px; }
    .fortune-meta { grid-template-columns: 1fr; }
    .fortune-yiji ul { justify-content: flex-start; }
    .role-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .role-metric:nth-child(2) { border-right: 0; }
    .role-metric:last-child { display: none; }
}

@keyframes sheet-up { from { opacity: 0.5; transform: translateY(40px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
}



