/* ========================================
   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;
    }
}

.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;
    }
}
