/* ========================================
   AI Image Studio - 全新样式（仿 NanoBanana）
   ======================================== */

:root {
    --sidebar-w: 90px;
    --sidebar-w-expanded: 90px;
    --topbar-h: 56px;
    --primary: #f59e0b;
    --primary-hover: #ea580c;
    --bg-dark: #0a0a0f;
    --bg-card: rgba(255,255,255,.04);
    --bg-card-hover: rgba(255,255,255,.07);
    --border-color: rgba(255,255,255,.08);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 8px 32px rgba(0,0,0,.3);
    --transition: .2s ease;
}

/* ========== 浅色主题变量 ========== */
[data-theme="light"] {
    --primary: #0ea5a3;
    --primary-hover: #0f766e;
    --bg-dark: #f4fbf8;
    --bg-card: rgba(255,255,255,.62);
    --bg-card-hover: rgba(255,255,255,.86);
    --border-color: rgba(20,116,103,.12);
    --text-primary: #17343b;
    --text-secondary: #5f7779;
    --text-muted: #7f9696;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, "SF Pro Text", "Microsoft YaHei", "PingFang SC", sans-serif;
    color: var(--text-primary);
    background: var(--bg-dark);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    transition: background var(--transition), color var(--transition);
    position: relative;
}

/* 深色背景装饰效果 */
[data-theme="dark"] body {
    background: 
        radial-gradient(ellipse 100% 60% at 10% 0%, rgba(255,120,30,.08), transparent 50%),
        radial-gradient(ellipse 80% 50% at 90% 0%, rgba(255,150,40,.05), transparent 45%),
        linear-gradient(180deg, #0a0a0f 0%, #0f0f18 50%, #0a0a0f 100%);
}

/* 背景网格纹理（可选） */
[data-theme="dark"] body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.01) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

[data-theme="light"] body {
    background: 
        linear-gradient(180deg, rgba(217,247,255,.88) 0%, rgba(246,255,250,.9) 42%, rgba(255,249,232,.9) 100%),
        linear-gradient(135deg, rgba(14,165,163,.13), transparent 38%),
        linear-gradient(225deg, rgba(251,191,36,.16), transparent 42%);
}

[data-theme="light"] body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        linear-gradient(180deg, transparent 0 64%, rgba(80,196,184,.08) 64% 75%, rgba(255,211,128,.16) 75% 100%),
        repeating-linear-gradient(90deg, rgba(14,165,163,.045) 0 1px, transparent 1px 118px);
    opacity: .82;
}

a { color: var(--primary); text-decoration: none; }
a:hover { opacity: .85; }

/* ========================================
   左侧固定导航栏
   ======================================== */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: rgba(12,12,18,.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

[data-theme="light"] .sidebar {
    background: rgba(255,255,255,.78);
    border-right-color: rgba(20,116,103,.12);
    box-shadow: 12px 0 34px rgba(22,96,87,.07);
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px 8px 10px;
    gap: 4px;
    overflow: visible;
}

/* Logo - 图标+文字垂直居中 */
.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 0 16px;
    gap: 4px;
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    text-decoration: none;
}

.logo-icon { font-size: 26px; }
.logo-text { 
    opacity: 1;
    letter-spacing: .5px;
    font-size: 13px;
}

/* 导航项 - 图标在上、文字在下 */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 11px 4px 9px;
    border-radius: 14px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    white-space: nowrap;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(245,158,11,.12);
    color: var(--primary);
}

[data-theme="light"] .nav-item.active {
    background: linear-gradient(180deg, rgba(255,232,166,.62), rgba(214,246,236,.72));
    color: #0f766e;
    box-shadow: inset 0 0 0 1px rgba(15,118,110,.08);
}

.nav-icon { 
    font-size: 22px; 
    width: 28px;
    height: 28px;
    text-align: center; 
    flex-shrink: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 25px;
    height: 25px;
    display: block;
    fill: currentColor;
}

.nav-icon svg [stroke] {
    fill: none;
}

.nav-icon-home { color: #0f9f91; }
.nav-icon-inspire { color: #ff8a34; }
.nav-item[data-page="assets"] .nav-icon,
.nav-item[onclick*="openRedeemModal"] .nav-icon {
    color: #0f9f91;
    filter: drop-shadow(0 5px 10px rgba(15,159,145,.16));
}
.nav-item .nav-icon svg rect[fill="none"],
.nav-item .nav-icon svg path[fill="none"] {
    stroke: currentColor;
}
.nav-label { 
    opacity: 1;
    width: auto;
    overflow: visible;
    transition: none;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
}

/* 底部工具区 - 垂直居中排列 */
.sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

/* 积分圆圈 */
.points-dropdown {
    position: relative;
}

.points-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #14b8a6, #fbbf24);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 2px 12px rgba(20,184,166,.24);
}

.points-circle:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 20px rgba(20,184,166,.34);
}

/* 积分下拉菜单 */
.points-menu {
    position: fixed;
    top: 0;
    left: -9999px;
    transform: translateY(8px);
    background: rgba(31,31,31,.96);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 18px 14px;
    min-width: 242px;
    box-shadow: 0 16px 48px rgba(0,0,0,.5);
    opacity: 0;
    visibility: hidden;
    transition: all .2s ease;
    pointer-events: none;
    z-index: 9999;
}

[data-theme="light"] .points-menu {
    background: rgba(35,35,35,.96);
    border-color: rgba(255,255,255,.14);
    box-shadow: 0 18px 54px rgba(16,32,36,.22);
}

.points-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.points-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 12px;
    margin-bottom: 6px;
    color: rgba(255,255,255,.82);
}

.points-menu-icon { font-size: 16px; }
.points-menu-label { flex: 1; color: rgba(255,255,255,.82); font-size: 21px; font-weight: 700; }
.points-menu-value {
    font-weight: 700;
    color: rgba(255,255,255,.74);
    font-size: 22px;
}

.points-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    color: rgba(255,255,255,.78);
    font-size: 21px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
    text-decoration: none;
}

.points-menu-item:hover,
.points-menu-item.active {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.points-menu-logout {
    color: rgba(255,255,255,.78);
}

.points-menu-divider {
    height: 1px;
    background: rgba(255,255,255,.08);
    margin: 8px 10px;
}

.menu-svg {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.82);
    flex: 0 0 26px;
}

.menu-svg svg {
    width: 24px;
    height: 24px;
    display: block;
}

/* 主题切换按钮 */
.theme-toggle,
.notify-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.theme-toggle:hover,
.notify-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.theme-icon { font-size: 16px; }

.theme-toggle svg,
.notify-btn svg {
    width: 22px;
    height: 22px;
    display: block;
}

/* 用户区域 */
.user-area {
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-button {
    position: relative;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.avatar-small {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.points-badge {
    position: absolute;
    top: -8px;
    right: -13px;
    min-width: 31px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(10,10,10,.78);
    color: #fff;
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: 0 8px 22px rgba(0,0,0,.24);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.points-badge-icon {
    color: #e5e7eb;
    font-size: 12px;
}

/* 登录/注册页面 */
.container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 40px 20px;
}

.card { width: 100%; max-width: 400px; }

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    box-shadow: var(--shadow);
}

.auth-card h2 {
    font-size: 22px; font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 24px;
}

.form-row { margin-bottom: 16px; }

.form-row input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,.15);
    color: var(--text-primary);
    font-size: 14.5px;
    outline: none;
    transition: border-color .15s;
}

[data-theme="light"] .form-row input { background: rgba(255,255,255,.5); }

.form-row input:focus { border-color: var(--primary); }
.form-row input::placeholder { color: var(--text-muted); }

.auth-card button[type="submit"],
.auth-card .btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    margin-top: 8px;
    transition: all .15s;
}

.auth-card button[type="submit"] {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: #fff;
}
.auth-card button[type="submit"]:hover { opacity: .9; }

.auth-body {
    background:
        radial-gradient(circle at 15% 8%, rgba(30,64,175,.18), transparent 30%),
        radial-gradient(circle at 88% 88%, rgba(88,28,135,.22), transparent 34%),
        linear-gradient(180deg, #090b12 0%, #050606 100%) !important;
}

.auth-body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.014) 1px, transparent 1px);
    background-size: 72px 72px;
    z-index: 0;
}

.auth-body .sidebar,
.auth-body .top-bar {
    display: none !important;
}

.auth-body .main-content {
    margin-left: 0;
    min-height: 100vh;
}

.auth-body .content-area {
    min-height: 100vh;
}

.auth-page {
    min-height: 100vh;
    width: 100%;
    display: grid;
    place-items: center;
    padding: 42px 18px 34px;
    position: relative;
    overflow: visible;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: inherit;
    border-right: inherit;
    box-shadow: inherit;
    z-index: -1;
}

.auth-glow {
    position: fixed;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    filter: blur(74px);
    opacity: .45;
    pointer-events: none;
}

.auth-glow-left {
    left: -130px;
    top: 0;
    background: rgba(30,64,175,.28);
}

.auth-glow-right {
    right: -120px;
    bottom: -70px;
    background: rgba(88,28,135,.34);
}

.auth-panel {
    width: min(720px, 92vw);
    border-radius: 34px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(15,15,15,.82);
    box-shadow: 0 30px 90px rgba(0,0,0,.44), inset 0 1px 0 rgba(255,255,255,.03);
    padding: 58px 58px 52px;
    position: relative;
    z-index: 1;
}

.auth-head {
    text-align: center;
    margin-bottom: 46px;
}

.auth-head h1 {
    color: #fff;
    font-size: 34px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 18px;
}

.auth-head p {
    color: #7f8797;
    font-size: 20px;
    font-weight: 500;
}

.auth-form {
    display: grid;
    gap: 26px;
}

.auth-field {
    display: grid;
    gap: 12px;
    color: #b7bdc8;
    font-size: 16px;
}

.auth-field input {
    width: 100%;
    height: 72px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.055);
    color: #eef2f7;
    font-size: 21px;
    font-weight: 500;
    outline: none;
    padding: 0 26px;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.auth-field input::placeholder {
    color: #46556d;
}

.auth-field input:focus {
    border-color: rgba(16,185,129,.45);
    background: rgba(255,255,255,.075);
    box-shadow: 0 0 0 4px rgba(16,185,129,.08);
}

.auth-password-wrap {
    position: relative;
}

.auth-password-wrap input {
    padding-right: 68px;
}

.auth-eye {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #778196;
    display: grid;
    place-items: center;
    padding: 6px;
}

.auth-eye:hover,
.auth-eye.is-visible {
    color: #dbeafe;
}

.auth-submit {
    height: 72px;
    border: 0;
    border-radius: 18px;
    background: #fff;
    color: #080808;
    font-size: 22px;
    font-weight: 700;
    margin-top: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.auth-submit:hover {
    transform: translateY(-1px);
    background: #f5f7fb;
    box-shadow: 0 18px 40px rgba(255,255,255,.1);
}

.auth-submit span {
    font-size: 28px;
    line-height: 1;
}

.auth-switch {
    color: #777f90;
    font-size: 18px;
    text-align: center;
    margin-top: 38px;
}

.auth-switch a {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.auth-switch a:hover {
    color: #34d399;
}

.auth-terms {
    position: relative;
    z-index: 1;
    color: #506079;
    font-size: 15px;
    text-align: center;
    margin-top: 34px;
}

.auth-toast {
    position: fixed;
    top: 26px;
    left: 50%;
    transform: translateX(-50%) translateY(-18px);
    min-width: 292px;
    min-height: 78px;
    padding: 0 24px;
    border-radius: 18px;
    border: 1px solid rgba(16,185,129,.34);
    background: rgba(4,52,38,.9);
    color: #f4fff8;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 2000;
    box-shadow: 0 18px 50px rgba(0,0,0,.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
    font-size: 22px;
    font-weight: 700;
}

.auth-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.auth-toast-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #10b981;
    color: #10f0a2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    font-size: 20px;
}

.auth-toast button {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #8aa098;
    font-size: 26px;
    line-height: 1;
    padding: 4px;
}

.auth-toast button:hover {
    color: #fff;
}

@media(max-width: 680px) {
    .auth-page {
        padding: 28px 12px;
    }

    .auth-panel {
        width: 100%;
        border-radius: 26px;
        padding: 38px 22px 34px;
    }

    .auth-head {
        margin-bottom: 34px;
    }

    .auth-head h1 {
        font-size: 28px;
    }

    .auth-head p {
        font-size: 17px;
    }

    .auth-field input,
    .auth-submit {
        height: 60px;
        font-size: 17px;
    }

    .auth-toast {
        width: calc(100vw - 28px);
        min-width: 0;
        font-size: 18px;
    }
}

.login-btn {
    padding: 6px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245,158,11,.35);
}

/* ========================================
   主内容区
   ======================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    transition: margin-left var(--transition);
}

/* 顶部导航条（暂时隐藏，后续开发功能用） */
.top-bar {
    display: none;
}

[data-theme="light"] .top-bar {
    background: rgba(255,255,255,.8);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
}

.top-search {
    flex: 1;
    max-width: 320px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.search-icon { font-size: 14px; opacity: .5; }

.top-search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
}

.top-tabs {
    display: flex;
    gap: 4px;
}

.top-tab {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.top-tab:hover { color: var(--text-primary); }
.top-tab.active {
    background: rgba(245,158,11,.12);
    color: var(--primary);
}

.top-mode select {
    padding: 6px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 12px;
    outline: none;
    cursor: pointer;
}

/* 内容区域 */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* ========================================
   Hero 欢迎区域
   ======================================== */
.hero-section {
    text-align: center;
    padding: 66px 24px 28px;
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .hero-section::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 18px;
    width: min(680px, 72vw);
    height: 190px;
    transform: translateX(-50%);
    pointer-events: none;
    background:
        linear-gradient(180deg, transparent 0 58%, rgba(13,148,136,.08) 58% 63%, transparent 63%),
        linear-gradient(115deg, transparent 0 42%, rgba(251,191,36,.16) 42% 44%, transparent 44% 100%),
        linear-gradient(65deg, transparent 0 56%, rgba(20,184,166,.12) 56% 58%, transparent 58% 100%);
    opacity: .9;
}

.hero-icon {
    font-size: 34px;
    margin-bottom: 14px;
    animation: floatIcon 3s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.hero-title {
    font-size: 34px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 0;
    position: relative;
    z-index: 1;
}

.hero-sub {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

/* 快捷标签 */
.quick-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.q-tag {
    padding: 7px 16px;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.q-tag:hover {
    border-color: rgba(14,165,163,.34);
    color: #0f766e;
    background: rgba(236,253,245,.82);
    transform: translateY(-1px);
}

[data-theme="light"] .q-tag {
    background: rgba(255,255,255,.56);
    border-color: rgba(20,116,103,.13);
    color: #607d7b;
    box-shadow: 0 10px 26px rgba(22,96,87,.05);
}

/* ========================================
   对话消息区域
   ======================================== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 120px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
}

.chat-msg {
    display: flex;
    gap: 12px;
    animation: msgIn .3s ease both;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.msg-avatar.user {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.msg-avatar.ai {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
}

.msg-body {
    flex: 1;
    max-width: calc(100% - 52px);
}

.msg-sender {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.msg-bubble {
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    line-height: 1.65;
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-word;
}

.msg-bubble.user-msg {
    /* 用户消息可特殊样式 */
    border-left: 3px solid var(--primary);
}

.msg-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ========================================
   单卡片大图生图结果（仿 viviai 参考网站）
   ======================================== */

.result-card-msg {
    display: flex;
    gap: 12px;
    animation: msgIn .3s ease both;
}

.result-card-body {
    flex: 1;
    max-width: calc(100% - 52px);
}

/* 标题 - 直接显示在顶部，无背景块 */
.result-card-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.5;
    word-break: break-word;
}

/* 参数行 - 紧跟标题下方 */
.result-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    font-size: 12px;
    color: var(--text-muted);
}

.result-card-prompt-row {
    margin-bottom: 8px;
}

.result-card-prompt-text {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: rgba(255,255,255,.04);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,.05);
}

[data-theme="light"] .meta-item {
    background: rgba(0,0,0,.03);
    border-color: rgba(0,0,0,.05);
}

.meta-model { color: #a78bfa; font-weight: 500; }
.meta-size { color: #60a5fa; }
.meta-quality { color: #34d399; }
.meta-count { color: #fbbf24; }
.meta-time { color: var(--text-muted); }

.meta-divider {
    color: rgba(255,255,255,.2);
    font-size: 10px;
    user-select: none;
}

[data-theme="light"] .meta-divider {
    color: rgba(0,0,0,.2);
}

.meta-copy {
    margin-left: auto;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 11px;
    transition: all .15s;
    background: rgba(255,255,255,.03);
}

.meta-copy:hover,
.meta-copy-btn:hover {
    background: rgba(245,158,11,.12);
    color: var(--primary);
}

.meta-copy-btn {
    margin-left: auto;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    color: var(--text-muted);
    transition: all .15s;
    background: rgba(255,255,255,.03);
}

/* ========================================
   单张大图区域（仿参考网站 - 带悬浮工具栏）
   ======================================== */

.single-card-image-wrap {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(0,0,0,.25);
    border: 1px solid rgba(255,255,255,.06);
    cursor: pointer;
    margin-bottom: 14px;
    transition: all .3s ease;
}

[data-theme="light"] .single-card-image-wrap {
    background: rgba(0,0,0,.04);
    border-color: rgba(0,0,0,.08);
}

.single-card-image-wrap:hover {
    border-color: rgba(245,158,11,.35);
    box-shadow: 0 10px 40px rgba(0,0,0,.35);
}

.single-card-main-img {
    width: 100%;
    display: block;
    max-height: 560px;
    object-fit: contain;
    background: #111;
    transition: opacity .2s ease, transform .4s ease;
}

[data-theme="light"] .single-card-main-img {
    background: #f0f0f2;
}

.single-card-image-wrap:hover .single-card-main-img {
    transform: scale(1.01);
}

/* ====== 图片右上角工具栏（收藏+下载）====== */
.sc-img-toolbar {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 15;
    opacity: 0;
    transition: opacity .2s ease;
}

.single-card-image-wrap:hover .sc-img-toolbar {
    opacity: 1;
}

.sc-tool-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.55);
    color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all .2s ease;
}

.sc-tool-btn:hover {
    background: rgba(245,158,11,.35);
    color: #fbbf24;
    transform: scale(1.08);
}

.sc-tool-btn.favorited {
    color: #fbbf24;
}
.sc-tool-btn.favorited svg {
    fill: #fbbf24;
}

/* ====== 图片底部操作栏（仿参考网站）====== */
.sc-bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0; right: 0;
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 10px 12px;
    background: linear-gradient(to top, rgba(0,0,0,.7) 0%, transparent 100%);
    opacity: 0;
    transition: opacity .25s ease;
    z-index: 12;
}

.single-card-image-wrap:hover .sc-bottom-bar {
    opacity: 1;
}

.sc-bbtn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(30,32,42,.65);
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all .2s ease;
}

.sc-bbtn:hover {
    background: rgba(245,158,11,.25);
    border-color: rgba(245,158,11,.45);
    color: #fbbf24;
    transform: translateY(-2px);
}

.sc-bbtn-danger:hover {
    background: rgba(239,68,68,.25);
    border-color: rgba(239,68,68,.45);
    color: #ef4444;
}

/* 左右切换箭头 */
.sc-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(0,0,0,.5);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: all .22s ease;
}

.single-card-image-wrap:hover .sc-nav {
    opacity: 1;
}

.sc-prev { left: 10px; }
.sc-next { right: 10px; }

.sc-nav:hover {
    background: rgba(245,158,11,.3);
    border-color: rgba(245,158,11,.5);
    transform: translateY(-50%) scale(1.1);
}

/* 图片计数器 */
.sc-counter {
    position: absolute;
    bottom: 52px;
    right: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 12px;
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity .2s ease;
}

.single-card-image-wrap:hover .sc-counter {
    opacity: 1;
}

/* 图片计数器 */
.single-card-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 12px;
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity .2s ease;
}

.single-card-image-wrap:hover .single-card-counter {
    opacity: 1;
}

/* ====== 旧图片网格兼容（保留不删除）====== */
.result-card-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.result-card-img {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(0,0,0,.2);
    border: 1px solid rgba(255,255,255,.06);
    cursor: pointer;
    transition: all .25s ease;
    aspect-ratio: 1 / 1;
}

[data-theme="light"] .result-card-img {
    background: rgba(0,0,0,.05);
    border-color: rgba(0,0,0,.08);
}

/* 根据比例调整 */
.result-card-img[data-ratio="16-9"],
.result-card-img[data-ratio="4-3"] { aspect-ratio: 16/9; }
.result-card-img[data-ratio="9-16"],
.result-card-img[data-ratio="3-4"] { aspect-ratio: 9/16; }
.result-card-img[data-ratio="3-2"] { aspect-ratio: 3/2; }
.result-card-img[data-ratio="2-3"] { aspect-ratio: 2/3; }

.result-card-img:hover {
    border-color: rgba(245,158,11,.4);
    box-shadow: 0 8px 30px rgba(0,0,0,.3);
    transform: translateY(-3px) scale(1.01);
}

.result-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity .2s, transform .3s ease;
}

.result-card-img:hover img {
    transform: scale(1.05);
}

.result-card-img.img-error {
    background: linear-gradient(135deg, rgba(239,68,68,.08), rgba(239,68,68,.03));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 13px;
    flex-direction: column;
    gap: 8px;
}

.result-card-img.img-error::before {
    content: "⚠️";
    font-size: 24px;
}

.result-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.6) 0%, rgba(0,0,0,.2) 50%, transparent 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 16px;
    opacity: 0;
    transition: opacity .25s ease;
}

.result-card-img:hover .result-img-overlay {
    opacity: 1;
}

.result-img-overlay span {
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,.2);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.15);
}

/* 操作按钮行 */
.result-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
}

.rca-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    color: var(--text-secondary);
    font-size: 12.5px;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
}

[data-theme="light"] .rca-btn {
    background: rgba(0,0,0,.03);
    border-color: rgba(0,0,0,.08);
    color: #555;
}

.rca-btn:hover {
    border-color: rgba(245,158,11,.35);
    background: rgba(245,158,11,.1);
    color: var(--primary);
    transform: translateY(-1px);
}

.rca-retry svg, .rca-edit svg, .rca-more svg { opacity: .7; }

.hidden-prompt,
.hidden-model,
.hidden-size,
.hidden-quality,
.hidden-count,
.hidden-images-json { display: none !important; }

/* ========================================
   图片查看器弹窗（仿参考网站）
   ======================================== */

.img-viewer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    justify-content: center;
    align-items: center;
}

.img-viewer-container {
    display: flex;
    width: 94vw;
    max-width: 1300px;
    height: 90vh;
    max-height: 850px;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(14,16,22,.98);
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 40px 100px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.05);
    animation: viewerIn .3s cubic-bezier(.4,0,.2,1);
}

@keyframes viewerIn {
    from { opacity: 0; transform: scale(.95) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.viewer-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.06);
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    z-index: 60;
    transition: all .2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-close-btn:hover {
    background: rgba(239,68,68,.2);
    border-color: rgba(239,68,68,.3);
    color: #ef4444;
    transform: rotate(90deg) scale(1.1);
}

/* 左侧大图区域 */
.viewer-main {
    flex: 1;
    min-width: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(25,27,35,1) 0%, rgba(12,14,20,1) 100%);
    overflow: hidden;
}

.viewer-image-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    transition: opacity .2s ease;
}

.viewer-image-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 12px 50px rgba(0,0,0,.5);
}

.viewer-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 32px;
    text-align: center;
}

/* 左右导航箭头 */
.viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(0,0,0,.5);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.viewer-prev { left: 16px; }
.viewer-next { right: 16px; }

.viewer-nav:hover {
    background: rgba(245,158,11,.3);
    border-color: rgba(245,158,11,.5);
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

/* 右侧详情面板 */
.viewer-sidebar {
    width: 320px;
    min-width: 300px;
    border-left: 1px solid rgba(255,255,255,.06);
    background: rgba(10,12,18,.98);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

[data-theme="light"] .viewer-sidebar {
    background: rgba(250,250,252,.98);
    border-left-color: rgba(0,0,0,.06);
}

/* 工具栏 */
.viewer-toolbar {
    display: flex;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,.05);
    flex-wrap: wrap;
}

[data-theme="light"] .viewer-toolbar {
    border-bottom-color: rgba(0,0,0,.05);
}

.vtool-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all .2s ease;
}

.vtool-btn:hover {
    background: rgba(255,255,255,.08);
    color: var(--text-primary);
    border-color: rgba(255,255,255,.12);
    transform: translateY(-1px);
}

.vtool-download:hover { border-color: rgba(34,197,94,.4); color: #22c55e; background: rgba(34,197,94,.1); }
.vtool-save:hover { border-color: rgba(59,130,246,.4); color: #3b82f6; background: rgba(59,130,246,.1); }

.vtool-more {
    margin-left: auto;
}

/* 详情区域 */
.viewer-section {
    border-bottom: 1px solid rgba(255,255,255,.05);
}

[data-theme="light"] .viewer-section {
    border-bottom-color: rgba(0,0,0,.05);
}

.viewer-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    transition: background .15s;
    user-select: none;
}

.viewer-section-title:hover {
    background: rgba(255,255,255,.03);
}

.viewer-arrow {
    margin-left: auto;
    font-size: 10px;
    color: var(--text-muted);
    transition: transform .2s;
}

.viewer-copy {
    margin-left: auto;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s;
    font-weight: 400;
    background: rgba(255,255,255,.03);
}

.viewer-copy:hover {
    background: rgba(245,158,11,.12);
    color: var(--primary);
}

.viewer-section-body {
    padding: 0 16px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

#viewerPrompt {
    word-break: break-word;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.7;
}

.param-row {
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255,255,255,.03);
}

.param-row:last-child {
    border-bottom: none;
}

.param-row b {
    color: var(--text-primary);
    font-weight: 600;
    display: inline-block;
    min-width: 56px;
    margin-right: 8px;
}

/* 参考图 */
.viewer-ref-imgs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.viewer-ref-imgs img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.08);
    cursor: pointer;
    transition: all .2s ease;
}

.viewer-ref-imgs img:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

/* 底部操作 */
.viewer-actions {
    padding: 16px;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.05);
}

.vaction-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    color: var(--text-primary);
    font-size: 13.5px;
    cursor: pointer;
    transition: all .2s ease;
    margin-bottom: 10px;
}

.vaction-btn:last-child { margin-bottom: 0; }

.vaction-btn:hover {
    background: rgba(245,158,11,.1);
    border-color: rgba(245,158,11,.3);
    color: var(--primary);
    transform: translateY(-1px);
}

/* Toast 提示 */
.toast-msg {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 22px;
    border-radius: 999px;
    background: rgba(34,197,94,.9);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: all .3s ease;
    box-shadow: 0 8px 24px rgba(34,197,94,.3);
}

.toast-msg.toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 加载中消息 */
.msg-loading .msg-bubble {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: typingBounce 1.2s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* 错误消息 */
.msg-error .msg-bubble {
    border-color: rgba(239,68,68,.3);
    background: rgba(239,68,68,.05);
    color: #fca5a5;
}

/* ========================================
   输入区域 - 仿参考网站一体化输入框
   ======================================== */
.chat-input-area {
    position: fixed;
    left: var(--sidebar-w);
    right: 0;
    bottom: 0;
    padding: 16px 32px 24px;
    background: linear-gradient(to top, rgba(10,10,15,.98) 70%, transparent);
    z-index: 40;
}

[data-theme="light"] .chat-input-area {
    background: linear-gradient(to top, rgba(244,251,248,.92) 70%, transparent);
}

.chat-messages {
    padding-bottom: 260px;
}

/* Single card generation mode */
.single-result-card {
    width: min(720px, calc(100vw - var(--sidebar-w) - 64px));
    margin: 0 auto;
    border-radius: 18px;
    animation: msgIn .28s ease both;
}

.single-result-card .msg-avatar {
    display: none;
}

.single-result-card .result-card-body {
    max-width: 100%;
}

.single-result-head {
    margin-bottom: 12px;
}

.single-result-title {
    font-size: 16px;
    font-weight: 650;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.single-result-meta,
.result-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 12px;
}

.result-card-meta .meta-item:not(.meta-copy-btn) {
    padding: 0;
    border: 0;
    background: transparent;
}

.result-card-meta .meta-model {
    color: #8b5cf6;
    font-weight: 700;
}

[data-theme="light"] .result-card-meta .meta-model {
    color: #7c3aed;
}

.meta-divider {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1;
}

.meta-copy-btn {
    margin-left: auto;
}

.generating-card,
.single-error-card {
    background: rgba(255,255,255,.68);
    border: 1px solid rgba(20,116,103,.12);
    box-shadow: 0 18px 48px rgba(22,96,87,.1);
    padding: 18px;
}

[data-theme="dark"] .generating-card,
[data-theme="dark"] .single-error-card {
    background: rgba(24,24,24,.92);
    border-color: rgba(255,255,255,.1);
    box-shadow: 0 18px 48px rgba(0,0,0,.28);
}

.generating-stage {
    min-height: 260px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(236,253,245,.72), rgba(255,251,235,.72));
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    color: #0f766e;
    font-weight: 650;
}

[data-theme="dark"] .generating-stage {
    background: rgba(255,255,255,.04);
    color: rgba(255,255,255,.74);
}

.generating-spinner {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid rgba(14,165,163,.18);
    border-top-color: #14b8a6;
    animation: spin .8s linear infinite;
}

.single-error-body {
    border-radius: 14px;
    border: 1px solid rgba(248,113,113,.22);
    background: rgba(254,242,242,.82);
    color: #ef4444;
    padding: 18px;
}

.generate-task-toast {
    position: fixed;
    top: 10px;
    right: 18px;
    z-index: 3200;
    min-width: 286px;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px 0 16px;
    border-radius: 14px 14px 0 0;
    background: rgba(255,255,255,.96);
    color: #111827;
    box-shadow: 0 14px 36px rgba(15,23,42,.14);
    border: 1px solid rgba(15,23,42,.08);
    animation: msgIn .22s ease both;
}

[data-theme="dark"] .generate-task-toast {
    background: rgba(24,24,24,.96);
    color: rgba(255,255,255,.9);
    border-color: rgba(255,255,255,.1);
}

.task-toast-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    background: linear-gradient(135deg, #f472b6, #38bdf8);
}

.task-toast-text {
    flex: 1;
    font-size: 14px;
    font-weight: 650;
}

.task-toast-close {
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: currentColor;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.task-toast-close:hover {
    background: rgba(15,23,42,.08);
}

.card-ref-strip {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    margin: -4px 0 10px;
    position: relative;
    z-index: 25;
}

.card-ref-thumb {
    width: 48px;
    height: 48px;
    padding: 0;
    border: 2px solid rgba(20,184,166,.42);
    border-radius: 13px;
    overflow: hidden;
    background: rgba(255,255,255,.72);
    box-shadow: 0 10px 24px rgba(15,23,42,.1);
    cursor: zoom-in;
    position: relative;
    pointer-events: auto;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.card-ref-thumb::after {
    content: '';
    position: absolute;
    right: -4px;
    top: -4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #14b8a6;
    border: 2px solid rgba(255,255,255,.95);
}

.card-ref-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.card-ref-thumb:hover {
    transform: translateY(-1px);
    border-color: rgba(20,184,166,.55);
}

.single-result-card .single-card-image-wrap {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 12px;
    background: rgba(255,255,255,.66);
    border-color: rgba(20,116,103,.12);
    box-shadow: 0 18px 48px rgba(22,96,87,.1);
}

[data-theme="dark"] .single-result-card .single-card-image-wrap {
    background: rgba(0,0,0,.28);
}

.single-result-card .single-card-main-img {
    width: auto;
    max-width: 100%;
    max-height: 390px;
    object-fit: contain;
}

@media (max-width: 860px) {
    .single-result-card {
        width: calc(100vw - 24px);
    }

    .single-result-card .single-card-main-img {
        max-height: 360px;
    }
}

/* Prompt-to-Spine workspace */
.spine-flow [hidden] { display: none !important; }

.page-spine_studio .content-area {
    padding: 0;
    overflow-x: hidden;
}

.spine-flow {
    width: min(1460px, calc(100vw - var(--sidebar-w) - 36px));
    margin: 0 auto;
    padding: 20px 0 44px;
}

.spine-source-selector {
    margin-bottom: 14px;
    padding: 0 0 14px;
    border-bottom: 1px solid rgba(24, 67, 64, .12);
}

.spine-source-selector > strong {
    display: block;
    margin-bottom: 9px;
    font-size: 16px;
}

.spine-announcement {
    height: 38px;
    margin: -2px 0 14px;
    overflow: hidden;
    border: 1px solid rgba(20, 116, 103, .14);
    border-radius: 7px;
    background: rgba(237, 247, 244, .82);
    color: #195b55;
}

.spine-announcement-track {
    --spine-announcement-duration: 28s;
    width: max-content;
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 72px;
    padding-left: 100%;
    white-space: nowrap;
    will-change: transform;
}

.spine-announcement-track.is-running {
    animation: spine-announcement-scroll var(--spine-announcement-duration) linear infinite;
}

.spine-announcement-track span {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
}

@keyframes spine-announcement-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(calc(-50% - 36px)); }
}

.spine-source-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.spine-source-options button {
    min-width: 0;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 8px 14px;
    border: 1px solid rgba(24, 67, 64, .16);
    border-radius: 7px;
    background: rgba(255, 255, 255, .7);
    color: #365653;
    font: 750 13px/1.25 inherit;
    cursor: pointer;
}

.spine-source-options button svg { width: 20px; height: 20px; flex: 0 0 auto; }
.spine-source-options button.active { border-color: #173f3c; background: #edf3f1; color: #173f3c; box-shadow: inset 0 0 0 1px #173f3c; }

.spine-flow-layout {
    display: grid;
    grid-template-columns: minmax(390px, 520px) minmax(520px, 1fr);
    gap: 16px;
    align-items: start;
}

.spine-prompt-workspace,
.spine-player-workspace {
    min-width: 0;
    padding: 20px;
    border: 1px solid rgba(24, 67, 64, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 14px 40px rgba(23, 58, 56, .07);
}

.spine-player-workspace {
    position: sticky;
    top: 12px;
}

.spine-flow-heading {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 16px;
}

.spine-flow-heading h1,
.spine-flow-heading h2 {
    margin: 0 0 3px;
    font-size: 19px;
    line-height: 1.2;
    letter-spacing: 0;
}

.spine-flow-heading p {
    color: var(--text-secondary);
    font-size: 12px;
}

.spine-flow-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 7px;
    color: #0f766e;
    background: #dff3ed;
}

.spine-flow-mark svg { width: 22px; height: 22px; }
.spine-flow-step-number {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #148b7f;
    color: #fff;
    font-size: 13px;
    font-weight: 850;
}
.spine-player-heading { justify-content: space-between; }

.spine-source-pane { display: none; }
.spine-source-pane.active { display: block; }

.spine-flow-alert {
    margin: -4px 0 14px;
    padding: 9px 11px;
    border-left: 3px solid #ca8a04;
    background: #fff8dd;
    color: #755b13;
    font-size: 12px;
    font-weight: 700;
}

.spine-prompt-field {
    position: relative;
    display: grid;
    gap: 7px;
}

.spine-prompt-field > span,
.spine-compact-field > span,
.spine-choice-field legend {
    color: #294b49;
    font-size: 12px;
    font-weight: 800;
}

.spine-prompt-field textarea {
    width: 100%;
    min-height: 174px;
    resize: vertical;
    padding: 12px 13px 30px;
    border: 1px solid rgba(24, 67, 64, .18);
    border-radius: 7px;
    outline: 0;
    background: #fff;
    color: var(--text-primary);
    font: 13px/1.72 inherit;
}

.spine-prompt-field textarea:focus,
.spine-compact-field input:focus,
.spine-compact-field select:focus {
    border-color: #168b80;
    box-shadow: 0 0 0 3px rgba(22, 139, 128, .1);
}

.spine-prompt-field output {
    position: absolute;
    right: 10px;
    bottom: 8px;
    color: #83918f;
    font-size: 10px;
}

.spine-preset-groups {
    display: grid;
    gap: 9px;
    margin-top: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(24, 67, 64, .11);
}

.spine-preset-row {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
}

.spine-preset-row > span {
    padding-top: 6px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
}

.spine-preset-row > div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.spine-preset-row button {
    min-height: 29px;
    padding: 5px 9px;
    border: 1px solid rgba(24, 67, 64, .13);
    border-radius: 6px;
    background: #f4f7f6;
    color: #385957;
    font: 11px/1.35 inherit;
    cursor: pointer;
}

.spine-preset-row button:hover,
.spine-preset-row button.selected {
    border-color: rgba(15, 118, 110, .38);
    background: #e9f6f2;
    color: #0c7067;
}

.spine-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.spine-choice-field {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.spine-choice-field legend { margin-bottom: 7px; }
.spine-choice-wide { grid-column: 1 / -1; }

.spine-choice-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border-radius: 7px;
    background: #edf2f0;
}

.spine-version-choice { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.spine-choice-group label { min-width: 0; cursor: pointer; }
.spine-choice-group input { position: absolute; opacity: 0; pointer-events: none; }
.spine-choice-group span {
    min-height: 34px;
    display: grid;
    place-items: center;
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 5px;
    color: #60726f;
    font-size: 11px;
    font-weight: 750;
    text-align: center;
}

.spine-choice-group input:checked + span {
    border-color: rgba(24, 67, 64, .1);
    background: #fff;
    color: #173f3c;
    box-shadow: 0 2px 8px rgba(25, 61, 59, .08);
}

.spine-compact-field { display: grid; gap: 7px; }
.spine-compact-field input,
.spine-compact-field select {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border: 1px solid rgba(24, 67, 64, .16);
    border-radius: 6px;
    outline: 0;
    background: #fff;
    color: var(--text-primary);
    font: 12px inherit;
}

.spine-frame-upload {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 14px;
    padding: 18px;
    border: 1px dashed rgba(15, 118, 110, .4);
    border-radius: 7px;
    background: #f5faf8;
    color: #315856;
    text-align: center;
    cursor: pointer;
}

.spine-frame-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.spine-frame-upload-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 7px; background: #dff3ed; color: #0f766e; }
.spine-frame-upload-icon svg { width: 22px; height: 22px; }
.spine-frame-upload strong { font-size: 13px; }
.spine-frame-upload small { color: var(--text-secondary); font-size: 10px; }
.spine-frame-upload:hover,
.spine-frame-upload.is-dragging { border-color: #0f8f82; background: #edf8f5; }
.spine-frame-upload.has-file { border-style: solid; border-color: #2d946c; background: #edfaf5; }

.spine-flow-generate {
    width: 100%;
    min-height: 48px;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    margin-top: 16px;
    padding: 0 15px;
    border: 0;
    border-radius: 7px;
    background: #173f3c;
    color: #fff;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 9px 22px rgba(23, 63, 60, .16);
}

.spine-flow-generate svg { width: 20px; height: 20px; color: #f0c85d; }
.spine-flow-generate span { text-align: left; font-size: 13px; font-weight: 850; }
.spine-flow-generate small { padding-left: 12px; border-left: 1px solid rgba(255,255,255,.2); color: #dcece9; }
.spine-flow-generate:disabled { opacity: .45; cursor: not-allowed; }
.spine-flow-generate.is-loading svg { animation: spineRotate .9s linear infinite; }
.spine-flow-login { display: block; margin-top: 8px; color: #0f766e; font-size: 12px; font-weight: 750; text-align: center; }

.spine-workflow-step {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(24, 67, 64, .11);
}

.spine-workflow-step > header {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.spine-workflow-step > header b {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(24, 67, 64, .18);
    border-radius: 50%;
    color: #2f625e;
    font-size: 10px;
}

.spine-workflow-step > header strong { font-size: 13px; }
.spine-workflow-step > header span { color: var(--text-secondary); font-size: 10px; font-weight: 700; }
.spine-workflow-step.is-ready > header b { border-color: #148b7f; background: #148b7f; color: #fff; }
.spine-workflow-step.is-active > header b { border-color: #148b7f; background: #e5f4f0; color: #0f766e; }
.spine-workflow-step .spine-settings-grid { margin-top: 12px; }
.spine-workflow-step fieldset:disabled,
.spine-workflow-step input:disabled,
.spine-workflow-step select:disabled { opacity: .48; cursor: not-allowed; }

.spine-step-action {
    width: 100%;
    min-height: 42px;
    margin-top: 12px;
    border: 1px solid rgba(15, 118, 110, .3);
    border-radius: 6px;
    background: #eef8f5;
    color: #0f6f67;
    font: 800 12px/1 inherit;
    cursor: pointer;
}

.spine-step-action.is-primary { border-color: #0f766e; background: #0f766e; color: #fff; }
.spine-step-action:disabled { opacity: .42; cursor: not-allowed; }
.spine-step-action.is-loading { color: transparent; position: relative; }
.spine-step-action.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    width: 18px;
    height: 18px;
    margin: auto;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    color: #148b7f;
    animation: spineRotate .9s linear infinite;
}
.spine-step-action.is-primary.is-loading::after { color: #fff; }

.spine-flow-status {
    min-width: 60px;
    height: 25px;
    display: inline-grid;
    place-items: center;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 850;
    white-space: nowrap;
}

.spine-flow-status.is-idle { background: #edf1ef; color: #667b78; }
.spine-flow-status.is-queued { background: #fff1c7; color: #8a6106; }
.spine-flow-status.is-generating { background: #e1edf8; color: #23628e; }
.spine-flow-status.is-completed { background: #ddf3e5; color: #197244; }
.spine-flow-status.is-failed { background: #fee2e2; color: #ac2525; }

.spine-pipeline {
    display: grid;
    grid-template-columns: auto minmax(18px, 1fr) auto minmax(18px, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin: 0 2px 13px;
}
.spine-pipeline.is-upload { grid-template-columns: auto minmax(18px, 1fr) auto; }

.spine-pipeline span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #82908e;
    font-size: 10px;
    font-weight: 750;
    white-space: nowrap;
}

.spine-pipeline b {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border: 1px solid #ced8d5;
    border-radius: 50%;
    background: #fff;
    font-size: 9px;
}

.spine-pipeline i { height: 1px; background: #d8dfdd; }
.spine-pipeline span.is-active { color: #0f766e; }
.spine-pipeline span.is-active b { border-color: #0f8f82; background: #e5f4f0; }
.spine-pipeline span.is-complete { color: #267758; }
.spine-pipeline span.is-complete b { border-color: #2d946c; background: #2d946c; color: #fff; }
.spine-pipeline i.is-complete { background: #57a984; }

.spine-artifact-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    padding: 3px;
    border-radius: 7px;
    background: #edf2f0;
}

.spine-artifact-tabs button {
    min-width: 0;
    flex: 1;
    height: 31px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #657672;
    font: 11px/1 inherit;
    font-weight: 750;
    cursor: pointer;
}

.spine-artifact-tabs button.active { background: #fff; color: #173f3c; box-shadow: 0 2px 7px rgba(25, 61, 59, .08); }
.spine-artifact-tabs button:disabled { opacity: .38; cursor: not-allowed; }

.spine-flow-stage {
    position: relative;
    width: 100%;
    min-height: 460px;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 1px solid rgba(24, 67, 64, .13);
    border-radius: 7px;
    background-color: #edf1ef;
    background-image: linear-gradient(45deg, rgba(25,67,64,.045) 25%, transparent 25%), linear-gradient(-45deg, rgba(25,67,64,.045) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(25,67,64,.045) 75%), linear-gradient(-45deg, transparent 75%, rgba(25,67,64,.045) 75%);
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.spine-flow-empty,
.spine-flow-progress {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    text-align: center;
}

.spine-flow-empty svg { width: 42px; height: 42px; color: #6e8985; }
.spine-flow-empty strong { max-width: 420px; font-size: 14px; line-height: 1.55; }
.spine-flow-progress { background: rgba(237, 241, 239, .96); }
.spine-flow-progress.is-overlay { inset: auto 12px 12px; align-items: flex-start; padding: 10px 12px 10px 44px; border: 1px solid rgba(24,67,64,.12); border-radius: 7px; background: rgba(255,255,255,.9); text-align: left; box-shadow: 0 8px 24px rgba(20,50,48,.12); }
.spine-flow-progress > span { width: 36px; height: 36px; border: 3px solid rgba(15,118,110,.15); border-top-color: #0f8f82; border-radius: 50%; animation: spineRotate .9s linear infinite; }
.spine-flow-progress.is-overlay > span { position: absolute; left: 12px; width: 22px; height: 22px; border-width: 2px; }
.spine-flow-progress strong { font-size: 13px; }
.spine-flow-progress small { color: var(--text-secondary); font-size: 10px; }
.spine-artifact-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.spine-flow-stage #spinePlayer { position: absolute; inset: 0; width: 100%; height: 100%; }
.spine-flow-stage #spinePlayer .spine-player { width: 100%; height: 100%; }

.spine-flow-controls {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) 38px auto minmax(150px, 1fr);
    align-items: end;
    gap: 8px;
    margin-top: 10px;
}

.spine-flow-controls > label:first-child,
.spine-speed-control { display: grid; gap: 4px; color: var(--text-secondary); font-size: 10px; font-weight: 700; }
.spine-flow-controls select { width: 100%; height: 34px; border: 1px solid rgba(24,67,64,.14); border-radius: 6px; padding: 0 8px; background: #fff; color: var(--text-primary); }
.spine-control-icon { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(24,67,64,.14); border-radius: 6px; background: #fff; color: #315856; cursor: pointer; }
.spine-control-icon svg { width: 18px; height: 18px; }
.spine-control-icon:disabled { opacity: .38; cursor: not-allowed; }
.spine-loop-control { min-height: 36px; display: flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 11px; white-space: nowrap; }
.spine-loop-control input { position: absolute; opacity: 0; }
.spine-loop-control > span { width: 32px; height: 18px; position: relative; border-radius: 999px; background: #cad5d2; }
.spine-loop-control > span::after { content: ''; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; border-radius: 50%; background: #fff; transition: .18s; }
.spine-loop-control input:checked + span { background: #148b7f; }
.spine-loop-control input:checked + span::after { transform: translateX(14px); }
.spine-speed-control > span { display: flex; justify-content: space-between; }
.spine-speed-control input { width: 100%; accent-color: #0f766e; }

.spine-flow-export {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(24,67,64,.11);
}

.spine-flow-export > span { color: var(--text-secondary); font-size: 11px; font-weight: 700; }
.spine-flow-download { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border-radius: 6px; background: #0f766e; color: #fff; font-size: 12px; font-weight: 800; }
.spine-flow-download svg { width: 17px; height: 17px; }
.spine-flow-download.disabled { opacity: .4; pointer-events: none; }

[data-theme="dark"] .spine-prompt-workspace,
[data-theme="dark"] .spine-player-workspace { background: rgba(17, 27, 27, .92); border-color: rgba(255,255,255,.1); }
[data-theme="dark"] .spine-source-options button,
[data-theme="dark"] .spine-frame-upload { background: #172725; border-color: rgba(255,255,255,.12); color: #c9dcda; }
[data-theme="dark"] .spine-source-options button.active { background: #203633; border-color: #61bbae; box-shadow: inset 0 0 0 1px #61bbae; }
[data-theme="dark"] .spine-announcement { background: #172725; border-color: rgba(97,187,174,.24); color: #bde2dc; }
[data-theme="dark"] .spine-prompt-field textarea,
[data-theme="dark"] .spine-compact-field input,
[data-theme="dark"] .spine-compact-field select,
[data-theme="dark"] .spine-flow-controls select,
[data-theme="dark"] .spine-control-icon,
[data-theme="dark"] .spine-choice-group input:checked + span,
[data-theme="dark"] .spine-artifact-tabs button.active { background: #1b2b2a; color: #e8f1ef; }
[data-theme="dark"] .spine-prompt-field > span,
[data-theme="dark"] .spine-compact-field > span,
[data-theme="dark"] .spine-choice-field legend { color: #c9dcda; }
[data-theme="dark"] .spine-choice-group,
[data-theme="dark"] .spine-artifact-tabs { background: #142423; }
[data-theme="dark"] .spine-preset-row button { background: #1b2a29; border-color: rgba(255,255,255,.09); color: #b8ceca; }
[data-theme="dark"] .spine-step-action { background: #18312e; color: #83d7cc; }
[data-theme="dark"] .spine-step-action.is-primary { background: #148b7f; color: #fff; }
[data-theme="dark"] .spine-flow-stage { background-color: #142322; }
[data-theme="dark"] .spine-flow-progress { background: rgba(20,35,34,.96); }

@media (max-width: 1180px) {
    .spine-flow { width: calc(100vw - var(--sidebar-w) - 24px); }
    .spine-flow-layout { grid-template-columns: 1fr; }
    .spine-player-workspace { position: static; }
}

@media (max-width: 720px) {
    .spine-flow { width: calc(100vw - 20px); padding-top: 10px; }
    .spine-prompt-workspace,
    .spine-player-workspace { padding: 14px; }
    .spine-source-options { grid-template-columns: 1fr; gap: 7px; }
    .spine-announcement { height: 36px; margin-bottom: 10px; }
    .spine-preset-row { grid-template-columns: 1fr; gap: 3px; }
    .spine-preset-row > span { padding-top: 0; }
    .spine-settings-grid { grid-template-columns: 1fr; }
    .spine-choice-wide { grid-column: auto; }
    .spine-flow-stage { min-height: 390px; aspect-ratio: 4 / 5; }
    .spine-flow-controls { grid-template-columns: minmax(120px, 1fr) 38px auto; }
    .spine-speed-control { grid-column: 1 / -1; }
    .spine-flow-export { align-items: stretch; flex-direction: column; }
    .spine-flow-download { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .spine-announcement-track.is-running { animation-duration: 70s; }
}

/* Spine creative studio */
.spine-studio [hidden],
.spine-modal[hidden] {
    display: none !important;
}

.spine-studio {
    width: min(1380px, calc(100vw - var(--sidebar-w) - 48px));
    margin: 0 auto;
    padding: 32px 0 72px;
}

.spine-hero {
    min-height: 120px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    padding: 6px 2px 24px;
    border-bottom: 1px solid rgba(20,116,103,.13);
}

.spine-kicker {
    color: #0f8f82;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
}

.spine-hero h1 {
    margin: 8px 0 7px;
    font-size: 40px;
    line-height: 1.08;
    letter-spacing: 0;
}

.spine-hero > div:first-child > p:last-child,
.spine-panel-heading p,
.spine-preview-head p,
.spine-history-heading p,
.spine-download-note {
    color: var(--text-secondary);
}

.spine-engine-badge {
    min-width: 260px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 14px;
    border: 1px solid rgba(20,116,103,.14);
    background: rgba(255,255,255,.66);
    border-radius: 8px;
}

.engine-signal {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #13a892;
    box-shadow: 0 0 0 5px rgba(19,168,146,.12);
}

.spine-engine-badge span:last-child { display: grid; gap: 2px; }
.spine-engine-badge strong { font-size: 13px; }
.spine-engine-badge small { color: var(--text-secondary); font-size: 11px; }

.spine-service-alert {
    margin-top: 14px;
    padding: 11px 14px;
    border: 1px solid rgba(239,68,68,.2);
    border-radius: 8px;
    background: rgba(254,226,226,.72);
    color: #b91c1c;
    font-size: 13px;
    font-weight: 700;
}

.spine-service-alert.warning {
    border-color: rgba(217,119,6,.22);
    background: rgba(254,243,199,.76);
    color: #a16207;
}

.spine-workflow-tabs {
    width: fit-content;
    display: flex;
    gap: 4px;
    margin: 22px 0 16px;
    padding: 4px;
    border: 1px solid rgba(20,116,103,.13);
    background: rgba(255,255,255,.62);
    border-radius: 9px;
}

.spine-workflow-tab,
.spine-segmented button,
.spine-view-switch button {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    cursor: pointer;
}

.spine-workflow-tab {
    min-width: 150px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 800;
}

.spine-workflow-tab svg { width: 19px; height: 19px; }
.spine-workflow-tab.active { background: #173d3d; color: #fff; box-shadow: 0 7px 18px rgba(23,61,61,.14); }

.spine-workspace {
    display: grid;
    grid-template-columns: minmax(390px, .9fr) minmax(480px, 1.1fr);
    gap: 16px;
    align-items: start;
}

.spine-config-panel,
.spine-preview-panel {
    min-width: 0;
    padding: 22px;
    border: 1px solid rgba(20,116,103,.13);
    border-radius: 8px;
    background: rgba(255,255,255,.76);
    box-shadow: 0 18px 54px rgba(34,88,82,.08);
}

.spine-preview-panel { position: sticky; top: 16px; }

.spine-panel-heading,
.spine-preview-head > div,
.spine-preview-head,
.spine-history-heading {
    display: flex;
    align-items: center;
}

.spine-panel-heading { gap: 12px; margin-bottom: 16px; }
.spine-panel-heading h2,
.spine-preview-head h2,
.spine-history-heading h2 { margin: 0 0 3px; font-size: 19px; letter-spacing: 0; }
.spine-panel-heading p,
.spine-preview-head p { font-size: 12px; }

.spine-step {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: #e2f4ef;
    color: #0f766e;
    font-size: 11px;
    font-weight: 900;
}

.compact-heading { margin-bottom: 14px; }
.spine-section-divider { height: 1px; background: rgba(20,116,103,.12); margin: 22px 0; }

.spine-segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 14px;
    padding: 4px;
    border-radius: 8px;
    background: #edf4f1;
}

.spine-segmented button {
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 750;
}

.spine-segmented button.active { color: #153e3c; background: #fff; box-shadow: 0 2px 9px rgba(24,72,68,.1); }
.spine-source-pane { display: none; }
.spine-source-pane.active { display: block; }

.spine-upload-zone {
    min-height: 160px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    border: 1px dashed rgba(15,118,110,.34);
    border-radius: 8px;
    background: #f6fbf9;
    color: #0f766e;
    text-align: center;
    cursor: pointer;
    transition: .18s ease;
}

.spine-upload-zone:hover,
.spine-upload-zone.is-dragging { border-color: #0f9f91; background: #ecf9f5; }
.spine-upload-zone.has-file { border-style: solid; background: #edfaf5; }
.spine-upload-zone input,
.spine-reference-upload input { display: none; }
.spine-upload-zone > span:last-child { color: var(--text-secondary); font-size: 12px; }

.spine-upload-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    color: #0f766e;
    background: #dff3ed;
}

.spine-upload-icon svg { width: 23px; height: 23px; }
.spine-text-action { display: block; margin: 9px 0 0 auto; border: 0; background: none; color: #0f766e; font-weight: 700; cursor: pointer; }

.spine-field { display: grid; gap: 7px; margin-top: 14px; }
.spine-field > span { color: #294c4d; font-size: 13px; font-weight: 800; }
.spine-field textarea,
.spine-field select {
    width: 100%;
    border: 1px solid rgba(20,116,103,.16);
    border-radius: 7px;
    outline: 0;
    background: rgba(255,255,255,.92);
    color: var(--text-primary);
    font: inherit;
}

.spine-field textarea { min-height: 112px; padding: 12px 13px; line-height: 1.65; resize: vertical; font-size: 13px; }
.spine-field select { height: 42px; padding: 0 11px; }
.spine-field textarea:focus,
.spine-field select:focus { border-color: #16a394; box-shadow: 0 0 0 3px rgba(22,163,148,.1); }
.spine-field.compact { margin: 0 0 10px; }

.spine-template-list { display: grid; gap: 6px; max-height: 250px; overflow: auto; padding-right: 2px; }
.spine-template-option {
    min-height: 62px;
    display: grid;
    grid-template-columns: 44px minmax(0,1fr) 24px;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(20,116,103,.12);
    border-radius: 7px;
    cursor: pointer;
    background: rgba(255,255,255,.68);
}

.spine-template-option:has(input:checked) { border-color: #14a593; background: #eef9f5; }
.spine-template-option input { position: absolute; opacity: 0; pointer-events: none; }
.template-cover { width: 44px; height: 44px; display: grid; place-items: center; overflow: hidden; border-radius: 6px; background: #e9f1ee; color: #0f766e; }
.template-cover img { width: 100%; height: 100%; object-fit: cover; }
.template-cover svg { width: 22px; height: 22px; }
.spine-template-option > span:nth-child(3) { display: grid; gap: 2px; min-width: 0; }
.spine-template-option strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.spine-template-option small { color: var(--text-secondary); }
.template-check { color: #0f8f82; opacity: 0; font-weight: 900; }
.spine-template-option:has(input:checked) .template-check { opacity: 1; }

.spine-inline-empty {
    min-height: 100px;
    display: grid;
    place-items: center;
    border: 1px dashed rgba(20,116,103,.2);
    border-radius: 7px;
    color: var(--text-secondary);
    font-size: 13px;
}

.spine-auto-rig {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 11px 12px;
    border-left: 3px solid #e8b641;
    background: rgba(255,248,218,.74);
}

.spine-auto-rig > span { width: 32px; height: 32px; display: grid; place-items: center; color: #9a6b00; }
.spine-auto-rig svg { width: 22px; height: 22px; }
.spine-auto-rig div { display: grid; gap: 2px; }
.spine-auto-rig small { color: #786c4c; }

.spine-reference-upload {
    min-height: 66px;
    display: grid;
    grid-template-columns: 48px minmax(0,1fr);
    align-items: center;
    gap: 11px;
    margin: 8px 0 14px;
    padding: 8px;
    border: 1px dashed rgba(15,118,110,.3);
    border-radius: 7px;
    cursor: pointer;
    background: #f7fbfa;
}

.reference-preview { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 6px; overflow: hidden; background: #e5f2ee; color: #0f766e; }
.reference-preview img { width: 100%; height: 100%; object-fit: cover; }
.reference-preview svg { width: 24px; height: 24px; }
.spine-reference-upload > span:last-child { display: grid; gap: 3px; min-width: 0; }
.spine-reference-upload strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.spine-reference-upload small { color: var(--text-secondary); }

.spine-constraint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 11px;
    border-radius: 7px;
    background: rgba(255,243,215,.72);
    color: #82621e;
    font-size: 12px;
    line-height: 1.55;
}

.spine-constraint svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }

.spine-generate-btn {
    width: 100%;
    min-height: 50px;
    display: grid;
    grid-template-columns: 24px minmax(0,1fr) auto;
    align-items: center;
    gap: 9px;
    margin-top: 16px;
    padding: 0 16px;
    border: 0;
    border-radius: 7px;
    background: #153e3c;
    color: #fff;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(21,62,60,.18);
}

.spine-generate-btn svg { width: 21px; height: 21px; color: #f2c75b; }
.spine-generate-btn span { text-align: left; font-weight: 900; }
.spine-generate-btn small { padding-left: 12px; border-left: 1px solid rgba(255,255,255,.18); color: #d9ebe7; }
.spine-generate-btn:disabled { cursor: not-allowed; opacity: .48; }
.spine-generate-btn.is-loading svg { animation: spineRotate 1.2s linear infinite; }
.spine-login-note { display: block; margin-top: 9px; text-align: center; color: #0f766e; font-size: 12px; font-weight: 700; }

.spine-preview-head { justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.spine-preview-head > div { gap: 11px; }
.spine-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}
.spine-status-badge.is-idle { background: #edf1ef; color: #667b78; }
.spine-status-badge.is-queued { background: #fff1c7; color: #926300; }
.spine-status-badge.is-generating { background: #dceefc; color: #176496; }
.spine-status-badge.is-completed { background: #dff5e8; color: #187344; }
.spine-status-badge.is-failed { background: #fee2e2; color: #b42323; }

.spine-stage {
    position: relative;
    width: 100%;
    min-height: 420px;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 1px solid rgba(20,116,103,.12);
    border-radius: 8px;
    background-color: #eff6f3;
    background-image: linear-gradient(45deg, rgba(20,116,103,.055) 25%, transparent 25%), linear-gradient(-45deg, rgba(20,116,103,.055) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(20,116,103,.055) 75%), linear-gradient(-45deg, transparent 75%, rgba(20,116,103,.055) 75%);
    background-size: 28px 28px;
    background-position: 0 0, 0 14px, 14px -14px, -14px 0;
}

.spine-stage-empty,
.spine-progress {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 24px;
    text-align: center;
}

.spine-stage-empty > span { width: 66px; height: 66px; display: grid; place-items: center; border-radius: 50%; color: #6f938e; background: rgba(255,255,255,.72); border: 1px solid rgba(20,116,103,.12); }
.spine-stage-empty svg { width: 34px; height: 34px; }
.spine-stage-empty strong { font-size: 16px; }
.spine-stage-empty small,
.spine-progress small { max-width: 320px; color: var(--text-secondary); line-height: 1.5; }
.spine-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
#spinePlayer { position: absolute; inset: 0; width: 100%; height: 100%; }
#spinePlayer .spine-player { width: 100%; height: 100%; }

.spine-compare { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(20,116,103,.16); }
.spine-compare figure { position: relative; min-width: 0; background: #eff6f3; }
.spine-compare img { width: 100%; height: 100%; display: block; object-fit: contain; }
.spine-compare figcaption { position: absolute; z-index: 2; left: 10px; top: 10px; padding: 5px 8px; border-radius: 5px; background: rgba(18,45,44,.78); color: #fff; font-size: 11px; font-weight: 800; }

.spine-progress-ring { width: 42px; height: 42px; border: 3px solid rgba(15,118,110,.16); border-top-color: #0f8f82; border-radius: 50%; animation: spineRotate .9s linear infinite; }
@keyframes spineRotate { to { transform: rotate(360deg); } }

.spine-preview-controls {
    display: grid;
    grid-template-columns: minmax(100px,.65fr) minmax(130px,1fr) 42px auto minmax(150px,.85fr);
    align-items: center;
    gap: 9px;
    margin-top: 11px;
}
.spine-version-field,
.spine-preview-controls > label:nth-child(2),
.spine-speed { display: grid; gap: 4px; color: var(--text-secondary); font-size: 10px; font-weight: 700; }
.spine-preview-controls select { width: 100%; height: 36px; border: 1px solid rgba(20,116,103,.14); border-radius: 6px; padding: 0 8px; background: #fff; color: var(--text-primary); }
.spine-icon-btn {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(20,116,103,.14);
    border-radius: 7px;
    background: rgba(255,255,255,.78);
    color: #315856;
    cursor: pointer;
}
.spine-icon-btn svg { width: 19px; height: 19px; }
.spine-icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.spine-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 12px; white-space: nowrap; }
.spine-toggle input { position: absolute; opacity: 0; }
.spine-toggle > span { width: 34px; height: 19px; position: relative; border-radius: 999px; background: #cbd9d5; transition: .18s; }
.spine-toggle > span::after { content: ''; position: absolute; width: 15px; height: 15px; left: 2px; top: 2px; border-radius: 50%; background: #fff; transition: .18s; }
.spine-toggle input:checked + span { background: #159787; }
.spine-toggle input:checked + span::after { transform: translateX(15px); }
.spine-speed > span { display: flex; justify-content: space-between; }
.spine-speed input { width: 100%; accent-color: #0f8f82; }

.spine-preview-actions { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.spine-view-switch { display: flex; padding: 3px; border-radius: 7px; background: #edf4f1; }
.spine-view-switch button { height: 32px; min-width: 58px; border-radius: 5px; font-size: 12px; font-weight: 750; }
.spine-view-switch button.active { background: #fff; color: #153e3c; box-shadow: 0 2px 7px rgba(24,72,68,.09); }
.spine-download-btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border-radius: 7px; background: #0f766e; color: #fff; font-size: 13px; font-weight: 800; }
.spine-download-btn:hover { opacity: 1; background: #0d665f; }
.spine-download-btn svg { width: 18px; height: 18px; }
.spine-download-btn.disabled { pointer-events: none; opacity: .42; }
.spine-download-note { margin-top: 9px; text-align: right; font-size: 11px; }

.spine-history-section { margin-top: 28px; }
.spine-history-heading { justify-content: space-between; gap: 16px; margin-bottom: 10px; padding: 0 2px; }
.spine-history-heading h2 { margin-top: 4px; font-size: 24px; }
.spine-history-list { border-top: 1px solid rgba(20,116,103,.14); }
.spine-history-row {
    width: 100%;
    min-height: 72px;
    display: grid;
    grid-template-columns: 48px minmax(0,1fr) 74px 70px 76px;
    align-items: center;
    gap: 13px;
    padding: 10px 4px;
    border: 0;
    border-bottom: 1px solid rgba(20,116,103,.11);
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}
.spine-history-row:hover,
.spine-history-row.active { background: rgba(255,255,255,.42); }
.history-thumb { width: 48px; height: 48px; display: grid; place-items: center; overflow: hidden; border-radius: 6px; background: #e8f1ed; color: #4e7771; }
.history-thumb img { width: 100%; height: 100%; object-fit: cover; }
.history-thumb svg { width: 23px; height: 23px; }
.history-main { min-width: 0; display: grid; gap: 5px; }
.history-main strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.history-main small { color: var(--text-secondary); font-size: 11px; }
.history-cost { color: var(--text-secondary); font-size: 11px; text-align: right; }
.history-arrow { color: #72918d; font-size: 24px; text-align: center; }
.history-download {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 9px;
    border: 1px solid rgba(20,116,103,.2);
    border-radius: 6px;
    background: rgba(255,255,255,.62);
    color: #176f65;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}
.history-download:hover { border-color: rgba(20,116,103,.38); background: #fff; }
.history-download svg { width: 16px; height: 16px; flex: 0 0 auto; }
.spine-history-empty { min-height: 150px; display: grid; place-content: center; gap: 5px; text-align: center; color: var(--text-secondary); }
.spine-history-empty strong { color: var(--text-primary); }

.spine-modal[hidden] { display: none; }
.spine-modal { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 18px; }
.spine-modal-backdrop { position: absolute; inset: 0; background: rgba(16,37,38,.42); backdrop-filter: blur(5px); }
.spine-modal-dialog { position: relative; width: min(520px,100%); overflow: hidden; border: 1px solid rgba(20,116,103,.16); border-radius: 8px; background: #fff; box-shadow: 0 30px 90px rgba(16,50,48,.22); }
.spine-modal-dialog header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid rgba(20,116,103,.12); }
.spine-modal-dialog h2 { margin-top: 4px; font-size: 20px; }
.spine-file-tree { display: grid; gap: 8px; margin: 20px; padding: 16px; border-radius: 7px; background: #f2f7f5; color: #315654; font: 13px/1.5 Consolas, monospace; }
.spine-file-tree span { padding-left: 12px; }
.spine-file-tree small { float: right; color: #78908d; font: 11px/1.5 inherit; }
.spine-modal-dialog > p { padding: 0 20px 20px; color: var(--text-secondary); font-size: 12px; line-height: 1.65; }

.spine-toast { position: fixed; z-index: 2000; left: 50%; bottom: 28px; transform: translate(-50%, 12px); padding: 11px 15px; border-radius: 7px; background: #173d3d; color: #fff; box-shadow: 0 15px 42px rgba(17,55,53,.24); opacity: 0; transition: .2s; }
.spine-toast.error { background: #a52a2a; }
.spine-toast.show { opacity: 1; transform: translate(-50%,0); }

[data-theme="dark"] .spine-engine-badge,
[data-theme="dark"] .spine-workflow-tabs,
[data-theme="dark"] .spine-config-panel,
[data-theme="dark"] .spine-preview-panel,
[data-theme="dark"] .spine-icon-btn { background: rgba(17,28,28,.9); border-color: rgba(255,255,255,.1); }
[data-theme="dark"] .spine-field > span { color: #c9ded9; }
[data-theme="dark"] .spine-segmented,
[data-theme="dark"] .spine-view-switch { background: #182a29; }
[data-theme="dark"] .spine-segmented button.active,
[data-theme="dark"] .spine-view-switch button.active,
[data-theme="dark"] .spine-template-option { background: #223332; color: #e5efed; }
[data-theme="dark"] .spine-upload-zone,
[data-theme="dark"] .spine-reference-upload,
[data-theme="dark"] .spine-field textarea,
[data-theme="dark"] .spine-field select,
[data-theme="dark"] .spine-preview-controls select { background: #172827; color: #e5efed; }
[data-theme="dark"] .spine-stage { background-color: #152625; }
[data-theme="dark"] .spine-history-row:hover,
[data-theme="dark"] .spine-history-row.active { background: rgba(255,255,255,.035); }

@media (max-width: 1120px) {
    .spine-studio { width: calc(100vw - var(--sidebar-w) - 28px); }
    .spine-workspace { grid-template-columns: 1fr; }
    .spine-preview-panel { position: static; }
}

@media (max-width: 720px) {
    .spine-studio { width: calc(100vw - 24px); padding-top: 20px; }
    .spine-hero { min-height: 0; align-items: flex-start; flex-direction: column; }
    .spine-hero h1 { font-size: 31px; }
    .spine-engine-badge { width: 100%; min-width: 0; }
    .spine-workflow-tabs { width: 100%; }
    .spine-workflow-tab { min-width: 0; flex: 1; }
    .spine-config-panel,
    .spine-preview-panel { padding: 16px; }
    .spine-stage { min-height: 340px; aspect-ratio: 4 / 5; }
    .spine-preview-controls { grid-template-columns: minmax(130px,1fr) 42px auto; }
    .spine-version-field { grid-column: 1 / -1; }
    .spine-speed { grid-column: 1 / -1; }
    .spine-preview-actions { align-items: stretch; flex-direction: column; }
    .spine-view-switch { align-self: flex-start; }
    .spine-download-btn { width: 100%; }
    .spine-download-note { text-align: center; }
    .spine-history-row { grid-template-columns: 44px minmax(0,1fr) 68px 38px; gap: 10px; }
    .history-thumb { width: 44px; height: 44px; }
    .history-cost,
    .history-arrow { display: none; }
    .history-download { width: 36px; min-height: 36px; padding: 0; }
    .history-download span { display: none; }
    .spine-compare { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
}

.single-result-card .result-card-actions {
    justify-content: center;
    padding-top: 4px;
}

.chat-form {
    max-width: 1040px;
    margin: 0 auto;
}

/* 一体化输入容器 */
.input-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    min-height: 184px;
    position: relative;
    background: linear-gradient(100deg, rgba(24,24,24,.98), rgba(17,22,23,.98));
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 28px;
    padding: 24px 22px 22px;
    transition: all .25s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 24px 80px rgba(0,0,0,.28);
}

[data-theme="light"] .input-container {
    background: linear-gradient(110deg, rgba(255,255,255,.86), rgba(238,252,247,.9));
    border: 1px solid rgba(20,116,103,.14);
    box-shadow: 0 22px 60px rgba(22,96,87,.11), inset 0 1px 0 rgba(255,255,255,.82);
}

[data-theme="light"] .input-container:focus-within {
    border-color: rgba(14,165,163,.34);
    box-shadow: 0 24px 70px rgba(22,96,87,.14), 0 0 0 4px rgba(14,165,163,.08);
}

.input-container:focus-within {
    border-color: rgba(255,255,255,.22);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 24px 90px rgba(0,0,0,.34);
}

.input-container.is-dragging-image {
    border-color: rgba(20, 184, 166, .72);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 26px 90px rgba(20,184,166,.24), 0 0 0 4px rgba(20,184,166,.14);
}

.input-container.is-dragging-image::after {
    content: '\62d6\653e\56fe\7247\5230\8fd9\91cc\6dfb\52a0\53c2\8003\56fe';
    position: absolute;
    inset: 12px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    background: rgba(11, 33, 33, .62);
    color: #f8ffff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
    pointer-events: none;
    z-index: 6;
}

[data-theme="light"] .input-container.is-dragging-image::after {
    background: rgba(236, 253, 245, .82);
    color: #0f766e;
}

/* 参考图图标行 */
.ref-icon-row {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
    position: absolute;
    top: 27px;
    left: 30px;
    z-index: 2;
}

.ref-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.1);
    background: transparent;
    color: rgba(255,255,255,.42);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
    overflow: hidden;
    padding: 0;
}

.ref-icon-btn > span {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    line-height: 32px;
    font-size: 12px;
    font-weight: 700;
}

[data-theme="light"] .ref-icon-btn {
    background: rgba(14,165,163,.07);
    color: rgba(15,118,110,.72);
    border-color: rgba(20,116,103,.12);
}

.ref-icon-btn:hover {
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.76);
}

.ref-icon-btn.has-image {
    position: relative;
    background: rgba(255,255,255,.08);
    border-color: rgba(14,165,163,.45);
    box-shadow: 0 8px 20px rgba(14,165,163,.16);
    overflow: visible;
}

.ref-icon-btn img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 9px;
}

.ref-remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 17px;
    height: 17px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(21, 34, 34, .9);
    color: #fff;
    border: 1px solid rgba(255,255,255,.72);
    box-shadow: 0 6px 14px rgba(15, 23, 42, .22);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
}

.ref-remove-btn:hover {
    background: #ef4444;
    transform: scale(1.06);
}

[data-theme="light"] .ref-remove-btn {
    background: rgba(15,118,110,.94);
    border-color: rgba(255,255,255,.95);
}

.ref-icon-btn.has-image::after {
    content: '';
    position: absolute;
    bottom: 3px; right: 3px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #22c55e;
    border: 1px solid rgba(255,255,255,.2);
}

#promptInput {
    flex: 1 1 auto;
    width: 100%;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 650;
    resize: none;
    max-height: 130px;
    line-height: 1.5;
    padding: 0 4px 0 104px;
    min-height: 110px;
    font-family: inherit;
}

.reference-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(8,12,15,.72);
    backdrop-filter: blur(10px);
}

.reference-preview-overlay.is-open {
    display: flex;
}

.reference-preview-overlay img {
    max-width: min(92vw, 980px);
    max-height: 88vh;
    border-radius: 14px;
    object-fit: contain;
    box-shadow: 0 24px 80px rgba(0,0,0,.36);
}

.reference-preview-close {
    position: fixed;
    top: 22px;
    right: 24px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.92);
    color: #0f172a;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

[data-theme="light"] #promptInput {
    color: #17343b;
}

[data-theme="light"] #promptInput::placeholder {
    color: rgba(95,119,121,.66);
}

#promptInput::placeholder {
    color: rgba(255,255,255,.28);
}

/* 右侧操作区 */
.input-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    flex-shrink: 0;
    margin-top: auto;
}

/* 内联设置行（模型/比例/数量/积分）*/
.inline-settings {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.native-config-select {
    display: none;
}

.config-control {
    position: relative;
    flex-shrink: 0;
}

.config-trigger {
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(36,36,36,.92);
    color: rgba(255,255,255,.7);
    height: 48px;
    border-radius: 24px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 650;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .18s ease, box-shadow .18s ease, color .18s ease, background .18s ease;
}

.model-trigger {
    min-width: 202px;
    justify-content: flex-start;
}

.params-trigger {
    min-width: 166px;
    justify-content: center;
}

.config-trigger:hover,
.config-trigger.is-open {
    color: rgba(255,255,255,.88);
    border-color: rgba(255,255,255,.62);
    box-shadow: 0 0 0 3px rgba(255,255,255,.08);
}

[data-theme="light"] .config-trigger {
    background: rgba(255,255,255,.72);
    border-color: rgba(20,116,103,.14);
    color: #456467;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

[data-theme="light"] .config-trigger:hover,
[data-theme="light"] .config-trigger.is-open {
    color: #0f766e;
    border-color: rgba(14,165,163,.34);
    background: rgba(236,253,245,.9);
    box-shadow: 0 0 0 3px rgba(14,165,163,.08);
}

.config-spark {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    opacity: .7;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4 8 13l-4 2 4 2 3 7 3-7 4-2-4-2-3-9Z'/%3E%3Cpath d='M18 2v4'/%3E%3Cpath d='M20 4h-4'/%3E%3Cpath d='M4 4v2'/%3E%3Cpath d='M5 5H3'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4 8 13l-4 2 4 2 3 7 3-7 4-2-4-2-3-9Z'/%3E%3Cpath d='M18 2v4'/%3E%3Cpath d='M20 4h-4'/%3E%3Cpath d='M4 4v2'/%3E%3Cpath d='M5 5H3'/%3E%3C/svg%3E") center/contain no-repeat;
}

.config-caret {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    opacity: .7;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
}

.param-sep {
    opacity: .72;
    padding: 0 1px;
}

.param-sep::before {
    content: "\00B7";
}

.params-trigger .param-sep {
    font-size: 0;
}

.config-popover {
    position: absolute;
    left: 0;
    bottom: calc(100% + 14px);
    z-index: 300;
    display: none;
    background: radial-gradient(circle at 60% 70%, rgba(70,70,70,.24), transparent 38%), rgba(31,31,30,.98);
    border: 1px solid rgba(255,255,255,.09);
    box-shadow: 0 24px 70px rgba(0,0,0,.58);
    color: rgba(255,255,255,.72);
    backdrop-filter: blur(18px);
}

[data-theme="light"] .config-popover {
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(240,253,249,.96));
    border-color: rgba(20,116,103,.12);
    box-shadow: 0 24px 70px rgba(22,96,87,.16);
    color: #456467;
}

[data-theme="light"] .config-popover-title,
[data-theme="light"] .params-title {
    color: #7f9696;
}

[data-theme="light"] .model-option,
[data-theme="light"] .quality-option,
[data-theme="light"] .count-option,
[data-theme="light"] .ratio-option {
    color: #5f7779;
}

[data-theme="light"] .model-option:hover,
[data-theme="light"] .model-option.is-selected,
[data-theme="light"] .quality-option.is-selected,
[data-theme="light"] .count-option.is-selected,
[data-theme="light"] .ratio-option.is-selected {
    background: rgba(14,165,163,.1);
    color: #0f766e;
}

.config-popover.is-open {
    display: block;
}

.model-popover {
    width: 410px;
    padding: 34px 22px 26px;
    border-radius: 28px;
}

.config-popover-title,
.params-title {
    font-size: 20px;
    font-weight: 600;
    color: rgba(255,255,255,.42);
}

.config-popover-title {
    padding: 0 14px 18px;
}

.model-option-list {
    display: grid;
    gap: 4px;
    overflow: visible;
}

.model-option {
    width: 100%;
    min-height: 68px;
    border: 0;
    border-radius: 20px;
    padding: 0 18px;
    background: transparent;
    color: rgba(255,255,255,.68);
    display: flex;
    align-items: center;
    gap: 18px;
    font: inherit;
    font-size: 23px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.model-option:hover,
.model-option.is-selected {
    background: rgba(255,255,255,.075);
    color: rgba(255,255,255,.9);
}

.model-option .config-spark {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
}

.model-option-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.model-check {
    width: 22px;
    height: 22px;
    opacity: 0;
    flex: 0 0 22px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
}

.model-option.is-selected .model-check {
    opacity: 1;
}

.params-popover {
    width: 490px;
    padding: 26px 28px 28px;
    border-radius: 26px;
}

.params-section + .params-section {
    margin-top: 34px;
}

.quality-option-list,
.count-option-list {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 16px;
}

.quality-option,
.count-option {
    border: 0;
    border-radius: 999px;
    min-width: 70px;
    height: 56px;
    padding: 0 20px;
    background: transparent;
    color: rgba(255,255,255,.58);
    font: inherit;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
}

.quality-option.is-selected,
.count-option.is-selected {
    background: rgba(255,255,255,.2);
    color: rgba(255,255,255,.92);
}

.ratio-option-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(72px, 1fr));
    gap: 22px 22px;
    margin-top: 16px;
}

.ratio-option {
    min-height: 86px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: rgba(255,255,255,.58);
    font: inherit;
    font-size: 18px;
    font-weight: 700;
    display: grid;
    place-items: center;
    gap: 7px;
    cursor: pointer;
}

.ratio-option.is-selected {
    background: rgba(255,255,255,.17);
    color: rgba(255,255,255,.92);
}

.ratio-icon {
    width: 30px;
    height: 30px;
    border: 3px solid currentColor;
    border-radius: 4px;
    opacity: .82;
}

.ratio-icon.ratio-16-9 { width: 30px; height: 17px; }
.ratio-icon.ratio-3-2 { width: 28px; height: 19px; }
.ratio-icon.ratio-4-3 { width: 28px; height: 21px; }
.ratio-icon.ratio-1-1 { width: 28px; height: 28px; }
.ratio-icon.ratio-3-4 { width: 21px; height: 28px; }
.ratio-icon.ratio-2-3 { width: 19px; height: 28px; }
.ratio-icon.ratio-9-16 { width: 17px; height: 30px; }

@media (max-width: 720px) {
    .input-actions {
        width: 100%;
        align-items: stretch;
    }

    .inline-settings {
        flex-wrap: wrap;
        width: 100%;
    }

    .model-trigger {
        min-width: 0;
        width: 100%;
    }

    .params-trigger {
        min-width: 0;
        width: 100%;
    }

    .model-control,
    .params-control {
        flex: 1 1 180px;
    }

    .model-popover,
    .params-popover {
        width: min(92vw, 490px);
        left: 50%;
        transform: translateX(-50%);
    }

    .ratio-option-grid {
        grid-template-columns: repeat(3, minmax(72px, 1fr));
    }
}

.inline-select {
    padding: 8px 32px 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(30,32,42,.85);
    color: #e2e8f0;
    font-size: 13.5px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    white-space: nowrap;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%2394a3b8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all .2s ease;
}

[data-theme="light"] .inline-select {
    background-color: rgba(255,255,255,.9);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%23666'/%3E%3C/svg%3E");
    color: #1a1a2e;
    border-color: rgba(0,0,0,.12);
}

.inline-select:hover,
.inline-select:focus {
    border-color: rgba(245,158,11,.55);
    background-color: rgba(40,42,55,.95);
    box-shadow: 0 0 0 3px rgba(245,158,11,.08);
}

[data-theme="light"] .inline-select:hover,
[data-theme="light"] .inline-select:focus {
    background-color: #fff;
    border-color: rgba(245,158,11,.5);
}

/* ====== 下拉选项面板（仿参考网站深色卡片风格）====== */
.inline-select option {
    background: #22252e;
    color: #e2e8f0;
    padding: 11px 16px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.6;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,.04);
}

[data-theme="light"] .inline-select option {
    background: #fff;
    color: #1a1a2e;
    border-bottom-color: rgba(0,0,0,.06);
}

.inline-select option:last-child {
    border-bottom: none;
}

/* hover 状态 - 高亮行 */
.inline-select option:hover {
    background: rgba(245,158,11,.15);
    color: #f59e0b;
}

/* 选中状态 */
.inline-select option:checked {
    background: linear-gradient(135deg, rgba(245,158,11,.25), rgba(234,88,12,.18));
    color: #fbbf24;
    font-weight: 600;
}

.inline-points {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 17px;
    color: rgba(255,255,255,.56);
    font-weight: 700;
    white-space: nowrap;
    user-select: none;
    padding: 0 6px;
    margin-left: auto;
    background: transparent;
    border-radius: 0;
    border: 0;
}

[data-theme="light"] .inline-points {
    background: transparent;
    color: #0f766e;
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all .25s ease;
    background: rgba(255,255,255,.34);
    color: rgba(0,0,0,.72);
    box-shadow: none;
}

[data-theme="light"] .send-btn {
    background: linear-gradient(135deg, #14b8a6, #fbbf24);
    color: #fff;
    box-shadow: 0 12px 30px rgba(20,184,166,.26);
}

.send-btn:hover {
    transform: translateY(-2px) scale(1.02);
    background: rgba(255,255,255,.5);
    box-shadow: none;
}

[data-theme="light"] .send-btn:hover {
    background: linear-gradient(135deg, #0d9488, #f59e0b);
    box-shadow: 0 14px 34px rgba(20,184,166,.32);
}

.send-btn:active {
    transform: translateY(0) scale(.98);
}

.send-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========================================
   弹窗/面板
   ======================================== */
.modal-overlay,
.panel-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(6px);
    z-index: 500;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: rgba(16,20,26,.95);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 480px;
    width: 90%;
    box-shadow: 0 25px 80px rgba(0,0,0,.55);
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.panel-content {
    background: rgba(16,20,26,.95);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 720px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0,0,0,.55);
    backdrop-filter: blur(20px);
}

.panel-small { max-width: 420px; }

.modal-header,
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3,
.panel-header h3 {
    font-size: 17px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close,
.panel-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover,
.panel-close:hover { color: var(--text-primary); }

.modal-body,
.panel-body {
    padding: 20px 22px;
    overflow-y: auto;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* 兑换弹窗 */
.redeem-modal { max-width: 400px; }

.redeem-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.redeem-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,.3);
    color: var(--text-primary);
    font-size: 17px;
    letter-spacing: 2px;
    text-align: center;
    text-transform: uppercase;
    outline: none;
    transition: all var(--transition);
    font-family: 'Courier New', monospace;
}

.redeem-input::placeholder {
    letter-spacing: 0;
    font-size: 13px;
    color: var(--text-muted);
    font-family: inherit;
}

.redeem-input:focus {
    border-color: var(--primary);
}

.btn-redeem {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 13px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    border: 0;
    cursor: pointer;
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: #fff;
    transition: all var(--transition);
}

.btn-redeem:hover { opacity: .9; }
.btn-redeem:disabled { opacity: .5; cursor: not-allowed; }

.redeem-msg {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
}

/* 资产卡片 */
.asset-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
}

.asset-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.asset-time {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
}

.asset-prompt {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    word-break: break-word;
}

.asset-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.asset-img-wrap {
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0,0,0,.15);
    border: 1px solid var(--border-color);
}

.asset-img-wrap img {
    width: 100%;
    display: block;
    aspect-ratio: auto;
}

.asset-img-actions {
    display: flex;
    gap: 6px;
    padding: 6px 8px;
}

.img-error {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

.asset-no-img {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    border-radius: 8px;
    background: var(--bg-card);
}

/* 通知面板 */
.notice-item { margin-bottom: 16px; }
.notice-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.notice-desc { font-size: 13px; color: var(--text-secondary); }

/* Badge */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(245,158,11,.10);
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
}

.notice {
    padding: 12px 16px;
    border-radius: var(--radius);
    background: rgba(245,158,11,.08);
    color: var(--text-secondary);
    font-size: 13px;
}

/* 空状态 */
.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    color: var(--text-muted);
    text-align: center;
}

.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-text { font-size: 15px; }

/* 侧边栏遮罩（移动端） */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99;
}

/* ========================================
   响应式
   ======================================== */
@media(max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-w);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* 移动端侧边栏展开时文字始终显示 */
    .sidebar.open .nav-label,
    .sidebar.open .logo-text {
        opacity: 1;
    }

    .main-content { margin-left: 0; }

    .chat-input-area { left: 0; }

    .menu-toggle { display: block; }

    .top-search { display: none; }

    .hero-title { font-size: 24px; }

    .settings-row {
        flex-direction: column;
    }

    .setting-group {
        min-width: 100%;
    }
}

@media(max-width: 600px) {
    .top-bar { padding: 0 12px; gap: 10px; }
    .content-area { padding: 0; }
    .chat-messages { padding: 0 12px 260px; }
    .chat-input-area { padding: 12px 12px 20px; }
    .hero-section { padding: 36px 12px 20px; }
    .hero-title { font-size: 22px; }
    
    /* 卡片式结果响应式 */
    .result-card-images { 
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .result-card-img {
        aspect-ratio: auto !important;
        min-height: 200px;
    }

    /* 查看器全屏 */
    .img-viewer-container {
        width: 100vw;
        height: 100vh;
        max-height: none;
        border-radius: 0;
        flex-direction: column;
    }
    .viewer-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 40vh;
        border-left: none;
        border-top: 1px solid var(--border-color);
        order: 2;
    }
    .viewer-main {
        flex: 1;
        min-height: 50vh;
        order: 1;
    }
    .viewer-close-btn {
        top: 8px; right: 8px;
    }
    .asset-images { grid-template-columns: 1fr; }
}

/* ========================================
   兼容旧组件
   ======================================== */
.loading-spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

input, textarea, select {
    font-family: inherit;
}

button, .btn {
    font-family: inherit;
    cursor: pointer;
}

/* Light theme modal and assets polish */
.modal-overlay,
.panel-overlay {
    background: rgba(20,36,38,.42);
    backdrop-filter: blur(10px);
}

.modal-content,
.panel-content {
    background: rgba(255,255,255,.88);
    border: 1px solid rgba(20,116,103,.12);
    border-radius: 28px;
    box-shadow: 0 28px 90px rgba(29,102,94,.2);
}

.panel-content {
    max-width: 920px;
    max-height: 84vh;
}

.modal-header,
.panel-header {
    padding: 22px 28px;
    border-bottom: 1px solid rgba(20,116,103,.1);
}

.modal-header h3,
.panel-header h3 {
    font-size: 22px;
}

.modal-body,
.panel-body {
    padding: 24px 28px;
}

.redeem-input {
    background: rgba(255,255,255,.72);
    border-color: rgba(20,116,103,.12);
}

.btn-redeem {
    background: linear-gradient(135deg, #14b8a6, #f4c945);
}

.asset-card {
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(20,116,103,.1);
    border-radius: 22px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 16px 44px rgba(29,102,94,.09);
}

.asset-prompt {
    font-size: 14px;
    line-height: 1.7;
}

.asset-images {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.asset-img-wrap {
    border-radius: 16px;
    background: rgba(240,250,247,.88);
    border-color: rgba(20,116,103,.12);
}

.asset-img-wrap img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* ========================================
   Account pages
   ======================================== */
.account-shell {
    width: min(1120px, calc(100vw - var(--sidebar-w) - 56px));
    margin: 0 auto;
    padding: 42px 0 70px;
}

.account-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 30px;
    border-radius: 28px;
    background: rgba(255,255,255,.62);
    border: 1px solid rgba(20,116,103,.1);
    box-shadow: 0 22px 70px rgba(28,99,92,.12);
}

[data-theme="dark"] .account-hero,
[data-theme="dark"] .account-panel,
[data-theme="dark"] .package-card {
    background: rgba(255,255,255,.05);
}

.account-kicker {
    color: #0f9f91;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 8px;
}

.account-hero h1 {
    font-size: 34px;
    line-height: 1.15;
    margin: 0 0 10px;
    color: var(--text-primary);
}

.account-hero p,
.account-profile-panel p,
.package-card p,
.package-note p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
}

.account-credit-orb {
    width: 118px;
    height: 118px;
    border-radius: 50%;
    background: linear-gradient(135deg, #18bfae 5%, #f3c744 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 45px rgba(19,174,159,.22);
    flex: 0 0 118px;
}

.account-credit-orb span {
    font-size: 28px;
    font-weight: 900;
}

.account-credit-orb small {
    margin-top: 4px;
    font-size: 12px;
    opacity: .9;
}

.account-grid {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 18px;
    margin-top: 18px;
}

.account-panel,
.package-card {
    border-radius: 24px;
    padding: 24px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(20,116,103,.1);
    box-shadow: 0 18px 55px rgba(28,99,92,.1);
}

.account-profile-panel,
.package-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.account-avatar-xl {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #15b8a8, #7c5cff);
    color: #fff;
    font-size: 34px;
    font-weight: 900;
}

.account-profile-panel h2,
.account-panel-title h2,
.package-card h2 {
    font-size: 22px;
    margin: 0;
}

.account-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
}

.account-btn {
    min-height: 42px;
    border: 0;
    border-radius: 14px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}

.account-btn.primary {
    background: linear-gradient(135deg, #14b8a6, #f4c945);
    color: #fff;
    box-shadow: 0 12px 28px rgba(20,184,166,.2);
}

.account-btn.ghost {
    background: rgba(15,118,110,.08);
    color: #0f766e;
}

.account-btn:disabled {
    opacity: .62;
    cursor: not-allowed;
}

.account-btn.wide {
    width: 100%;
}

.account-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.account-form {
    display: grid;
    gap: 12px;
}

.account-form label {
    display: grid;
    gap: 7px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
}

.account-form input {
    width: 100%;
    height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(20,116,103,.12);
    background: rgba(255,255,255,.72);
    color: var(--text-primary);
    padding: 0 14px;
    outline: none;
}

.account-form input:focus {
    border-color: rgba(20,184,166,.45);
    box-shadow: 0 0 0 4px rgba(20,184,166,.1);
}

.account-message {
    margin-top: 12px;
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 13px;
}

.account-message.ok {
    background: rgba(16,185,129,.12);
    color: #059669;
}

.account-message.error {
    background: rgba(239,68,68,.12);
    color: #dc2626;
}

.account-log-list {
    display: grid;
    gap: 10px;
}

.account-log-row {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr) 150px;
    gap: 12px;
    align-items: center;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,.45);
}

.account-log-row small {
    color: var(--text-muted);
    text-align: right;
}

.account-log-change {
    font-weight: 900;
}

.account-log-change.plus {
    color: #059669;
}

.account-log-change.minus {
    color: #dc2626;
}

.account-empty {
    color: var(--text-secondary);
    padding: 18px;
    border-radius: 16px;
    background: rgba(255,255,255,.45);
}

.package-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.package-card {
    min-height: 280px;
}

.package-card.featured {
    background: linear-gradient(180deg, rgba(21,184,168,.16), rgba(255,255,255,.78));
    border-color: rgba(20,184,166,.28);
}

.package-tag {
    align-self: flex-start;
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(15,118,110,.09);
    color: #0f766e;
    font-size: 12px;
    font-weight: 900;
}

.package-price {
    margin-top: auto;
    font-size: 28px;
    font-weight: 900;
    color: var(--text-primary);
}

.package-note {
    margin-top: 18px;
}

.package-note b {
    color: #0f9f91;
    font-size: 20px;
}

@media (max-width: 860px) {
    .account-shell {
        width: min(100%, calc(100vw - 24px));
        padding: 24px 0 54px;
    }

    .account-hero,
    .account-grid,
    .package-grid {
        grid-template-columns: 1fr;
    }

    .account-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .account-log-row {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .account-log-row small {
        grid-column: 2;
        text-align: left;
    }

    .points-menu {
        right: auto;
        bottom: auto;
    }
}

/* Image slicer */
.slicer-shell {
    width: min(1180px, calc(100vw - 48px));
    margin: 0 auto;
    padding: 34px 0 64px;
}

.slicer-hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    margin-bottom: 22px;
}

.slicer-hero h1 {
    margin: 4px 0 8px;
    font-size: clamp(30px, 5vw, 52px);
    letter-spacing: 0;
}

.slicer-hero p,
.slicer-panel-head p,
.slicer-status {
    color: var(--text-secondary);
    line-height: 1.7;
}

.slicer-hero-stats,
.slicer-panel,
.slicer-result-card {
    background: rgba(255,255,255,.76);
    border: 1px solid rgba(20,116,103,.11);
    box-shadow: 0 18px 48px rgba(22,96,87,.1);
}

.slicer-hero-stats {
    min-width: 148px;
    border-radius: 24px;
    padding: 18px 22px;
    text-align: center;
}

.slicer-hero-stats span {
    display: block;
    font-size: 42px;
    font-weight: 800;
    color: #0f766e;
}

.slicer-hero-stats small {
    color: var(--text-secondary);
}

.slicer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
    gap: 18px;
    align-items: stretch;
}

.slicer-panel {
    border-radius: 22px;
    padding: 20px;
}

.slicer-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.slicer-panel-head h2 {
    margin: 0 0 6px;
    font-size: 21px;
}

.slicer-dropzone {
    position: relative;
    min-height: 260px;
    border-radius: 20px;
    border: 1.5px dashed rgba(15,118,110,.28);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(240,253,250,.74), rgba(255,255,255,.76));
    color: #0f766e;
    cursor: pointer;
    transition: .2s ease;
    overflow: hidden;
}

.slicer-dropzone:hover,
.slicer-dropzone.is-dragging {
    border-color: rgba(20,184,166,.72);
    box-shadow: inset 0 0 0 4px rgba(20,184,166,.1);
    transform: translateY(-1px);
}

.slicer-dropzone input {
    display: none;
}

.slicer-drop-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(20,184,166,.1);
}

.slicer-drop-icon svg {
    width: 30px;
    height: 30px;
}

.slicer-dropzone strong {
    font-size: 18px;
}

.slicer-dropzone small {
    color: var(--text-secondary);
}

.slicer-drop-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.slicer-dropzone.has-source {
    min-height: 360px;
    align-items: stretch;
    justify-content: stretch;
    padding: 12px;
}

.slicer-source-thumb {
    width: 100%;
    height: 100%;
    max-height: 520px;
    min-height: 320px;
    display: block;
    object-fit: contain;
    border-radius: 16px;
    background:
        linear-gradient(45deg, rgba(15,118,110,.08) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(15,118,110,.08) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(15,118,110,.08) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(15,118,110,.08) 75%);
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.slicer-preview-wrap,
.slicer-result-img {
    background:
        linear-gradient(45deg, rgba(15,118,110,.08) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(15,118,110,.08) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(15,118,110,.08) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(15,118,110,.08) 75%);
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.slicer-preview-wrap {
    margin-top: 14px;
    border-radius: 18px;
    overflow: auto;
    max-height: 420px;
    border: 1px solid rgba(20,116,103,.1);
}

.slicer-preview-wrap img {
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

.developing-panel {
    max-width: 560px;
    margin: 80px auto;
    text-align: center;
}

.developing-panel h1 {
    margin: 0 0 10px;
    font-size: 34px;
}

.developing-panel p {
    color: var(--text-secondary);
    margin-bottom: 22px;
}

.slicer-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.slicer-controls label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--text-secondary);
    font-size: 13px;
}

.slicer-controls select {
    height: 42px;
    border-radius: 13px;
    border: 1px solid rgba(20,116,103,.14);
    background: rgba(255,255,255,.88);
    color: var(--text-primary);
    padding: 0 12px;
    outline: none;
}

.slicer-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 18px 0 12px;
}

.slicer-btn,
.slicer-download-one {
    border: 0;
    border-radius: 14px;
    background: rgba(15,118,110,.1);
    color: #0f766e;
    font-weight: 700;
}

.slicer-btn {
    padding: 11px 16px;
}

.slicer-btn.primary {
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    color: #fff;
    box-shadow: 0 12px 28px rgba(15,118,110,.22);
}

.slicer-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.slicer-results-panel {
    margin-top: 18px;
}

.slicer-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}

.slicer-empty {
    grid-column: 1 / -1;
    min-height: 160px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--text-secondary);
    background: rgba(240,253,250,.62);
    border: 1px dashed rgba(20,116,103,.16);
    padding: 24px;
}

.slicer-result-card {
    border-radius: 18px;
    overflow: hidden;
}

.slicer-result-img {
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    padding: 12px;
}

.slicer-result-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.slicer-result-info {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px 6px;
    color: var(--text-secondary);
    font-size: 12px;
}

.slicer-result-info strong {
    color: var(--text-primary);
}

.slicer-download-one {
    width: calc(100% - 20px);
    margin: 0 10px 10px;
    height: 34px;
}

[data-theme="dark"] .slicer-panel,
[data-theme="dark"] .slicer-hero-stats,
[data-theme="dark"] .slicer-result-card {
    background: rgba(18,24,24,.86);
    border-color: rgba(255,255,255,.1);
}

[data-theme="dark"] .slicer-dropzone,
[data-theme="dark"] .slicer-empty {
    background: rgba(20,32,32,.72);
    border-color: rgba(20,184,166,.28);
}

@media (max-width: 860px) {
    .slicer-shell {
        width: calc(100vw - 24px);
        padding-top: 22px;
    }

    .slicer-hero,
    .slicer-panel-head {
        flex-direction: column;
    }

    .slicer-grid,
    .slicer-controls {
        grid-template-columns: 1fr;
    }

    .slicer-results {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ========================================
   DrawMJ-inspired public visual refresh
   ======================================== */
:root {
    --sidebar-w: 88px;
    --sidebar-w-expanded: 88px;
    --primary: #6d28d9;
    --primary-hover: #7c3aed;
    --bg-dark: #020817;
    --bg-card: rgba(15, 23, 42, .72);
    --bg-card-hover: rgba(30, 41, 59, .78);
    --border-color: rgba(148, 163, 184, .18);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --radius: 8px;
    --radius-lg: 10px;
    --shadow: 0 18px 54px rgba(0, 0, 0, .34);
}

[data-theme="light"] {
    --primary: #6d28d9;
    --primary-hover: #7c3aed;
    --bg-dark: #020817;
    --bg-card: rgba(15, 23, 42, .72);
    --bg-card-hover: rgba(30, 41, 59, .78);
    --border-color: rgba(148, 163, 184, .18);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
}

body,
[data-theme="dark"] body,
[data-theme="light"] body {
    color: var(--text-primary);
    background:
        radial-gradient(circle at 18% 0%, rgba(109, 40, 217, .22), transparent 32%),
        radial-gradient(circle at 86% 14%, rgba(37, 99, 235, .14), transparent 34%),
        linear-gradient(180deg, #020817 0%, #050816 58%, #020817 100%);
}

body::before,
[data-theme="dark"] body::before,
[data-theme="light"] body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(148, 163, 184, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, .03) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.78) 45%, transparent 100%);
}

.sidebar,
[data-theme="light"] .sidebar {
    background: rgba(2, 8, 23, .86);
    border-right: 1px solid rgba(148, 163, 184, .14);
    box-shadow: none;
}

.sidebar-inner {
    padding: 18px 10px 12px;
    gap: 8px;
}

.sidebar-logo {
    color: #f8fafc;
    padding-bottom: 18px;
}

.logo-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #6d28d9;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
}

.logo-text {
    color: #f8fafc;
    font-size: 13px;
    letter-spacing: 0;
}

.nav-item {
    border-radius: 8px;
    color: #94a3b8;
    padding: 11px 4px 10px;
}

.nav-item:hover,
.nav-item.active,
[data-theme="light"] .nav-item.active {
    background: rgba(109, 40, 217, .16);
    color: #f8fafc;
    box-shadow: inset 0 0 0 1px rgba(109, 40, 217, .32);
}

.nav-icon-home,
.nav-icon-inspire,
.nav-item[data-page="assets"] .nav-icon,
.nav-item[onclick*="openRedeemModal"] .nav-icon {
    color: #a78bfa;
    filter: none;
}

.sidebar-bottom {
    border-top-color: rgba(148, 163, 184, .14);
}

.theme-toggle,
.notify-btn {
    color: #94a3b8;
    border-radius: 8px;
}

.theme-toggle:hover,
.notify-btn:hover {
    background: rgba(30, 41, 59, .9);
    color: #f8fafc;
}

.avatar-small,
.login-btn,
.auth-card button[type="submit"],
.btn-redeem,
.account-btn.primary,
.slicer-btn.primary {
    background: #6d28d9;
    color: #fff;
    box-shadow: none;
}

.points-badge,
.points-circle {
    background: #111827;
    border: 1px solid rgba(148, 163, 184, .22);
    box-shadow: none;
}

.points-menu,
[data-theme="light"] .points-menu {
    background: rgba(2, 8, 23, .96);
    border-color: rgba(148, 163, 184, .18);
    border-radius: 10px;
    box-shadow: 0 20px 64px rgba(0,0,0,.5);
}

.main-content {
    background: transparent;
}

.content-area {
    min-height: 100vh;
}

.hero-section {
    width: min(1120px, calc(100vw - var(--sidebar-w) - 56px));
    margin: 0 auto;
    padding: 78px 24px 28px;
}

.hero-section::before,
[data-theme="light"] .hero-section::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 34px;
    width: min(620px, 70vw);
    height: 240px;
    transform: translateX(-50%);
    pointer-events: none;
    background: radial-gradient(circle, rgba(109, 40, 217, .24), transparent 64%);
    opacity: .8;
}

.hero-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 22px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(109, 40, 217, .16);
    border: 1px solid rgba(167, 139, 250, .26);
    color: #c4b5fd;
    font-size: 22px;
    animation: none;
}

.hero-title {
    max-width: 780px;
    margin: 0 auto 14px;
    color: #f8fafc;
    font-size: clamp(36px, 6.4vw, 68px);
    line-height: 1.06;
    font-weight: 800;
    letter-spacing: 0;
}

.hero-sub {
    max-width: 700px;
    margin: 0 auto 28px;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1.75;
}

.quick-tags {
    max-width: 760px;
    gap: 10px;
}

.q-tag,
[data-theme="light"] .q-tag {
    border-radius: 8px;
    background: rgba(15, 23, 42, .7);
    border-color: rgba(148, 163, 184, .18);
    color: #cbd5e1;
    box-shadow: none;
}

.q-tag:hover {
    background: rgba(109, 40, 217, .14);
    border-color: rgba(167, 139, 250, .42);
    color: #f8fafc;
}

.chat-messages {
    width: min(1120px, calc(100vw - var(--sidebar-w) - 56px));
    margin: 0 auto;
    padding: 0 24px 260px;
}

.chat-input-area,
[data-theme="light"] .chat-input-area {
    background: linear-gradient(to top, rgba(2, 8, 23, .98) 76%, rgba(2, 8, 23, 0));
}

.chat-form {
    max-width: 980px;
}

.input-container,
[data-theme="light"] .input-container {
    min-height: 176px;
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, .95), rgba(2, 8, 23, .95));
    border: 1px solid rgba(148, 163, 184, .22);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .42);
}

.input-container:focus-within,
[data-theme="light"] .input-container:focus-within {
    border-color: rgba(167, 139, 250, .58);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .5), 0 0 0 3px rgba(109, 40, 217, .18);
}

#promptInput,
[data-theme="light"] #promptInput {
    color: #f8fafc;
}

#promptInput::placeholder,
[data-theme="light"] #promptInput::placeholder {
    color: rgba(148, 163, 184, .68);
}

.ref-icon-btn,
[data-theme="light"] .ref-icon-btn,
.config-trigger,
[data-theme="light"] .config-trigger,
.inline-points {
    border-radius: 8px;
    background: rgba(15, 23, 42, .82);
    border-color: rgba(148, 163, 184, .18);
    color: #cbd5e1;
    box-shadow: none;
}

.ref-icon-btn:hover,
.config-trigger:hover,
.config-trigger.is-open,
[data-theme="light"] .config-trigger:hover,
[data-theme="light"] .config-trigger.is-open {
    background: rgba(30, 41, 59, .92);
    border-color: rgba(167, 139, 250, .48);
    color: #f8fafc;
}

.send-btn {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background: #6d28d9;
    box-shadow: none;
}

.send-btn:hover {
    background: #7c3aed;
    transform: translateY(-1px);
}

.config-popover,
[data-theme="light"] .config-popover,
.modal-content,
.panel-content,
[data-theme="dark"] .generating-card,
[data-theme="dark"] .single-error-card,
.generating-card,
.single-error-card,
.account-hero,
.account-panel,
.package-card,
.slicer-panel,
.slicer-hero-stats,
.slicer-result-card,
[data-theme="dark"] .slicer-panel,
[data-theme="dark"] .slicer-hero-stats,
[data-theme="dark"] .slicer-result-card {
    background: rgba(15, 23, 42, .92);
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 10px;
    box-shadow: 0 20px 64px rgba(0,0,0,.34);
    color: #f8fafc;
}

.config-popover-title,
.params-title,
[data-theme="light"] .config-popover-title,
[data-theme="light"] .params-title {
    color: #94a3b8;
}

.model-option,
.quality-option,
.count-option,
.ratio-option,
[data-theme="light"] .model-option,
[data-theme="light"] .quality-option,
[data-theme="light"] .count-option,
[data-theme="light"] .ratio-option {
    color: #cbd5e1;
}

.model-option:hover,
.model-option.is-selected,
.quality-option.is-selected,
.count-option.is-selected,
.ratio-option.is-selected,
[data-theme="light"] .model-option:hover,
[data-theme="light"] .model-option.is-selected,
[data-theme="light"] .quality-option.is-selected,
[data-theme="light"] .count-option.is-selected,
[data-theme="light"] .ratio-option.is-selected {
    background: rgba(109, 40, 217, .18);
    color: #f8fafc;
}

.single-result-card {
    width: min(860px, calc(100vw - var(--sidebar-w) - 64px));
}

.result-card-prompt-text {
    color: #f8fafc;
}

.result-card-meta,
.single-result-meta {
    color: #94a3b8;
}

.result-card-meta .meta-model,
[data-theme="light"] .result-card-meta .meta-model,
.meta-model {
    color: #a78bfa;
}

.meta-copy,
.meta-copy-btn,
.rca-btn,
[data-theme="light"] .rca-btn {
    border-radius: 8px;
    background: rgba(15, 23, 42, .78);
    border: 1px solid rgba(148, 163, 184, .18);
    color: #cbd5e1;
}

.meta-copy:hover,
.meta-copy-btn:hover,
.rca-btn:hover {
    background: rgba(109, 40, 217, .16);
    border-color: rgba(167, 139, 250, .44);
    color: #f8fafc;
}

.single-card-image-wrap,
.result-card-img,
[data-theme="light"] .single-card-image-wrap,
[data-theme="light"] .result-card-img {
    border-radius: 10px;
    background: #020817;
    border: 1px solid rgba(148, 163, 184, .18);
}

.single-card-image-wrap:hover,
.result-card-img:hover {
    border-color: rgba(167, 139, 250, .46);
    box-shadow: 0 22px 70px rgba(0,0,0,.44);
}

.single-card-main-img,
[data-theme="light"] .single-card-main-img {
    background: #020817;
}

.sc-tool-btn,
.sc-bbtn,
.viewer-close-btn,
.viewer-nav {
    border-radius: 8px;
    background: rgba(2, 8, 23, .78);
    border: 1px solid rgba(148, 163, 184, .2);
}

.sc-tool-btn:hover,
.sc-bbtn:hover,
.viewer-nav:hover {
    background: rgba(109, 40, 217, .28);
    border-color: rgba(167, 139, 250, .52);
    color: #fff;
}

.modal-overlay,
.panel-overlay {
    background: rgba(2, 8, 23, .72);
}

.modal-header,
.panel-header {
    border-bottom-color: rgba(148, 163, 184, .14);
}

.asset-card,
[data-theme="light"] .asset-card {
    background: rgba(15, 23, 42, .78);
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 10px;
    box-shadow: none;
}

.asset-img-wrap,
[data-theme="light"] .asset-img-wrap {
    border-radius: 8px;
    background: #020817;
    border-color: rgba(148, 163, 184, .18);
}

.badge,
.notice {
    background: rgba(109, 40, 217, .14);
    color: #c4b5fd;
}

.auth-body,
.auth-body .content-area {
    background:
        radial-gradient(circle at 18% 0%, rgba(109, 40, 217, .18), transparent 34%),
        linear-gradient(180deg, #020817 0%, #050816 100%) !important;
}

.auth-panel {
    border-radius: 10px;
    background: rgba(15, 23, 42, .92);
    border-color: rgba(148, 163, 184, .18);
}

.auth-field input,
.account-form input,
.redeem-input,
.slicer-controls select {
    border-radius: 8px;
    background: rgba(2, 8, 23, .64);
    border-color: rgba(148, 163, 184, .18);
    color: #f8fafc;
}

.account-kicker,
.package-tag,
.slicer-hero-stats span {
    color: #a78bfa;
}

.account-btn.ghost,
.slicer-btn,
.slicer-download-one {
    border-radius: 8px;
    background: rgba(109, 40, 217, .14);
    color: #ddd6fe;
}

@media (max-width: 900px) {
    .hero-section,
    .chat-messages {
        width: min(100%, 100vw);
    }

    .single-result-card {
        width: min(100%, calc(100vw - 28px));
    }
}

@media (max-width: 600px) {
    .hero-section {
        padding: 44px 18px 22px;
    }

    .hero-title {
        font-size: 34px;
    }

    .hero-sub {
        font-size: 15px;
    }

    .input-container {
        min-height: 164px;
        padding: 20px 16px 16px;
    }

    #promptInput {
        padding-left: 88px;
        font-size: 16px;
    }

    .config-trigger {
        height: 42px;
        font-size: 14px;
    }
}
