:root {
    --accent: #534AB7;
    --accent-hover: #3C3489;
    --accent-soft: #EEEDFE;
    --accent-100: #CECBF6;
    --accent-300: #7F77DD;
    --bg: #fafafa;
    --card: #ffffff;
    --text: #18181b;
    --text-secondary: #52525b;
    --text-muted: #a1a1aa;
    --border: #e4e4e7;
    --border-soft: #f0f0f2;
    --success: #0F6E56;
    --success-soft: #E1F5EE;
    --danger: #A32D2D;
    --danger-soft: #FCEBEB;
    --warning: #BA7517;
    --warning-soft: #FAEEDA;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 15px;
}

/* ===== 整体布局（左侧侧边栏 + 右侧主体） ===== */
body { display: flex; min-height: 100vh; }

/* 左侧深色侧边栏 */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #23242a;
    color: #a5a8b8;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 120;
}
.sidebar-logo {
    display: flex; align-items: center; gap: 10px;
    padding: 22px 20px 20px;
    color: #fff;
}
.sidebar-logo .logo-icon {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, #534AB7 0%, #7F77DD 100%); color: #fff; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
}
.sidebar-logo .logo-text { color: #fff; font-weight: 700; font-size: 16px; }

.side-nav { flex: 1; overflow-y: auto; padding: 4px 12px 20px; }
.side-nav-group { margin-bottom: 18px; }
.side-nav-label {
    font-size: 11px; color: #5c5f6e; letter-spacing: 1px;
    padding: 0 12px; margin-bottom: 6px; text-transform: uppercase;
}
.side-nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; border-radius: 8px;
    color: #a5a8b8; text-decoration: none; font-size: 14px;
    cursor: pointer; transition: all 0.15s; position: relative;
    margin-bottom: 2px;
}
.side-nav-item svg { flex-shrink: 0; }
.side-nav-item:hover { color: #fff; background: rgba(255,255,255,0.05); }
.side-nav-item.active {
    color: #fff; background: linear-gradient(135deg, #534AB7 0%, #3C3489 100%);
    box-shadow: 0 4px 12px rgba(83,74,183,0.35);
}
.side-nav-item.active::before {
    content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 22px; border-radius: 2px; background: #9b93e0;
}
.side-nav-disabled { opacity: 0.55; cursor: not-allowed; }
.side-nav-disabled:hover { background: transparent; color: #a5a8b8; }
.side-nav-tag {
    margin-left: auto; font-size: 10px; color: #fff;
    background: rgba(255,255,255,0.18); padding: 2px 7px; border-radius: 8px;
    white-space: nowrap;
}
.sidebar-footer {
    padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 11px; color: #5c5f6e;
}

/* 右侧主体容器 */
.layout-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ===== 顶部导航 ===== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid var(--border-soft);
    height: 56px;
}
.topbar-inner {
    height: 100%;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}
.topbar-title { font-size: 16px; font-weight: 600; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.topbar-links { display: flex; align-items: center; gap: 14px; }
.topbar-link { color: var(--text-muted); font-size: 13px; cursor: pointer; }
.topbar-link:hover { color: var(--text); }

.logo-icon {
    background: linear-gradient(135deg, #534AB7 0%, #7F77DD 100%); color: #fff; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}

.user-area { display: flex; align-items: center; gap: 10px; }
.balance-pill {
    background: #f4f4f5; color: var(--text);
    padding: 5px 13px; border-radius: 7px; font-weight: 600; font-size: 13px;
}
.avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, #534AB7 0%, #7F77DD 100%);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 13px;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; border-radius: 8px; border: none;
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: all 0.15s; gap: 7px; font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: #fafafa; border-color: #d4d4d8; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.btn-block { width: 100%; }

/* ===== 主体 ===== */
.main {
    flex: 1;
    padding: 24px 28px 80px;
    width: 100%;
    background: #f5f6f8;
    min-width: 0;
}
.page-container { width: 100%; max-width: 1160px; margin: 0 auto; min-width: 0; }
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-header { margin-bottom: 22px; }
.page-header h1 { font-size: 22px; font-weight: 700; letter-spacing: 0.2px; }
.subtitle { color: var(--text-secondary); margin-top: 4px; font-size: 14px; }

/* ===== 卡片 ===== */
.card {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 24px;
    border: 1px solid var(--border-soft);
    max-width: 100%;
    min-width: 0;
}

/* ===== 生成页布局 ===== */
.create-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
    min-width: 0;
    max-width: 1200px;
    margin: 0 auto;
}
.config-card { padding: 24px 26px; }
.side-panel { position: sticky; top: 76px; min-width: 0; max-width: 100%; display: flex; flex-direction: column; gap: 14px; }
.create-grid > * { min-width: 0; }

/* 生成页顶部 Tab */
.create-tabs {
    display: flex; gap: 8px; margin-bottom: 22px;
    border-bottom: 1px solid var(--border-soft); padding-bottom: 12px;
}
.create-tab {
    padding: 7px 18px; border-radius: 20px; font-size: 13.5px; font-weight: 500;
    cursor: pointer; color: var(--text-secondary); border: 1px solid var(--border);
    background: #fff; transition: all 0.15s;
}
.create-tab:hover { color: var(--accent); border-color: var(--accent-300); }
.create-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }

.form-label-sub { color: var(--text-muted); font-weight: 400; font-size: 12px; margin-left: auto; }

@media (max-width: 1100px) {
    .create-grid { grid-template-columns: minmax(0, 1fr); }
    .side-panel { position: static; order: 2; }
}

/* ===== 表单 ===== */
.form-group { margin-bottom: 22px; }
.form-label {
    display: flex; align-items: baseline; gap: 8px;
    font-size: 13px; font-weight: 600; margin-bottom: 10px; color: var(--text);
    letter-spacing: 0.2px;
}
.optional { color: var(--text-muted); font-weight: 400; font-size: 12px; }

/* ===== 模型选择 ===== */
.model-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.model-item {
    border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
    cursor: pointer; transition: all 0.15s; position: relative; background: #fff;
}
.model-item:hover { border-color: var(--accent); }
.model-item.active { border-color: var(--accent); background: var(--accent-soft); }
.model-item .model-name { font-weight: 600; font-size: 14px; }
.model-item .model-desc { color: var(--text-secondary); font-size: 12.5px; margin-top: 4px; line-height: 1.5; }
.model-item .model-price { color: var(--accent); font-weight: 700; font-size: 13px; margin-top: 6px; }
.model-item .model-check {
    position: absolute; top: 14px; right: 14px; width: 16px; height: 16px;
    border-radius: 50%; border: 1.5px solid var(--border); background: #fff; transition: all 0.15s;
}
.model-item.active .model-check { border-color: var(--accent); background: var(--accent); }
.model-item.active .model-check::after {
    content: "✓"; color: #fff; font-size: 10px; font-weight: 700;
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
}

/* ===== 图片模型下拉选择器 ===== */
.model-select { position: relative; }
.model-select-trigger {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
    background: #fff; cursor: pointer; text-align: left; font-family: inherit;
    transition: border-color 0.15s;
}
.model-select-trigger:hover { border-color: var(--accent); }
.model-select.open .model-select-trigger { border-color: var(--accent); }
.model-select-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.model-select-name { font-weight: 600; font-size: 14px; color: var(--text); }
.model-select-desc { color: var(--text-secondary); font-size: 12px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.model-select-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.model-select-price { color: var(--accent); font-weight: 700; font-size: 13px; }
.model-select-arrow { color: var(--text-muted); transition: transform 0.2s; }
.model-select.open .model-select-arrow { transform: rotate(180deg); }

.model-select-dropdown {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
    max-height: 320px; overflow-y: auto; background: #fff;
    border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    padding: 6px; display: none;
}
.model-select.open .model-select-dropdown { display: block; }
.model-option {
    position: relative; padding: 10px 12px; border-radius: 8px; cursor: pointer;
    transition: background 0.12s;
}
.model-option:hover { background: var(--accent-soft); }
.model-option.active { background: var(--accent-soft); }
.model-option-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.model-option-name { font-weight: 600; font-size: 13.5px; color: var(--text); }
.model-option-price { color: var(--accent); font-weight: 700; font-size: 12.5px; flex-shrink: 0; }
.model-option-desc { color: var(--text-secondary); font-size: 12px; margin-top: 2px; line-height: 1.5; }
.model-option-check {
    position: absolute; top: 12px; right: 12px; width: 16px; height: 16px;
    border-radius: 50%; border: 1.5px solid var(--border); background: #fff; transition: all 0.15s;
    display: none;
}
.model-option.active .model-option-check { display: block; border-color: var(--accent); background: var(--accent); }
.model-option.active .model-option-check::after {
    content: "✓"; color: #fff; font-size: 10px; font-weight: 700;
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
}
/* 选中态下价格会被勾号挡住，给价格留出右侧空间 */
.model-option.active .model-option-main { padding-right: 20px; }

/* 选项类下拉（比例/画质/输出格式）更紧凑 */
.opt-select .model-select-trigger { padding: 10px 13px; }
.opt-select .model-select-dropdown { max-height: 260px; }

/* ===== 输入框 ===== */
.prompt-wrap { position: relative; }
.textarea, .input {
    width: 100%; padding: 12px 14px; border: 1px solid var(--border);
    border-radius: 9px; font-size: 14px; font-family: inherit;
    resize: vertical; transition: all 0.15s; outline: none; background: #fff;
    color: var(--text); line-height: 1.6;
}
.textarea::placeholder, .input::placeholder { color: var(--text-muted); }
.textarea:focus, .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(83,74,183,0.12); }
.prompt-footer { display: flex; justify-content: flex-end; padding: 5px 2px 0; }
.prompt-count { font-size: 12px; color: var(--text-muted); }

/* ===== 参数面板 ===== */
.param-panel {
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: #fff;
}
.param-row {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 16px;
}
.param-label {
    font-size: 13px; font-weight: 600; color: var(--text);
    flex-shrink: 0; min-width: 60px;
}
.param-divider { height: 1px; background: var(--border-soft); margin: 0 16px; }

/* ===== 选项组 ===== */
.option-group { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.option {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 14px; border: 1px solid var(--border); border-radius: 7px;
    cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.15s;
    user-select: none; background: #fff; color: var(--text);
}
.option:hover { border-color: var(--accent); }
.option .option-dot {
    width: 14px; height: 14px; border-radius: 50%;
    border: 1.5px solid #d4d4d8; flex-shrink: 0; transition: all 0.15s;
    display: flex; align-items: center; justify-content: center;
}
.option.active {
    border-color: var(--accent); background: var(--accent-soft);
    color: var(--accent); font-weight: 600;
}
.option.active .option-dot {
    border-color: var(--accent); background: var(--accent);
}
.option.active .option-dot::after {
    content: "✓"; color: #fff; font-size: 9px; font-weight: 700; line-height: 1;
}

/* ===== 画面比例下拉选择 ===== */
.ratio-select { position: relative; flex: 1; min-width: 0; }
.ratio-select.disabled { opacity: 0.5; pointer-events: none; }
.ratio-select-trigger {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px; border: 1px solid var(--border); border-radius: 7px;
    cursor: pointer; background: #fff; font-size: 13px; font-weight: 500;
    transition: all 0.15s; user-select: none; min-height: 40px;
}
.ratio-select-trigger:hover { border-color: var(--accent); }
.ratio-select.open .ratio-select-trigger { border-color: var(--accent); }
.ratio-select-value { flex: 1; color: var(--text); }
.ratio-select-arrow {
    display: flex; align-items: center; color: var(--text-muted); transition: transform 0.15s;
}
.ratio-select.open .ratio-select-arrow { transform: rotate(180deg); }
.ratio-select-menu {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
    background: #fff; border: 1px solid var(--border); border-radius: 9px;
    box-shadow: var(--shadow); padding: 5px; display: none; max-height: 260px; overflow-y: auto;
}
.ratio-select.open .ratio-select-menu { display: block; }
.ratio-menu-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 6px; cursor: pointer; font-size: 13px;
    color: var(--text); transition: background 0.12s;
}
.ratio-menu-item:hover { background: #f4f4f5; }
.ratio-menu-item.active { background: var(--accent-soft); }
.ratio-menu-text { flex: 1; font-weight: 500; }
.ratio-check { color: var(--accent); font-weight: 700; opacity: 0; font-size: 13px; }
.ratio-menu-item.active .ratio-check { opacity: 1; }

/* 比例示意图框 */
.ratio-box {
    display: inline-block; border: 1.5px solid #a1a1aa; border-radius: 2px;
    flex-shrink: 0; background: transparent;
}
.ratio-select-trigger .ratio-box,
.ratio-menu-item.active .ratio-box { border-color: var(--accent); }

/* ===== 上传 ===== */
.upload-box { position: relative; }
.upload-placeholder {
    border: 1px dashed #d4d4d8; border-radius: 9px; padding: 26px 20px;
    text-align: center; cursor: pointer; color: var(--text-secondary);
    transition: all 0.15s; display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: #fff;
}
.upload-placeholder:hover { border-color: var(--accent); background: var(--accent-soft); }
.upload-placeholder[hidden] { display: none; }
.upload-icon {
    width: 40px; height: 40px; border-radius: 8px;
    background: #f4f4f5; color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center; margin-bottom: 4px;
}
.upload-title { font-size: 13.5px; font-weight: 500; }
.upload-hint { font-size: 12px; color: var(--text-muted); }
.upload-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; margin-bottom: 10px; }
.upload-item { position: relative; border-radius: 9px; overflow: hidden; aspect-ratio: 1; background: #f4f4f5; }
.upload-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-add {
    border: 1px dashed #d4d4d8; border-radius: 9px; padding: 22px 20px;
    text-align: center; cursor: pointer; color: var(--text-secondary);
    transition: all 0.15s; display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: #fff;
}
.upload-add:hover { border-color: var(--accent); background: var(--accent-soft); }
.upload-add[hidden] { display: none; }
.remove-img {
    position: absolute; top: 8px; right: 8px; width: 28px; height: 28px;
    border-radius: 50%; border: none; background: rgba(0,0,0,0.6); color: #fff;
    cursor: pointer; font-size: 16px; line-height: 1; transition: all 0.15s;
}
.remove-img:hover { background: rgba(220,38,38,0.9); }

/* ===== 价格栏 ===== */
.price-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 18px;
    background: #fafafa;
    border: 1px solid var(--border-soft);
    border-radius: 9px;
}
.price-info { display: flex; flex-direction: column; }
.price-label { color: var(--text-secondary); font-size: 13px; font-weight: 500; }
.price-hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.price-value { color: var(--text); font-size: 24px; font-weight: 700; }

/* 提交栏（吸底固定） */
.submit-bar {
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin-top: 18px;
    padding-top: 12px;
    background: var(--card);
    border-top: 1px solid var(--border-soft);
}

/* ===== 制作记录面板（右侧） ===== */
.records-card { padding: 18px 16px; }
.records-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.records-header h3 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.records-count {
    font-size: 12px; color: var(--text-muted); font-weight: 500;
    background: #f4f4f5; padding: 1px 8px; border-radius: 10px;
}
.records-refresh {
    width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border);
    background: #fff; color: var(--text-secondary); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.records-refresh:hover { color: var(--accent); border-color: var(--accent-300); }
.records-refresh.loading { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.records-list { display: flex; flex-direction: column; gap: 10px; max-height: 560px; overflow-y: auto; padding-right: 2px; }
.records-list::-webkit-scrollbar { width: 5px; }
.records-list::-webkit-scrollbar-thumb { background: #e4e4e7; border-radius: 3px; }

.record-item {
    display: flex; gap: 10px; padding: 10px; border-radius: 8px;
    border: 1px solid var(--border-soft); background: #fff; cursor: pointer;
    transition: all 0.15s; align-items: flex-start;
}
.record-item:hover { border-color: var(--border); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.record-thumb {
    width: 56px; height: 40px; border-radius: 5px; overflow: hidden; flex-shrink: 0;
    background: #f4f4f5; display: flex; align-items: center; justify-content: center;
}
.record-thumb img, .record-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.record-thumb .thumb-icon { color: #c0c0cc; }
.record-info { flex: 1; min-width: 0; }
.record-title {
    font-size: 12.5px; color: var(--text); line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    word-break: break-all;
}
.record-meta { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.record-time { font-size: 11px; color: var(--text-muted); }
.record-badge {
    font-size: 10.5px; font-weight: 600; padding: 1px 8px; border-radius: 8px; flex-shrink: 0;
}
.record-badge.processing { background: var(--warning-soft); color: var(--warning); }
.record-badge.queued, .record-badge.pending { background: var(--accent-soft); color: var(--accent); }
.record-badge.success { background: var(--success-soft); color: var(--success); }
.record-badge.failed { background: var(--danger-soft); color: var(--danger); }
.record-badge.refunded { background: #f4f4f5; color: #71717a; }

.records-empty { text-align: center; padding: 36px 16px; color: var(--text-secondary); }
.records-empty[hidden] { display: none; }
.records-empty p { font-size: 13px; margin-bottom: 14px; }

/* 制作记录分页 */
.records-pager {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-soft);
}
.records-pager[hidden] { display: none; }
.records-page-info { font-size: 12px; color: var(--text-muted); }
.records-page-btns { display: flex; gap: 6px; }
.records-page-btn {
    padding: 4px 12px; border-radius: 6px; border: 1px solid var(--border);
    background: #fff; color: var(--text-secondary); font-size: 12px; cursor: pointer;
    transition: all 0.15s; font-family: inherit;
}
.records-page-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--accent-300); }
.records-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* 公告 */
.tips-card { margin-top: 14px; padding: 18px 20px; }
.tips-card h4 { font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.tips-list { list-style: none; }
.tips-list li {
    position: relative; padding: 8px 0 8px 16px;
    font-size: 12.5px; color: var(--text-secondary); line-height: 1.6;
}
.tips-list li + li { border-top: 1px solid var(--border-soft); }
.tips-list li::before {
    content: ""; position: absolute; left: 0; top: 15px;
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--text); opacity: 0.35;
}
.tips-list li strong {
    display: block; color: var(--text); font-weight: 600; font-size: 13px; margin-bottom: 2px;
}
.tips-list li span {
    display: block; color: var(--text-secondary); white-space: pre-line;
}

/* ===== 任务列表 ===== */
/* 任务类型切换 Tab（视频 / 图片） */
.task-type-tabs {
    display: flex; gap: 8px; margin-bottom: 18px;
    background: #f4f4f5; padding: 4px; border-radius: 10px; width: fit-content;
}
.task-type-tab {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 18px; border-radius: 8px; border: none; cursor: pointer;
    background: transparent; color: var(--text-secondary); font-size: 13.5px; font-weight: 500;
    transition: all 0.15s; font-family: inherit;
}
.task-type-tab:hover { color: var(--text); }
.task-type-tab.active { background: #fff; color: var(--accent); font-weight: 600; box-shadow: var(--shadow-sm); }
.task-type-tab svg { flex-shrink: 0; }
.task-type-tag {
    font-size: 11px; padding: 1px 7px; border-radius: 10px;
    background: var(--accent-soft); color: var(--accent); font-weight: 600; white-space: nowrap;
}
/* 任务类型徽章（列表项内） */
.task-type-badge {
    display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 4px;
    background: var(--accent-soft); color: var(--accent); font-weight: 600; margin-right: 8px;
    vertical-align: middle;
}

.filter-bar { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-btn {
    padding: 6px 15px; border-radius: 7px; border: 1px solid var(--border);
    background: #fff; cursor: pointer; font-size: 13px; transition: all 0.15s;
    color: var(--text-secondary); font-family: inherit;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: transparent; }

.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-item {
    background: var(--card); border-radius: 10px; box-shadow: var(--shadow);
    padding: 14px 18px; display: flex; align-items: center; gap: 16px;
    border: 1px solid var(--border-soft); transition: all 0.15s;
}
.task-item:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.06); }
.task-thumb {
    width: 96px; height: 62px; border-radius: 7px; overflow: hidden; flex-shrink: 0;
    background: #f4f4f5; display: flex; align-items: center; justify-content: center;
}
.task-thumb img { width: 100%; height: 100%; object-fit: cover; }
.task-thumb video { width: 100%; height: 100%; object-fit: cover; }
/* 非成功状态的任务图标占位 */
.task-thumb-status {
    background: #fafafa; border: 1px solid var(--border-soft);
}
.task-status-svg { display: block; }
.task-status-svg.pulse { animation: taskPulse 1.4s ease-in-out infinite; }
@keyframes taskPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.task-info { flex: 1; min-width: 0; }
.task-info .task-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-info .task-meta { color: var(--text-secondary); font-size: 12.5px; margin-top: 4px; }
.task-status { flex-shrink: 0; }
.status-badge {
    padding: 4px 12px; border-radius: 16px; font-size: 12px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 6px;
}
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-queued { background: var(--accent-soft); color: var(--accent); }
.status-processing { background: var(--warning-soft); color: var(--warning); }
.status-processing::before { animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.status-success { background: var(--success-soft); color: var(--success); }
.status-failed { background: var(--danger-soft); color: var(--danger); }
.status-refunded { background: #f4f4f5; color: #71717a; }
.status-pending { background: #f4f4f5; color: #71717a; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.empty-state[hidden] { display: none; }
.empty-state p { font-size: 14px; }

/* ===== 余额与充值 ===== */
.wallet-wrap {
    display: flex; flex-direction: column; gap: 20px;
    max-width: 760px; margin: 0 auto;
}

/* 余额卡片（紫罗兰品牌渐变，横向） */
.balance-card {
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, #3C3489 0%, #534AB7 55%, #7F77DD 100%);
    border: none; border-radius: 18px; padding: 0;
    box-shadow: 0 16px 40px rgba(60,52,137,0.28);
}
.balance-bg {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none;
    background:
        radial-gradient(circle at 90% 0%, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0) 45%),
        radial-gradient(circle at 5% 100%, rgba(206,203,246,0.30) 0%, rgba(206,203,246,0) 55%);
}
.balance-inner {
    position: relative; padding: 28px 30px;
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.balance-left { min-width: 0; }
.balance-label { color: rgba(255,255,255,0.60); font-size: 13px; letter-spacing: 0.5px; }
.balance-big {
    font-size: 44px; font-weight: 700; color: #fff; margin-top: 8px;
    letter-spacing: 0.5px; line-height: 1; display: flex; align-items: baseline;
}
.balance-cur { font-size: 24px; font-weight: 600; margin-right: 4px; color: rgba(255,255,255,0.75); }
.balance-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.balance-badge {
    display: inline-flex; align-items: center; gap: 5px;
    color: rgba(255,255,255,0.85); font-size: 12px;
    background: rgba(255,255,255,0.12); padding: 4px 10px; border-radius: 20px;
}
.balance-sub { color: rgba(255,255,255,0.55); font-size: 12.5px; text-align: right; }

/* 充值卡片 */
.recharge-card { padding: 26px 28px 24px; }
.recharge-head {
    display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px;
}
.recharge-head h3 { font-size: 17px; font-weight: 700; }
.recharge-head-sub { color: var(--text-muted); font-size: 12.5px; margin-top: 3px; }
.recharge-secure {
    display: inline-flex; align-items: center; gap: 5px;
    color: var(--text-muted); font-size: 12px; padding-top: 2px;
}
.recharge-secure svg { color: var(--success); }
.recharge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px; }
@media (max-width: 480px) { .recharge-grid { grid-template-columns: repeat(2, 1fr); } }
.recharge-item {
    border: 1.5px solid var(--border); border-radius: 12px; padding: 22px 10px 18px;
    text-align: center; cursor: pointer; transition: all 0.18s;
    display: flex; flex-direction: column; gap: 8px; position: relative; background: #fff;
}
.recharge-item .amount { font-weight: 700; font-size: 24px; color: var(--text); line-height: 1; }
.recharge-item .recharge-note { font-size: 12px; color: var(--text-muted); }
.recharge-item:hover { border-color: var(--accent-300); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(60,52,137,0.10); }
.recharge-item.active {
    border-color: var(--accent); background: var(--accent);
    box-shadow: 0 10px 24px rgba(60,52,137,0.28);
}
.recharge-item.active .amount { color: #fff; }
.recharge-item.active .recharge-note { color: rgba(255,255,255,0.75); }
.recharge-item.active::after {
    content: "✓"; position: absolute; top: 8px; right: 10px;
    width: 18px; height: 18px; border-radius: 50%; background: #fff; color: var(--accent);
    font-size: 11px; font-weight: 700; line-height: 18px;
}
.recharge-item.hot::before {
    content: "推荐"; position: absolute; top: -1px; right: 12px;
    background: var(--accent); color: #fff; font-size: 10px;
    font-weight: 600; padding: 3px 9px; border-radius: 0 12px 0 10px; letter-spacing: 0.5px;
}
.recharge-item.hot.active::before { background: #fff; color: var(--accent); }
/* 推荐项选中时，勾选标记移到左上角避免与「推荐」角标重叠 */
.recharge-item.hot.active::after { top: 8px; right: auto; left: 10px; }

/* 支付金额汇总 */
.recharge-pay-info {
    display: flex; align-items: center; justify-content: space-between;
    background: #fafafa; border: 1px solid var(--border-soft); border-radius: 12px;
    padding: 16px 18px; margin-bottom: 18px;
}
.recharge-amount-label { color: var(--text-secondary); font-size: 13px; }
.recharge-amount-value { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: 0.3px; }
.recharge-tip { color: var(--text-muted); font-size: 12px; margin-top: 14px; text-align: center; }

/* ===== 余额明细 ===== */
.moneylog-card { padding: 24px 28px; }
.moneylog-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.moneylog-head h3 { font-size: 16px; font-weight: 600; color: var(--text); }
.moneylog-head-sub { font-size: 12px; color: var(--text-muted); }
.moneylog-list { display: flex; flex-direction: column; }
.moneylog-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 0; border-bottom: 1px solid var(--border-soft);
}
.moneylog-item:last-child { border-bottom: none; }
.moneylog-icon {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.moneylog-icon.in { background: #ecfdf5; color: var(--success); }
.moneylog-icon.out { background: #f1f0fb; color: var(--accent); }
.moneylog-main { flex: 1; min-width: 0; }
.moneylog-memo { font-size: 14px; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.moneylog-time { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.moneylog-right { text-align: right; flex-shrink: 0; }
.moneylog-amount { font-size: 15px; font-weight: 700; }
.moneylog-amount.in { color: var(--success); }
.moneylog-amount.out { color: var(--text); }
.moneylog-after { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.moneylog-empty { text-align: center; padding: 32px 0; color: var(--text-muted); font-size: 13px; }

/* 充值记录 */
.recharge-log-card { padding: 24px 28px; margin-top: 20px; }
.recharge-log-list { display: flex; flex-direction: column; }
.recharge-log-item {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 14px 0; border-bottom: 1px solid var(--border-soft);
}
.recharge-log-item:last-child { border-bottom: none; }
.recharge-log-main { flex: 1; min-width: 0; }
.recharge-log-order { font-size: 13px; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recharge-log-time { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.recharge-log-right { text-align: right; flex-shrink: 0; }
.recharge-log-amount { font-size: 15px; font-weight: 700; color: var(--text); }
.recharge-log-status { font-size: 12px; margin-top: 4px; }
.recharge-log-status.paid { color: var(--success); }
.recharge-log-status.pending { color: #f59e0b; }
.recharge-log-status.failed { color: #ef4444; }
.recharge-log-status.closed { color: var(--text-muted); }

/* 余额明细筛选栏 */
.moneylog-filter {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 16px; flex-wrap: wrap;
}
.moneylog-filter-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.moneylog-tab {
    border: 1px solid var(--border-soft); background: transparent;
    color: var(--text-muted); font-size: 13px; padding: 6px 14px;
    border-radius: 999px; cursor: pointer; transition: all .15s ease;
}
.moneylog-tab:hover { border-color: var(--accent); color: var(--accent); }
.moneylog-tab.active {
    background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
}
.moneylog-range-select {
    border: 1px solid var(--border-soft); background: transparent;
    color: var(--text); font-size: 13px; padding: 6px 10px;
    border-radius: 8px; cursor: pointer; outline: none;
}
.moneylog-range-select:focus { border-color: var(--accent); }

/* 移动端适配 */
@media (max-width: 640px) {
    .balance-inner { flex-direction: column; align-items: flex-start; gap: 14px; padding: 24px 22px; }
    .balance-right { align-items: flex-start; }
    .balance-sub { text-align: left; }
    .balance-big { font-size: 38px; }
    .recharge-card { padding: 20px 16px 20px; }
    .recharge-item .amount { font-size: 20px; }
    .moneylog-card { padding: 20px 16px; }
    .moneylog-filter { flex-direction: column; align-items: stretch; }
    .moneylog-filter-range { display: flex; justify-content: flex-end; }
}

/* ===== 登录引导遮罩 ===== */
.gate {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 150;
    background: linear-gradient(180deg, #ffffff 0%, #f7f8fa 55%, #eef1f6 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    overflow-y: auto;
}
.gate[hidden] { display: none; }
.gate-bg { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; pointer-events: none; }
.gate-blob {
    position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.55;
}
.blob-1 {
    width: 420px; height: 420px; top: -120px; right: -100px;
    background: radial-gradient(circle, rgba(83,74,183,0.28) 0%, rgba(83,74,183,0) 70%);
}
.blob-2 {
    width: 480px; height: 480px; bottom: -160px; left: -140px;
    background: radial-gradient(circle, rgba(127,119,221,0.24) 0%, rgba(127,119,221,0) 70%);
}
.gate-card {
    position: relative;
    text-align: center;
    max-width: 400px;
    width: 100%;
    background: rgba(255,255,255,0.86);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.7);
    border-radius: 22px;
    padding: 36px 30px 30px;
    box-shadow: 0 20px 50px rgba(24,24,27,0.10), 0 2px 8px rgba(24,24,27,0.04);
}
.gate-logo { display: flex; justify-content: center; margin-bottom: 16px; }
.gate-logo .logo-icon {
    width: 60px; height: 60px; border-radius: 18px;
    background: linear-gradient(135deg, #3C3489 0%, #7F77DD 100%);
    box-shadow: 0 10px 24px rgba(60,52,137,0.28);
}
.gate-title { font-size: 26px; font-weight: 700; letter-spacing: 0.5px; }
.gate-sub { color: var(--text-secondary); font-size: 14px; margin-top: 6px; }
.gate-form {
    margin-top: 28px;
    text-align: left;
}
.gate-form .form-label { margin-bottom: 8px; }
.gate-form .form-group { margin-bottom: 18px; }

/* 带图标输入框 */
.input-wrap {
    position: relative; display: flex; align-items: center;
}
.input-wrap.flex-1 { flex: 1; min-width: 0; }
.input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none; display: flex;
    transition: color 0.15s;
}
.input-wrap .input {
    height: 48px; font-size: 15px; padding-left: 44px; padding-right: 14px;
    border-radius: 12px; border: 1px solid var(--border); background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input-wrap .input:focus {
    border-color: var(--accent); box-shadow: 0 0 0 4px rgba(83,74,183,0.12);
}
.input-wrap .input:focus ~ .input-icon,
.input-wrap:focus-within .input-icon { color: var(--accent); }
.input-wrap .sms-input { text-align: left; letter-spacing: 1px; }
.input-wrap .image-captcha-input { text-align: left; }
.gate-form .sms-btn { height: 48px; border-radius: 12px; font-weight: 600; }
.gate-form .image-captcha-box { height: 48px; border-radius: 12px; width: 124px; }
.gate-form #auth-submit {
    height: 50px; font-size: 16px; border-radius: 13px; letter-spacing: 2px; margin-top: 6px;
    background: linear-gradient(135deg, #534AB7 0%, #3C3489 100%);
    box-shadow: 0 10px 22px rgba(60,52,137,0.28);
    transition: transform 0.15s, box-shadow 0.15s;
}
.gate-form #auth-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(60,52,137,0.34); }
.gate-form #auth-submit:active { transform: translateY(0); }
.gate-form .auth-agree { margin-top: 16px; }

.auth-error {
    color: var(--danger); font-size: 12.5px; margin: 2px 0 12px;
    background: #fef2f2; border: 1px solid #fee2e2; padding: 8px 12px; border-radius: 8px;
}
.auth-error[hidden] { display: none; }

/* 短信验证码 */
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.sms-input { flex: 1; min-width: 0; letter-spacing: 2px; font-weight: 600; text-align: center; }
.sms-btn { flex-shrink: 0; white-space: nowrap; padding: 0 18px; font-size: 13.5px; height: 44px; }
.sms-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 图形验证码 */
.image-captcha-input { flex: 1; min-width: 0; letter-spacing: 1px; }
.image-captcha-box {
    flex-shrink: 0; height: 44px; width: 118px; border-radius: 9px;
    overflow: hidden; cursor: pointer; border: 1px solid var(--border);
    background: #f4f4f5; display: flex; align-items: center; justify-content: center;
    transition: border-color 0.15s;
}
.image-captcha-box:hover { border-color: var(--accent); }
.image-captcha-box img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===== 图形验证码弹窗 ===== */
.captcha-modal {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 220;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.captcha-modal[hidden] { display: none; }
.captcha-modal-mask {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(24, 24, 27, 0.42);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.captcha-modal-card {
    position: relative;
    width: 100%; max-width: 360px;
    background: #fff; border-radius: 18px;
    padding: 30px 26px 26px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(24, 24, 27, 0.28);
    animation: captchaModalIn 0.22s ease;
}
@keyframes captchaModalIn {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to { opacity: 1; transform: none; }
}
.captcha-modal-close {
    position: absolute; top: 14px; right: 14px;
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); background: transparent; border: none; cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.captcha-modal-close:hover { background: #f4f4f5; color: var(--text-primary); }
.captcha-modal-title { font-size: 18px; font-weight: 700; }
.captcha-modal-sub { color: var(--text-muted); font-size: 13px; margin-top: 6px; line-height: 1.5; }
.captcha-modal-body {
    display: flex; align-items: stretch; gap: 10px; margin-top: 22px;
}
.captcha-modal-input { flex: 1; min-width: 0; height: 48px; text-align: left; letter-spacing: 2px; }
.captcha-modal-img { height: 48px; width: 124px; flex-shrink: 0; }
.captcha-modal-error {
    color: var(--danger); font-size: 12.5px; margin: 12px 0 0;
    background: #fef2f2; border: 1px solid #fee2e2; padding: 8px 12px; border-radius: 8px;
    text-align: left;
}
.captcha-modal-error[hidden] { display: none; }
.captcha-modal #captcha-modal-confirm {
    margin-top: 18px; height: 48px; font-size: 15px; border-radius: 12px;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #534AB7 0%, #3C3489 100%);
    box-shadow: 0 10px 22px rgba(60,52,137,0.24);
}
.captcha-modal #captcha-modal-confirm:disabled { opacity: 0.6; }

/* 登录协议 */
.auth-agree { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 16px; }

/* ===== Toast ===== */
.toast {
    position: fixed; top: 76px; left: 50%; transform: translateX(-50%);
    background: #18181b; color: #fff; padding: 11px 22px; border-radius: 8px;
    z-index: 300; font-size: 13.5px; box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    animation: fadeIn 0.2s ease; font-weight: 500;
}

/* ===== 移动端菜单 ===== */
.menu-toggle { display: none; }

/* 平板/小屏：收起侧边栏 */
@media (max-width: 900px) {
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; z-index: 200;
        transform: translateX(-100%); transition: transform 0.25s ease;
        box-shadow: 0 0 30px rgba(0,0,0,0.2);
    }
    .sidebar.open { transform: translateX(0); }
    .menu-toggle {
        display: flex; align-items: center; justify-content: center;
        position: fixed; top: 10px; left: 14px; z-index: 150;
        background: #fff; border: 1px solid var(--border); border-radius: 8px;
        width: 36px; height: 36px; cursor: pointer; color: var(--text);
        box-shadow: var(--shadow-sm);
    }
    .topbar-inner { padding: 0 16px 0 60px; }
}

@media (max-width: 640px) {
    .topbar-inner { height: 56px; padding: 0 12px 0 56px; gap: 12px; }
    .main { padding: 16px 12px 60px; width: 100%; }
    .page-container { width: 100%; max-width: 100%; }
    .page-header h1 { font-size: 20px; }
    .user-area .balance-pill { display: none; }
    .user-area { gap: 8px; }
    .topbar-links { display: none; }
    .task-item { flex-wrap: wrap; }
    .card { padding: 16px 14px; }
    .config-card { padding: 16px 14px; }
    .submit-bar { padding-top: 12px; margin-top: 14px; }
    .model-list { grid-template-columns: 1fr; gap: 8px; }
    .model-item { padding: 12px; min-width: 0; }
    .model-item .model-desc { font-size: 12px; }
    .option-group { gap: 6px; }
    .param-row { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 12px; }
    .param-label { min-width: 0; }
    .param-divider { margin: 0 12px; }
    .records-list { max-height: 400px; }
    .price-value { font-size: 22px; }
    .gate { padding: 16px; }
    .gate-card { padding: 28px 20px 24px; border-radius: 18px; }
    .gate-title { font-size: 24px; }
    .gate-form .captcha-row { gap: 8px; }
    .gate-form .sms-btn { padding: 0 12px; font-size: 13px; }
    .gate-form .image-captcha-box { width: 108px; }
}

/* ===== 图片生成页补充样式 ===== */
.upload-remove {
    position: absolute; top: 4px; right: 4px; width: 22px; height: 22px;
    border-radius: 6px; border: none; background: rgba(0,0,0,0.55); color: #fff;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    padding: 0; transition: background 0.15s;
}
.upload-remove:hover { background: rgba(0,0,0,0.75); }
.upload-box.drag-over { border-color: var(--accent); background: var(--accent-soft); }

.img-ratio-group, .img-quality-group, .img-format-group { display: flex; flex-wrap: wrap; gap: 8px; }
.img-ratio-group .option, .img-quality-group .option, .img-format-group .option {
    display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px;
    border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
    font-size: 13px; color: var(--text-secondary); transition: all 0.15s; background: #fff;
}
.img-ratio-group .option:hover, .img-quality-group .option:hover, .img-format-group .option:hover { border-color: var(--accent); color: var(--accent); }
.img-ratio-group .option.active, .img-quality-group .option.active, .img-format-group .option.active {
    border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600;
}
.img-ratio-group .option-dot, .img-quality-group .option-dot, .img-format-group .option-dot {
    width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; flex-shrink: 0;
}
.img-ratio-group .option.active .option-dot, .img-quality-group .option.active .option-dot, .img-format-group .option.active .option-dot { background: var(--accent); border-color: var(--accent); }

/* 透明背景开关 */
.bg-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; margin: 0; }
.bg-toggle input[type="checkbox"] { display: none; }
.bg-toggle-track {
    position: relative; width: 42px; height: 24px; border-radius: 999px;
    background: var(--border); transition: background 0.2s; flex-shrink: 0;
}
.bg-toggle-thumb {
    position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform 0.2s;
}
.bg-toggle input[type="checkbox"]:checked + .bg-toggle-track { background: var(--accent); }
.bg-toggle input[type="checkbox"]:checked + .bg-toggle-track .bg-toggle-thumb { transform: translateX(18px); }
.bg-toggle-text { font-size: 13px; color: var(--text-secondary); }

/* 图片生成结果区 */
.img-result-area { min-height: 200px; display: flex; align-items: center; justify-content: center; }
.img-result-empty { text-align: center; color: var(--text-muted); padding: 30px 16px; }
.img-result-empty .img-result-icon { color: var(--border); margin-bottom: 12px; }
.img-result-empty p { font-size: 13px; }
.img-result-loading { text-align: center; padding: 30px 16px; color: var(--text-secondary); }
.img-result-loading .spinner {
    width: 32px; height: 32px; border: 3px solid var(--accent-soft);
    border-top-color: var(--accent); border-radius: 50%; margin: 0 auto 12px;
    animation: img-spin 0.8s linear infinite;
}
.img-result-loading p { font-size: 13px; }
@keyframes img-spin { to { transform: rotate(360deg); } }
.img-result-box { width: 100%; }
.img-result-img { width: 100%; border-radius: 10px; display: block; box-shadow: var(--shadow); }
.img-result-actions { margin-top: 12px; display: flex; justify-content: flex-end; gap: 8px; }

/* 图片历史记录区 */
.img-records-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-soft);
}
.img-records-header h4 { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.img-records-viewall {
    border: none; background: none; color: var(--accent); font-size: 12.5px;
    cursor: pointer; padding: 2px 4px; font-family: inherit; font-weight: 500;
}
.img-records-viewall:hover { text-decoration: underline; }
.img-records-list { max-height: 560px; }
.img-record-item { align-items: center; }
.img-record-item .record-thumb { width: 56px; height: 56px; border-radius: 8px; }
.img-thumb-loading { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.img-thumb-loading .spinner {
    width: 22px; height: 22px; border: 3px solid var(--accent-soft);
    border-top-color: var(--accent); border-radius: 50%;
    animation: img-spin 0.8s linear infinite;
}

/* 图片预览弹窗 */
.img-preview-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.img-preview-mask { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.img-preview-dialog {
    position: relative; background: #fff; border-radius: 14px; padding: 16px;
    width: min(640px, 92vw); max-height: 88vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.img-preview-close {
    position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
    border-radius: 8px; border: none; background: rgba(0,0,0,0.06); color: #555;
    cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2;
    transition: all 0.15s;
}
.img-preview-close:hover { background: rgba(0,0,0,0.12); }
.img-preview-img { width: 100%; border-radius: 10px; display: block; }
.img-preview-meta { margin-top: 14px; }
.img-preview-prompt {
    font-size: 13px; color: var(--text-secondary); line-height: 1.6;
    max-height: 60px; overflow-y: auto; word-break: break-all;
}
.img-preview-actions { margin-top: 12px; display: flex; justify-content: flex-end; gap: 8px; }

/* 图片任务状态徽章 */
.status-badge.img-status-succeeded { background: #e6f6ef; color: #0F6E56; }
.status-badge.img-status-failed, .status-badge.img-status-violation { background: #fdeaea; color: #A32D2D; }
.status-badge.img-status-running { background: #ede9fb; color: #534AB7; }
.status-badge.img-status-pending { background: #f1f1f3; color: #6b7280; }
