:root {
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", sans-serif;
    --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
    --font-read: "PingFang SC", -apple-system, "Songti SC", serif;
    --mono: "SF Mono", ui-monospace, Menlo, Monaco, monospace;

    --bg: #f5f5f7;
    --bg-grad-1: rgba(0, 113, 227, 0.10);
    --bg-grad-2: rgba(191, 90, 242, 0.08);
    --surface: #ffffff;
    --surface-2: #fbfbfd;
    --fill: rgba(120, 120, 128, 0.12);
    --fill-2: rgba(120, 120, 128, 0.08);
    --sidebar: rgba(242, 242, 247, 0.72);
    --toolbar: rgba(245, 245, 247, 0.78);
    --label: #1d1d1f;
    --label-2: #6e6e73;
    --label-3: #86868b;
    --sep: rgba(60, 60, 67, 0.12);
    --sep-strong: rgba(60, 60, 67, 0.2);
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --accent-soft: rgba(0, 113, 227, 0.1);
    --green: #28cd41;
    --orange: #ff9500;
    --red: #ff3b30;
    --purple: #af52de;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 1px rgba(0, 0, 0, 0.03);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.05), 0 12px 32px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.08);
    --r-sm: 8px;
    --r: 14px;
    --r-lg: 20px;
    --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

[data-theme="dark"] {
    --bg: #000000;
    --bg-grad-1: rgba(10, 132, 255, 0.14);
    --bg-grad-2: rgba(191, 90, 242, 0.10);
    --surface: #1c1c1e;
    --surface-2: #232325;
    --fill: rgba(120, 120, 128, 0.24);
    --fill-2: rgba(120, 120, 128, 0.16);
    --sidebar: rgba(30, 30, 32, 0.66);
    --toolbar: rgba(0, 0, 0, 0.7);
    --label: #f5f5f7;
    --label-2: #a1a1a6;
    --label-3: #7c7c80;
    --sep: rgba(84, 84, 88, 0.45);
    --sep-strong: rgba(84, 84, 88, 0.7);
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --accent-soft: rgba(10, 132, 255, 0.18);
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--label);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
    overflow: hidden;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(60vw 50vh at 0% 0%, var(--bg-grad-1), transparent 70%),
        radial-gradient(50vw 50vh at 0% 100%, var(--bg-grad-2), transparent 70%);
    pointer-events: none;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
button:focus { outline: none; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
[hidden] { display: none !important; }
svg { display: block; flex-shrink: 0; }
.flex1 { flex: 1; }

/* ---------- Layout ---------- */
.app { position: relative; display: flex; height: 100vh; }

.sidebar {
    width: 268px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--sidebar);
    backdrop-filter: saturate(180%) blur(30px);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
    border-right: 0.5px solid var(--sep);
    padding: 18px 12px 12px;
    z-index: 2;
}
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.sb-logo {
    width: 34px; height: 34px; border-radius: 9px;
    display: grid; place-items: center;
    color: #fff;
    background: linear-gradient(145deg, #2997ff, #0060df 55%, #6e3bd8);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.sb-title { font-family: var(--font-display); font-weight: 650; font-size: 15px; letter-spacing: -0.02em; }
.sb-nav { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.sb-section {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 10px 6px;
    font-size: 11px; font-weight: 600; color: var(--label-3);
    letter-spacing: 0.02em;
}
.sb-section .icon-btn { width: 22px; height: 22px; color: var(--label-2); }
.sb-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 7px 10px;
    border-radius: var(--r-sm);
    color: var(--label);
    font-size: 13.5px;
    text-align: left;
    transition: background 0.15s;
}
.sb-item:hover { background: var(--fill-2); }
.sb-item.active { background: var(--fill); }
.sb-item .sb-icon {
    width: 24px; height: 24px; border-radius: 6px;
    display: grid; place-items: center;
    color: #fff;
}
.sb-item .sb-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-item .sb-count { font-size: 12px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.sb-item .sb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }

.sb-footer { display: flex; align-items: center; gap: 6px; padding-top: 10px; border-top: 0.5px solid var(--sep); }
.sb-foot-btn {
    flex: 1; display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: var(--r-sm);
    font-size: 13px; color: var(--label);
    min-width: 0;
}
.sb-foot-btn:hover { background: var(--fill-2); }
.sb-foot-btn > span { white-space: nowrap; }
.sb-model-hint { margin-left: auto; font-size: 11px; color: var(--label-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-auth-btn {
    display: flex; align-items: center; gap: 5px; flex-shrink: 0;
    height: 30px; padding: 0 11px; border-radius: 15px;
    font-size: 12.5px; font-weight: 500;
    color: #fff; background: var(--accent);
    transition: background 0.15s;
}
.sb-auth-btn:hover { background: var(--accent-hover); }
.sb-auth-btn.signed { color: var(--label-2); background: var(--fill-2); max-width: 116px; padding: 0 9px; }
.sb-auth-btn.signed:hover { background: var(--fill); color: var(--label); }
.sb-auth-btn .auth-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Login ---------- */
.login-page { display: flex; align-items: center; justify-content: center; overflow: auto; padding: 24px; }
.login-card {
    position: relative; width: 100%; max-width: 380px;
    display: flex; flex-direction: column; align-items: stretch; gap: 14px;
    padding: 34px 28px 26px; border-radius: var(--r-lg);
    background: var(--surface); border: 0.5px solid var(--sep); box-shadow: var(--shadow);
    text-align: center;
}
.login-card h1 { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.login-logo { width: 46px; height: 46px; border-radius: 12px; margin: 0 auto 2px; }
.login-sub { margin-top: -8px; font-size: 13px; color: var(--label-3); }
.login-card .group { text-align: left; }
.login-card .field-row > span:first-child { width: 56px; }
.login-card .field-row input:not([type=checkbox]) { text-align: left; color: var(--label); }
.login-error { font-size: 12.5px; color: var(--red); }
.login-submit { height: 38px; border-radius: 19px; font-size: 14.5px; }
.login-back { font-size: 13px; }

.main { position: relative; flex: 1; min-width: 0; overflow-y: auto; scroll-behavior: smooth; overflow-anchor: none; }

.toolbar {
    position: sticky; top: 0; z-index: 5;
    height: 52px;
    display: flex; align-items: center; gap: 12px;
    padding: 0 28px;
    background: transparent;
    border-bottom: 0.5px solid transparent;
    transition: background 0.25s, border-color 0.25s;
}
.toolbar.scrolled {
    background: var(--toolbar);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom-color: var(--sep);
}
.tb-title { font-weight: 600; font-size: 14px; opacity: 0; transform: translateY(4px); transition: opacity 0.25s, transform 0.25s; }
.toolbar.scrolled .tb-title { opacity: 1; transform: none; }
.tb-actions { margin-left: auto; display: flex; gap: 8px; }
.tb-back { display: flex; align-items: center; gap: 2px; color: var(--accent); font-size: 14px; padding: 4px 6px 4px 0; }
.tb-back:hover { opacity: 0.8; }

.view { max-width: 1180px; margin: 0 auto; padding: 4px 40px 120px; animation: rise 0.45s var(--ease); }

/* ---------- Hero ---------- */
.hero { display: flex; align-items: flex-end; gap: 24px; padding: 16px 0 26px; }
.hero-text { flex: 1; min-width: 0; }
.hero-eyebrow { font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.hero-title {
    font-family: var(--font-display);
    font-size: 40px; line-height: 1.1; font-weight: 700;
    letter-spacing: -0.035em;
}
.hero-desc { margin-top: 8px; font-size: 17px; color: var(--label-2); letter-spacing: -0.015em; }
.hero-meta { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
    display: inline-flex; align-items: center; gap: 6px;
    height: 26px; padding: 0 10px;
    border-radius: 13px;
    background: var(--fill-2);
    color: var(--label-2);
    font-size: 12px;
    max-width: 460px;
}
.pill a { color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill a:hover { color: var(--accent); }
.pill.green { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.pill.blue { color: var(--accent); background: var(--accent-soft); }
.pill.red { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.pill.orange { color: var(--orange); background: color-mix(in srgb, var(--orange) 12%, transparent); }
.hero-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 34px; padding: 0 16px;
    border-radius: 17px;
    font-size: 13.5px; font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s, transform 0.1s, opacity 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--fill); }
.btn-secondary:hover { background: var(--sep-strong); }
.btn-plain { color: var(--accent); padding: 0 10px; }
.btn-plain:hover { background: var(--accent-soft); }
.btn-ghost-light { color: rgba(255, 255, 255, 0.85); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.12); }
.btn-danger-plain { color: var(--red); padding: 0 10px; }
.btn-danger-plain:hover { background: color-mix(in srgb, var(--red) 10%, transparent); }
.btn.sm { height: 28px; padding: 0 12px; font-size: 12.5px; border-radius: 14px; }
.icon-btn {
    width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center;
    color: var(--label-2);
    transition: background 0.15s;
}
.icon-btn:hover { background: var(--fill); color: var(--label); }

/* ---------- Segmented ---------- */
.segmented {
    position: relative;
    display: inline-flex;
    padding: 2px;
    border-radius: 9px;
    background: var(--fill);
    margin-bottom: 22px;
}
.segmented button {
    position: relative; z-index: 1;
    min-width: 112px; height: 30px; padding: 0 14px;
    border-radius: 7px;
    font-size: 13px; font-weight: 500;
    color: var(--label);
    transition: color 0.2s;
}
.segmented button:disabled { opacity: 0.35; cursor: default; }
.seg-thumb {
    position: absolute; top: 2px; left: 2px; height: calc(100% - 4px);
    border-radius: 7px;
    background: var(--surface);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s var(--ease), width 0.3s var(--ease);
}
[data-theme="dark"] .seg-thumb { background: #636366; }
.seg-count { color: var(--label-3); font-weight: 400; margin-left: 2px; font-variant-numeric: tabular-nums; }
.segmented.small { margin-bottom: 0; }
.segmented.small button { min-width: 0; height: 26px; font-size: 12.5px; }

/* ---------- Article cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 28px 22px; }
.card { cursor: pointer; animation: rise 0.5s var(--ease) both; }
.card-cover {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: var(--r);
    overflow: hidden;
    background: linear-gradient(135deg, var(--fill), var(--fill-2));
    box-shadow: var(--shadow);
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.card:hover .card-cover { transform: translateY(-3px) scale(1.01); box-shadow: var(--shadow-lg); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-cover .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--label-3); }
.card-status {
    position: absolute; inset: auto 10px 10px 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(28, 28, 30, 0.62);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    color: #fff;
}
.card-status .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; }
.card-status .detail { margin-top: 3px; font-size: 11.5px; color: rgba(255, 255, 255, 0.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { margin-top: 8px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 2px; background: #fff; transition: width 0.6s var(--ease); }
.card-status.failed { background: rgba(255, 59, 48, 0.82); }
.card-status.waiting { background: color-mix(in srgb, var(--orange) 85%, transparent); }
.card-body { padding: 12px 2px 0; }
.card-title {
    font-size: 15px; font-weight: 600; line-height: 1.35;
    letter-spacing: -0.015em;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { margin-top: 4px; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--label-3); }
.card-meta .spacer { flex: 1; }
.card-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.2s; }
.card:hover .card-actions { opacity: 1; }
.card-actions .icon-btn { width: 26px; height: 26px; }

/* ---------- Agenda cards ---------- */
.filter-bar.agenda {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px 16px;
    padding: 14px 16px;
    border-radius: var(--r);
    background: var(--surface);
    border: 0.5px solid var(--sep);
    box-shadow: var(--shadow-sm);
}
.filter-bar.agenda .search-field { width: min(360px, 100%); }
.filter-tail { display: flex; align-items: center; gap: 10px; justify-self: end; }
.tail-count { font-size: 12.5px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.topic-reset {
    display: inline-flex; align-items: center; gap: 5px;
    height: 28px; padding: 0 10px; border-radius: 14px;
    font-size: 12.5px; font-weight: 500; color: var(--accent);
    transition: background 0.15s;
}
.topic-reset:hover { background: var(--accent-soft); }
.topic-reset:disabled { color: var(--label-3); background: transparent; cursor: default; }
.filter-bar.agenda .chips { grid-column: 1 / -1; align-items: center; gap: 8px; padding-top: 12px; border-top: 0.5px solid var(--sep); }
.topic-label { font-size: 13px; font-weight: 600; color: var(--label-2); margin-right: 4px; }
.topic-label::after { content: "："; }
.topic-chip {
    display: inline-flex; align-items: center; gap: 6px;
    max-width: 210px; height: 30px; padding: 0 12px;
    border-radius: 8px;
    border: 0.5px solid var(--sep-strong);
    background: var(--surface-2);
    font-size: 12.5px; color: var(--label);
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.topic-chip .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-chip .n { color: var(--label-3); font-variant-numeric: tabular-nums; }
.topic-chip:hover { border-color: var(--accent); color: var(--accent); }
.topic-chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 500; }
.topic-chip.active .n { color: inherit; opacity: 0.7; }

.card-grid.agenda { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.agenda-card {
    position: relative;
    display: flex; flex-direction: column; gap: 10px;
    min-height: 176px;
    padding: 20px 22px 18px;
    border-radius: var(--r);
    background: var(--surface);
    border: 0.5px solid var(--sep);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: translate 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.agenda-card::before {
    content: ""; position: absolute; inset: 0 0 auto; height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--purple));
    opacity: 0; transition: opacity 0.3s;
}
.agenda-card:hover { translate: 0 -2px; box-shadow: var(--shadow); }
.agenda-card:hover::before { opacity: 1; }
.ag-title {
    font-size: 16px; font-weight: 600; line-height: 1.4; letter-spacing: -0.015em;
    padding-right: 24px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ag-desc {
    font-size: 13.5px; line-height: 1.65; color: var(--label-2);
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.ag-desc.muted { color: var(--label-3); }
.ag-actions { position: absolute; top: 12px; right: 10px; }
.ag-status { margin-top: auto; padding-top: 12px; border-top: 0.5px solid var(--sep); }
.ag-status .row { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--accent); }
.ag-status .row .spinner { width: 11px; height: 11px; border-width: 1.5px; }
.ag-status .step { margin-left: auto; color: var(--label-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.ag-status .detail { margin-top: 2px; font-size: 12px; color: var(--label-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-status .progress { height: 3px; background: var(--fill); }
.ag-status .progress > i { background: var(--accent); }
.ag-status.failed .row { color: var(--red); }
.ag-status.waiting .row { color: var(--orange); }
.ag-retry {
    margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
    height: 24px; padding: 0 10px; border-radius: 12px;
    font-size: 12px; font-weight: 500; color: var(--accent); background: var(--accent-soft);
}
.ag-retry:hover { background: var(--accent); color: #fff; }

.empty {
    grid-column: 1 / -1;
    padding: 80px 20px;
    text-align: center;
    color: var(--label-3);
}
.empty .empty-icon {
    width: 64px; height: 64px; margin: 0 auto 16px;
    border-radius: 18px;
    display: grid; place-items: center;
    background: var(--fill-2);
    color: var(--label-3);
}
.empty h3 { font-size: 19px; font-weight: 600; color: var(--label); margin-bottom: 6px; letter-spacing: -0.02em; }
.empty p { font-size: 14px; margin-bottom: 18px; }

/* ---------- Agent card ---------- */
.agent-card {
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    border: 0.5px solid var(--sep);
    overflow: hidden;
    margin-bottom: 20px;
}
.agent-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.agent-avatar {
    position: relative;
    width: 40px; height: 40px; border-radius: 12px;
    display: grid; place-items: center;
    color: #fff;
    background: linear-gradient(145deg, #1d1d1f, #3a3a3c);
}
[data-theme="dark"] .agent-avatar { background: linear-gradient(145deg, #48484a, #2c2c2e); }
.agent-avatar.running::after {
    content: ""; position: absolute; inset: -3px;
    border-radius: 15px;
    border: 2px solid var(--accent);
    border-top-color: transparent; border-left-color: transparent;
    animation: spin 1.1s linear infinite;
}
.agent-info { flex: 1; min-width: 0; }
.agent-name { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.agent-sub { font-size: 12.5px; color: var(--label-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--fill); color: var(--label-2); }
.badge.running { background: var(--accent-soft); color: var(--accent); }
.badge.done { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.badge.failed { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }

.agent-log {
    max-height: 0;
    overflow-y: auto;
    border-top: 0.5px solid transparent;
    background: var(--surface-2);
    transition: max-height 0.4s var(--ease), border-color 0.3s;
}
.agent-card.open .agent-log { max-height: 340px; border-top-color: var(--sep); }
.log-list { padding: 12px 18px 14px; }
.log-item { display: flex; gap: 10px; padding: 5px 0; font-size: 12.5px; line-height: 1.5; animation: fadein 0.3s ease both; }
.log-icon {
    width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
    display: grid; place-items: center;
    background: var(--fill-2); color: var(--label-2);
    margin-top: 1px;
}
.log-item.tool .log-text { font-family: var(--mono); font-size: 11.5px; color: var(--label-2); word-break: break-all; }
.log-item.text .log-text { color: var(--label); }
.log-item.done .log-icon { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.log-item.done .log-text { color: var(--green); font-weight: 600; }
.log-item.error .log-icon { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
.log-item.error .log-text { color: var(--red); }
.log-tag { font-size: 10.5px; font-weight: 600; color: var(--label-3); margin-right: 6px; font-family: var(--font); }
.log-time { margin-left: auto; color: var(--label-3); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 8px; }

/* ---------- Filter & video list ---------- */
.filter-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
#articlesPane .filter-bar { margin-bottom: 22px; }
.search-field {
    display: flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 10px;
    width: 260px;
    border-radius: 9px;
    background: var(--fill);
    color: var(--label-3);
}
.search-field input { flex: 1; border: none; outline: none; background: transparent; font-size: 13.5px; color: var(--label); }
.search-field:focus-within { box-shadow: 0 0 0 3px var(--accent-soft); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.chip {
    height: 28px; padding: 0 12px;
    border-radius: 14px;
    font-size: 12.5px;
    background: var(--fill-2);
    color: var(--label-2);
    transition: background 0.15s, color 0.15s;
}
.chip:hover { background: var(--fill); }
.chip.active { background: var(--label); color: var(--bg); }
.chip .n { opacity: 0.6; margin-left: 3px; font-variant-numeric: tabular-nums; }

.switch-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--label-2); cursor: pointer; }
.switch { position: relative; width: 42px; height: 25px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch .knob {
    position: absolute; inset: 0;
    border-radius: 13px;
    background: var(--fill);
    transition: background 0.25s;
}
.switch .knob::after {
    content: ""; position: absolute; top: 2px; left: 2px;
    width: 21px; height: 21px; border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 1px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s var(--ease);
}
.switch input:checked + .knob { background: var(--green); }
.switch input:checked + .knob::after { transform: translateX(17px); }

.video-list {
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 0.5px solid var(--sep);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.vl-head {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 18px;
    font-size: 12px; color: var(--label-3);
    border-bottom: 0.5px solid var(--sep);
    background: var(--surface-2);
}
.vl-row {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 18px;
    border-bottom: 0.5px solid var(--sep);
    cursor: pointer;
    transition: background 0.12s;
}
.vl-row:last-child { border-bottom: none; }
.vl-row:hover { background: var(--fill-2); }
.vl-row.selected { background: var(--accent-soft); }
.vl-row.converted { cursor: default; }
.check {
    width: 22px; height: 22px; border-radius: 50%;
    border: 1.5px solid var(--sep-strong);
    display: grid; place-items: center;
    color: #fff;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.selected .check, .check.on { background: var(--accent); border-color: var(--accent); }
.check.mixed { background: var(--accent); border-color: var(--accent); }
.check svg { opacity: 0; transform: scale(0.6); transition: 0.15s; }
.selected .check svg, .check.on svg, .check.mixed svg { opacity: 1; transform: none; }
.converted .check { border-style: dashed; opacity: 0.4; }
.check:disabled { opacity: 0.4; cursor: default; }
.vl-row.unavailable { cursor: default; }
.vl-row.unavailable:hover { background: transparent; }
.vl-row.unavailable .check { border-style: dashed; opacity: 0.3; }
.vl-row.unavailable .vl-thumb img { filter: grayscale(1); opacity: 0.45; }
.vl-row.unavailable .vl-title { color: var(--label-3); }
.vl-row.unavailable .vl-sub, .vl-row.unavailable .vl-date { opacity: 0.7; }
.badge.waiting { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; background: color-mix(in srgb, var(--orange) 14%, transparent); color: var(--orange); }
.vl-summary { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vl-recheck {
    display: inline-flex; align-items: center; gap: 5px;
    height: 24px; padding: 0 10px;
    border-radius: 12px;
    font-size: 12px; font-weight: 500; color: var(--accent);
    flex-shrink: 0;
    transition: background 0.15s;
}
.vl-recheck:hover { background: var(--accent-soft); }
.vl-recheck:disabled { color: var(--label-3); background: transparent; cursor: default; }
.vl-thumb {
    width: 104px; height: 58px; flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--fill-2);
    position: relative;
}
.vl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vl-thumb .dur {
    position: absolute; right: 4px; bottom: 4px;
    font-size: 10.5px; font-weight: 600; color: #fff;
    padding: 1px 5px; border-radius: 4px;
    background: rgba(0, 0, 0, 0.6);
    font-variant-numeric: tabular-nums;
}
.vl-main { flex: 1; min-width: 0; }
.vl-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vl-sub { margin-top: 2px; font-size: 12px; color: var(--label-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vl-date { width: 92px; font-size: 12px; color: var(--label-3); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.vl-state { width: 96px; display: flex; justify-content: flex-end; flex-shrink: 0; }
.vl-state a { font-size: 12px; font-weight: 500; }
.vl-more { padding: 14px; text-align: center; }

/* ---------- Floating action bar ---------- */
.action-bar {
    position: fixed; left: calc(50% + 134px); bottom: 28px; z-index: 20;
    transform: translateX(-50%);
    display: flex; align-items: center; gap: 10px;
    padding: 8px 8px 8px 20px;
    border-radius: 26px;
    background: rgba(29, 29, 31, 0.82);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    color: #fff;
    box-shadow: var(--shadow-lg);
    font-size: 13.5px;
    animation: popup 0.4s var(--ease);
}
.action-bar #actionBarText { margin-right: 6px; font-weight: 500; }
.export-bar #exportBarText { margin-right: 6px; font-weight: 500; font-variant-numeric: tabular-nums; }
.export-bar .btn-primary:disabled { opacity: 0.45; }

/* ---------- Pick mode (batch export) ---------- */
#articleFilterBar:not(.agenda) .filter-tail { order: 3; margin-left: auto; }
.pick-btn.on { background: var(--accent); color: #fff; }
.pick-btn.on:hover { background: var(--accent); filter: brightness(1.08); }
.card-cover .pick-check {
    position: absolute; top: 10px; left: 10px; z-index: 2;
    width: 24px; height: 24px;
    border: 1.5px solid #fff;
    background: rgba(0, 0, 0, 0.28);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.card.selected .card-cover .pick-check { background: var(--accent); border-color: #fff; }
.card-grid.picking .card.selected .card-cover { box-shadow: 0 0 0 3px var(--accent), var(--shadow); }
.card-grid.picking .card:hover .card-cover { transform: none; }
.agenda-card .pick-check { position: absolute; top: 14px; right: 14px; z-index: 2; background: var(--surface); }
.agenda-card.selected .pick-check { background: var(--accent); border-color: var(--accent); }
.card-grid.picking .agenda-card .ag-title { padding-right: 34px; }
.card-grid.picking .agenda-card.selected { box-shadow: inset 0 0 0 2px var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.card-grid.picking .unpickable { opacity: 0.4; cursor: not-allowed; }
.card-grid.picking .card-actions { display: none; }

/* ---------- Export sheet ---------- */
.export-sheet { width: min(640px, calc(100vw - 48px)); }
.exp-preview { max-height: 300px; overflow-y: auto; padding: 4px 0; }
.exp-part + .exp-part { border-top: 0.5px solid var(--sep); }
.exp-part-head {
    position: sticky; top: -4px;
    display: flex; align-items: baseline; gap: 8px;
    padding: 10px 14px 6px;
    background: var(--surface);
    font-size: 13.5px;
}
.exp-part-head .no { font-size: 11.5px; font-weight: 600; color: var(--accent); }
.exp-part-head b { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-part-head .n { font-size: 12px; color: var(--label-3); }
.exp-item { display: flex; gap: 10px; padding: 4px 14px; font-size: 12.5px; color: var(--label-2); }
.exp-item .idx { width: 20px; flex-shrink: 0; color: var(--label-3); font-variant-numeric: tabular-nums; }
.exp-item .t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-progress { padding: 28px 12px 12px; text-align: center; }
.exp-progress h3 { margin-top: 16px; font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.exp-ring {
    width: 56px; height: 56px; margin: 0 auto;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent);
}
.exp-ring .spinner { width: 24px; height: 24px; border-width: 2.5px; }
.exp-ring.ok { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.exp-ring.err { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.exp-stage { margin-top: 6px; font-size: 13px; color: var(--label-2); min-height: 18px; }
.exp-bar { width: min(380px, 100%); height: 6px; margin: 16px auto 0; border-radius: 3px; background: var(--fill); overflow: hidden; }
.exp-bar > i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width 0.8s var(--ease); }
.exp-sub { margin-top: 8px; font-size: 12px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.exp-tip { margin: 18px auto 0; max-width: 420px; font-size: 12px; line-height: 1.6; color: var(--label-3); }
.exp-err {
    margin: 14px auto 0; max-width: 520px; max-height: 180px; overflow: auto;
    padding: 10px 12px; border-radius: 8px;
    background: var(--fill); text-align: left;
    font: 12px/1.5 var(--mono); white-space: pre-wrap; word-break: break-all; color: var(--label-2);
}

/* ---------- Sheets ---------- */
.sheet-layer {
    position: fixed; inset: 0; z-index: 50;
    display: grid; place-items: center;
    background: rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(2px);
    animation: fadein 0.2s ease;
}
.sheet {
    width: min(720px, calc(100vw - 48px));
    max-height: calc(100vh - 64px);
    display: flex; flex-direction: column;
    border-radius: 18px;
    background: var(--bg);
    box-shadow: var(--shadow-lg);
    border: 0.5px solid var(--sep);
    overflow: hidden;
    animation: sheetin 0.4s var(--ease);
}
.sheet.narrow { width: min(520px, calc(100vw - 48px)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px 24px; }
.sheet-head h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.025em; }
.sheet-body { flex: 1; overflow-y: auto; padding: 10px 24px 20px; }
.sheet-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 0.5px solid var(--sep); background: var(--surface-2); }
.foot-note { flex: 1; font-size: 12px; color: var(--label-3); }

.group-title { font-size: 12px; font-weight: 600; color: var(--label-3); padding: 18px 14px 6px; text-transform: none; letter-spacing: 0.01em; display: flex; align-items: center; gap: 8px; }
.group-title:first-child { padding-top: 6px; }
.group {
    border-radius: 12px;
    background: var(--surface);
    border: 0.5px solid var(--sep);
    overflow: hidden;
}
.group-foot { font-size: 12px; color: var(--label-3); padding: 6px 14px 0; line-height: 1.5; }
.field-row {
    display: flex; align-items: center; gap: 14px;
    min-height: 44px;
    padding: 6px 14px;
    border-bottom: 0.5px solid var(--sep);
    font-size: 13.5px;
}
.field-row:last-child { border-bottom: none; }
.field-row > span:first-child { width: 96px; flex-shrink: 0; color: var(--label); }
.field-row input:not([type=checkbox]), .field-row select {
    flex: 1; min-width: 0;
    height: 30px;
    border: none; outline: none;
    background: transparent;
    text-align: right;
    color: var(--label-2);
}
.field-row input:focus { color: var(--label); }
.field-row select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' viewBox='0 0 10 14' fill='none' stroke='%2386868b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 5l3-3 3 3M2 9l3 3 3-3'/%3E%3C/svg%3E") no-repeat right center; }
.field-row .value { flex: 1; text-align: right; color: var(--label-2); }
.field-row .switch { margin-left: auto; }
.field-row .segmented { margin: 0 0 0 auto; }
.field-row .segmented button { min-width: 0; height: 26px; padding: 0 10px; font-size: 12px; }
.key-input { font-family: var(--mono); font-size: 12.5px !important; }
.test-result { font-size: 12px; margin-left: 8px; }
.test-result.ok { color: var(--green); }
.test-result.err { color: var(--red); }
.stepper { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.stepper button { width: 28px; height: 24px; border-radius: 6px; background: var(--fill); font-size: 15px; line-height: 1; }
.stepper span { min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.purpose-chip { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff; }

.icon-picker { display: flex; gap: 8px; flex-wrap: wrap; padding: 16px 2px 0; }
.icon-picker button {
    width: 40px; height: 40px; border-radius: 11px;
    display: grid; place-items: center; color: #fff;
    opacity: 0.55; transition: opacity 0.15s, transform 0.15s;
}
.icon-picker button.active { opacity: 1; transform: scale(1.06); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }

/* ---------- Reader ---------- */
.reader { max-width: 1240px; padding-top: 0; }
.reader-col { max-width: none; margin: 0; }
.detail-head { padding: 4px 0 18px; }
.detail-head .reader-title { font-size: 30px; line-height: 1.2; }
.detail-head .reader-meta { margin-top: 6px; }

.media-row { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; margin-bottom: 30px; }
.player-box {
    position: relative; aspect-ratio: 16 / 9;
    border-radius: var(--r-lg);
    background: #000;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.player-inner { position: absolute; inset: 0; background: #000; }
.player-inner video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-box.floating::after {
    content: "正在小窗播放"; position: absolute; inset: 0;
    display: grid; place-items: center;
    color: rgba(255, 255, 255, 0.45); font-size: 13px;
}
.player-box.floating .player-inner {
    position: fixed; inset: auto 28px 28px auto; z-index: 40;
    width: 400px; height: auto; aspect-ratio: 16 / 9;
    border-radius: 14px; overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: popin 0.35s var(--ease);
}
.mini-close {
    display: none; position: absolute; top: 8px; right: 8px; z-index: 2;
    width: 26px; height: 26px; border-radius: 50%;
    place-items: center; color: #fff;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.player-box.floating .player-inner:not(:fullscreen) .mini-close { display: grid; }
.player-box .player-inner:fullscreen { border-radius: 0; box-shadow: none; animation: none; }
.player-inner.idle { cursor: none; }

.pc-big {
    position: absolute; left: 50%; top: 50%; z-index: 1;
    width: 64px; height: 64px; margin: -32px 0 0 -32px; padding-left: 4px;
    display: grid; place-items: center; border-radius: 50%; color: #fff;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
    opacity: 0; transform: scale(0.88); pointer-events: none;
    transition: opacity 0.2s, transform 0.25s var(--ease);
}
.player-inner.paused:not(.loading) .pc-big { opacity: 1; transform: none; }
.pc-spin {
    display: none; position: absolute; left: 50%; top: 50%; z-index: 1;
    width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.25); border-top-color: #fff;
    animation: spin 0.8s linear infinite; pointer-events: none;
}
.player-inner.loading:not(.paused) .pc-spin { display: block; }

.pc-bar {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    padding: 30px 12px 6px; color: #fff;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.66), rgba(0, 0, 0, 0.3) 55%, transparent);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.player-inner.idle .pc-bar { opacity: 0; transform: translateY(6px); pointer-events: none; }
.pc-prog { --p: 0%; --b: 0%; --h: 0%; position: relative; height: 16px; margin: 0 4px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.pc-track { position: relative; width: 100%; height: 4px; border-radius: 2px; overflow: hidden; background: rgba(255, 255, 255, 0.26); transition: height 0.15s; }
.pc-prog:hover .pc-track, .pc-prog.drag .pc-track { height: 6px; }
.pc-track i { position: absolute; left: 0; top: 0; bottom: 0; }
.pc-buf { width: var(--b); background: rgba(255, 255, 255, 0.38); }
.pc-played { width: var(--p); background: var(--accent); }
.pc-knob {
    position: absolute; left: var(--p); top: 50%;
    width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    transform: scale(0); transition: transform 0.15s;
}
.pc-prog:hover .pc-knob, .pc-prog.drag .pc-knob { transform: scale(1); }
.pc-tip {
    position: absolute; bottom: 20px; left: var(--h); transform: translateX(-50%);
    padding: 3px 7px; border-radius: 6px; white-space: nowrap;
    font-size: 12px; font-variant-numeric: tabular-nums; color: #fff; background: rgba(0, 0, 0, 0.72);
    opacity: 0; pointer-events: none; transition: opacity 0.12s;
}
.pc-prog.drag .pc-tip { left: var(--p); }
.pc-prog:hover .pc-tip, .pc-prog.drag .pc-tip { opacity: 1; }
.pc-tip:empty { display: none; }
.pc-row { display: flex; align-items: center; gap: 2px; height: 38px; margin-top: 2px; }
.pc-btn {
    min-width: 34px; height: 34px; padding: 0 6px; border-radius: 8px;
    display: grid; place-items: center; color: rgba(255, 255, 255, 0.92);
    transition: background 0.15s, color 0.15s;
}
.pc-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.14); }
.pc-txt { padding: 0 10px; font-size: 13.5px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pc-time { margin-left: 6px; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; color: rgba(255, 255, 255, 0.92); }
.pc-dur { color: rgba(255, 255, 255, 0.6); }
.pc-gap { flex: 1; }
.pc-vol { display: flex; align-items: center; }
.pc-vol-range {
    --v: 100%; width: 0; height: 4px; margin: 0; opacity: 0; cursor: pointer;
    appearance: none; -webkit-appearance: none; border-radius: 2px;
    background: linear-gradient(to right, #fff var(--v), rgba(255, 255, 255, 0.3) var(--v));
    transition: width 0.2s var(--ease), opacity 0.2s, margin 0.2s var(--ease);
}
.pc-vol:hover .pc-vol-range, .pc-vol:focus-within .pc-vol-range { width: 72px; margin: 0 8px 0 4px; opacity: 1; }
.pc-vol-range::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
.pc-vol-range::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }
.pc-menu-wrap { position: relative; }
.pc-menu {
    position: absolute; left: 50%; bottom: calc(100% + 12px); z-index: 3;
    display: flex; flex-direction: column; min-width: 96px; padding: 4px;
    border-radius: 12px; background: rgba(28, 28, 30, 0.88);
    backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 0 0 0.5px rgba(255, 255, 255, 0.12);
    opacity: 0; visibility: hidden; transform: translate(-50%, 6px) scale(0.97); transform-origin: bottom center;
    transition: opacity 0.16s, transform 0.2s var(--ease), visibility 0.16s;
}
.pc-menu-wrap.open .pc-menu { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.pc-item {
    position: relative; height: 36px; padding: 0 16px; border-radius: 8px;
    font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, 0.9);
}
.pc-item + .pc-item::before { content: ""; position: absolute; top: 0; left: 12px; right: 12px; height: 0.5px; background: rgba(255, 255, 255, 0.12); }
.pc-item:hover { background: rgba(255, 255, 255, 0.1); }
.pc-item.active { color: color-mix(in srgb, var(--accent) 78%, #fff); font-weight: 600; }
.player-box.floating .player-inner:not(:fullscreen) .pc-full { display: none; }
.player-box.floating .player-inner:not(:fullscreen) .pc-bar { padding: 22px 6px 2px; }
.player-box.floating .player-inner:not(:fullscreen) .pc-row { height: 32px; }
.player-box.floating .player-inner:not(:fullscreen) .pc-big { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
.player-inner:fullscreen .pc-bar { padding: 48px 28px 14px; }
.player-inner:fullscreen .pc-row { height: 46px; }
.player-ph { position: absolute; inset: 0; display: grid; place-items: center; background: #111; }
.player-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(3px) brightness(0.42) saturate(1.1); transform: scale(1.05); }
.ph-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 440px; padding: 24px; text-align: center; color: #fff; }
.ph-icon {
    width: 54px; height: 54px; border-radius: 16px;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.ph-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.ph-sub { font-size: 13px; line-height: 1.55; color: rgba(255, 255, 255, 0.72); }
.ph-progress { width: 300px; max-width: 100%; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.2); overflow: hidden; }
.ph-progress > i { display: block; height: 100%; border-radius: 2px; background: #fff; transition: width 0.6s var(--ease); }
.ph-inner .btn { margin-top: 6px; }

.hl-panel {
    position: relative; min-height: 260px;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 0.5px solid var(--sep);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.hl-inner { position: absolute; inset: 0; display: flex; flex-direction: column; }
.hl-head { display: flex; align-items: center; gap: 8px; padding: 13px 14px 11px 16px; border-bottom: 0.5px solid var(--sep); }
.hl-heading { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.hl-heading::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: linear-gradient(var(--accent), var(--purple)); }
.hl-count { font-size: 12px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.hl-toggle { margin-left: auto; padding: 3px 8px; border-radius: 10px; font-size: 12px; color: var(--accent); }
.hl-toggle:hover { background: var(--accent-soft); }
.hl-scroll { position: relative; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 6px 0 10px; }
.hl-list { list-style: none; }
.hl-item {
    position: relative;
    display: grid; grid-template-columns: 48px 14px minmax(0, 1fr); column-gap: 8px;
    padding: 9px 14px 9px 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.hl-item:hover { background: var(--fill-2); }
.hl-time { padding-top: 1px; text-align: right; font-family: var(--mono); font-size: 11.5px; color: var(--label-3); font-variant-numeric: tabular-nums; transition: color 0.2s; }
.hl-rail { position: relative; }
.hl-rail::before {
    content: ""; position: absolute; left: 50%; top: -9px; bottom: -9px;
    width: 1.5px; transform: translateX(-50%);
    background: var(--sep-strong);
}
.hl-item:first-child .hl-rail::before { top: 8px; }
.hl-item:last-child .hl-rail::before { bottom: auto; height: 17px; }
.hl-rail i {
    position: absolute; left: 50%; top: 4px;
    width: 9px; height: 9px; border-radius: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1.5px solid var(--label-3);
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.hl-name { font-size: 13.5px; font-weight: 600; line-height: 1.45; color: var(--label); transition: color 0.2s; }
.hl-sum {
    margin-top: 3px; font-size: 12.5px; line-height: 1.6; color: var(--label-2);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hl-item.open .hl-sum, .hl-item.active .hl-sum { display: block; -webkit-line-clamp: unset; }
.hl-more { margin-top: 2px; font-size: 12px; color: var(--accent); }
.hl-more:hover { text-decoration: underline; }
.hl-item.active .hl-more { display: none; }
.hl-item.past .hl-rail::before { background: var(--accent); }
.hl-item.past .hl-rail i { background: var(--accent); border-color: var(--accent); }
.hl-item.active { background: var(--accent-soft); }
.hl-item.active .hl-rail::before { background: linear-gradient(var(--accent) 0 17px, var(--sep-strong) 17px); }
.hl-item.active .hl-rail i {
    top: 3px; width: 11px; height: 11px;
    background: var(--accent); border-color: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}
.hl-item.active .hl-name, .hl-item.active .hl-time { color: var(--accent); }
.hl-state { padding: 18px; font-size: 13px; color: var(--label-2); }
.hl-state p { margin: 6px 0 14px; font-size: 12.5px; line-height: 1.6; color: var(--label-3); }
.hl-gen { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--accent); }
.hl-gen-time { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--label-3); font-variant-numeric: tabular-nums; }
.hl-skel { display: grid; grid-template-columns: 40px 1fr; gap: 7px 12px; padding: 10px 0; }
.hl-skel i, .hl-skel b {
    height: 10px; border-radius: 5px;
    background: linear-gradient(90deg, var(--fill-2), var(--fill), var(--fill-2));
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
}
.hl-skel i { grid-row: span 2; }
.hl-skel b:last-child { width: 70%; grid-column: 2; }

.version-hint { flex: 1; min-width: 0; margin-left: 14px; font-size: 12.5px; color: var(--label-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-link {
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding: 0 8px; margin-left: 8px;
    position: relative; top: -3px;
    border-radius: 11px;
    font-family: var(--font); font-size: 12px; font-weight: 600; letter-spacing: 0;
    color: var(--accent); background: var(--accent-soft);
    font-variant-numeric: tabular-nums;
    transition: background 0.15s, color 0.15s;
}
.ts-link:hover { background: var(--accent); color: #fff; }
.ts-link.cap { height: auto; padding: 0 4px; margin: 0 1px 0 0; top: 0; border-radius: 4px; background: none; font-size: inherit; }
.ts-link.cap:hover { background: var(--accent-soft); color: var(--accent); }
.reader-cover { border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); margin: 8px 0 28px; aspect-ratio: 16 / 8; background: var(--fill-2); }
.reader-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reader-eyebrow { font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.reader-title { font-family: var(--font-display); font-size: 38px; line-height: 1.15; font-weight: 700; letter-spacing: -0.035em; }
.reader-meta { margin-top: 10px; font-size: 13.5px; color: var(--label-3); }
.reader-bar {
    position: sticky; top: 52px; z-index: 4;
    display: flex; align-items: center; justify-content: space-between;
    margin: 22px 0 8px; padding: 10px 0;
    background: linear-gradient(var(--bg) 70%, transparent);
}
.reader-body { font-family: var(--font-read); font-size: 17px; line-height: 1.85; color: var(--label); letter-spacing: 0; }
.reader-body h1 { font-family: var(--font-display); font-size: 30px; line-height: 1.25; margin: 40px 0 16px; letter-spacing: -0.03em; }
.reader-body h2 { font-family: var(--font-display); font-size: 24px; line-height: 1.3; margin: 44px 0 14px; letter-spacing: -0.025em; }
.reader-body h3 { font-size: 19px; margin: 30px 0 10px; }
.reader-body h4 { font-size: 17px; margin: 24px 0 8px; }
.reader-body p { margin: 0 0 18px; }
.reader-body img {
    display: block; max-width: 100%;
    margin: 26px auto 8px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}
.reader-body em { display: block; text-align: center; font-style: normal; font-size: 13px; color: var(--label-3); margin-top: -2px; }
.reader-body p > em:only-child { margin-bottom: 18px; }
.reader-body ul, .reader-body ol { margin: 0 0 18px; padding-left: 24px; }
.reader-body li { margin: 6px 0; }
.reader-body blockquote { margin: 0 0 18px; padding: 4px 18px; border-left: 3px solid var(--accent); color: var(--label-2); }
.reader-body code { font-family: var(--mono); font-size: 0.86em; padding: 2px 6px; border-radius: 5px; background: var(--fill-2); }
.reader-body pre { padding: 14px 16px; border-radius: 12px; background: var(--fill-2); overflow-x: auto; margin: 0 0 18px; }
.reader-body pre code { background: none; padding: 0; }
.reader-body table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 14px; }
.reader-body th, .reader-body td { padding: 8px 12px; border-bottom: 0.5px solid var(--sep); text-align: left; }
.reader-body hr { border: none; border-top: 0.5px solid var(--sep); margin: 32px 0; }
.reader-body strong { font-weight: 600; }
.reader-body .brief {
    margin: 8px 0 36px; padding: 20px 24px 14px;
    border-radius: 14px; background: var(--surface); border: 0.5px solid var(--sep);
    font-family: var(--font); font-size: 15px; line-height: 1.7;
}
.reader-body .brief h1, .reader-body .brief h2, .reader-body .brief h3 { font-size: 16px; font-weight: 700; letter-spacing: 0; margin: 0 0 10px; }
.reader-body .brief h2 + p { margin: 0 0 20px; color: var(--label-2); }
.reader-body .brief ol { list-style: none; counter-reset: bp; margin: 0 0 6px; padding: 0; }
.reader-body .brief li { counter-increment: bp; position: relative; padding-left: 34px; margin: 0 0 10px; }
.reader-body .brief li::before {
    content: counter(bp); position: absolute; left: 0; top: 2px;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--green); color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center;
}

/* ---------- Rich version ---------- */
.reader-body.rich { container: rich / inline-size; font-family: var(--font); font-size: 16px; line-height: 1.75; }
.reader-body.rich h2 {
    font-family: var(--font); font-size: 21px; font-weight: 700; letter-spacing: -0.01em;
    margin: 44px 0 16px; padding-left: 12px; border-left: 4px solid var(--accent); line-height: 1.35;
}
.reader-body.rich h3 { font-size: 17px; margin: 26px 0 12px; }
.reader-body.rich p { margin: 0 0 14px; }
.reader-body.rich em { display: inline; font-style: italic; text-align: inherit; font-size: inherit; color: inherit; margin: 0; }
.reader-body.rich ul, .reader-body.rich ol { margin: 0 0 16px; padding-left: 22px; }
.reader-body.rich li { margin: 5px 0; }
.reader-body.rich li > ul, .reader-body.rich li > ol { margin: 4px 0 10px; }
.reader-body.rich li::marker { color: var(--label-3); }
.reader-body.rich blockquote.rich-meta {
    margin: 0 0 22px; padding: 2px 14px; border-left: 3px solid var(--sep-strong);
    font-size: 14px; line-height: 1.8; color: var(--label-2);
}
.reader-body.rich .rich-meta p { margin: 0; white-space: pre-line; }

.reader-body.rich .rich-summary {
    margin: 4px 0 40px; padding: 26px 28px 14px;
    border-radius: 16px; background: var(--surface); border: 0.5px solid var(--sep); box-shadow: var(--shadow-sm);
}
.reader-body.rich .rsum-title { font-size: 22px; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; margin-bottom: 16px; }
.reader-body.rich .rich-summary h3 { margin: 26px 0 12px; }
.reader-body.rich .rich-summary > :last-child { margin-bottom: 0; }
.reader-body.rich .rsum-foot { margin-top: 14px; text-align: right; font-size: 12px; color: var(--label-3); }

.reader-body.rich .rsum-share, .reader-body.rich .rich-share-h2 { --c: #4361d8; }
.reader-body.rich [data-tone="1"]:is(.rsum-share, .rich-share-h2) { --c: #0a85a8; }
.reader-body.rich [data-tone="2"]:is(.rsum-share, .rich-share-h2) { --c: #d5620f; }
.reader-body.rich [data-tone="3"]:is(.rsum-share, .rich-share-h2) { --c: #c2307a; }
[data-theme="dark"] .reader-body.rich :is(.rsum-share, .rich-share-h2) { --c: #8ea2ff; }
[data-theme="dark"] .reader-body.rich [data-tone="1"]:is(.rsum-share, .rich-share-h2) { --c: #4cc4e6; }
[data-theme="dark"] .reader-body.rich [data-tone="2"]:is(.rsum-share, .rich-share-h2) { --c: #ff9f5a; }
[data-theme="dark"] .reader-body.rich [data-tone="3"]:is(.rsum-share, .rich-share-h2) { --c: #f07ab3; }
.reader-body.rich .rsum-share {
    margin: 22px 0 0; padding: 0 18px 4px; border-radius: 14px; overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--c) 22%, var(--sep));
    background: color-mix(in srgb, var(--c) 2.5%, var(--surface));
}
.reader-body.rich .rich-share-head {
    display: flex; align-items: flex-start; gap: 12px; margin: 0 -18px 4px; padding: 13px 18px 12px;
    background: color-mix(in srgb, var(--c) 10%, var(--surface));
    border-bottom: 1px solid color-mix(in srgb, var(--c) 20%, transparent);
    box-shadow: inset 4px 0 0 var(--c);
}
.reader-body.rich .rsh-avatar {
    flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
    background: var(--c); color: #fff; font-size: 16px; font-weight: 700;
}
[data-theme="dark"] .reader-body.rich .rsh-avatar { color: #000; }
.reader-body.rich .rsh-main { flex: 1; min-width: 0; }
.reader-body.rich .rsh-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; line-height: 1.45; }
.reader-body.rich .rsh-name { font-size: 16px; color: var(--c); }
.reader-body.rich .rsh-role { font-size: 13px; color: var(--label-2); }
.reader-body.rich .rsh-topic { margin-top: 2px; font-size: 15.5px; font-weight: 700; line-height: 1.45; }
.reader-body.rich .rsh-gist { margin-top: 3px; font-size: 13.5px; line-height: 1.6; color: var(--label-2); }
.reader-body.rich .rsh-idx {
    flex: none; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6;
    color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
}
.reader-body.rich .rsum-share h3 { margin: 18px 0 10px; font-size: 15.5px; }
.reader-body.rich .rsum-share > :last-child { margin-bottom: 14px; }

.reader-body.rich > h3 { display: flex; align-items: center; gap: 9px; margin: 28px 0 10px; }
.reader-body.rich > h3::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.reader-body.rich h2.rich-share-h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; border-left-color: var(--c); }
.reader-body.rich .rsh-chip {
    padding: 1px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; letter-spacing: 0; line-height: 1.6;
    color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent);
}

.reader-body.rich .rich-insight {
    display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 14px;
    margin: 0 0 8px; padding: 14px 20px; border-radius: 10px; background: var(--fill-2);
    font-size: 15px; line-height: 1.75;
}
.reader-body.rich .ri-label { font-weight: 700; white-space: nowrap; }
.reader-body.rich .rich-insight ul { margin: 0; padding-left: 18px; }
.reader-body.rich .rich-insight li { margin: 0 0 4px; }

.reader-body.rich .rich-cards { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 14px; margin: 0 0 22px; }
.reader-body.rich .rc {
    --c: #4361d8;
    display: flex; flex-direction: column; padding: 4px 10px 10px; border-radius: 12px;
    background: color-mix(in srgb, var(--c) 7%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--c) 14%, transparent);
}
.reader-body.rich .rc[data-tone="1"] { --c: #0a85a8; }
.reader-body.rich .rc[data-tone="2"] { --c: #5f8a0f; }
.reader-body.rich .rc[data-tone="3"] { --c: #d5620f; }
.reader-body.rich .rc[data-tone="4"] { --c: #c2307a; }
.reader-body.rich .rc[data-tone="5"] { --c: #7048e8; }
[data-theme="dark"] .reader-body.rich .rc { --c: #8ea2ff; background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
[data-theme="dark"] .reader-body.rich .rc[data-tone="1"] { --c: #4cc4e6; }
[data-theme="dark"] .reader-body.rich .rc[data-tone="2"] { --c: #a3cf4f; }
[data-theme="dark"] .reader-body.rich .rc[data-tone="3"] { --c: #ff9f5a; }
[data-theme="dark"] .reader-body.rich .rc[data-tone="4"] { --c: #f07ab3; }
[data-theme="dark"] .reader-body.rich .rc[data-tone="5"] { --c: #a98bff; }
.reader-body.rich .rc-head { display: flex; align-items: center; gap: 9px; padding: 8px 6px; font-size: 15px; font-weight: 700; color: var(--c); line-height: 1.4; }
.reader-body.rich .rc-head i { flex-shrink: 0; width: 8px; height: 8px; border-radius: 2px; background: var(--c); transform: rotate(45deg); }
.reader-body.rich .rc-body { flex: 1; padding: 12px 16px; border-radius: 8px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
.reader-body.rich .rc-sub { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px dashed var(--sep-strong); font-size: 14.5px; font-weight: 700; line-height: 1.5; }
.reader-body.rich .rc-body ul { margin: 0; padding-left: 18px; font-size: 14.5px; line-height: 1.65; }
.reader-body.rich .rc-body li { margin: 4px 0; }

.reader-body.rich .rich-steps { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); margin: 6px 0 24px; }
.reader-body.rich .rs { display: contents; }
.reader-body.rich .rs > * { grid-column: var(--i); padding: 0 10px; text-align: center; }
.reader-body.rich .rs-title { grid-row: 1; align-self: end; padding-bottom: 8px; font-size: 15px; font-weight: 700; color: var(--accent); line-height: 1.4; }
.reader-body.rich .rs-dot { grid-row: 2; position: relative; display: grid; place-items: center; height: 22px; padding: 0; }
.reader-body.rich .rs-dot::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1.5px dashed var(--sep-strong); }
.reader-body.rich .rs-dot b {
    position: relative; width: 20px; height: 20px; border-radius: 50%;
    background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
    box-shadow: 0 0 0 3px var(--surface);
}
.reader-body.rich .rs-desc { grid-row: 3; padding-top: 8px; font-size: 13.5px; line-height: 1.6; color: var(--label-2); }

.reader-body.rich .rich-timeline { list-style: none; margin: 4px 0 24px; padding: 0; }
.reader-body.rich .rich-timeline li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 18px; margin: 0; }
.reader-body.rich .rt-time { text-align: right; font-size: 14.5px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.6; }
.reader-body.rich .rt-main { position: relative; padding: 0 0 16px 20px; border-left: 2px solid var(--sep); }
.reader-body.rich .rt-main::before {
    content: ""; position: absolute; left: -6px; top: 7px; width: 10px; height: 10px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 0 3px var(--surface);
}
.reader-body.rich .rich-timeline li:last-child .rt-main { border-left-color: transparent; padding-bottom: 0; }
.reader-body.rich .rt-title { font-weight: 600; line-height: 1.6; }
.reader-body.rich .rt-desc { font-size: 14px; color: var(--label-2); line-height: 1.6; }

.reader-body.rich .rich-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 4px 0 24px; }
.reader-body.rich .st { padding: 14px 16px 12px; border-radius: 12px; background: var(--fill-2); }
.reader-body.rich .st-num { font-size: 26px; font-weight: 700; line-height: 1.25; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.reader-body.rich .st-label { margin-top: 4px; font-size: 13px; line-height: 1.5; color: var(--label-2); }

.reader-body.rich .callout {
    --co: #e8a400;
    margin: 4px 0 22px; padding: 12px 18px; border-radius: 10px;
    background: color-mix(in srgb, var(--co) 9%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--co) 22%, transparent);
}
.reader-body.rich .callout-note { --co: #3370ff; }
.reader-body.rich .callout-warning { --co: #f05a28; }
.reader-body.rich .co-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; font-weight: 700; }
.reader-body.rich .co-body p { margin: 0 0 6px; }
.reader-body.rich .co-body > :last-child { margin-bottom: 0; }

.reader-body.rich .rich-table { margin: 0 0 22px; overflow-x: auto; border: 1px solid var(--sep); border-radius: 10px; }
.reader-body.rich .rich-table table { margin: 0; font-size: 14px; line-height: 1.6; }
.reader-body.rich .rich-table th, .reader-body.rich .rich-table td { padding: 9px 14px; border: 1px solid var(--sep); vertical-align: top; }
.reader-body.rich .rich-table th { background: var(--fill-2); font-weight: 600; white-space: nowrap; }
.reader-body.rich .rich-table tr > :first-child { border-left: 0; }
.reader-body.rich .rich-table tr > :last-child { border-right: 0; }
.reader-body.rich .rich-table thead th { border-top: 0; }
.reader-body.rich .rich-table tbody tr:last-child td { border-bottom: 0; }

.reader-body.rich figure { margin: 0; }
.reader-body.rich figure img {
    display: block; width: 100%; height: auto; margin: 0;
    border-radius: 10px; border: 0.5px solid var(--sep); box-shadow: var(--shadow-sm); cursor: zoom-in;
}
.reader-body.rich figcaption { margin-top: 6px; font-size: 12.5px; line-height: 1.5; color: var(--label-3); text-align: center; }
.reader-body.rich figcaption .ts-link.cap { font-size: inherit; }
.reader-body.rich .rich-row { display: grid; grid-template-columns: minmax(0, 1fr) 40%; gap: 28px; align-items: start; margin: 4px 0 18px; }
.reader-body.rich .rr-text > :last-child { margin-bottom: 0; }
.reader-body.rich .rich-strip { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 400px)); justify-content: center; gap: 16px; margin: 6px 0 22px; }
.reader-body.rich figure.solo { max-width: 60%; margin: 6px auto 22px; }

@container rich (max-width: 600px) {
    .reader-body.rich .rich-cards, .reader-body.rich .rich-row, .reader-body.rich .rich-strip { grid-template-columns: minmax(0, 1fr); }
    .reader-body.rich .rich-row { gap: 12px; }
    .reader-body.rich .rich-row figure { order: -1; }
    .reader-body.rich figure.solo { max-width: none; }
    .reader-body.rich .rich-insight { grid-template-columns: minmax(0, 1fr); }
    .reader-body.rich .rich-summary { padding: 20px 16px 12px; }
    .reader-body.rich .rsum-share { padding: 0 12px 2px; }
    .reader-body.rich .rich-share-head { position: relative; gap: 10px; margin: 0 -12px 4px; padding: 12px; }
    .reader-body.rich .rsh-avatar { width: 32px; height: 32px; font-size: 14px; }
    .reader-body.rich .rsh-idx { position: absolute; top: 12px; right: 12px; }
    .reader-body.rich .rsh-who { padding-right: 60px; }
    .reader-body.rich .rich-steps { display: block; }
    .reader-body.rich .rs { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 12px; }
    .reader-body.rich .rs > * { grid-column: 2; padding: 0; text-align: left; }
    .reader-body.rich .rs-title { grid-row: 1; align-self: start; padding: 0; }
    .reader-body.rich .rs-desc { grid-row: 2; padding: 0 0 14px; }
    .reader-body.rich .rs-dot { grid-column: 1; grid-row: 1 / span 2; height: auto; place-items: start center; padding-top: 2px; }
    .reader-body.rich .rs-dot::before { left: 50%; right: auto; top: 0; bottom: 0; border-top: 0; border-left: 1.5px dashed var(--sep-strong); }
    .reader-body.rich .rs:last-child .rs-dot::before { display: none; }
    .reader-body.rich .rich-timeline li { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .reader-body.rich .rt-time { text-align: left; padding-left: 22px; border-left: 2px solid var(--sep); }
}

@media print {
    .reader-body.rich { font-size: 13.5px; line-height: 1.7; }
    .reader-body.rich h2 { font-size: 17px; margin: 26px 0 10px; break-after: avoid; }
    .reader-body.rich h3 { font-size: 15px; break-after: avoid; }
    .reader-body.rich .rich-summary { padding: 18px 20px 10px; box-shadow: none; }
    .reader-body.rich .rsum-title { font-size: 18px; }
    .reader-body.rich .rich-insight, .reader-body.rich .rich-cards, .reader-body.rich .rich-steps, .reader-body.rich .rich-stats,
    .reader-body.rich .rich-row, .reader-body.rich .rich-strip, .reader-body.rich figure, .reader-body.rich .callout,
    .reader-body.rich .rich-table, .reader-body.rich .rich-timeline li { break-inside: avoid; }
    .reader-body.rich .rc-body ul, .reader-body.rich .rich-insight { font-size: 12.5px; }
    .reader-body.rich figure img { box-shadow: none; }
    .reader-body.rich .rich-summary h3, .reader-body.rich > h3, .reader-body.rich .rich-share-head { break-after: avoid; }
    .reader-body.rich .rich-share-head { break-inside: avoid; }
    .reader-body.rich .rsum-share, .reader-body.rich .rich-share-head, .reader-body.rich .rsh-avatar, .reader-body.rich .rsh-chip {
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
}

.lightbox {
    position: fixed; inset: 0; z-index: 300;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    padding: 40px; background: rgba(0, 0, 0, 0.82); cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: calc(100% - 40px); border-radius: 8px; }
.lightbox .lb-cap { font-size: 13px; color: rgba(255, 255, 255, 0.8); }

.disclosure { margin-top: 18px; border-radius: 12px; background: var(--surface); border: 0.5px solid var(--sep); overflow: hidden; }
.disclosure:first-of-type { margin-top: 48px; }
.disclosure summary {
    list-style: none; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 16px; font-weight: 500; font-size: 14px;
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary svg { transition: transform 0.25s var(--ease); color: var(--label-3); }
.disclosure[open] summary svg { transform: rotate(180deg); }
.disclosure a { display: block; padding: 0 16px 14px; font-size: 13px; word-break: break-all; }
.disclosure pre { margin: 0; padding: 0 16px 16px; max-height: 420px; overflow-y: auto; font-family: var(--mono); font-size: 12px; line-height: 1.7; white-space: pre-wrap; color: var(--label-2); }

/* ---------- Log drawer ---------- */
button.pill { border: 0; cursor: pointer; font: inherit; font-size: 12px; transition: filter 0.2s, transform 0.2s var(--ease); }
button.pill:hover { filter: brightness(0.96) saturate(1.2); }
button.pill:active { transform: scale(0.97); }
button.pill .pill-more { opacity: 0.6; margin-left: -2px; }
.badge[data-log] { cursor: pointer; }
.badge[data-log]:hover { filter: brightness(0.95) saturate(1.3); }

.ld-mask {
    position: fixed; inset: 0; z-index: 60;
    background: rgba(0, 0, 0, 0.14);
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
.ld-mask.open { opacity: 1; pointer-events: auto; }
.log-drawer {
    position: fixed; top: 10px; right: 10px; bottom: 10px; z-index: 61;
    width: min(460px, calc(100vw - 20px));
    display: flex; flex-direction: column;
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface) 76%, transparent);
    backdrop-filter: saturate(180%) blur(30px);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
    border: 0.5px solid var(--sep-strong);
    box-shadow: var(--shadow-lg);
    transform: translateX(calc(100% + 24px));
    visibility: hidden;
    transition: transform 0.46s var(--ease), visibility 0s linear 0.46s;
    overflow: hidden;
}
.log-drawer.open { transform: none; visibility: visible; transition: transform 0.46s var(--ease); }
.ld-head { display: flex; align-items: flex-start; gap: 10px; padding: 18px 16px 10px 20px; }
.ld-head-text { flex: 1; min-width: 0; }
.ld-eyebrow { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--accent); }
.ld-title { margin-top: 4px; font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ld-sub { margin-top: 5px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--label-2); }
.ld-sub .sep { color: var(--label-3); }

.ld-tasks { display: flex; gap: 6px; padding: 0 20px 10px; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; }
.ld-tasks::-webkit-scrollbar { display: none; }
.ld-chip {
    flex-shrink: 0; max-width: 200px; display: inline-flex; align-items: center; gap: 6px;
    height: 26px; padding: 0 10px; border-radius: 13px; border: 0;
    background: var(--fill-2); color: var(--label-2); font: inherit; font-size: 12px; cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.ld-chip span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-chip:hover { background: var(--fill); }
.ld-chip.active { background: var(--accent); color: #fff; }
.ld-chip .spinner { width: 9px; height: 9px; border-width: 1.5px; flex-shrink: 0; }

.ld-error {
    margin: 0 16px 10px; padding: 10px 12px; border-radius: 12px; flex-shrink: 0;
    background: color-mix(in srgb, var(--red) 10%, transparent);
    border: 0.5px solid color-mix(in srgb, var(--red) 35%, transparent);
    color: var(--red); font-size: 12.5px;
}
.ld-error .row { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.ld-error .row .flex1 { flex: 1; }
.ld-error pre { margin: 6px 0 0; font-family: var(--mono); font-size: 11.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; max-height: 132px; overflow-y: auto; color: color-mix(in srgb, var(--red) 85%, var(--label)); }
.ld-error .btn { height: 24px; padding: 0 10px; font-size: 12px; }

.ld-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 0 16px 12px; flex-shrink: 0; }
.ld-step {
    position: relative; min-width: 0; padding: 7px 8px 6px; border-radius: 10px;
    background: color-mix(in srgb, var(--surface) 60%, transparent);
    border: 0.5px solid var(--sep);
    transition: background 0.3s, border-color 0.3s;
}
.ld-step .top { display: flex; align-items: center; gap: 5px; }
.ld-step .dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: var(--fill); color: var(--label-3); }
.ld-step .dot svg { width: 9px; height: 9px; }
.ld-step .name { flex: 1; min-width: 0; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-step .tag { font-size: 9.5px; font-weight: 600; padding: 0 4px; border-radius: 4px; line-height: 15px; background: var(--fill-2); color: var(--label-3); flex-shrink: 0; }
.ld-step .tag.model { color: var(--purple); background: color-mix(in srgb, var(--purple) 12%, transparent); }
.ld-step .time { margin-top: 3px; padding-left: 19px; font-family: var(--mono); font-size: 11px; color: var(--label-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-step.wait .name { color: var(--label-3); font-weight: 500; }
.ld-step.done .dot, .ld-step.skip .dot { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.ld-step.skip .time { color: var(--green); font-family: var(--font); }
.ld-step.run { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.ld-step.run .dot { background: transparent; color: var(--accent); }
.ld-step.run .dot .spinner { width: 11px; height: 11px; border-width: 1.6px; }
.ld-step.run .time { color: var(--accent); font-weight: 600; }
.ld-step.fail { background: color-mix(in srgb, var(--red) 9%, transparent); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.ld-step.fail .dot { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
.ld-step.fail .time { color: var(--red); font-family: var(--font); }
.ld-step.stop .dot { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.ld-step.stop .time { color: var(--orange); font-family: var(--font); }
.ld-step.par { border-style: dashed; }
.ld-step.par::before {
    content: "并行"; position: absolute; top: -6px; right: 6px; padding: 0 4px; border-radius: 4px;
    font-size: 9px; font-weight: 600; line-height: 12px; color: var(--label-3); background: var(--bg);
}

.ld-lives { display: flex; flex-direction: column; gap: 6px; padding: 0 16px 10px; flex-shrink: 0; }
.ld-live { border-radius: 12px; padding: 8px 10px; background: color-mix(in srgb, var(--purple) 7%, transparent); border: 0.5px solid color-mix(in srgb, var(--purple) 22%, transparent); animation: fadein 0.25s ease; }
.ld-live .hd { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--purple); font-weight: 600; }
.ld-live .hd .m { font-weight: 500; color: var(--label-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-live .hd .n { margin-left: auto; font-family: var(--mono); font-weight: 500; color: var(--label-2); flex-shrink: 0; }
.ld-live .hd .pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--purple); animation: pulse 1.2s ease infinite; flex-shrink: 0; }
.ld-live .bd {
    margin-top: 5px; font-family: var(--mono); font-size: 11.5px; line-height: 1.55; color: var(--label-2);
    white-space: pre-wrap; word-break: break-all; height: 4.65em; overflow: hidden;
    display: flex; flex-direction: column; justify-content: flex-end;
}
.ld-live .bd i { font-style: normal; color: var(--purple); animation: pulse 1s steps(2) infinite; }

.ld-log-wrap { position: relative; flex: 1; min-height: 120px; margin: 0 10px; border-top: 0.5px solid var(--sep); }
.ld-log { position: absolute; inset: 0; overflow-y: auto; padding: 8px 6px 14px; font-family: var(--mono); font-size: 11.5px; line-height: 1.6; overscroll-behavior: contain; }
.ld-row { display: grid; grid-template-columns: 58px 30px minmax(0, 1fr); gap: 6px; padding: 1px 4px; border-radius: 5px; }
.ld-row.fresh { animation: ldflash 1.2s ease; }
.ld-row .t { color: var(--label-3); }
.ld-row .s { color: var(--label-3); font-family: var(--font); font-size: 10.5px; padding-top: 1px; white-space: nowrap; }
.ld-row .m { color: var(--label); white-space: pre-wrap; word-break: break-word; }
.ld-row.progress .m { color: var(--accent); }
.ld-row.st-hl .s { color: var(--purple); }
.ld-row.step .m { color: var(--label-2); font-family: var(--font); font-weight: 600; font-size: 12px; }
.ld-row.step.done .m, .ld-row.step.skip .m { color: var(--green); }
.ld-row.step.fail .m, .ld-row.error .m { color: var(--red); }
.ld-row.error { background: color-mix(in srgb, var(--red) 8%, transparent); padding-top: 3px; padding-bottom: 3px; }
.ld-row.run { margin: 6px 0; padding: 4px 6px; background: color-mix(in srgb, var(--orange) 10%, transparent); }
.ld-row.run .m { color: var(--orange); font-family: var(--font); font-weight: 600; font-size: 12px; }
.ld-row.end .m { color: var(--green); font-family: var(--font); font-weight: 700; font-size: 12.5px; }
.ld-empty { padding: 36px 18px; text-align: center; font-family: var(--font); color: var(--label-3); font-size: 13px; line-height: 1.7; }
.ld-empty b { display: block; color: var(--label-2); font-size: 14px; margin-bottom: 4px; }
.ld-latest {
    position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
    display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 12px; border-radius: 14px; border: 0;
    background: var(--accent); color: #fff; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent);
    animation: popin 0.3s var(--ease);
}
.ld-foot { display: flex; align-items: center; gap: 8px; padding: 9px 20px 12px; font-size: 11.5px; color: var(--label-3); border-top: 0.5px solid var(--sep); flex-shrink: 0; }
.ld-foot .beat { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.ld-foot .beat.live { animation: pulse 1.6s ease infinite; }
.ld-foot .beat.idle { background: var(--label-3); }
.ld-foot .beat.warn { background: var(--orange); }
.ld-foot .warn-text { color: var(--orange); }
.ld-foot .mode { margin-left: auto; }
@keyframes ldflash { from { background: var(--accent-soft); } to { background: transparent; } }

/* ---------- Toast ---------- */
.toast-stack { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
    padding: 10px 18px;
    border-radius: 20px;
    background: rgba(29, 29, 31, 0.86);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #fff; font-size: 13px; font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastin 0.35s var(--ease);
}
.toast.err { background: rgba(255, 59, 48, 0.92); }

.spinner {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid currentColor; border-right-color: transparent;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.8); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetin { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes popup { from { opacity: 0; transform: translate(-50%, 16px) scale(0.96); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes toastin { from { opacity: 0; transform: translateY(-10px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes popin { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (max-width: 1180px) {
    .card-grid.agenda { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
    .media-row { grid-template-columns: minmax(0, 1fr); }
    .hl-panel { height: 380px; }
}
@media (max-width: 700px) {
    .card-grid.agenda { grid-template-columns: minmax(0, 1fr); }
    .player-box.floating .player-inner { width: 260px; inset: auto 12px 12px auto; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--fill); border-radius: 5px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 860px) {
    .sidebar { width: 220px; }
    .view { padding: 4px 22px 120px; }
    .hero { flex-direction: column; align-items: flex-start; }
    .hero-title { font-size: 32px; }
    .vl-date { display: none; }
    .action-bar { left: calc(50% + 110px); }
}
