/* ==========================================================================
   片刻私语 · Modern Blue / White UI
   ========================================================================== */

/* --------------------------------------------------------------- 设计变量 */
:root {
    --brand-50: #eff6ff;
    --brand-100: #dbeafe;
    --brand-200: #bfdbfe;
    --brand-300: #93c5fd;
    --brand-400: #60a5fa;
    --brand-500: #3b82f6;
    --brand-600: #2563eb;
    --brand-700: #1d4ed8;

    --ink-900: #0b1220;
    --ink-800: #131c2e;
    --ink-700: #1e293b;
    --ink-600: #475569;
    --ink-500: #64748b;
    --ink-400: #94a3b8;
    --ink-300: #cbd5e1;

    --bg: #f4f8ff;
    --bg-soft: #eef5ff;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --line: #e2e8f0;
    --line-soft: #eef2f7;

    --ok: #0d9488;
    --warn: #d97706;
    --danger: #dc2626;
    --danger-soft: #fef2f2;

    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-sm: 0 4px 12px -6px rgba(15, 23, 42, .12);
    --shadow-md: 0 18px 40px -24px rgba(37, 99, 235, .35);
    --shadow-lg: 0 40px 80px -48px rgba(37, 99, 235, .5);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    --header-h: 64px;
    color-scheme: light;
}

[data-theme="dark"] {
    --brand-50: #0f1d33;
    --brand-100: #14284a;
    --brand-200: #1c3560;
    --brand-300: #2a4a80;
    --brand-400: #4b7bd4;
    --brand-500: #5b8def;
    --brand-600: #6f9cf5;
    --brand-700: #9dbcf9;

    --ink-900: #eef4ff;
    --ink-800: #dbe6fa;
    --ink-700: #c3d3ec;
    --ink-600: #a5b8d4;
    --ink-500: #8497b4;
    --ink-400: #6b7e9c;
    --ink-300: #4a5b76;

    --bg: #070d18;
    --bg-soft: #0b1424;
    --surface: #0f1a2b;
    --surface-2: #131f33;
    --surface-3: #18263d;
    --line: #1e2c44;
    --line-soft: #182439;

    --danger-soft: #2a1218;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-sm: 0 4px 14px -6px rgba(0, 0, 0, .5);
    --shadow-md: 0 18px 40px -24px rgba(0, 0, 0, .8);
    --shadow-lg: 0 40px 80px -48px rgba(0, 0, 0, .9);
    color-scheme: dark;
}

/* --------------------------------------------------------------- 基础重置 */
*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink-800);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(37, 99, 235, .18); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--ink-300);
    border-radius: 99px;
    border: 3px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-400); background-clip: content-box; }

/* --------------------------------------------------------------- 背景装饰 */
.ambient {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(1000px 620px at 12% -12%, rgba(219, 234, 254, .9) 0%, transparent 62%),
        radial-gradient(820px 520px at 92% 4%, rgba(224, 242, 254, .85) 0%, transparent 58%),
        var(--bg);
}

[data-theme="dark"] .ambient {
    background:
        radial-gradient(900px 560px at 10% -14%, rgba(30, 64, 175, .35) 0%, transparent 62%),
        radial-gradient(760px 520px at 94% 2%, rgba(14, 116, 144, .22) 0%, transparent 58%),
        var(--bg);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .5;
    animation: float 18s ease-in-out infinite;
}

.orb-a {
    width: 420px;
    height: 420px;
    left: -120px;
    top: 120px;
    background: radial-gradient(circle at 30% 30%, #93c5fd, transparent 70%);
}

.orb-b {
    width: 520px;
    height: 520px;
    right: -180px;
    top: -120px;
    background: radial-gradient(circle at 60% 40%, #bae6fd, transparent 70%);
    animation-delay: -8s;
}

.grid-lines {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(37, 99, 235, .045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(37, 99, 235, .045) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
}

@keyframes float {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(24px, -26px, 0) scale(1.06); }
}

/* --------------------------------------------------------------- 通用布局 */
.shell {
    width: min(1160px, calc(100% - 40px));
    margin-inline: auto;
}

.section { padding: 76px 0 10px; }

.section-head {
    text-align: center;
    max-width: 620px;
    margin: 0 auto 38px;
}

.section-head h2 {
    font-size: clamp(24px, 3vw, 32px);
    letter-spacing: -.6px;
    color: var(--ink-900);
    margin-bottom: 10px;
}

.section-head p { color: var(--ink-500); font-size: 15px; }

/* --------------------------------------------------------------- 品牌 */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    color: inherit;
}

.brand:hover { text-decoration: none; }

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, #60a5fa, #2563eb 60%, #1d4ed8);
    box-shadow: 0 12px 26px -14px rgba(37, 99, 235, .9), inset 0 1px 0 rgba(255, 255, 255, .28);
    flex: none;
}

.brand-mark svg { width: 23px; height: 23px; }
.brand-mark.sm { width: 36px; height: 36px; border-radius: 11px; }
.brand-mark.sm svg { width: 21px; height: 21px; }
.brand-mark.lg { width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 14px; }
.brand-mark.lg svg { width: 31px; height: 31px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 17px; letter-spacing: .2px; color: var(--ink-900); }
.brand-text small { font-size: 9.5px; letter-spacing: 2.1px; color: var(--ink-400); font-weight: 600; }

/* --------------------------------------------------------------- 顶栏 */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    border-bottom: 1px solid rgba(226, 232, 240, .6);
}

[data-theme="dark"] .site-header { border-bottom-color: var(--line); }

.header-inner {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-select {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    color: var(--ink-500);
    box-shadow: var(--shadow-xs);
    transition: border-color .18s, box-shadow .18s;
}

.tool-select:hover { border-color: var(--brand-200); }
.tool-select:focus-within { border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(59, 130, 246, .13); }
.tool-select svg { width: 17px; height: 17px; }

.tool-select select {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-700);
    padding-inline-end: 4px;
    max-width: 118px;
    cursor: pointer;
    outline: none;
}

.tool-tz select { max-width: 150px; }

.icon-btn {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-500);
    box-shadow: var(--shadow-xs);
    transition: .18s;
}

.icon-btn:hover { color: var(--brand-600); border-color: var(--brand-200); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.xs { width: 28px; height: 28px; border: 0; box-shadow: none; background: transparent; }
.icon-btn.xs svg { width: 15px; height: 15px; }

.i-moon { display: none; }
[data-theme="dark"] .i-sun { display: none; }
[data-theme="dark"] .i-moon { display: block; }

/* --------------------------------------------------------------- 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 44px;
    padding: 0 20px;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 650;
    letter-spacing: .1px;
    border: 1px solid transparent;
    transition: transform .16s, box-shadow .16s, background .16s, border-color .16s;
    white-space: nowrap;
    user-select: none;
}

.btn svg { width: 18px; height: 18px; }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.995); }
.btn[disabled] { opacity: .55; pointer-events: none; }

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #4b8dfa, #2563eb 55%, #1d4ed8);
    box-shadow: 0 14px 28px -16px rgba(37, 99, 235, .95), inset 0 1px 0 rgba(255, 255, 255, .25);
}

.btn-primary:hover { box-shadow: 0 20px 34px -18px rgba(37, 99, 235, 1); transform: translateY(-1px); }

.btn-soft {
    color: var(--brand-700);
    background: var(--surface);
    border-color: var(--brand-200);
    box-shadow: var(--shadow-xs);
}

.btn-soft:hover {
    background: var(--brand-50);
    border-color: var(--brand-300);
    transform: translateY(-1px);
}

.btn-ghost {
    color: var(--ink-600);
    background: var(--surface);
    border-color: var(--line);
    box-shadow: var(--shadow-xs);
}

.btn-ghost:hover { color: var(--ink-900); border-color: var(--ink-300); }

.btn-danger { color: #fff; background: linear-gradient(135deg, #ef4444, #dc2626); }
.btn-block { width: 100%; }
.btn-lg { height: 50px; border-radius: 14px; font-size: 15.5px; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }

/* --------------------------------------------------------------- 表单 */
.field { margin-bottom: 16px; }

.field label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 650;
    color: var(--ink-700);
    margin-bottom: 7px;
}

.field .opt {
    font-weight: 500;
    font-size: 11.5px;
    color: var(--ink-400);
    background: var(--surface-3);
    border-radius: 99px;
    padding: 1px 7px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
select {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink-800);
    font-size: 14.5px;
    outline: none;
    transition: border-color .18s, box-shadow .18s, background .18s;
}

textarea { height: auto; padding: 12px 14px; resize: none; }

input::placeholder, textarea::placeholder { color: var(--ink-400); }

input:hover, textarea:hover, select:hover { border-color: var(--ink-300); }

input:focus, textarea:focus, select:focus {
    border-color: var(--brand-400);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .13);
}

.input-code {
    font-family: var(--mono);
    font-size: 17px;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.hint { font-size: 12.5px; color: var(--ink-400); margin-top: 7px; line-height: 1.55; }
.form-note { font-size: 12.5px; color: var(--ink-400); text-align: center; margin-top: 12px; line-height: 1.6; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 分段选择 */
.seg {
    display: flex;
    gap: 6px;
    padding: 5px;
    background: var(--surface-3);
    border-radius: 13px;
    overflow-x: auto;
    scrollbar-width: none;
}

.seg::-webkit-scrollbar { display: none; }

.seg-item {
    flex: 1 0 auto;
    min-width: 56px;
    height: 36px;
    padding: 0 12px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-500);
    transition: .16s;
}

.seg-item:hover { color: var(--ink-800); }

.seg-item.is-active {
    background: var(--surface);
    color: var(--brand-600);
    box-shadow: var(--shadow-sm);
}

/* 开关 */
.switch {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    cursor: pointer;
    padding: 10px 0 2px;
}

.switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch-track {
    width: 42px;
    height: 24px;
    border-radius: 99px;
    background: var(--ink-300);
    flex: none;
    position: relative;
    transition: background .2s;
    margin-top: 2px;
}

.switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: transform .2s;
}

.switch input:checked + .switch-track { background: var(--brand-600); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 4px rgba(59, 130, 246, .18); }

.switch-text { display: flex; flex-direction: column; line-height: 1.4; }
.switch-text strong { font-size: 13.5px; color: var(--ink-700); font-weight: 650; }
.switch-text small { font-size: 12px; color: var(--ink-400); }

/* 展开区 */
.advanced { margin: 2px 0 18px; border-top: 1px dashed var(--line); padding-top: 12px; }

.advanced summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 650;
    color: var(--ink-500);
    cursor: pointer;
    list-style: none;
    padding: 4px 0;
    transition: color .16s;
}

.advanced summary::-webkit-details-marker { display: none; }
.advanced summary:hover { color: var(--brand-600); }
.advanced summary svg { width: 16px; height: 16px; transition: transform .2s; }
.advanced[open] summary svg { transform: rotate(180deg); }
.advanced-body { padding-top: 14px; }

/* --------------------------------------------------------------- 首页 Hero */
.hero { padding: 74px 0 46px; text-align: center; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 14px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .75);
    border: 1px solid var(--brand-100);
    color: var(--brand-700);
    font-size: 12.5px;
    font-weight: 650;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
}

[data-theme="dark"] .hero-badge { background: rgba(15, 26, 43, .7); }

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .55);
    animation: pulse 2.2s infinite;
    flex: none;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.hero-title {
    margin: 22px auto 18px;
    font-size: clamp(34px, 6.2vw, 60px);
    line-height: 1.12;
    letter-spacing: -1.6px;
    font-weight: 800;
    color: var(--ink-900);
    max-width: 820px;
}

.grad-text {
    background: linear-gradient(110deg, #2563eb 0%, #3b82f6 34%, #0ea5e9 72%, #2563eb 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shine 9s linear infinite;
}

@keyframes shine {
    to { background-position: 200% center; }
}

.hero-sub {
    max-width: 590px;
    margin: 0 auto;
    color: var(--ink-500);
    font-size: clamp(14.5px, 1.7vw, 17px);
    line-height: 1.75;
}

.hero-stats {
    display: inline-flex;
    align-items: stretch;
    gap: 0;
    margin-top: 34px;
    padding: 14px 8px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .72);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}

[data-theme="dark"] .hero-stats { background: rgba(15, 26, 43, .7); }

.hero-stats .stat {
    padding: 0 30px;
    text-align: center;
    border-right: 1px solid var(--line-soft);
}

.hero-stats .stat:last-child { border-right: 0; }

.hero-stats strong {
    display: block;
    font-size: 23px;
    font-weight: 750;
    letter-spacing: -.5px;
    color: var(--ink-900);
    font-variant-numeric: tabular-nums;
}

.hero-stats span { font-size: 12px; color: var(--ink-400); }

/* --------------------------------------------------------------- 卡片 */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 26px;
    box-shadow: var(--shadow-md);
    position: relative;
}

.duo {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 22px;
    align-items: start;
    padding-top: 14px;
}

.stack { display: grid; gap: 18px; }

.card-head { margin-bottom: 20px; }

.card-head h2 {
    font-size: 21px;
    letter-spacing: -.45px;
    color: var(--ink-900);
    margin: 9px 0 5px;
}

.card-head p { font-size: 13.5px; color: var(--ink-500); line-height: 1.65; }

.chip {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 99px;
    background: var(--surface-3);
    color: var(--ink-500);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .3px;
}

.chip-blue { background: var(--brand-50); color: var(--brand-700); }

.create-card { padding: 28px; }

.recover-card { padding: 0; overflow: hidden; }

.recover-card > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    cursor: pointer;
    list-style: none;
    transition: background .16s;
}

.recover-card > summary::-webkit-details-marker { display: none; }
.recover-card > summary:hover { background: var(--surface-2); }

.recover-title {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    font-weight: 650;
    color: var(--ink-700);
}

.recover-title svg { width: 18px; height: 18px; color: var(--brand-500); }
.recover-card .chev { width: 16px; height: 16px; color: var(--ink-400); transition: transform .2s; }
.recover-card[open] .chev { transform: rotate(180deg); }

.recover-card form {
    padding: 4px 22px 22px;
    border-top: 1px solid var(--line-soft);
    padding-top: 18px;
}

.recover-card .hint { margin: -4px 0 16px; }

/* --------------------------------------------------------------- 特性 */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.feature {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 20px;
    box-shadow: var(--shadow-xs);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

.feature:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-200);
}

.feature-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--brand-50);
    color: var(--brand-600);
    margin-bottom: 14px;
}

.feature-icon svg { width: 22px; height: 22px; }
.feature h3 { font-size: 15px; color: var(--ink-900); margin-bottom: 6px; letter-spacing: -.2px; }
.feature p { font-size: 13px; color: var(--ink-500); line-height: 1.68; }

/* 步骤 */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    counter-reset: step;
}

.steps li {
    position: relative;
    padding: 26px 24px;
    border-radius: var(--radius);
    background: linear-gradient(160deg, var(--surface), var(--surface-2));
    border: 1px solid var(--line);
}

.step-num {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: var(--brand-600);
    color: #fff;
    font-size: 13px;
    font-weight: 750;
    margin-bottom: 12px;
    box-shadow: 0 10px 18px -12px rgba(37, 99, 235, .9);
}

.steps h3 { font-size: 15px; color: var(--ink-900); margin-bottom: 6px; }
.steps p { font-size: 13px; color: var(--ink-500); }

/* --------------------------------------------------------------- 页脚 */
.site-footer {
    margin-top: 84px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 0;
    flex-wrap: wrap;
}

.footer-brand { display: flex; flex-direction: column; gap: 2px; }
.footer-brand strong { font-size: 14.5px; color: var(--ink-900); }
.footer-brand span { font-size: 12.5px; color: var(--ink-400); }
.footer-note { font-size: 12.5px; color: var(--ink-400); }

/* --------------------------------------------------------------- 提示 */
.page-room .toast-wrap { bottom: 104px; }

.toast-wrap {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
    width: max-content;
    max-width: calc(100vw - 32px);
}

.toast {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 16px;
    border-radius: 12px;
    background: rgba(15, 23, 42, .93);
    color: #fff;
    font-size: 13.5px;
    box-shadow: 0 18px 36px -18px rgba(0, 0, 0, .6);
    animation: toast-in .22s ease-out;
    max-width: 100%;
    line-height: 1.5;
}

.toast.is-error { background: #b91c1c; }
.toast.is-ok { background: #0f766e; }
.toast.is-out { animation: toast-out .2s ease-in forwards; }
.toast svg { width: 17px; height: 17px; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: none; }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateY(8px) scale(.98); }
}

.noscript {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: var(--bg);
    z-index: 999;
    padding: 30px;
    text-align: center;
    color: var(--ink-600);
}

/* ==========================================================================
   聊天室
   ========================================================================== */
.page-room { overflow: hidden; }

.room-app {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.room-header {
    height: var(--header-h);
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 18px;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid var(--line);
    position: relative;
    z-index: 30;
}

.rh-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rh-right { display: flex; align-items: center; gap: 8px; flex: none; }

.room-heading { min-width: 0; }

.room-heading h1 {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--ink-900);
    letter-spacing: -.25px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 46vw;
}

.room-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 1px;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: hidden;
}

.code-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 20px;
    padding: 0 7px;
    border-radius: 6px;
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: 11px;
    font-weight: 700;
    font-family: var(--mono);
    letter-spacing: .6px;
    transition: .16s;
}

.code-chip:hover { background: var(--brand-100); }
.code-chip svg { width: 11px; height: 11px; }

.meta-item { font-size: 11.5px; color: var(--ink-400); }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-300); flex: none; }

.expiry-chip {
    font-size: 11.5px;
    color: var(--ink-400);
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.expiry-chip.is-soon { color: #d97706; font-weight: 650; }

.only-mobile { display: none; }

.room-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 268px 1fr;
}

/* 成员面板 */
.member-panel {
    border-right: 1px solid var(--line);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.mp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 10px;
    flex: none;
}

.mp-head h2 {
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--ink-400);
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.mp-head .count {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 19px;
    padding: 0 5px;
    border-radius: 99px;
    background: var(--brand-50);
    color: var(--brand-600);
    font-size: 10.5px;
    letter-spacing: 0;
}

.mp-search {
    position: relative;
    padding: 0 14px 8px;
    flex: none;
}

.mp-search > svg {
    position: absolute;
    inset-inline-start: 24px;
    top: 17px;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: var(--ink-400);
    pointer-events: none;
}

.mp-search input {
    width: 100%;
    height: 34px;
    padding-block: 0;
    padding-inline: 33px 32px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink-800);
    font-size: 12.5px;
}

.mp-search input::placeholder { color: var(--ink-400); }

.mp-search input:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--brand-300);
    box-shadow: 0 0 0 3px var(--brand-50);
}

.mp-search .mp-clear {
    position: absolute;
    inset-inline-end: 21px;
    top: 17px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--ink-500);
    background: var(--line-soft);
}

.mp-search .mp-clear svg { width: 9px; height: 9px; }
.mp-search .mp-clear:hover { color: var(--ink-800); background: var(--line); }

.member-empty {
    padding: 26px 10px;
    text-align: center;
    font-size: 12.5px;
    color: var(--ink-400);
    list-style: none;
}

.member-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 10px 12px;
    min-height: 0;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 10px;
    transition: background .15s;
    width: 100%;
    text-align: start;
    color: inherit;
}

.member-item:hover { background: var(--surface-2); }
.member-item.is-target { cursor: pointer; }

.m-avatar {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    flex: none;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}

.m-avatar .status {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ink-300);
    border: 2px solid var(--surface);
}

.m-avatar .status.on { background: #22c55e; }

.m-info {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.m-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 5px;
}

.m-sub { font-size: 11px; color: var(--ink-400); }

.tag {
    display: inline-flex;
    align-items: center;
    height: 16px;
    padding: 0 5px;
    border-radius: 4px;
    font-size: 9.5px;
    font-weight: 750;
    letter-spacing: .3px;
    flex: none;
}

.tag-owner { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.tag-admin { background: var(--brand-100); color: var(--brand-700); }
.tag-muted { background: #fef3c7; color: #b45309; }

[data-theme="dark"] .tag-admin { background: var(--brand-100); color: var(--brand-300); }
[data-theme="dark"] .tag-muted { background: #3a2b0e; color: #fbbf24; }

.member-item .typing-dots { display: inline-flex; gap: 2px; align-items: center; height: 10px; }
.member-item .typing-dots i {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--brand-500);
    animation: blink 1.1s infinite;
}
.member-item .typing-dots i:nth-child(2) { animation-delay: .16s; }
.member-item .typing-dots i:nth-child(3) { animation-delay: .32s; }

@keyframes blink {
    0%, 60%, 100% { opacity: .25; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-2px); }
}

.mp-foot { padding: 10px 12px 14px; border-top: 1px solid var(--line-soft); flex: none; }

/* 聊天主区 */
.chat {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    position: relative;
    background:
        radial-gradient(800px 400px at 70% 0%, rgba(239, 246, 255, .8), transparent 70%),
        var(--bg);
}

[data-theme="dark"] .chat {
    background: radial-gradient(700px 380px at 70% 0%, rgba(30, 58, 138, .18), transparent 70%), var(--bg);
}

.topic-bar {
    flex: none;
    padding: 9px 24px;
    font-size: 12.5px;
    color: var(--ink-500);
    background: var(--brand-50);
    border-bottom: 1px solid var(--brand-100);
    display: flex;
    align-items: center;
    gap: 8px;
}

.topic-bar::before {
    content: "";
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--brand-400);
    flex: none;
}

.messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 0 12px;
    min-height: 0;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
}

/* 空状态 */
.room-intro {
    max-width: 460px;
    margin: 8vh auto 0;
    text-align: center;
    padding: 0 24px 40px;
    animation: fade-up .5s ease both;
}

.intro-mark {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(150deg, var(--brand-100), var(--surface));
    color: var(--brand-500);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.intro-mark svg { width: 32px; height: 32px; }
.room-intro h2 { font-size: 19px; color: var(--ink-800); letter-spacing: -.3px; margin-bottom: 7px; }
.room-intro p { font-size: 13.5px; color: var(--ink-400); line-height: 1.7; }

.intro-tags {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.intro-tags span {
    font-size: 11.5px;
    color: var(--ink-500);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 99px;
    padding: 4px 11px;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

/* 消息 */
.msg-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: auto;
}

.date-sep {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px 10px;
    font-size: 11px;
    color: var(--ink-400);
    font-weight: 600;
}

.date-sep::before,
.date-sep::after {
    content: "";
    height: 1px;
    background: var(--line);
    flex: 1;
    opacity: .7;
}

.msg {
    display: flex;
    gap: 10px;
    padding: 4px 24px;
    animation: msg-in .24s cubic-bezier(.2, .8, .3, 1) both;
    position: relative;
}

@keyframes msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.msg.is-me { flex-direction: row-reverse; }
.msg.is-cont { padding-top: 1px; }
.msg.is-cont .msg-avatar { visibility: hidden; height: 0; }
.msg.is-cont .msg-name { display: none; }

.msg-avatar {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex: none;
    margin-top: 2px;
    user-select: none;
}

.msg-body {
    max-width: min(660px, 78%);
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
}
.msg.is-me .msg-body { align-items: flex-end; }

.msg-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--ink-400);
    margin-bottom: 3px;
    padding-inline: 4px;
}

.msg-name b { font-weight: 650; color: var(--ink-500); }

.bubble {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px 15px 15px 15px;
    padding: 9px 13px;
    box-shadow: var(--shadow-xs);
    color: var(--ink-800);
    font-size: 14.5px;
    line-height: 1.62;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.msg.is-cont .bubble { border-radius: 15px; }
.msg.is-me .bubble {
    background: linear-gradient(140deg, #4b8dfa, #2563eb 70%, #2563eb);
    border-color: transparent;
    color: #fff;
    border-radius: 15px 4px 15px 15px;
    box-shadow: 0 10px 24px -16px rgba(37, 99, 235, .9);
}

[data-theme="dark"] .msg.is-me .bubble { background: linear-gradient(140deg, #3567cc, #2554b8); }

.msg-text { white-space: pre-wrap; }

.msg-text a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    opacity: .95;
}

.msg.is-me .msg-text a { color: #eaf2ff; }

.msg-time {
    font-size: 10.5px;
    color: var(--ink-400);
    margin-top: 3px;
    padding-inline: 4px;
    opacity: 0;
    transition: opacity .16s;
    font-variant-numeric: tabular-nums;
}

.msg:hover .msg-time { opacity: 1; }

.msg-actions {
    position: absolute;
    top: 0;
    display: flex;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 2px;
    box-shadow: var(--shadow-sm);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
    z-index: 2;
}

.msg:not(.is-me) .msg-actions { left: 100%; margin-left: 8px; }
.msg.is-me .msg-actions { right: 100%; margin-right: 8px; }
.msg:hover .msg-actions,
.msg.show-actions .msg-actions { opacity: 1; pointer-events: auto; }

.msg-action {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    color: var(--ink-400);
    transition: .14s;
}

.msg-action:hover { background: var(--surface-3); color: var(--brand-600); }
.msg-action svg { width: 14px; height: 14px; }
.msg-action.is-danger:hover { background: var(--danger-soft); color: var(--danger); }

.msg-reply {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 5px 9px;
    margin-bottom: 6px;
    border-radius: 8px;
    background: var(--surface-2);
    border-left: 3px solid var(--brand-400);
    font-size: 12px;
    line-height: 1.45;
    max-width: 100%;
    cursor: default;
}

.msg.is-me .msg-reply {
    background: rgba(255, 255, 255, .16);
    border-left-color: rgba(255, 255, 255, .7);
}

.msg-reply strong { font-weight: 650; opacity: .85; font-size: 11px; }
.msg-reply span { opacity: .78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bubble.has-image { padding: 6px; overflow: hidden; }

.msg .bubble.has-image,
.msg.is-me .bubble.has-image {
    background: var(--surface);
    border-color: var(--line);
    box-shadow: var(--shadow-xs);
    color: var(--ink-800);
}

.msg .bubble.has-image .msg-text { padding: 7px 6px 3px; font-size: 13.5px; }

.msg-image {
    display: block;
    border-radius: 10px;
    cursor: zoom-in;
    background: #fff;
    max-width: 100%;
    height: auto;
}

.msg.is-me .msg-image { margin-left: auto; }

.msg-caption {
    padding: 7px 8px 3px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* 系统消息 */
.sys-msg {
    display: flex;
    justify-content: center;
    padding: 5px 24px;
}

.sys-msg > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 82%;
    padding: 4px 12px;
    border-radius: 99px;
    background: var(--surface-3);
    color: var(--ink-400);
    font-size: 11.5px;
    line-height: 1.55;
    text-align: center;
    flex-wrap: wrap;
    justify-content: center;
}

.sys-msg b { color: var(--ink-500); font-weight: 650; }
.sys-msg svg { width: 12px; height: 12px; }

.new-pill {
    position: absolute;
    left: 50%;
    bottom: 132px;
    transform: translateX(-50%);
    z-index: 12;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    border-radius: 99px;
    background: var(--brand-600);
    color: #fff;
    font-size: 12px;
    font-weight: 650;
    box-shadow: 0 12px 26px -12px rgba(37, 99, 235, .9);
    animation: fade-up .2s ease both;
}

.new-pill svg { width: 14px; height: 14px; }

/* 输入区 */
.composer-wrap {
    flex: none;
    padding: 10px 20px 14px;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: relative;
}

.reply-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    margin-bottom: 8px;
    border-radius: 10px;
    background: var(--brand-50);
    border: 1px solid var(--brand-100);
    animation: fade-up .18s ease both;
}

.reply-content { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.reply-content strong { font-size: 11px; color: var(--brand-600); font-weight: 700; }
.reply-content span {
    font-size: 12px;
    color: var(--ink-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.composer {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 7px;
    box-shadow: var(--shadow-sm);
    transition: border-color .18s, box-shadow .18s;
}

.composer:focus-within {
    border-color: var(--brand-300);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .1), var(--shadow-sm);
}

.composer textarea {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 8px 6px;
    max-height: 152px;
    min-height: 36px;
    font-size: 14.5px;
    line-height: 1.55;
    box-shadow: none !important;
    resize: none;
    outline: none;
}

.composer-btn {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: var(--ink-400);
    flex: none;
    transition: .16s;
}

.composer-btn:hover { background: var(--surface-3); color: var(--brand-600); }
.composer-btn svg { width: 20px; height: 20px; }

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    flex: none;
    background: linear-gradient(140deg, #4b8dfa, #2563eb);
    box-shadow: 0 10px 20px -12px rgba(37, 99, 235, .95);
    transition: transform .16s, opacity .16s;
}

.send-btn:hover { transform: translateY(-1px) scale(1.02); }
.send-btn:disabled { opacity: .45; transform: none; box-shadow: none; }
.send-btn svg { width: 21px; height: 21px; }

.composer-hint {
    font-size: 11px;
    color: var(--ink-400);
    padding: 6px 6px 0;
    min-height: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.composer-hint:empty { display: none; }

.notice-bar {
    position: absolute;
    left: 50%;
    top: 12px;
    transform: translateX(-50%);
    z-index: 8;
    padding: 7px 14px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    background: var(--ink-800);
    color: #fff;
    box-shadow: var(--shadow-md);
    max-width: calc(100% - 32px);
    text-align: center;
}

.notice-bar.is-warn { background: #b45309; }

/* 表情选择 */
.emoji-pop {
    position: absolute;
    bottom: calc(100% - 4px);
    left: 20px;
    width: 344px;
    max-width: calc(100vw - 40px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 20;
    overflow: hidden;
    animation: fade-up .16s ease both;
}

.emoji-head { padding: 9px 9px 6px; }
.emoji-head input { height: 34px; font-size: 13px; border-radius: 9px; }

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 1px;
    padding: 4px 8px 10px;
    max-height: 216px;
    overflow-y: auto;
}

.emoji-grid button {
    height: 36px;
    border-radius: 8px;
    font-size: 21px;
    line-height: 1;
    display: grid;
    place-items: center;
    transition: background .12s, transform .12s;
}

.emoji-grid button:hover { background: var(--surface-3); transform: scale(1.14); }

.emoji-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--ink-400);
    font-size: 12px;
    padding: 16px 0;
}

/* 成员抽屉遮罩 */
.side-scrim { display: none; }

/* ==========================================================================
   浮层 / 面板
   ========================================================================== */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: overlay-in .16s ease both;
}

@keyframes overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.overlay.center { display: grid; place-items: center; padding: 20px; overflow-y: auto; }

.join-card {
    width: min(420px, 100%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: pop-in .22s cubic-bezier(.2, .9, .3, 1) both;
    margin: auto;
}

@keyframes pop-in {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: none; }
}

.join-card h2 { font-size: 20px; color: var(--ink-900); letter-spacing: -.35px; margin-bottom: 5px; }
.join-card > p { font-size: 13px; color: var(--ink-400); margin-bottom: 20px; }
.join-card .field { text-align: start; }
.join-card .hint { text-align: center; margin-top: 14px; }

.link-quiet {
    display: inline-block;
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--ink-400);
}

.link-quiet:hover { color: var(--brand-600); }

/* 状态卡片 */
.state-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.state-card {
    width: min(440px, 100%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 36px 30px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: pop-in .24s ease both;
}

.state-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    background: var(--brand-50);
    color: var(--brand-500);
}

.state-icon svg { width: 28px; height: 28px; }
.state-card h1, .state-card h2 { font-size: 20px; color: var(--ink-900); margin-bottom: 8px; letter-spacing: -.3px; }
.state-card p { font-size: 13.5px; color: var(--ink-500); line-height: 1.7; margin-bottom: 22px; }
.state-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* 抽屉 */
.sheet-overlay { display: flex; justify-content: flex-end; }

.sheet-panel {
    width: min(480px, 100%);
    height: 100%;
    background: var(--surface);
    border-left: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    box-shadow: -30px 0 60px -40px rgba(15, 23, 42, .5);
    animation: sheet-in .24s cubic-bezier(.2, .9, .3, 1) both;
}

.sheet-panel.sheet-sm { width: min(380px, 100%); }

@keyframes sheet-in {
    from { transform: translateX(24px); opacity: .6; }
    to { transform: none; opacity: 1; }
}

[dir="rtl"] .sheet-overlay { justify-content: flex-start; }
[dir="rtl"] .sheet-panel { border-left: 0; border-right: 1px solid var(--line); }
[dir="rtl"] .sheet-panel { animation-name: sheet-in-rtl; }

@keyframes sheet-in-rtl {
    from { transform: translateX(-24px); opacity: .6; }
    to { transform: none; opacity: 1; }
}

.sheet-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px 14px;
    flex: none;
}

.sheet-head h2 { font-size: 17px; color: var(--ink-900); letter-spacing: -.25px; }
.sheet-head p { font-size: 12px; color: var(--ink-400); margin-top: 2px; line-height: 1.5; }

.sheet-tabs {
    display: flex;
    gap: 4px;
    padding: 0 18px;
    border-bottom: 1px solid var(--line);
    flex: none;
}

.sheet-tabs button {
    position: relative;
    padding: 10px 12px 11px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-400);
    transition: color .16s;
}

.sheet-tabs button:hover { color: var(--ink-700); }

.sheet-tabs button.is-active { color: var(--brand-600); }

.sheet-tabs button.is-active::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--brand-600);
}

.sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 22px 30px;
    min-height: 0;
}

.set-section { margin-bottom: 26px; }

.set-section > h3 {
    font-size: 11.5px;
    font-weight: 750;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--ink-400);
    margin-bottom: 12px;
}

.set-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
}

.set-row:last-child { border-bottom: 0; }
.set-row .set-label { min-width: 0; }
.set-row .set-label strong { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-700); }
.set-row .set-label small { display: block; font-size: 11.5px; color: var(--ink-400); line-height: 1.5; margin-top: 1px; }
.set-row .set-control { flex: none; display: flex; align-items: center; gap: 8px; }
.set-row .set-control input[type="number"] { width: 88px; height: 38px; text-align: center; }
.set-row .set-control select { width: 118px; height: 38px; }

.set-field { margin-bottom: 14px; }
.set-field label { font-size: 12.5px; font-weight: 600; color: var(--ink-600); display: block; margin-bottom: 6px; }

.danger-zone {
    border: 1px solid #fecaca;
    background: var(--danger-soft);
    border-radius: 14px;
    padding: 16px;
    margin-top: 8px;
}

[data-theme="dark"] .danger-zone { border-color: #4a1d24; }

.danger-zone h3 { font-size: 13px; color: #b91c1c; margin-bottom: 10px; }
.danger-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-danger-soft {
    color: #b91c1c;
    background: #fff;
    border: 1px solid #fecaca;
}

[data-theme="dark"] .btn-danger-soft { background: #1b1116; border-color: #4a1d24; color: #f87171; }
.btn-danger-soft:hover { background: #fff1f2; }

.code-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px dashed var(--line);
    font-family: var(--mono);
    font-size: 13px;
    color: var(--ink-600);
    word-break: break-all;
}

.audit-list { display: flex; flex-direction: column; gap: 2px; }

.log-item {
    display: flex;
    gap: 10px;
    padding: 9px 2px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 12.5px;
    line-height: 1.5;
}

.log-item time { color: var(--ink-400); font-size: 11px; flex: none; font-variant-numeric: tabular-nums; }
.log-item .log-text { color: var(--ink-600); }
.log-item .log-text b { color: var(--ink-800); font-weight: 650; }

.ban-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line-soft);
}

.ban-item .ban-info { min-width: 0; }
.ban-item strong { font-size: 13px; color: var(--ink-700); display: block; }
.ban-item small { font-size: 11.5px; color: var(--ink-400); }

.empty-note {
    text-align: center;
    color: var(--ink-400);
    font-size: 12.5px;
    padding: 26px 0;
}

/* 成员操作 */
.member-sheet-title { display: flex; align-items: center; gap: 11px; }

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    flex: none;
}

.action-list { display: flex; flex-direction: column; gap: 4px; }

.action-item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 11px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    color: var(--ink-700);
    text-align: start;
    transition: background .14s, color .14s;
}

.action-item:hover { background: var(--surface-2); }
.action-item svg { width: 17px; height: 17px; color: var(--ink-400); }
.action-item.is-danger { color: #b91c1c; }
.action-item.is-danger svg { color: #dc2626; }
.action-item.is-danger:hover { background: var(--danger-soft); }

.action-sub { font-size: 11.5px; color: var(--ink-400); margin: 4px 0 8px; }
.action-group { margin-bottom: 14px; }
.action-group h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .9px; color: var(--ink-400); margin-bottom: 4px; font-weight: 700; }

.member-rename h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .9px;
    color: var(--ink-400);
    margin-bottom: 6px;
    font-weight: 700;
}

.member-rename .hint { margin: -2px 0 12px; }
.member-rename input { margin-bottom: 12px; }

/* 涂鸦 */
.doodle-overlay { display: grid; place-items: center; padding: 18px; }

.doodle-panel {
    width: min(980px, 100%);
    max-height: 94vh;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: pop-in .22s ease both;
}

.doodle-stage {
    flex: 1;
    min-height: 0;
    padding: 0 18px;
    display: grid;
    place-items: center;
    background: var(--surface-2);
}

#doodleCanvas {
    width: 100%;
    height: auto;
    max-height: 54vh;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    touch-action: none;
    cursor: crosshair;
}

.doodle-tools {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    flex-wrap: wrap;
    border-top: 1px solid var(--line-soft);
}

.tool-group { display: flex; align-items: center; gap: 6px; }

.color-dot {
    width: 26px;
    height: 26px;
    border-radius: 9px;
    border: 2px solid transparent;
    transition: transform .14s, border-color .14s;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .14);
}

.color-dot:hover { transform: scale(1.1); }
.color-dot.is-active { border-color: var(--ink-500); transform: scale(1.08); }
.color-dot.is-active::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 5px;
    border: 1.5px solid #fff;
}

.size-dot {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: var(--ink-500);
    transition: background .14s;
}

.size-dot:hover { background: var(--surface-3); }
.size-dot.is-active { background: var(--brand-50); color: var(--brand-600); }
.size-dot i { display: block; border-radius: 50%; background: currentColor; }

.tool-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: var(--ink-500);
    border: 1px solid transparent;
    transition: .14s;
}

.tool-btn:hover { background: var(--surface-3); }
.tool-btn.is-active { background: var(--brand-50); color: var(--brand-600); border-color: var(--brand-100); }
.tool-btn svg { width: 17px; height: 17px; }

.doodle-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px 16px;
    border-top: 1px solid var(--line-soft);
}

.doodle-foot input { flex: 1; height: 42px; }

/* 灯箱 */
.lightbox {
    display: grid;
    place-items: center;
    padding: 28px;
    background: rgba(2, 6, 23, .82);
}

.lightbox img {
    max-width: min(1100px, 96vw);
    max-height: 88vh;
    border-radius: 12px;
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8);
    background: #fff;
    animation: pop-in .2s ease both;
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(255, 255, 255, .12);
    border-color: transparent;
    color: #fff;
}

[dir="rtl"] .lightbox-close { right: auto; left: 18px; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1080px) {
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .duo { grid-template-columns: 1fr; }
    .hero { padding-top: 54px; }
    .room-body { grid-template-columns: 1fr; }

    .member-panel {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 280px;
        z-index: 90;
        transform: translateX(-102%);
        transition: transform .26s cubic-bezier(.2, .9, .3, 1);
        box-shadow: 30px 0 60px -40px rgba(15, 23, 42, .5);
        border-right: 1px solid var(--line);
    }

    [dir="rtl"] .member-panel {
        left: auto;
        right: 0;
        transform: translateX(102%);
        box-shadow: -30px 0 60px -40px rgba(15, 23, 42, .5);
    }

    body.side-open .member-panel { transform: none; }

    body.side-open .side-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 80;
        background: rgba(15, 23, 42, .35);
        backdrop-filter: blur(2px);
    }

    .only-mobile { display: inline-grid; }
    .mp-head .icon-btn { display: inline-grid; }
    .tool-tz { display: none; }
}

@media (max-width: 760px) {
    .shell { width: calc(100% - 28px); }
    .section { padding-top: 56px; }
    .hero { padding: 40px 0 30px; }
    .hero-title { letter-spacing: -1px; }
    .hero-stats { width: 100%; justify-content: space-between; }
    .hero-stats .stat { padding: 0 14px; flex: 1; }
    .feature-grid, .steps { grid-template-columns: 1fr; }
    .create-card { padding: 22px; }
    .footer-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
    .header-inner { height: 62px; }
    .brand-text small { display: none; }

    .room-header { padding: 0 10px; height: 58px; gap: 8px; }
    .room-heading h1 { font-size: 14.5px; max-width: 42vw; }
    .brand-mark.sm { display: none; }

    /* 语言切换收成图标按钮，点击仍会打开原生选择器 */
    .rh-right .tool-select {
        width: 38px;
        padding: 0;
        justify-content: center;
        position: relative;
    }

    .rh-right .tool-select select {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        cursor: pointer;
        max-width: none;
    }

    .rh-right .tool-select svg { margin: 0; }
    .room-meta .meta-item { display: none; }
    .room-meta .meta-item + .dot-sep { display: none; }
    .page-room .toast-wrap { bottom: 92px; }

    .msg-actions {
        top: -14px;
        left: auto;
        right: 0;
        margin: 0;
    }

    .msg:not(.is-me) .msg-actions { left: auto; right: 0; margin: 0; }
    .msg { padding: 3px 12px; }
    .msg-body { max-width: 84%; }
    .date-sep { padding: 14px 12px 8px; }
    .composer-wrap { padding: 8px 10px 10px; }
    .composer { border-radius: 14px; }
    .emoji-pop { left: 8px; width: calc(100vw - 20px); }
    .new-pill { bottom: 120px; }
    .sheet-panel { width: 100%; }
    .doodle-tools { gap: 10px; }
    .doodle-foot { flex-wrap: wrap; }
    .doodle-foot input { flex: 1 0 100%; }
    .room-intro { margin-top: 4vh; }
}

@media (max-width: 420px) {
    .field-row { grid-template-columns: 1fr; }
    .tool-select select { max-width: 84px; }
    .hero-stats .stat { padding: 0 8px; }
    .hero-stats strong { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --------------------------------------------------------------- 最近访问 */
.recent-card { padding: 16px 20px; }

.recent-card h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    color: var(--ink-400);
    font-weight: 750;
    margin-bottom: 8px;
}

.recent-list { display: flex; flex-direction: column; gap: 2px; }

.recent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 10px;
    color: var(--ink-700);
    font-size: 13px;
    text-decoration: none;
    transition: background .15s;
}

.recent-item:hover { background: var(--surface-2); text-decoration: none; }

.recent-avatar {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    flex: none;
}

.recent-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.switch.is-compact { padding: 0; align-items: center; gap: 0; }

.msg.is-flash .bubble { animation: msg-flash 1.3s ease; }

@keyframes msg-flash {
    0%, 100% { box-shadow: var(--shadow-xs); }
    22% { box-shadow: 0 0 0 4px rgba(59, 130, 246, .22); }
}

/* --------------------------------------------------------------- 站点后台 */
.admin-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

.admin-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 28px 0 22px;
    flex-wrap: wrap;
}

.admin-title h1 { font-size: 22px; color: var(--ink-900); letter-spacing: -.4px; }
.admin-title p { font-size: 13px; color: var(--ink-400); margin-top: 2px; }
.admin-top .actions { display: flex; gap: 8px; align-items: center; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: var(--shadow-xs);
}

.stat-card span { font-size: 12px; color: var(--ink-400); }

.stat-card strong {
    display: block;
    font-size: 25px;
    font-weight: 750;
    color: var(--ink-900);
    letter-spacing: -.6px;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.table { width: 100%; border-collapse: collapse; font-size: 13px; }

.table th {
    text-align: start;
    font-size: 10.5px;
    letter-spacing: .7px;
    text-transform: uppercase;
    color: var(--ink-400);
    font-weight: 750;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    background: var(--surface-2);
}

.table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
    color: var(--ink-600);
}

.table tr:last-child td { border-bottom: 0; }
.table .cell-title { font-weight: 600; color: var(--ink-800); }
.table .cell-code { font-family: var(--mono); font-size: 12px; color: var(--brand-600); }
.table .cell-num { font-variant-numeric: tabular-nums; }

.badge {
    display: inline-flex;
    align-items: center;
    height: 21px;
    padding: 0 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
}

.badge-live { background: #ecfdf5; color: #047857; }
.badge-expired { background: #fff7ed; color: #b45309; }
.badge-closed { background: var(--surface-3); color: var(--ink-500); }

[data-theme="dark"] .badge-live { background: #052e24; color: #34d399; }
[data-theme="dark"] .badge-expired { background: #3a2b0e; color: #fbbf24; }

.admin-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(380px, 100%); }
.login-card .card { padding: 28px; }

.pagination {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    padding: 14px 4px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--line);
    font-size: 12.5px;
    padding: 0 9px;
    color: var(--ink-600);
    background: var(--surface);
}

.pagination a:hover { border-color: var(--brand-300); color: var(--brand-600); text-decoration: none; }
.pagination .is-current { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }

.admin-alert {
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 13px;
    margin-bottom: 16px;
    background: var(--danger-soft);
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.admin-alert.ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }

@media (max-width: 760px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 打印无用元素隐藏 */
@media print {
    .site-header, .site-footer, .composer-wrap, .member-panel, .ambient, .toast-wrap { display: none !important; }
}
