/* ═══════════════════════════════════════════════════════
   AI 视频创作平台 – 即梦极简浅色风格
   ═══════════════════════════════════════════════════════ */

:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --text: #1a1a1a;
    --text-secondary: #666;
    --text-muted: #999;
    --border: #e8eaed;
    --border-light: #f0f1f3;
    --primary: #14b8a6;
    --primary-dark: #0d9488;
    --primary-light: #2dd4bf;
    --primary-bg: #e6f7f4;
    --primary-border: #99e6dd;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-card: 0 2px 20px rgba(0,0,0,.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.1);
    --transition: .2s ease;
    --sidebar-width: 240px;
    --sidebar-rail: 76px;
    --font: -apple-system, "SF Pro Display", "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* ── App Shell ─────────────────────────────────────── */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    height: 100vh;
    overflow: hidden;
}
/* 收起态：整条侧栏退回原来的图标窄条。开关挂在 .app-shell 上而不是 .sidebar 上，
   因为要改的是网格列宽，那是父元素的事。 */
.app-shell.nav-collapsed { grid-template-columns: var(--sidebar-rail) 1fr; }

/* ── Sidebar (浅色极简) ────────────────────────────── */
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    padding: 16px 0;
    z-index: 100;
    overflow: hidden;
}
.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 30px;
    padding: 0 12px 0 16px;
    margin-bottom: 18px;
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--primary);
}
.logo-text {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .2px;
    white-space: nowrap;
    color: var(--text);
}
.sidebar-collapse {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    transition: all var(--transition);
}
.sidebar-collapse:hover { color: var(--text); background: var(--bg); }
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    width: 100%;
    padding: 0 10px;
    overflow-y: auto;
}
/* 一行一项：图标在左、文字在右、数值贴到最右（余额那行）。
   收起态见下面的 .nav-collapsed，那时才变回"图标在上、小字在下"。 */
.nav-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition);
    position: relative;
    text-align: left;
    white-space: nowrap;
}
.nav-item > svg { flex-shrink: 0; }
.nav-item:hover {
    color: var(--text);
    background: var(--bg);
}
.nav-item.active {
    color: var(--text);
    background: var(--bg);
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}
.nav-label {
    font-size: 13px;
    font-weight: 500;
}
/* 余额那个数字。margin-left:auto 把它顶到行尾 —— 和参考站一样，
   一眼能扫到"钱在这里"。 */
.nav-value {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-dark);
}
.nav-tag {
    font-size: 10px;
    font-weight: 600;
    color: var(--primary-dark);
    background: var(--primary-bg);
    border-radius: 4px;
    padding: 1px 4px;
}
.nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 18px;
}
.nav-group-title {
    font-size: 11px;
    color: var(--text-muted);
    padding: 0 10px 6px;
    white-space: nowrap;
}

/* ── 收起态 ───────────────────────────────────────── */
.nav-collapsed .logo-text,
.nav-collapsed .nav-group-title,
.nav-collapsed .nav-tag { display: none; }
.nav-collapsed .sidebar-head {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 0;
}
.nav-collapsed .sidebar-collapse svg { transform: rotate(180deg); }
.nav-collapsed .nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 10px 4px;
}
.nav-collapsed .nav-label { font-size: 10px; }
.nav-collapsed .nav-value { margin-left: 0; font-size: 11px; }
/* 窄条里"余额"两个字省掉，直接显示金额 —— 一行只放得下一个东西时，数字比标签有用。 */
.nav-collapsed #user-badge .nav-label { display: none; }
/* 分组标题藏了就没有分隔感了，用一条细线代替。 */
.nav-collapsed .nav-group {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

/* ── Main Content ──────────────────────────────────── */
.main-content {
    position: relative;
    overflow: hidden;
    display: flex;
    background: var(--bg);
}
.view {
    display: none;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.view.active {
    display: flex;
}

/* ── Topbar ────────────────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    flex-shrink: 0;
}
.topbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.topbar-btn:hover {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary-light);
}

/* ── Results Feed ──────────────────────────────────── */
.results-feed {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 0 24px;
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
}
/* 结果卡片整组贴顶（最新在上，向下滚动加载历史）：自然 flex-column 从顶部堆叠，
   各卡片靠 margin-bottom 产生间距，无需 margin-top:auto。 */
.results-feed > .result-card {
    margin-top: 0;
}
.feed-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 200px;
}
.welcome-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
    text-align: center;
}

/* ── Central Input Card ────────────────────────────── */
.input-card-wrap {
    flex-shrink: 0;
    padding: 0 24px 32px;
    display: flex;
    justify-content: center;
}
.input-card {
    width: 100%;
    max-width: 768px;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    position: relative;
}
.input-card-body {
    display: flex;
    align-items: center;
    padding: 12px 16px 10px;
    gap: 10px;
    min-height: 70px;
    overflow: visible;
}

/* Card upload button (left) */
.card-media-area {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    position: relative;
    overflow: visible;
    max-height: 100px;
}
.card-upload {
    width: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.card-upload-inner {
    width: 56px;
    height: 68px;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 10px;
    transition: all var(--transition);
}
.card-upload:hover .card-upload-inner {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}
.card-media-area.has-items .card-upload {
    display: none;
}

/* ── Photo Pile (stacked attachments) ────────────── */
.attach-stack {
    position: relative;
    width: 80px;
    height: 90px;
    margin: 4px 0 4px 0;
    cursor: pointer;
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.attach-stack:hover {
    width: var(--hover-width, 80px);
}
.attach-stack:empty {
    display: none;
    width: 0;
    height: 0;
    margin: 0;
}
.attach-stack .attach-item {
    position: absolute;
    left: 36px;
    top: 50%;
    width: 60px;
    height: 75px;
    margin-left: -30px;
    margin-top: -37px;
    border-radius: 8px;
    overflow: visible;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.06);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translate(var(--pile-x, 0px), var(--pile-y, 0px)) rotate(var(--pile-r, 0deg));
    z-index: var(--pile-z, 0);
}
/* Hover: fan out (stay same size, just spread) */
.attach-stack:hover .attach-item {
    transform: translate(var(--fan-x, 0px), var(--fan-y, 0px)) rotate(var(--fan-r, 0deg));
    box-shadow: 0 4px 14px rgba(0,0,0,0.14), 0 2px 6px rgba(0,0,0,0.08);
}
.attach-stack .attach-item img,
.attach-stack .attach-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 6px;
}
.attach-stack .attach-item .attach-del {
    position: absolute;
    top: -6px;
    right: -6px;
    left: auto;
    width: 18px;
    height: 18px;
    margin: 0;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    border: none;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s, transform 0.3s;
    backdrop-filter: blur(2px);
    z-index: 10;
}
.attach-stack:hover .attach-item .attach-del {
    opacity: 1;
    transform: scale(1);
}
.attach-stack .attach-item .attach-del:hover {
    background: #ef4444;
    transform: scale(1.1);
}
.attach-stack .attach-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.5);
    overflow: hidden;
}
.attach-stack .attach-progress-bar {
    height: 100%;
    background: var(--primary);
    transition: width .2s;
}

/* Uploading state: dim thumb + spinner overlay */
.attach-stack .attach-item.uploading::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    border-radius: inherit;
    z-index: 5;
    pointer-events: none;
}
.attach-stack .attach-item.uploading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: attach-spin .9s linear infinite;
    z-index: 6;
    pointer-events: none;
}
@keyframes attach-spin { to { transform: rotate(360deg); } }

/* Failed state: red border + error badge */
.attach-stack .attach-item.upload-failed {
    outline: 2px solid #ef4444;
    outline-offset: -2px;
}
.attach-error-mark {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    z-index: 8;
    pointer-events: none;
    box-shadow: 0 0 0 1.5px #fff;
}
/* Item count badge */
.attach-stack .pile-count {
    position: absolute;
    bottom: 4px;
    left: 36px;
    transform: translateX(-50%);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s;
}
.attach-stack:hover .pile-count {
    opacity: 0;
    pointer-events: none;
}

/* Add more button */
.attach-add-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all var(--transition);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    position: absolute;
    bottom: 6px;
    right: -10px;
    z-index: 101;
}
.attach-add-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}

/* Drag states */
.attach-stack .attach-item.dragging {
    opacity: 0.4;
    transform: translate(var(--fan-x, 0px), var(--fan-y, 0px)) rotate(0deg) scale(0.85) !important;
    z-index: 200 !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2) !important;
}
.attach-stack.drag-active {
    outline: 2px dashed var(--primary-light);
    outline-offset: 6px;
    border-radius: 10px;
}

/* Card editor area (right) */
.card-editor-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.input-editor-wrap {
    flex: 1;
    position: relative;
}
.input-editor {
    min-height: 36px;
    max-height: 100px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.6;
    outline: none;
    color: var(--text);
    word-break: break-word;
}
.input-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 12px;
    line-height: 1.6;
}

/* Card toolbar (bottom) */
.card-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 12px;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
}
.toolbar-settings {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 0 1 auto;
    min-width: 0;
}
.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}
.toolbar-spacer { flex: 1; }

/* ── Pill Buttons ──────────────────────────────────── */
.pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    transition: all var(--transition);
    white-space: nowrap;
}
.pill-btn:hover {
    border-color: #ccc;
    background: #f0f0f0;
}
.pill-btn.pill-primary {
    color: var(--primary);
    border-color: var(--primary-border);
    background: var(--primary-bg);
}
.pill-btn.pill-primary:hover {
    background: #ccefea;
}
.pill-arrow {
    opacity: .5;
}
.inline-params {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pill-toggle.active {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary);
}

/* ── Submit Button ─────────────────────────────────── */
.submit-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
    color: #9ca3af;
    transition: all var(--transition);
    position: relative;
}
.submit-btn:hover {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(20,184,166,.3);
}
.submit-btn.disabled-state {
    background: #e5e7eb;
    color: #d1d5db;
    cursor: not-allowed;
    box-shadow: none;
}
.submit-btn.disabled-state:hover {
    background: #e5e7eb;
    color: #d1d5db;
    box-shadow: none;
}
.submit-progress-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
    pointer-events: none;
}

/* ── Reset Button ──────────────────────────────────── */
.reset-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.reset-btn:hover {
    color: #ef4444;
    border-color: #fca5a5;
    background: #fef2f2;
}

/* ── Dropdown Panels ───────────────────────────────── */
.ctrl-dropdown { position: relative; }
.ctrl-panel {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 200;
}
.ctrl-panel-wide {
    min-width: 300px;
    right: 0;
    left: auto;
}
#size-panel, #quality-panel {
    min-width: 240px;
}
.ctrl-panel-img {
    min-width: 240px;
    max-height: 360px;
    overflow-y: auto;
}
.ctrl-dropdown.open .ctrl-panel { display: block; }
.ctrl-panel-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 10px 4px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.ctrl-item {
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    transition: background var(--transition);
}
.ctrl-item:hover { background: var(--bg); }
.ctrl-item.active {
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 600;
}
/* 当前模型不支持的选项（如 Seedance 2.5 的「图生视频」）：置灰不可点，
   见 app.js InputBar.applySubtypeCaps。hover 也不给背景，免得看着像能点。 */
.ctrl-item.disabled {
    color: var(--text-muted);
    opacity: .45;
    cursor: not-allowed;
}
.ctrl-item.disabled:hover { background: transparent; }
.ctrl-divider { height: 1px; background: var(--border-light); margin: 4px 0; }

/* ── Combined video param panel (ratio / resolution / count) ── */
.ctrl-panel-video { min-width: 300px; }
.ratio-sub { color: var(--text-muted); }
.opt-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 4px 4px 10px;
}
.opt-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 52px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all .12s;
}
.opt-cell:hover:not(.active) { background: var(--bg); }
.opt-cell.active { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.ratio-ico { display: block; border: 1.5px solid currentColor; border-radius: 2px; }
.r-21-9 { width: 21px; height: 9px; }
.r-16-9 { width: 18px; height: 10px; }
.r-4-3  { width: 16px; height: 12px; }
.r-1-1  { width: 13px; height: 13px; }
.r-3-4  { width: 12px; height: 16px; }
.r-9-16 { width: 10px; height: 18px; }
.opt-row { display: flex; gap: 6px; padding: 4px 4px 10px; }
.opt-pill {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all .12s;
}
.opt-pill:hover:not(.active) { background: var(--bg); }
.opt-pill.active { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
/* 当前模型没有的档（如 Seedance 2.5 的 1080P/4K）：置灰不可点，
   见 app.js InputBar.applyModelCaps。hover 不给反馈，免得看着像能点。 */
.opt-cell.disabled,
.opt-pill.disabled {
    border-style: dashed;
    color: var(--text-muted);
    opacity: .45;
    cursor: not-allowed;
}
.opt-cell.disabled:hover,
.opt-pill.disabled:hover { background: transparent; }

/* 时长面板：Seedance 2.5 支持到 30 秒，27 个选项排成 6 列网格，
   否则一列会拉出屏幕（超出当前模型上限的格子由 applyModelCaps 隐藏）。 */
#duration-panel { min-width: 268px; }
.dur-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    padding: 4px 4px 10px;
}
.dur-grid .opt-pill { flex: none; padding: 7px 0; }

/* ── Result Card ───────────────────────────────────── */
.result-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
    border: 1px solid var(--border-light);
}
.result-card:hover { box-shadow: var(--shadow-card); }
.result-card.rc-flash {
    animation: rc-flash-anim 1.2s ease-out;
}
@keyframes rc-flash-anim {
    0% { box-shadow: 0 0 0 3px rgba(16,185,129,0.6); transform: translateY(-2px); }
    100% { box-shadow: 0 1px 4px rgba(0,0,0,.04); transform: translateY(0); }
}
.rc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.rc-type {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--primary-bg);
    color: var(--primary);
}
.rc-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}
.rc-time { font-size: 12px; color: var(--text-muted); }
.rc-cost { font-size: 12px; font-weight: 600; color: #d97706; }
.rc-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
}
.status-submitted, .status-processing, .status-unknown {
    background: #fef3c7; color: #92400e;
}
.status-succeed, .status-succeeded, .status-success, .status-completed, .status-done {
    background: #d1fae5; color: #065f46;
}
.status-failed, .status-failure, .status-error {
    background: #fee2e2; color: #991b1b;
}
.rc-prompt {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rc-body {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.rc-thumb {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: var(--surface-2, #f1f5f9);
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.rc-thumb img, .rc-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.rc-thumb-audio {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}
.rc-thumb-count {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 10px;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 8px;
    font-weight: 600;
}
.rc-prompt-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
}
.rc-prompt-wrap .rc-prompt { margin-bottom: 0; cursor: default; }
.rc-prompt-popover {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s, visibility 0s 0.15s;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-width: 640px;
    max-height: 60vh;
    overflow-y: auto;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-primary, #111827);
    white-space: pre-wrap;
    box-shadow: 0 12px 32px rgba(0,0,0,.12);
    z-index: 50;
    cursor: text;
}
.rc-prompt-wrap:hover .rc-prompt-popover {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.15s 2s, visibility 0s 2s;
}
.prompt-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 7px;
    margin: 0 2px;
    background: var(--primary-bg, #e0f2fe);
    color: var(--primary, #0369a1);
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    vertical-align: baseline;
}
.prompt-pill-icon { font-size: 11px; }
.rc-media { margin-top: 12px; }
.rc-media video {
    width: 100%;
    border-radius: var(--radius-md);
    background: #000;
    max-height: 360px;
}
.rc-media .rc-img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.rc-media .rc-img-grid img {
    width: 100%;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform var(--transition);
    border: 1px solid var(--border-light);
}
.rc-media .rc-img-grid img:hover { transform: scale(1.02); }
.rc-error {
    font-size: 12px;
    color: #991b1b;
    background: #fef2f2;
    border-left: 3px solid #ef4444;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-top: 8px;
}
.rc-error:empty { display: none; }
.rc-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.rc-actions button, .rc-actions a {
    font-size: 12px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition);
}
.rc-actions button:hover, .rc-actions a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.rc-btn { cursor: pointer; }
.rc-btn-edit::before { content: "✎ "; opacity: .8; }
.rc-btn-regen::before { content: "↻ "; opacity: .8; }
.rc-timer { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rc-timer-done { color: #065f46; font-weight: 600; }
.rc-status-row { display: flex; align-items: center; gap: 8px; }
.rc-spec { margin-left: auto; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rc-expiry {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    font-size: 12px;
    color: #92400e;
}
.rc-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── History Panel ─────────────────────────────────── */
.history-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 380px;
    height: 100%;
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 24px rgba(0,0,0,.06);
    transform: translateX(100%);
    transition: transform .3s ease;
    z-index: 150;
    display: flex;
    flex-direction: column;
}
.history-panel.open { transform: translateX(0); }
.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}
.history-header h3 { font-size: 16px; font-weight: 600; }
.history-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 20px;
    color: var(--text-muted);
    transition: all var(--transition);
}
.history-close:hover { background: var(--bg); color: var(--text); }
.history-filters {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
    flex-wrap: wrap;
}
.history-filters input,
.history-filters select {
    flex: 1;
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg);
    outline: none;
    transition: border-color var(--transition);
}
.history-filters input:focus,
.history-filters select:focus { border-color: var(--primary-light); }
.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}
.history-item {
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all var(--transition);
}
.history-item:hover { background: var(--primary-bg); border-color: var(--primary-border); }
.history-item .hi-type { font-size: 11px; font-weight: 600; color: var(--primary); }
.history-item .hi-prompt {
    font-size: 13px;
    color: var(--text);
    margin: 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.history-item .hi-meta { font-size: 11px; color: var(--text-muted); display: flex; gap: 12px; }
.history-status {
    padding: 24px 12px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}
.history-status.error { color: #d32f2f; }
.history-status .retry-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
}

/* ── Usage View ──────────────────────────────────── */
.usage-container {
    padding: 28px 40px 40px;
    width: 100%;
    max-width: none;
    margin: 0;
    overflow-y: auto;
    height: 100%;
    background: #fafbfc;
    box-sizing: border-box;
}
.usage-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}
.usage-title-block h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 4px;
    letter-spacing: -0.2px;
}
.usage-subtitle { font-size: 13px; color: var(--text-muted); }
.usage-balance-card {
    padding: 14px 22px;
    background: linear-gradient(135deg, #14b8a6 0%, #0ea5a5 100%);
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(20,184,166,0.25);
    min-width: 180px;
    text-align: right;
}
.usage-balance-card .ub-label { font-size: 12px; opacity: 0.85; margin-bottom: 4px; }
.usage-balance-card .ub-value { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }
.usage-balance-card .ub-recharge {
    margin-top: 8px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: rgba(255,255,255,.22);
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 999px;
    cursor: pointer;
    transition: all var(--transition);
}
.usage-balance-card .ub-recharge:hover { background: rgba(255,255,255,.34); }
.usage-status {
    padding: 60px 12px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}
.usage-status.error { color: #d32f2f; }

/* KPI cards */
.usage-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.usage-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eaecef;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    min-height: 128px;
    position: relative;
    overflow: hidden;
}
.usage-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}
.usage-card .uc-top { display: flex; align-items: center; justify-content: space-between; }
.usage-card .uc-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.3px;
}
.usage-card .uc-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(20,184,166,0.1);
    color: var(--primary);
}
.usage-card .uc-icon svg { width: 16px; height: 16px; }
.usage-card .uc-cost {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin: 8px 0 6px;
    letter-spacing: -0.5px;
    line-height: 1;
}
.usage-card .uc-cost .uc-currency { font-size: 15px; font-weight: 500; color: var(--text-muted); margin-right: 2px; }
.usage-card .uc-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}
.usage-card .uc-rate {
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(20,184,166,0.1);
    color: var(--primary);
    font-weight: 600;
    font-size: 11px;
}
.usage-card .uc-rate.low { background: rgba(224,131,131,0.15); color: #d05555; }
.usage-card .uc-spark {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 96px;
    height: 32px;
    pointer-events: none;
}

/* Sections */
.usage-section {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eaecef;
    padding: 18px 22px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.usage-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.usage-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}
.usage-section-header .usage-section-title { margin-bottom: 0; }
.usage-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); }
.usage-legend .dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.usage-legend .dot.success { background: var(--primary); }
.usage-legend .dot.failed  { background: #e08383; }

/* Main chart */
.usage-main-section { padding-bottom: 8px; }
.usage-chart {
    width: 100%;
    height: 260px;
}
/* Fallback CSS bar chart (used only when ECharts fails to load).
   Marked with a class so JS can add fallback bars into the same container. */
.usage-chart.fallback {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    padding: 8px 4px;
    height: 220px;
    border-bottom: 1px solid var(--border-light);
}
.usage-chart.fallback .usage-bar {
    flex: 1;
    display: flex;
    flex-direction: column-reverse;
    min-width: 6px;
    position: relative;
    background: transparent;
}
.usage-chart.fallback .usage-bar .seg-success { background: var(--primary); }
.usage-chart.fallback .usage-bar .seg-failed  { background: #e08383; }
.usage-chart.fallback .usage-bar .seg { width: 100%; }
.usage-chart.fallback .usage-bar:hover { opacity: 0.85; }
.usage-chart.fallback .usage-bar .tip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333; color: #fff;
    padding: 4px 8px; border-radius: 4px;
    font-size: 11px; white-space: nowrap;
    opacity: 0; pointer-events: none;
    transition: opacity 0.15s; z-index: 10;
}
.usage-chart.fallback .usage-bar:hover .tip { opacity: 1; }

/* Task list section */
.usage-tasks-section { margin-top: 4px; }
.usage-task-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}
.usage-task-filters input[type="text"],
.usage-task-filters input[type="date"],
.usage-task-filters select {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
}
.usage-task-filters input[type="text"]:focus,
.usage-task-filters input[type="date"]:focus,
.usage-task-filters select:focus { border-color: var(--primary-light, #14b8a6); }
.usage-task-filters input[type="text"] { flex: 1; min-width: 240px; }
.usage-task-filters .btn-reset {
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: var(--text-secondary, #555);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.usage-task-filters .btn-reset:hover { background: #f5f7fa; border-color: #d1d5db; }
.usage-task-table-wrap {
    overflow-x: auto;
    border: 1px solid #f0f2f5;
    border-radius: 8px;
}
.usage-task-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.usage-task-table thead th {
    padding: 12px;
    text-align: left;
    background: #fafbfc;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #f0f2f5;
    white-space: nowrap;
}
.usage-task-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: middle;
}
.usage-task-table tbody tr:hover td { background: #fafbfc; }
.usage-task-table tbody tr:last-child td { border-bottom: none; }
.usage-task-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.usage-task-table td.tid { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12px; color: var(--text); }
.usage-task-table td.model { font-weight: 500; }
.usage-task-table td.err { color: #b74040; max-width: 320px; }
.usage-task-table td.result a { color: var(--primary); text-decoration: none; font-size: 12px; }
.usage-task-table td.result a:hover { text-decoration: underline; }
.usage-task-table .status-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}
.usage-task-table .status-pill.completed { background: rgba(20,184,166,0.12); color: #0e9884; }
.usage-task-table .status-pill.failed    { background: rgba(224,131,131,0.18); color: #b74040; }
.usage-task-table .status-pill.pending   { background: rgba(180,180,190,0.2); color: #666; }
.usage-task-empty {
    padding: 40px 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.usage-task-more {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    background: #fff;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    color: var(--text-secondary, #555);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.usage-task-more:hover { background: #fafbfc; border-color: var(--primary); color: var(--primary); }
.usage-task-more:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 900px) {
    .usage-container { padding: 20px 16px; }
    .usage-cards { grid-template-columns: repeat(2, 1fr); }
    .usage-header { flex-direction: column; align-items: stretch; }
    .usage-balance-card { text-align: left; }
}

/* ── Placeholder Views ─────────────────────────────── */
.placeholder-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
    color: var(--text-muted);
}
.placeholder-view h2 { font-size: 20px; font-weight: 600; color: var(--text-secondary); }
.placeholder-view p { font-size: 14px; }

/* ── Admin Panel ───────────────────────────────────── */
.admin-container {
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
    overflow-y: auto;
    height: 100%;
}
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.admin-header h2 { font-size: 20px; font-weight: 700; }
.admin-login { display: flex; gap: 8px; }
.admin-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg);
    outline: none;
}
.admin-input:focus { border-color: var(--primary-light); }
.btn-sm {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: all var(--transition);
}
.btn-sm:hover { background: var(--bg); }
.btn-sm.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-sm.btn-primary:hover { background: var(--primary-dark); }
.admin-section { margin-bottom: 32px; }
.admin-section h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.admin-toolbar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text-secondary);
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.admin-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--primary-bg); }

/* ── Modal ─────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.modal-box {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 400px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
    position: relative;
    text-align: center;
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-box h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.modal-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.modal-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    text-align: center;
    letter-spacing: 1px;
    outline: none;
}
.modal-input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(20,184,166,.1); }
.modal-error { font-size: 13px; color: #dc2626; margin-top: 8px; }
.modal-btn {
    width: 100%;
    padding: 12px;
    margin-top: 16px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    transition: all var(--transition);
}
.modal-btn:hover { background: var(--primary-dark); }
.modal-contact { margin-top: 14px; font-size: 12px; color: var(--text-muted); text-align: center; }
.modal-contact-qq { color: var(--primary); font-weight: 600; user-select: all; }

/* 通知弹窗：公告 + 三张介绍卡 + 两类模型 + 价格，宽版欢迎弹窗，超高给滚动条 */
.notice-box {
    width: min(880px, 92vw);
    max-height: 90vh;
    overflow-y: auto;
    /* 外框自己不留 padding：hero 要满宽铺渐变，留了 32px padding 它就只能缩在里面。
       负 margin 顶出去也不行 —— overflow-y:auto 会把 overflow-x 也算成 auto，
       右边那 32px 会变成一条横向滚动条。左右留白改由 .notice-body 出。 */
    padding: 0;
    text-align: left;
    scrollbar-width: none; /* Firefox；Chrome/Edge 走下面的 ::-webkit-scrollbar */
}
.notice-body { padding: 18px 32px 28px; }
.notice-list { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.9; color: var(--text-secondary); }
.notice-list a { color: var(--primary-dark); text-decoration: none; }
.notice-list a:hover { text-decoration: underline; }
/* 公告块：和下面两块说明区分开（有底色+左边一条主色），因为它是"这次有新事情"，
   不是常驻说明。 */
.notice-announce {
    background: var(--primary-bg);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 14px;
}
.notice-announce h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 6px;
}
.notice-announce .notice-list { color: var(--text); }
.notice-announce code {
    font-size: 11.5px;
    background: rgba(255,255,255,.7);
    padding: 1px 4px;
    border-radius: 3px;
}
/* 公告行上的未读红点。宽版里顶到行尾（和余额那个数字同一根右边线）；
   收起态没有横向空间，改成叠在图标右上角。 */
#btn-notice { position: relative; }
.notice-dot {
    margin-left: auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 2px var(--surface);
}
.nav-collapsed .notice-dot {
    position: absolute;
    top: 4px;
    right: 8px;
    margin-left: 0;
}
/* 顶部 hero：青绿渐变 + 两枚标签 + 标题。用站内主色，不引入另一套配色。 */
.notice-hero {
    padding: 30px 32px 22px;
    background: linear-gradient(135deg, var(--primary-bg) 0%, var(--surface) 78%);
    border-bottom: 1px solid var(--border-light);
}
.notice-hero h3 {
    /* 覆盖 .modal-box h3 的居中：这一整块是左对齐的排版 */
    text-align: left;
    font-size: 22px;
    font-weight: 700;
    margin: 12px 0 6px;
}
.notice-sub { margin: 0; font-size: 13px; color: var(--text-secondary); }
.notice-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.notice-chip {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
}
.notice-chip-soft { background: rgba(20,184,166,.15); color: var(--primary-dark); }
/* 「今日不提醒」顶在关闭叉左边（.modal-close 占 right:16~48） */
.notice-snooze {
    position: absolute;
    top: 19px;
    right: 56px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.notice-snooze input { width: 13px; height: 13px; accent-color: var(--primary); cursor: pointer; }

/* 三组卡片：常驻介绍 3 列、模型分类 2 列、价格 3 列（对应三个 task_type） */
.notice-cards, .notice-cats, .notice-prices { display: grid; gap: 12px; margin-bottom: 14px; }
.notice-cards { grid-template-columns: repeat(3, 1fr); }
.notice-cats { grid-template-columns: repeat(2, 1fr); }
/* 视频那张横跨两列，图片那张自然落到下一行只占一半 —— 主营业务给整行 */
.notice-cat-wide { grid-column: 1 / -1; }
.notice-prices { grid-template-columns: repeat(2, 1fr); margin-bottom: 16px; }
.notice-card, .notice-cat, .notice-price {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
}
.notice-card-t { font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.notice-card p, .notice-cat p { margin: 0; font-size: 12px; line-height: 1.75; color: var(--text-secondary); }
.notice-cat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.notice-cat-tag {
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 600;
    background: var(--primary-bg);
    color: var(--primary-dark);
}
.notice-cat-tag-blue { background: #eff6ff; color: #3b82f6; }
.notice-cat-model { font-size: 13px; font-weight: 700; }
.notice-price-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.notice-price-head h4 { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin: 0; }
.notice-price-t {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 6px;
}
/* 「文生图 / 图生图 同价」这类补注：跟在标题后面，不单独占一行 —— 占了行两张卡
   就不等高了，视频那张底下会空出一条。 */
.notice-price-sub { font-size: 11px; font-weight: 400; color: var(--text-muted); margin-left: 6px; }
.notice-price-chip {
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: var(--primary-bg);
    color: var(--primary-dark);
}
.notice-price-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    line-height: 1.9;
    color: var(--text-muted);
}
.notice-price-row b { color: var(--text); font-weight: 600; }
/* 价格拉不到时占满整行说话。三张空卡看起来像"这里本来就没内容"，用户不会重试。 */
.notice-price-err {
    grid-column: 1 / -1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: #dc2626;
}
.notice-foot { padding-top: 12px; border-top: 1px solid var(--border-light); }
.notice-foot p { margin: 0; font-size: 12px; line-height: 1.9; color: var(--text-muted); }
.notice-foot a { color: var(--primary-dark); text-decoration: none; }
.notice-foot a:hover { text-decoration: underline; }
/* 窄屏：三组 grid 全收成一列，左右留白也收一点，否则 375px 宽下每张卡只剩几个字 */
@media (max-width: 900px) {
    .notice-cards, .notice-cats, .notice-prices { grid-template-columns: 1fr; }
    .notice-hero { padding: 26px 20px 18px; }
    .notice-hero h3 { font-size: 19px; }
    .notice-body { padding: 16px 20px 24px; }
    /* 「今日不提醒」在右上角是绝对定位的，窄屏下标签行会顶到它身上；
       给标签行留出那块宽度，挤不下就自己换行。 */
    .notice-chips { max-width: calc(100% - 110px); }
}

/* ── 登录 / 注册弹窗 ─────────────────────────────────
   复用 .modal-box 的外框，只加"多面板 + 表单行"这一层。
   .modal-input 本身是给单个激活码输入框设计的（居中 + 字间距），账号密码这类
   普通表单字段要左对齐、要行间距，所以叠一个 .auth-input 覆盖，而不是改
   .modal-input —— 激活码那一栏还在用原来的样子。 */
.auth-box {
    width: 420px;
    /* 注册那一栏有 5 个输入框 + 协议勾选 + 计费表，矮屏（笔记本 768px 高）会顶出
       视口，弹窗又是 fixed 居中的 —— 不给滚动条的话"注册"按钮直接点不到。 */
    max-height: 90vh;
    overflow-y: auto;
}
.auth-tabs {
    display: flex;
    gap: 22px;
    margin: 2px 0 18px;
    border-bottom: 1px solid var(--border-light);
}
.auth-tab {
    padding: 9px 2px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition);
}
.auth-tab:hover { color: var(--text-secondary); }
.auth-tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); }

.auth-panel { display: none; }
.auth-panel.active { display: block; }

.auth-input {
    text-align: left;
    letter-spacing: 0;
    font-size: 14px;
    margin-bottom: 10px;
}
/* 密码框 + 小眼睛。UI.initPwdToggles 在运行时把 input 包进 .pwd-wrap，所以
   行距（.auth-input 的 margin-bottom）要挪到壳上，不然壳把 10px 吃掉、几个
   密码框会挤成一坨。 */
.pwd-wrap { position: relative; margin-bottom: 10px; }
.pwd-wrap .auth-input { margin-bottom: 0; padding-right: 44px; }
.pwd-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: color var(--transition);
}
.pwd-eye:hover { color: var(--text-secondary); background: var(--border-light); }
.pwd-eye svg { width: 17px; height: 17px; }
.pwd-eye .eye-off { display: none; }
.pwd-eye.on .eye-on { display: none; }
.pwd-eye.on .eye-off { display: block; }
.auth-hint {
    margin-top: 12px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-muted);
    text-align: left;
}
.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
}
.auth-check input { margin-top: 3px; flex-shrink: 0; }
.auth-check a { color: var(--primary-dark); text-decoration: none; }
.auth-check a:hover { text-decoration: underline; }
/* 登录面板里协议勾选排在按钮**下面**（注册面板排在按钮上面），得离按钮远一点，
   否则看着像按钮的一部分。 */
#auth-panel-login .auth-check { margin-top: 14px; }

/* 次要按钮（退出登录）：与 .modal-btn 同尺寸，但不抢主操作的视觉权重 */
.modal-btn-ghost {
    margin-top: 8px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.modal-btn-ghost:hover { background: var(--bg); color: var(--text); }

/* 我的账号：一行一个键值 */
.account-rows { text-align: left; }
.account-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}
.account-row .ar-label { color: var(--text-muted); flex-shrink: 0; width: 62px; }
.account-row .ar-value { color: var(--text); word-break: break-all; }
.account-row .ar-value.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; user-select: all; }
.account-row .ar-copy {
    margin-left: auto;
    flex-shrink: 0;
    padding: 3px 9px;
    font-size: 12px;
    color: var(--primary-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.account-row .ar-copy:hover { background: var(--bg); }

/* ── Toast ─────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--text);
    color: #fff;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all .3s ease;
    z-index: 10000;
    pointer-events: none;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Mention ───────────────────────────────────────── */
.mention-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 8px;
    margin: 0 1px;
    background: var(--primary-bg);
    border: 1px solid var(--primary-border);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    user-select: all;
    white-space: nowrap;
    vertical-align: baseline;
    line-height: 1.6;
}
.mention-pill .pill-icon { font-size: 12px; }
.mention-pill-img {
    padding: 1px 8px 1px 3px;
    gap: 5px;
}
.mention-pill-img .pill-thumb {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    object-fit: cover;
    vertical-align: middle;
    border: 1px solid var(--primary-border);
}
.mention-popover {
    display: none;
    position: absolute;
    z-index: 200;
    left: 0;
    right: 0;
    bottom: calc(100% + 8px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 240px;
    overflow-y: auto;
    padding: 6px;
}
.mention-popover.visible { display: block; }
.mention-popover .mention-group-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 6px 8px 2px;
}
.mention-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    transition: background .1s;
}
.mention-item:hover, .mention-item.active { background: var(--primary-bg); }
.mention-item .mi-icon { font-size: 16px; width: 20px; text-align: center; }
.mention-item .mi-thumb { width: 28px; height: 28px; border-radius: 4px; object-fit: cover; border: 1px solid var(--border); }
.mention-item .mi-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention-popover .mention-empty { padding: 12px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ── Attachment hover preview ──────────────────────── */
.attach-hover-preview {
    position: fixed;
    z-index: 9999;
    display: none;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    background: #000;
    pointer-events: none;
}
.attach-hover-preview.visible { display: block; }
.attach-hover-preview img,
.attach-hover-preview video {
    display: block;
    max-width: 320px;
    max-height: 360px;
    object-fit: contain;
}

/* ── Scrollbar ─────────────────────────────────────── */
.results-feed::-webkit-scrollbar,
.history-list::-webkit-scrollbar,
.admin-container::-webkit-scrollbar { width: 5px; }
.results-feed::-webkit-scrollbar-track,
.history-list::-webkit-scrollbar-track,
.admin-container::-webkit-scrollbar-track { background: transparent; }
.results-feed::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb,
.admin-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
/* 弹窗里的滚动条整条藏掉。系统那条有 24px 宽还带上下箭头，压在 24px 圆角上像是
   弹窗右边被切掉一块；连细的那 5px 也不留，是因为它紧贴 hero 渐变的右边线，
   一条灰杠横穿过去比没有更难看。滚轮 / 触控板 / 键盘照样能滚。 */
.notice-box::-webkit-scrollbar { width: 0; height: 0; }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
    /* Sidebar stays fixed on the left at all widths (no bottom-bar collapse) */
    .history-panel { width: 100%; }
    .welcome-title { font-size: 24px; }
    .input-card { border-radius: var(--radius-lg); }
    .input-card-body { padding: 16px; }
    .card-toolbar { padding: 10px 16px 12px; }
}

/* ── Utility ───────────────────────────────────────── */
.hidden { display: none !important; }
.load-more-btn {
    width: 100%;
    padding: 10px;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    transition: all var(--transition);
}
.load-more-btn:hover { background: var(--primary-bg); color: var(--primary); }

/* ── Assets Page ────────────────────────────────────────── */
.assets-container { padding: 24px 32px; }
.assets-tabs { display: flex; gap: 0; margin-bottom: 28px; padding: 0; border: none; }
.assets-tab { padding: 8px 24px; border: none; background: none; font-size: 15px; color: var(--text-secondary); cursor: pointer; border-radius: 20px; transition: all var(--transition); font-weight: 400; }
.assets-tab:hover { background: var(--hover); }
.assets-tab.active { background: var(--primary-bg); color: var(--primary); font-weight: 500; }
.assets-date-group { margin-bottom: 32px; }
.assets-date-title { font-size: 22px; color: var(--text); margin-bottom: 16px; font-weight: 600; }
.assets-date-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px; }
.asset-item { position: relative; aspect-ratio: 1; overflow: hidden; cursor: pointer; background: var(--hover); }
.asset-item img, .asset-item video { width: 100%; height: 100%; object-fit: cover; }
.asset-item:hover { opacity: 0.85; }
.asset-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 24px; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.5); pointer-events: none; }
.assets-loading, .assets-empty { text-align: center; padding: 60px 0; color: var(--text-muted); font-size: 14px; }
.asset-audio { display: flex; align-items: center; justify-content: center; background: var(--hover); }
.asset-audio-icon { font-size: 32px; }

/* ═══════════════════════════════════════════════════════
   即梦新版复刻 – 装饰元素 & 布局微调
   ═══════════════════════════════════════════════════════ */

/* ── Sidebar: Octo Beta 角标 ──────────────────────── */
.nav-beta {
    display: inline-block;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    color: var(--primary);
    background: var(--primary-bg);
    border-radius: 4px;
    padding: 2px 4px;
    margin-top: 2px;
}

/* ── 侧栏账户区 ───────────────────────────────────── */
/* 未登录时的「登录」入口。形状就是普通 .nav-item（同一根竖线上，形状不一致会显得
   是另一个控件），只有配色用主色，让它是这一列里唯一的召唤动作。
   登录之后（.login-entry-on）褪成和普通 nav-item 一样的灰 —— 那时它只是
   「账户设置」的入口，不该再抢注意力。 */
.login-entry {
    color: var(--primary-dark);
    background: var(--primary-bg);
    cursor: pointer;
}
.login-entry:hover {
    color: var(--primary-dark);
    background: #d6f1ec;
}
.login-entry.login-entry-on {
    color: var(--text-secondary);
    background: transparent;
}
.login-entry.login-entry-on:hover {
    color: var(--text);
    background: var(--bg);
}

/* ── 在线充值弹窗 ──────────────────────────────────── */
/* 结构：头部 / Tab / 可滚动 body / 固定底部结算条。
   body 之所以单独滚动而不是让整个弹窗长出屏幕：充值记录条数不定，
   底部那颗支付按钮必须永远可见，否则移动端要滑到底才能付钱。 */
.pay-modal {
    width: 640px;
    max-width: 94vw;
    padding: 0;
    text-align: left;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 88vh;
}
.pay-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 24px 18px;
    background: linear-gradient(120deg, #eefaf8 0%, #fdfcf6 100%);
    border-bottom: 1px solid var(--border-light);
}
.pay-head-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    background: #d8f3ee;
    border-radius: var(--radius-md);
}
.pay-head-text h3 { font-size: 19px; font-weight: 700; margin: 0 0 2px; }
.pay-head-text p { font-size: 12.5px; color: var(--text-muted); }
.pay-close {
    margin-left: auto;
    align-self: flex-start;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    color: var(--text-muted);
    background: rgba(255,255,255,.7);
    border-radius: 50%;
    transition: all var(--transition);
}
.pay-close:hover { background: #fff; color: var(--text); }

.pay-tabs {
    display: flex;
    gap: 24px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}
.pay-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 13px 2px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition);
}
.pay-tab:hover { color: var(--text-secondary); }
.pay-tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); }

.pay-body {
    padding: 20px 24px 22px;
    overflow-y: auto;
    flex: 1;
}
.pay-sec-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
}
.pay-sec-title { font-size: 13.5px; font-weight: 700; }
.pay-sec-note { font-size: 12px; color: var(--text-muted); }

.pay-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.pay-amount {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    text-align: left;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}
.pay-amount:hover { border-color: var(--primary-light); }
.pay-amount .pa-num { font-size: 15px; font-weight: 600; color: var(--text); }
.pay-amount .pa-num b { font-size: 21px; font-weight: 700; }
.pay-amount .pa-sub { font-size: 11.5px; color: var(--text-muted); }
.pay-amount.active {
    background: #f3fbf9;
    border-color: var(--primary);
}
.pay-amount.active .pa-num { color: var(--primary-dark); }
/* 右上角对勾：用伪元素画，省一个 svg 和一次 DOM 操作 */
.pay-amount.active::after {
    content: '✓';
    position: absolute;
    top: 0;
    right: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: var(--primary);
    border-radius: 0 10px 0 10px;
}

.pay-manual {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 16px 0;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    font-size: 12.5px;
    color: var(--text-secondary);
}
.pay-ghost-btn {
    flex-shrink: 0;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--primary-dark);
    background: var(--surface);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.pay-ghost-btn:hover { background: var(--primary-bg); }

.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pay-method {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    background: var(--bg);
    border: 1.5px solid transparent;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}
.pay-method.active { background: #f3fbf9; border-color: var(--primary); }
/* .disabled 留着：pickMethod 仍然认这个 class，将来某条渠道临时停用可以直接用。
   原来配的 .pm-tip（"暂未开通"小徽标）随支付宝开通一起删了 —— 现在渠道没启用
   是整颗按钮不显示，不再需要"显示但灰着"这种中间态。 */
.pay-method.disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: .65;
}
.pay-error { font-size: 12.5px; color: #dc2626; margin-top: 12px; }

/* ── 底部结算条 ── */
.pay-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    background: var(--surface);
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}
.pay-foot-sum { display: flex; flex-direction: column; gap: 2px; }
.pay-foot-sum span { font-size: 11.5px; color: var(--text-muted); }
.pay-foot-sum strong { font-size: 22px; font-weight: 700; }
.pay-foot-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(20,184,166,.28);
    transition: all var(--transition);
}
.pay-foot-btn:hover { background: var(--primary-dark); }
.pay-foot-btn:disabled { background: var(--text-muted); box-shadow: none; cursor: not-allowed; }

/* ── 充值记录 ── */
.pay-records { display: flex; flex-direction: column; }
.pay-record {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 2px;
    border-bottom: 1px solid var(--border-light);
}
.pay-record:last-child { border-bottom: none; }
.pay-rec-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #09bb07;
    border-radius: 10px;
}
.pay-rec-main { flex: 1; min-width: 0; }
.pay-rec-title { font-size: 13.5px; font-weight: 600; }
.pay-rec-no {
    font-size: 11.5px;
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pay-rec-amount { text-align: right; flex-shrink: 0; }
.pay-rec-amount b { font-size: 15px; font-weight: 700; }
.pay-rec-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
    min-width: 92px;
}
.pay-rec-badge {
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 999px;
}
.pay-rec-badge.paid    { color: #0d9488; background: #e6f7f4; }
.pay-rec-badge.pending { color: #b45309; background: #fef3c7; }
.pay-rec-badge.closed  { color: var(--text-muted); background: var(--border-light); }
.pay-rec-badge.abnormal{ color: #b91c1c; background: #fee2e2; }
.pay-rec-time { font-size: 11px; color: var(--text-muted); }
.pay-records-empty { padding: 48px 0; text-align: center; font-size: 13px; color: var(--text-muted); }

/* ── 等待支付 ── */
.pay-waiting-wrap { padding: 26px 0 10px; text-align: center; }
.pay-spinner {
    width: 34px;
    height: 34px;
    margin: 0 auto 16px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: pay-spin .9s linear infinite;
}
@keyframes pay-spin { to { transform: rotate(360deg); } }
.pay-waiting-amount { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.pay-waiting-hint { font-size: 13px; color: var(--text-secondary); margin-bottom: 18px; }

/* 扫码区（支付宝在 PC 上唯一可行的付款方式，见 handlers/payment/qrcode.go）。
   码本身留白边：二维码贴边会让部分扫码器识别不出来。 */
.pay-qr { margin-bottom: 14px; }
.pay-qr-img {
    width: 200px;
    height: 200px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    image-rendering: pixelated;   /* 320px 的码缩到 200px，别让插值把点阵抹糊 */
}
.pay-qr-tip { font-size: 13px; font-weight: 600; margin-top: 10px; }
.pay-qr-expire { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
#pay-qr-renew { margin-top: 10px; }

.pay-waiting-actions { display: flex; justify-content: center; gap: 10px; margin-bottom: 16px; }
.pay-waiting-no {
    font-size: 11.5px;
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (max-width: 640px) {
    .pay-amounts { grid-template-columns: 1fr 1fr; }
    .pay-head { padding: 18px 16px 14px; }
    .pay-tabs, .pay-body, .pay-foot { padding-left: 16px; padding-right: 16px; }
    .pay-foot-btn { padding: 12px 18px; }
}
.sidebar-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, #94a3b8, #475569);
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}
.sidebar-icon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--text-muted);
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.sidebar-icon-btn:hover { color: var(--text); background: var(--bg); }
.sidebar-icon-btn .si-label { font-size: 9px; font-weight: 600; letter-spacing: .3px; }

/* ── Topbar 左右按钮 ──────────────────────────────── */
.topbar-left { display: flex; align-items: center; gap: 8px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.newchat-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.newchat-btn:hover { background: var(--bg); }
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition);
}
.icon-btn:hover { background: var(--bg); color: var(--text); }

/* ── 输入卡：说明文字 & 倾斜上传卡 ────────────────── */
.input-hint {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-muted);
    flex: 1;
    min-width: 0;
}
.input-hint .hint-at {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 700;
    vertical-align: -3px;
    margin: 0 2px;
}
.card-upload-inner {
    transform: rotate(-5deg);
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    background: var(--surface);
}
.card-upload:hover .card-upload-inner {
    transform: rotate(-5deg) scale(1.04);
}

/* ── 工具栏：积分 & @ pill ────────────────────────── */
.pill-credits {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 4px 8px;
}
.pill-credits .credit-star { color: var(--text-muted); }
/* 未登录时替代价格 pill 的那句话。做成文字按钮而不是灰字提示：它是可点的。 */
.login-hint {
    display: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-dark);
    background: var(--primary-bg);
    padding: 5px 12px;
    border-radius: 999px;
    transition: all var(--transition);
}
.login-hint:hover { background: #d6f1ec; }
.brand-sparkle { color: var(--primary); margin-left: 1px; }
.pill-at {
    position: relative;
    padding: 6px 9px;
}
.pill-at .dot-badge {
    position: absolute;
    top: 2px;
    right: 3px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    border: 1.5px solid var(--surface);
}

/* ── 响应式：侧边栏始终固定在左，窄屏不折叠 ───────── */

/* ── 空状态：标题 + 输入卡垂直居中成组（对齐即梦） ── */
#view-generate.is-empty .results-feed { justify-content: center; }
#view-generate.is-empty .feed-empty { flex: 0 0 auto; min-height: 0; }
#view-generate.is-empty .input-card-wrap { flex: 0 0 auto; align-items: stretch; }
