*, *::before, *::after { box-sizing: border-box; }
:root {
    --bg: #faf8f5;
    --fg: #1a1814;
    --muted: #6b6560;
    --line: rgba(26, 24, 20, 0.08);
    --card: #ffffff;
    --primary: #1a1814;
    --accent: #c45c3e;
    --accent-soft: rgba(196, 92, 62, 0.12);
    --accent-hover: #a84d32;
    --danger: #b54132;
    --shadow: 0 4px 24px rgba(26, 24, 20, 0.06);
    --shadow-lg: 0 24px 64px rgba(26, 24, 20, 0.1);
    --radius: 12px;
    --radius-lg: 20px;
    --font-serif: 'Instrument Serif', Georgia, serif;
    --font-sans: 'Outfit', system-ui, sans-serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --agent-sidebar-w: clamp(300px, 30vw, 400px);
    --agent-canvas: #f3efe8;
    --agent-sidebar-bg: #ffffff;
    --agent-chat-bg: #faf8f5;
    --agent-border: rgba(26, 24, 20, 0.08);
    --agent-accent: #c45c3e;
}
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}
html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* 导航样式见 assets/shared-nav.css（内页）与 assets/home.css（首页 landing） */

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 28px 80px;
}
.container.narrow {
    max-width: 720px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--fg);
    background: var(--fg);
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .08s ease, opacity .12s ease;
}
.btn:hover { opacity: .92; }
.btn:active { transform: translateY(1px); }
.btn.ghost {
    background: transparent;
    color: var(--fg);
}
.btn.ghost:hover { background: rgba(0,0,0,0.04); text-decoration: none; }
.btn.danger {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
}
.btn.full { width: 100%; }
.btn[disabled] {
    opacity: .55;
    cursor: not-allowed;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}

.field { margin-bottom: 16px; }
.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
}
.field input, .field textarea, .field select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font-size: 15px;
    font-family: inherit;
    color: var(--fg);
}
.field textarea {
    resize: vertical;
    min-height: 90px;
}
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none;
    border-color: var(--fg);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}
.row {
    display: flex;
    gap: 12px;
}
.row > * { flex: 1; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }

.toast-host {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: #111;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: var(--shadow);
    animation: toast-in .2s ease;
}
.toast.error { background: var(--danger); }
.toast.ok { background: #16a34a; }
@keyframes toast-in {
    from { transform: translateY(-8px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* Hero (landing) */
.hero h1 {
    font-size: 44px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
}
.hero p.lead {
    font-size: 18px;
    color: var(--muted);
    max-width: 620px;
    margin: 0 0 28px;
}

.home-brief-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.5;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    background: #fafaf8;
}
.home-brief-input:focus {
    outline: none;
    border-color: #c4b8a8;
    background: #fff;
}
.home-options-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 20px;
    align-items: flex-end;
    margin-top: 16px;
}
.home-option-field {
    flex: 1;
    min-width: 180px;
}
.home-option-field-narrow {
    flex: 0 0 auto;
    min-width: 120px;
}
.home-option-field-resolution {
    flex: 1;
    min-width: 220px;
}
.home-option-field .home-label {
    margin-bottom: 6px;
}
.home-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafaf8;
    font-size: 14px;
    font-family: inherit;
    color: var(--fg);
    cursor: pointer;
}
.home-select:focus {
    outline: none;
    border-color: #c4b8a8;
    background: #fff;
}
.home-select-narrow {
    max-width: 140px;
}
.hero .cta { display: flex; gap: 10px; flex-wrap: wrap; }

/* ─────────────────────────────────────────────────────
   Agent（Suno 风）：全高侧栏 + 暖色画布
   关键：根元素必须有「确定的高度」，内部 flex+min-height:0 才能让
   chat-stream / page-feed 真正出现滚动条；不要再用 min-height:100vh，
   否则内容多时整页会被撑高，scroll 反而消失。
   ───────────────────────────────────────────────────── */
html.html-agent,
html.html-agent body.page-agent {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
}

body.page-agent {
    display: flex;
    flex-direction: column;
    background: var(--agent-canvas);
    margin: 0;
}

body.page-agent .nav {
    flex-shrink: 0;
    position: relative;
    border-bottom: 1px solid var(--agent-border);
    background: rgba(250, 248, 245, 0.92);
    backdrop-filter: blur(10px);
}

body.page-agent .agent-shell {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.agent-left {
    width: var(--agent-sidebar-w);
    min-width: 280px;
    max-width: 440px;
    flex-shrink: 0;
    height: auto;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--agent-sidebar-bg);
    border-right: 1px solid var(--agent-border);
    border-radius: 0;
    box-shadow: 6px 0 32px rgba(0, 0, 0, 0.05);
}

.agent-left-head {
    flex-shrink: 0;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--agent-border);
    background: linear-gradient(180deg, #ffffff 0%, #faf9f7 100%);
}

.agent-left-head .agent-title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.agent-left-head .agent-meta {
    margin: 0 0 10px;
    line-height: 1.45;
}

.agent-left-head .agent-meta a {
    color: var(--agent-accent);
    text-decoration: none;
}
.agent-left-head .agent-meta a:hover {
    text-decoration: underline;
}

.agent-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.agent-select {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--agent-border);
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    color: var(--fg);
}

.agent-list-link {
    flex-shrink: 0;
    white-space: nowrap;
}

.chat-stream {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--agent-chat-bg);
    -webkit-overflow-scrolling: touch;
}

.chat-msg {
    display: flex;
    width: 100%;
}
.chat-msg .bubble {
    max-width: 92%;
    padding: 11px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.55;
    white-space: normal;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.chat-msg.role-user {
    justify-content: flex-end;
}
.chat-msg.role-user .bubble {
    background: #f0eeeb;
    color: var(--fg);
    border: 1px solid var(--agent-border);
    border-bottom-right-radius: 5px;
}
.chat-msg.role-assistant {
    justify-content: flex-start;
}
.chat-msg.role-assistant .bubble {
    background: #fff;
    color: var(--fg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom-left-radius: 5px;
}
.chat-msg.role-system .bubble {
    background: #fff8eb;
    color: #92400e;
    border: 1px solid #fde68a;
    font-size: 13px;
    box-shadow: none;
}
.chat-msg .bubble-rich b {
    font-weight: 600;
}
.spin-inline {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid rgba(0, 0, 0, 0.12);
    border-top-color: var(--fg);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: -1px;
    margin-right: 4px;
}

.composer-suno {
    flex-shrink: 0;
    padding: 10px 12px 14px;
    background: #fff;
    border-top: 1px solid var(--agent-border);
}

.composer-suno .composer-thumbs {
    margin-bottom: 8px;
}

.composer-box {
    background: #faf9f7;
    border: 1px solid var(--agent-border);
    border-radius: 20px;
    padding: 12px 14px 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.composer-suno textarea,
.composer-box textarea {
    width: 100%;
    border: none;
    background: transparent;
    border-radius: 0;
    padding: 4px 2px 10px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    min-height: 64px;
    max-height: 200px;
}
.composer-suno textarea:focus,
.composer-box textarea:focus {
    outline: none;
}

.composer-suno .composer-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    padding-top: 8px;
    margin-top: 2px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.composer-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.composer-select {
    padding: 6px 8px;
    border: 1px solid var(--agent-border);
    border-radius: 10px;
    background: #fff;
    font-size: 12px;
    color: var(--fg);
    max-width: 50%;
}
.composer-select-narrow {
    max-width: 72px;
    flex-shrink: 0;
}

.btn-chat-pill {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--agent-border);
    background: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, transform 0.08s;
}
.btn-chat-pill:hover {
    background: #f4f2ee;
}
.btn-chat-pill:active {
    transform: scale(0.96);
}
.btn-chat-pill[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-gen-circle {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--fg);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    transition: transform 0.08s, opacity 0.12s;
    padding-left: 2px;
}
.btn-gen-circle:hover {
    opacity: 0.92;
}
.btn-gen-circle:active {
    transform: scale(0.95);
}
.composer-suno .composer-bar .btn-gen-circle {
    margin-left: auto;
}
.btn-gen-circle[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.page-move-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.page-move-select {
    max-width: 140px;
    font-size: 12px;
    padding: 2px 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--card);
    color: var(--muted);
}
.page-move-btn {
    font-size: 12px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    text-decoration: underline;
}
.page-move-btn:hover {
    color: var(--accent);
}

.btn-sm {
    padding: 7px 12px;
    font-size: 13px;
}

.composer-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.composer-thumbs:empty {
    display: none;
}

.agent-right {
    /* 用 Grid 而不是 Flex 实现"上面工具条 auto / 下面列表 1fr"——
       flex+min-height:0 的链有时被 Safari 旧版 / 子节点的 implicit width 干扰，
       Grid 的 1fr 行高被严格限定，不会被内容撑开，page-feed 一定能拿到溢出滚动。 */
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto 1fr;
    background: var(--agent-canvas);
    border-radius: 0;
    border: none;
    box-shadow: none;
    overflow: hidden;
}

.feed-bar {
    flex-shrink: 0;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.55);
    border-bottom: 1px solid var(--agent-border);
    backdrop-filter: blur(8px);
}
.feed-bar-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* "N 个任务进行中"小徽章。和占位卡片是冗余信号，但放在顶栏更醒目。 */
.in-flight-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 8px;
    border-radius: 999px;
    background: rgba(40, 36, 30, 0.06);
    color: var(--fg);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.in-flight-pill[hidden] { display: none; }
.in-flight-pill::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    animation: in-flight-pulse 1.4s ease-in-out infinite;
}
@keyframes in-flight-pulse {
    0%, 100% { opacity: 0.45; transform: scale(0.92); }
    50%      { opacity: 1;    transform: scale(1.05); }
}

.feed-bar-title {
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 11px;
}

.agent-right .page-feed {
    /* grid 1fr 已经把高度锁住，这里只负责滚动 + 内排版。
       min-height: 0 防止 Firefox 把 grid item 拉伸到内容高度。 */
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 20px 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    -webkit-overflow-scrolling: touch;
}

/* 关键：默认 flex 子项 flex-shrink:1，当 N 张 16:9 卡的总高超过 page-feed 时，
   flex 会"压扁"每张卡来塞进容器——结果不是滚动，是图被挤糊（aspect-ratio 在
   被 flex 强制压缩时只是建议值，不会硬保住）。
   显式设 flex-shrink: 0，让卡片保住自己的自然高度，
   总高超出时就由父容器的 overflow-y: auto 触发滚动。 */
.agent-right .page-feed > .page-card,
.agent-right .page-feed > .empty-state {
    flex: 0 0 auto;
}

.agent-right .empty-state {
    margin: auto;
    max-width: 360px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px dashed var(--agent-border);
}

.agent-right .page-card {
    max-width: 980px;
    margin: 0 auto;
    width: 100%;
}

.page-card.placeholder {
    background: rgba(255, 255, 255, 0.55);
    border-style: dashed;
    border-color: var(--agent-border);
}
.page-card .placeholder-body {
    padding: 60px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
    body.page-agent .agent-shell {
        flex-direction: column;
    }
    .agent-left {
        width: 100%;
        max-width: none;
        max-height: min(56vh, 520px);
        border-right: none;
        border-bottom: 1px solid var(--agent-border);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    }
    .agent-right {
        flex: 1;
        min-height: 44vh;
    }
}

.preview {
    background: #f1f1ec;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.preview img {
    width: 100%;
    height: auto;
}
.preview .empty {
    color: var(--muted);
    font-size: 14px;
    text-align: center;
    padding: 40px;
}
.preview .progress {
    position: absolute;
    inset: auto 0 0 0;
    background: rgba(0,0,0,0.65);
    color: #fff;
    padding: 10px 14px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.spinner {
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.spinner.dark {
    border-color: rgba(0,0,0,.15);
    border-top-color: var(--fg);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Project list / view */
.proj-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}
.proj-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 4px);
    overflow: hidden;
    transition: transform .12s, box-shadow .12s;
}
.proj-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.proj-card .thumb {
    aspect-ratio: 16 / 9;
    min-height: 198px;
    background: #f1f1ec;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted);
    font-size: 15px;
    overflow: hidden;
}
.proj-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.proj-card .meta { padding: 20px 22px 22px; }
.proj-card-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}
.proj-card-title a {
    text-decoration: none;
    color: inherit;
}
.proj-card-title a:hover {
    text-decoration: underline;
}
.proj-card-sub {
    font-size: 15px;
    margin-bottom: 16px;
    line-height: 1.45;
}
.proj-card-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.proj-card-toolbar .btn-sm {
    padding: 9px 14px;
    font-size: 14px;
}
.list-delete-btn {
    color: var(--danger);
    border-color: rgba(192, 57, 43, 0.35);
}
.list-delete-btn:hover {
    background: rgba(192, 57, 43, 0.06);
    text-decoration: none;
}

body.page-list .container.list-wrap {
    max-width: 1320px;
    padding-top: 36px;
    padding-bottom: 100px;
}
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}
.list-page-title {
    margin: 0 0 8px;
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.list-meta {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}
.list-new-btn {
    min-height: 48px;
    padding: 12px 24px;
    font-size: 15px;
}
.list-empty {
    padding: 80px 28px;
    font-size: 17px;
}

.page-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.page-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.page-card .head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 13px; color: var(--muted);
}
.page-card .page-card-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}
.page-card .page-card-title-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── 上下箭头排序按钮 ─── */
.page-reorder-controls {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
    flex-shrink: 0;
}
.page-arrow {
    width: 22px;
    height: 14px;
    padding: 0;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--fg, #111);
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.page-arrow:hover:not(:disabled) {
    background: var(--fg, #111);
    color: #fff;
    border-color: var(--fg, #111);
}
.page-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* 老的拖拽柄保留少量样式，避免别处复用时报错；新 UI 不再渲染它。 */
.page-drag-handle {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    color: var(--muted);
    padding: 2px 4px;
    line-height: 1;
    font-size: 14px;
    letter-spacing: -2px;
    flex-shrink: 0;
    touch-action: none;
}
.page-drag-handle:active {
    cursor: grabbing;
}
.page-card.dragging {
    opacity: 0.6;
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
}
.page-card img {
    width: 100%;
    display: block;
    /* 显式锁 16:9，浏览器在图未加载完时也能预留正确高度，
       避免 flex 列表里"图片加载完才撑开"导致的跳动 / 比例错位。 */
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    background: #f4f2ee;
}

.empty-state {
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    padding: 60px 20px;
    text-align: center;
    color: var(--muted);
}

/* 设计稿缩略图栏（i2i） */
.ref-zone {
    border: 1px dashed var(--line);
    border-radius: 10px;
    padding: 14px;
    background: #fbfbf8;
}
.ref-zone.has-files { background: #fff; border-style: solid; }
.ref-list {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 10px;
}
.ref-list:empty { margin-top: 0; }
.ref-thumb {
    width: 64px; height: 64px;
    border-radius: 8px;
    border: 1px solid var(--line);
    object-fit: cover;
    background: #f1f1ec;
    position: relative;
}
.ref-slot {
    width: 64px; height: 64px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #f1f1ec;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted);
    font-size: 12px;
    position: relative;
    overflow: hidden;
}
.ref-slot img { width: 100%; height: 100%; object-fit: cover; }
.ref-slot .x {
    position: absolute; top: 2px; right: 2px;
    width: 18px; height: 18px;
    background: rgba(0,0,0,.7); color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; line-height: 1; cursor: pointer;
}
.ref-slot.loading::after {
    content: ''; position: absolute; inset: 0;
    background: rgba(255,255,255,.5);
    backdrop-filter: blur(2px);
}
.ref-slot.loading .spin {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 18px; height: 18px;
    border: 2px solid rgba(0,0,0,.15);
    border-top-color: var(--fg);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.ref-add {
    width: 64px; height: 64px;
    border: 1px dashed #c5c5be;
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.ref-add:hover { border-color: var(--fg); color: var(--fg); }

/* 导航：见 shared-nav.css */

/* ─── 首页（单栏） ─── */
.home-page {
    position: relative;
}
.home-page-bg {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: min(52vh, 520px);
    background:
        radial-gradient(800px 380px at 20% -20%, rgba(124, 58, 237, 0.09), transparent 55%),
        radial-gradient(600px 320px at 90% 0%, rgba(255, 91, 31, 0.08), transparent 50%),
        linear-gradient(180deg, #fbfaf7 0%, var(--bg) 100%);
    pointer-events: none;
    z-index: 0;
}
.home-page-inner {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
    padding-top: 40px;
    padding-bottom: 72px;
}
.home-intro {
    margin-bottom: 28px;
}
.home-eyebrow {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}
.home-page .home-title {
    margin: 0 0 14px;
    font-size: clamp(26px, 5vw, 34px);
    line-height: 1.18;
    letter-spacing: -0.03em;
    font-weight: 800;
    color: var(--fg);
}
.home-page .home-lead {
    margin: 0 0 18px;
    font-size: 16px;
    line-height: 1.6;
    max-width: none;
}
.home-points {
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
    font-size: 14px;
    line-height: 1.55;
    color: var(--fg);
}
.home-points li {
    position: relative;
    padding-left: 1.1em;
    margin-bottom: 8px;
}
.home-points li:last-child {
    margin-bottom: 0;
}
.home-points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.85;
}
.home-form-intro {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
}
.home-flash-err {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
    font-size: 14px;
}
.home-panel {
    padding: 24px 22px 26px;
    border-radius: 16px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    background: var(--card);
}
.home-panel .home-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 8px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.home-panel .home-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 8px;
}
.home-btn-primary {
    min-height: 44px;
    padding-left: 22px;
    padding-right: 22px;
    border-radius: 12px;
    font-weight: 700;
}
.home-hint { margin-top: 14px !important; }
.home-ref-block {
    margin-top: 16px;
    margin-bottom: 8px;
}
.home-ref-label { margin-bottom: 10px; }
.home-ref-strip.ref-list { margin-top: 0; }
button.ref-add {
    font-family: inherit;
    margin: 0;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
}

.quota-banner, .agent-quota-banner {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    background: linear-gradient(135deg, #fff8eb 0%, #fef3c7 100%);
    border: 1px solid #fcd34d;
    color: #78350f;
}
.agent-quota-banner a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}
.agent-quota-banner a:hover { text-decoration: underline; }

