/* ============================================================
   电商配图生成器 — 现代简约风格
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #0071E3;
    --primary-hover: #0077ED;
    --primary-light: #EBF5FF;
    --bg: #F5F6F8;
    --card-bg: #FFFFFF;
    --border: #E5E5EA;
    --border-light: #F0F0F0;
    --text: #1D1D1F;
    --text-secondary: #86868B;
    --text-placeholder: #B0B0B8;
    --success: #34C759;
    --error: #FF3B30;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-primary: 0 4px 14px rgba(0,113,227,0.25);
}

html { font-size: 16px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- 头部 --- */
.header {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo::before {
    content: "";
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary), #5856D6);
    border-radius: 8px;
    display: inline-block;
}
.header-right { display: flex; align-items: center; gap: 12px; }

/* 用户菜单 */
.user-menu { position: relative; }
.user-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}
.user-btn:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: 200;
    overflow: hidden;
    border: 1px solid var(--border-light);
}
.dropdown-item {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s;
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-item strong { color: var(--primary); font-weight: 600; }
.dropdown-item:not(:last-child) { border-bottom: 1px solid var(--border-light); }

/* 登录按钮 */
#loginBtn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-primary);
}
#loginBtn:hover { background: var(--primary-hover); transform: translateY(-1px); }
#loginBtn:active { transform: translateY(0); }

/* --- 登录状态切换 --- */
body.logged-in #loginBtn { display: none !important; }
body.logged-in #userMenu { display: block !important; }
body.logged-in #loginTip { display: none !important; }
body.logged-in #creditBar { display: flex !important; }
body:not(.logged-in) #userMenu { display: none !important; }
body:not(.logged-in) #loginTip { display: block !important; }
body:not(.logged-in) #creditBar { display: none !important; }

/* --- 布局 --- */
.app-layout {
    display: flex;
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 20px;
    gap: 24px;
    align-items: flex-start;
}
.left-panel {
    width: 360px;
    min-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.right-panel { flex: 1; min-width: 0; }

/* --- 卡片 --- */
.panel-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.02);
    transition: box-shadow 0.2s;
}
.panel-card:hover { box-shadow: var(--shadow); }
.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 18px;
    color: var(--text);
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title::before {
    content: "";
    width: 4px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
}

/* --- 上传区 --- */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-bottom: 12px;
    background: #FAFAFA;
    position: relative;
    overflow: hidden;
}
.upload-zone::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,113,227,0.03), rgba(88,86,214,0.03));
    opacity: 0;
    transition: opacity 0.25s;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.upload-zone:hover::before, .upload-zone.dragover::before { opacity: 1; }
.upload-zone.dragover { transform: scale(1.01); }
.upload-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.7;
    display: block;
}
.upload-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}
.upload-hint {
    font-size: 13px;
    color: var(--text-secondary);
}
.upload-preview {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    justify-content: center;
}
.preview-thumb {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--border-light);
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}
.preview-thumb:hover { transform: scale(1.05); box-shadow: var(--shadow); }
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; }
.preview-thumb .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 12px;
    cursor: pointer;
    line-height: 20px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s;
}
.preview-thumb:hover .remove-btn { opacity: 1; }

/* --- 表单 --- */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: -0.1px;
}
.form-row { display: flex; gap: 12px; }
.form-group.half { flex: 1; }

input, textarea, select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: #FAFAFA;
    color: var(--text);
    outline: none;
    transition: all 0.2s;
}
input:hover, textarea:hover, select:hover { border-color: #C7C7CC; }
input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,113,227,0.12);
    background: white;
}
input::placeholder, textarea::placeholder { color: var(--text-placeholder); }
textarea { resize: vertical; min-height: 60px; }
select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2386868B' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
select:disabled { opacity: 0.5; cursor: not-allowed; }

/* 积分条 */
.credit-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    margin: 12px 0;
    padding: 10px 16px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
}
.credit-bar strong { color: var(--primary); font-weight: 600; }

/* 标签 */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
    padding: 5px 12px;
    background: var(--bg);
    color: var(--text-secondary);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}
.tag:hover { background: var(--primary-light); color: var(--primary); }

/* 复选框 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    color: var(--text);
    padding: 8px 0;
}
.checkbox-label input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* --- 类型切换（卡片式）--- */
.type-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.type-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #FAFAFA;
}
.type-card:hover { border-color: var(--primary); }
.type-card.active {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 2px 8px rgba(0,113,227,0.15);
}
.type-card .type-icon { font-size: 24px; margin-bottom: 8px; display: block; }
.type-card .type-name { font-size: 14px; font-weight: 600; color: var(--text); }
.type-card.active .type-name { color: var(--primary); }
.type-card .type-desc { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }

/* --- 按钮 --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-primary);
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,113,227,0.3); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: #EBEBEB; }
.btn-small { padding: 6px 14px; font-size: 12px; }
.btn-full { width: 100%; padding: 12px; font-size: 15px; border-radius: var(--radius); margin-top: 12px; }

.actions { display: flex; gap: 10px; margin-top: 16px; }

/* --- 结果区 --- */
.right-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.right-header h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.right-header h2::before {
    content: "";
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-secondary);
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border);
}
.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.4;
}
.empty-state p { font-size: 15px; }

/* 结果网格 */
.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
}
.gen-result-card {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.02);
    transition: all 0.25s;
    position: relative;
}
.gen-result-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.result-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #F1F3F7;
    overflow: hidden;
}
.result-image-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--text-secondary);
    font-size: 13px;
}
.gen-result-card .card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
}
.gen-result-card .card-body {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.gen-result-card .card-label { font-size: 14px; font-weight: 500; }
.gen-result-card .card-meta { font-size: 12px; color: var(--text-secondary); }
.gen-result-card .card-error { font-size: 13px; color: var(--error); padding: 12px; }

.card-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}
.card-badge.main { background: var(--primary-light); color: var(--primary); }
.card-badge.detail { background: #FCE7F3; color: #DB2777; }
.card-badge.wholesale { background: #E8F8EF; color: #059669; }

.regen-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.95);
    border: 1px solid var(--border);
    cursor: pointer;
    color: var(--text-secondary);
    opacity: 0;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    z-index: 2;
}
.gen-result-card:hover .regen-btn { opacity: 1; }
.regen-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* 进度条 */
#genProgress {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #5856D6);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}
.help-text { font-size: 13px; color: var(--text-secondary); text-align: center; }

/* --- 弹窗 --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    padding: 20px;
}
.modal-dialog {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}
.modal-dialog h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.3px;
}
.recharge-option {
    padding: 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    background: #FAFAFA;
}
.recharge-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
}
.recharge-option strong { font-size: 18px; display: block; margin-bottom: 4px; }
.recharge-option span { font-size: 13px; color: var(--text-secondary); }

/* 阶段 8：一级直推推广中心 */
.promotion-dialog { max-width: 560px; }
.promotion-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.promotion-dialog-head h3 { margin: 6px 0 0; }
.promotion-close { border: 0; background: transparent; color: var(--text-secondary); font-size: 28px; line-height: 1; cursor: pointer; padding: 0 3px; }
.promotion-rule-note { margin: -5px 0 18px; color: var(--text-secondary); font-size: 13px; line-height: 1.65; }
.promotion-rule-note strong { color: var(--primary); }
.promotion-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.promotion-summary-grid > div { padding: 13px 10px; border: 1px solid var(--border-light); border-radius: 12px; background: #fafcff; }
.promotion-summary-grid small, .promotion-code-row small { display: block; color: var(--text-secondary); font-size: 11px; margin-bottom: 6px; }
.promotion-summary-grid strong { font-size: 22px; color: var(--text); margin-right: 3px; }
.promotion-summary-grid span { color: var(--text-secondary); font-size: 11px; }
.promotion-code-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; border-radius: 12px; background: var(--primary-light); margin-bottom: 12px; }
.promotion-code-row code { color: var(--primary); font-size: 20px; font-weight: 800; letter-spacing: 2px; }
.promotion-rules-box, .promotion-withdraw-box, .promotion-ledger-box { border: 1px solid var(--border-light); border-radius: 12px; padding: 14px; margin-top: 12px; }
.promotion-rules-box { background: #fbfcfe; }
.promotion-rules-box p { color: var(--text); font-size: 12px; line-height: 1.65; margin: 8px 0; white-space: pre-wrap; }
.promotion-rules-box small, .promotion-withdraw-box p, .promotion-section-title span { color: var(--text-secondary); font-size: 11px; line-height: 1.5; }
.promotion-withdraw-box h4 { margin: 0 0 4px; font-size: 14px; }
.promotion-withdraw-box p { margin: 0 0 10px; }
.promotion-withdraw-fields { display: grid; grid-template-columns: .8fr 1.2fr; gap: 8px; margin-bottom: 10px; }
.promotion-withdraw-fields input { min-width: 0; border: 1px solid var(--border); border-radius: 9px; padding: 10px; font: inherit; outline: 0; }
.promotion-withdraw-fields input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.promotion-section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.promotion-ledger { display: grid; gap: 0; max-height: 210px; overflow: auto; }
.promotion-ledger-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border-light); }
.promotion-ledger-item div { min-width: 0; display: grid; gap: 2px; }
.promotion-ledger-item strong { font-size: 12px; }
.promotion-ledger-item small { color: var(--text-secondary); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.promotion-ledger-item b { color: var(--text-secondary); white-space: nowrap; }
.promotion-ledger-item b.is-plus { color: var(--success); }
.promotion-ledger-item b.is-minus { color: var(--error); }
.promotion-empty { color: var(--text-secondary); font-size: 12px; text-align: center; padding: 18px 0; }
@media (max-width: 560px) {
    .promotion-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .promotion-withdraw-fields { grid-template-columns: 1fr; }
    .promotion-code-row code { font-size: 17px; }
}

/* 精修弹窗 */
.refine-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    padding: 20px;
}
.refine-dialog {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.refine-dialog h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.refine-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.refine-option {
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s;
    text-align: center;
}
.refine-option:hover { border-color: var(--primary); }
.refine-option.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

/* 加载动画 */
.analyze-loading { text-align: center; padding: 24px; }
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 管理后台 */
.admin-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg);
}
.admin-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.admin-tab.active { background: var(--primary); color: white; }
.admin-tab:not(:last-child) { border-right: 1px solid var(--border); }
.admin-panel { min-height: 200px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.stat-card {
    text-align: center;
    padding: 24px;
    background: var(--bg);
    border-radius: var(--radius);
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-num { font-size: 32px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* 表格 */
.plan-table-wrap { overflow-x: auto; margin-top: 12px; border-radius: var(--radius-sm); }
.plan-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.plan-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    border-bottom: 2px solid var(--border);
    background: var(--bg);
}
.plan-table td { padding: 12px; border-bottom: 1px solid var(--border-light); }
.plan-table tr:hover td { background: var(--bg); }

/* 分析结果卡片 */
#analysisCard { max-height: 400px; overflow-y: auto; }
#genConfigCard {
    position: sticky;
    bottom: 20px;
    z-index: 5;
    background: var(--card-bg);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}

/* 批发图参数 */
#wholesaleFields {
    border-top: 2px dashed var(--border);
    padding-top: 16px;
    margin-top: 16px;
}

/* 响应式 */
@media (max-width: 900px) {
    .app-layout { flex-direction: column; }
    .left-panel { width: 100%; min-width: auto; }
    .results-grid { grid-template-columns: 1fr; }
    .header-inner { padding: 0 16px; }
    .logo { font-size: 16px; }
    .type-cards { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .panel-card { padding: 20px; }
    .upload-zone { padding: 32px 16px; }
    .modal-dialog { padding: 20px; }
    .form-row { flex-direction: column; gap: 0; }
}

/* ============================================================
   商用收口：平台推荐、项目版本、案例空状态与桌面弹性布局
   ============================================================ */
.header-intro-link { color: #52647D; font-size: 12px; font-weight: 650; text-decoration: none; }
.header-intro-link:hover { color: var(--primary); }
.app-layout { display: grid; grid-template-columns: minmax(320px, 360px) minmax(0, 1fr); max-width: 1380px; gap: 32px; }
.left-panel { width: auto; min-width: 0; }
.right-panel { min-width: 0; }
.web-bottom-nav { width: 470px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.current-project-summary { display: grid; gap: 10px; margin: -6px 0 2px; padding: 14px; border: 1px solid #CFE0FF; border-radius: 15px; background: linear-gradient(145deg, #F5F9FF, #FBFAFF); }
.current-project-summary-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--text-secondary); font-size: 11px; }
.current-project-summary-head b { overflow: hidden; color: var(--text); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.current-project-summary-meta { display: flex; flex-wrap: wrap; gap: 7px; color: #49617E; font-size: 11px; }
.current-project-summary-meta span { padding: 4px 7px; border-radius: 7px; background: #EAF2FF; }
.current-project-summary .btn { justify-self: start; }
.platform-recommendation { display: grid; gap: 9px; margin: 14px 0 12px; padding: 12px; border: 1px solid #DFE8F7; border-radius: 13px; background: #F8FAFF; }
.platform-recommendation-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.platform-recommendation-head strong { color: #2F4D78; font-size: 12px; }
.platform-recommendation-head span { color: var(--text-secondary); font-size: 10px; text-align: right; }
.platform-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.platform-option { min-height: 31px; overflow: hidden; padding: 4px 5px; border: 1px solid #DCE5F2; border-radius: 8px; color: #52647D; background: #FFF; font: inherit; font-size: 10px; cursor: pointer; text-overflow: ellipsis; white-space: nowrap; }
.platform-option:hover { border-color: #9ABDF8; color: var(--primary); }
.platform-option.is-active { border-color: var(--primary); color: var(--primary); background: #EAF2FF; box-shadow: 0 0 0 2px rgba(36,107,254,.08); }
#generationSettingsPanel:focus-visible { outline: 3px solid rgba(36,107,254,.18); outline-offset: 4px; border-radius: 12px; }
.empty-state { min-height: 360px; }
.empty-showcase { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; max-width: 620px; margin: 20px auto 16px; text-align: left; }
.empty-showcase article { display: grid; gap: 3px; padding: 8px; border: 1px solid #E0E7F1; border-radius: 11px; background: rgba(255,255,255,.78); }
.empty-showcase strong { color: var(--text); font-size: 11px; }
.empty-showcase small { color: var(--text-secondary); font-size: 10px; line-height: 1.45; }
.showcase-visual { display: grid; place-items: center; height: 70px; border-radius: 8px; color: #FFF; font-size: 13px; font-weight: 800; }
.showcase-main { background: linear-gradient(145deg,#246BFE,#8C7DF4); }
.showcase-detail { color: #70553D; background: linear-gradient(145deg,#EAD8C2,#FAF4EC); }
.showcase-wholesale { background: linear-gradient(145deg,#344A62,#8596AA); }
.empty-create-btn { min-height: 42px; padding: 9px 20px; font-size: 12px; }
.project-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); align-items: start; gap: 16px; }
.project-list { display: grid; gap: 12px; min-width: 0; }
.project-card { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 17px; background: #FFF; box-shadow: var(--shadow-sm); }
.project-card:hover { border-color: #C9DAF7; box-shadow: 0 8px 24px rgba(31,52,88,.08); }
.project-card-main { display: flex; align-items: center; gap: 13px; min-width: 0; }
.project-cover { display: grid; place-items: center; width: 72px; height: 72px; flex: 0 0 72px; border-radius: 14px; color: #FFF; background: linear-gradient(145deg,#246BFE,#7657F5); font-size: 12px; font-weight: 800; }
.project-card-copy { min-width: 0; }
.project-card-copy h3 { overflow: hidden; margin: 0 0 3px; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.project-card-copy p { overflow: hidden; margin: 0 0 4px; color: var(--text-secondary); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.project-card-copy small { color: var(--text-secondary); font-size: 11px; }
.project-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.project-delete { margin-left: auto; padding: 5px 7px; border: 0; color: #B42318; background: transparent; font: inherit; font-size: 11px; cursor: pointer; }
.project-version-panel { position: sticky; top: 72px; padding: 18px; border: 1px solid var(--border); border-radius: 17px; background: #FFF; box-shadow: var(--shadow-sm); }
.project-version-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.project-version-head small { color: var(--text-secondary); font-size: 11px; }
.project-version-head h3 { margin: 3px 0 0; overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.project-version-hint { margin: 12px 0; color: var(--text-secondary); font-size: 11px; line-height: 1.6; }
.project-version-list { display: grid; gap: 8px; }
.project-version-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--border-light); border-radius: 11px; background: #FBFCFE; }
.project-version-card strong { display: block; font-size: 12px; }
.project-version-card small { display: block; margin-top: 3px; color: var(--text-secondary); font-size: 10px; }
.project-version-card > span { color: var(--text-secondary); font-size: 10px; }
.project-version-card .btn { grid-column: 2; grid-row: 1 / span 2; }
.project-version-empty { padding: 30px 10px; color: var(--text-secondary); font-size: 12px; text-align: center; }
body.has-results .empty-state { display: none !important; }
body.has-results .current-project-summary { border-color: #BFD5FF; }
body.has-results .right-panel { min-height: 0; }
@media (max-width: 1080px) {
    .app-layout { grid-template-columns: minmax(300px, 350px) minmax(0, 1fr); gap: 22px; }
    .web-bottom-nav { width: 440px; }
    .project-layout { grid-template-columns: 1fr; }
    .project-version-panel { position: static; }
}
@media (max-width: 900px) {
    .app-layout { display: flex; gap: 24px; }
    .web-bottom-nav { width: calc(100vw - 24px); }
    .platform-recommendation-head { display: grid; gap: 2px; }
    .platform-recommendation-head span { text-align: left; }
    .empty-showcase { max-width: 520px; }
}
@media (max-width: 480px) {
    .header-intro-link { display: none; }
    .platform-options { gap: 4px; }
    .platform-option { font-size: 9px; }
    .empty-showcase { grid-template-columns: 1fr; max-width: 250px; }
    .empty-showcase article { grid-template-columns: 50px 1fr; align-items: center; }
    .showcase-visual { grid-row: 1 / span 2; width: 50px; height: 50px; font-size: 10px; }
    .project-card-actions .project-delete { margin-left: 0; }
}

/* 正文和控件不再低于移动端可读字号；时间等元信息可保留更小字号。 */
.platform-recommendation, .project-card, .project-version-panel { font-size: 12px; }

/* ============================================================
   电商视觉工作台改版覆盖层
   保留原有组件类名，方便现有业务逻辑无感迁移。
   ============================================================ */
:root {
    --primary: #246BFE;
    --primary-hover: #1557E8;
    --primary-light: #EEF4FF;
    --bg: #F5F7FB;
    --card-bg: #FFFFFF;
    --border: #E5EAF2;
    --border-light: #EEF1F6;
    --text: #182230;
    --text-secondary: #7B8798;
    --text-placeholder: #AAB4C3;
    --accent: #7657F5;
    --accent-light: #F1EEFF;
    --shadow-sm: 0 2px 8px rgba(34, 52, 84, .04);
    --shadow: 0 10px 30px rgba(34, 52, 84, .08);
    --shadow-lg: 0 18px 48px rgba(34, 52, 84, .13);
    --shadow-primary: 0 8px 20px rgba(36, 107, 254, .22);
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
}

body { background: var(--bg); color: var(--text); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

.header { background: rgba(255,255,255,.86); border-bottom: 1px solid rgba(229,234,242,.85); }
.header-inner { max-width: 1380px; height: 50px; padding: 0 28px; }
.brand-lockup { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: white; font-size: 17px; background: linear-gradient(145deg, #246BFE, #7657F5); box-shadow: 0 6px 14px rgba(76,93,238,.22); }
.logo { font-size: 16px; line-height: 1.1; letter-spacing: -.3px; }
.logo::before { display: none; }
.brand-subtitle { display: block; margin-top: 3px; color: var(--text-secondary); font-size: 11px; letter-spacing: .1px; }
.header-status { display: flex; align-items: center; gap: 7px; color: var(--text-secondary); font-size: 12px; margin-right: 8px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #2ECF83; box-shadow: 0 0 0 4px #E5FAF0; }
.header-right { gap: 14px; }
#loginBtn { background: var(--text); box-shadow: none; padding: 10px 18px; }
#loginBtn:hover { background: #2B394A; transform: translateY(-1px); }
.user-btn { padding: 9px 14px; border-color: var(--border); }

.app-layout { max-width: 1380px; margin: 0 auto; padding: 34px 32px 70px; gap: 36px; align-items: flex-start; }
.left-panel { width: 398px; min-width: 398px; gap: 18px; }
.right-panel { padding-top: 13px; }
.workspace-intro { padding: 4px 4px 9px; }
.eyebrow { color: var(--primary); font-size: 10px; font-weight: 700; letter-spacing: 1.6px; line-height: 1.4; }
.workspace-intro h2 { margin: 12px 0 10px; font-size: 31px; line-height: 1.18; letter-spacing: -1.25px; }
.workspace-intro h2 em { color: var(--primary); font-style: normal; }
.workspace-intro p { max-width: 330px; color: var(--text-secondary); font-size: 13px; line-height: 1.7; }
.panel-card { padding: 22px; border: 1px solid rgba(229,234,242,.85); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.panel-card:hover { box-shadow: var(--shadow); }
.step-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.step-number { min-width: 29px; height: 29px; display: grid; place-items: center; border-radius: 10px; background: var(--primary-light); color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .3px; }
.card-title { margin: 0 0 3px; font-size: 15px; letter-spacing: -.15px; }
.card-title::before { display: none; }
.step-hint { color: var(--text-secondary); font-size: 11px; }

.upload-zone { min-height: 214px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1.5px dashed #C9D4E4; border-radius: 16px; padding: 26px 20px; margin: 0; background: linear-gradient(145deg, #FBFCFF, #F8FAFD); }
.upload-zone::before { background: linear-gradient(135deg, rgba(36,107,254,.07), rgba(118,87,245,.07)); }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: var(--primary-light); }
.upload-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 13px; border-radius: 16px; color: var(--primary); font-size: 29px; background: #EAF1FF; opacity: 1; }
.icon-camera { display: block; transform: rotate(-15deg); }
.upload-text { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.upload-hint { font-size: 11px; }
.btn { border-radius: 11px; font-weight: 600; }
.btn-ghost { color: var(--text); background: white; border: 1px solid var(--border); box-shadow: none; }
.btn-ghost:hover { color: var(--primary); background: var(--primary-light); border-color: #C8D8FF; }
.btn-small { padding: 8px 13px; }
.upload-zone .btn { margin-top: 16px; }
.upload-preview { max-width: 100%; margin-top: 16px; gap: 7px; }
.preview-thumb { width: 58px; height: 58px; border-radius: 11px; border: 2px solid white; box-shadow: 0 2px 8px rgba(32,49,84,.12); }
.preview-thumb .remove-btn { opacity: 1; top: 3px; right: 3px; width: 18px; height: 18px; font-size: 11px; line-height: 18px; }

.type-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 19px; }
.type-option { min-height: 96px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding: 12px 11px; border: 1px solid var(--border); border-radius: 14px; color: var(--text); background: #FBFCFE; cursor: pointer; text-align: left; font-family: inherit; transition: .2s ease; }
.type-option:hover { border-color: #BFCFFF; transform: translateY(-1px); }
.type-option.active { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 4px 13px rgba(36,107,254,.12); }
.type-option-icon { width: 25px; height: 25px; display: block; color: var(--primary); margin-bottom: 2px; }
.type-option-icon svg { width: 100%; height: 100%; display: block; }
.type-option strong { font-size: 13px; }
.type-option small { color: var(--text-secondary); font-size: 10px; white-space: nowrap; }
.compact-row { gap: 10px; }
#countGroup { flex: 1; }
#languageGroup { flex: 1; }
.form-group { margin-bottom: 14px; }
.form-group label, .field-label { color: var(--text-secondary); font-size: 11px; font-weight: 600; margin-bottom: 6px; }
.label-optional { color: #ADB7C4; font-weight: 400; margin-left: 3px; }
input, textarea, select { min-height: 42px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 11px; background: #FBFCFE; font-size: 13px; }
input:hover, textarea:hover, select:hover { border-color: #C2CDDC; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(36,107,254,.1); background: white; }
#wholesaleFields { border-top: 1px solid var(--border-light); padding-top: 15px; margin-top: 3px; }
#wholesaleFields .form-row { margin-top: 9px; }
.field-label { display: block; }
.custom-fields-section { margin-top: 16px; padding-top: 15px; border-top: 1px dashed var(--border); }
.custom-fields-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.custom-fields-header .field-label { margin: 0; }
.custom-fields-header .btn { padding: 6px 10px; font-size: 11px; }
.custom-field-row { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.custom-field-row input { min-width: 0; }
.custom-field-name { flex: 2; }
.custom-field-value { flex: 3; }
.custom-field-remove { width: 28px; height: 28px; flex: 0 0 28px; border: 0; border-radius: 8px; color: var(--text-secondary); background: #F1F4F8; cursor: pointer; font-size: 18px; line-height: 1; }
.custom-field-remove:hover { color: var(--error); background: #FFF0F0; }
.custom-fields-empty { padding: 9px 0 1px; color: var(--text-placeholder); font-size: 11px; }
.btn-secondary { color: var(--primary); background: var(--primary-light); border-color: transparent; }
.btn-secondary:hover { background: #E3ECFF; }
.btn-full { min-height: 46px; margin-top: 10px; border-radius: 12px; }

.analysis-card { background: linear-gradient(180deg, #FFFFFF, #FCFDFF); }
.analysis-notice { margin: 10px 0 12px; padding: 10px 12px; border-radius: 10px; background: #FFF8E8; color: #9A6700; font-size: 12px; line-height: 1.5; }
.analysis-confirm-label { color: #B7791F; font-size: 11px; font-weight: 500; }
.analysis-toggle { width: 100%; border: 0; border-radius: 10px; padding: 10px 12px; background: #F3F6FA; color: var(--primary); font-size: 13px; cursor: pointer; margin-bottom: 12px; }
.analysis-toggle:hover { background: #EAF2FF; }
.analysis-generate-action { margin-top: 16px; padding-top: 16px; border-top: 1px solid #E7EDF6; }
.analysis-generate-action .btn { margin-top: 0; }
.idea-card { margin-bottom: 10px; padding: 10px; background: #F5F6F8; border-radius: 10px; border-left: 3px solid var(--primary); }
.idea-label { display: block; margin-bottom: 6px; color: var(--text-secondary); font-size: 12px; font-weight: 600; }
.idea-textarea { width: 100%; min-height: 58px; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px; font-size: 13px; line-height: 1.5; background: #fff; resize: vertical; }
#analysisCard { max-height: 620px; overflow-y: auto; }
#analysisCard::-webkit-scrollbar { width: 4px; }
#analysisCard::-webkit-scrollbar-thumb { background: #DCE4EF; border-radius: 9px; }
.analysis-error { margin: 0 0 16px; padding: 12px 14px; border: 1px solid #FECACA; border-radius: 10px; background: #FFF7F7; color: #C62828; font-size: 13px; line-height: 1.6; }
.tag { padding: 5px 9px; background: var(--accent-light); color: #6A55D7; font-size: 11px; }
.tag:hover { background: #E5DFFF; color: #5E47CE; }

#genConfigCard { position: sticky; top: 94px; bottom: auto; z-index: 5; padding: 20px 22px 22px; background: rgba(255,255,255,.95); box-shadow: 0 10px 35px rgba(31,52,88,.13); }
.config-title { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.config-title h3 { margin-top: 4px; font-size: 17px; letter-spacing: -.3px; }
.config-spark { color: var(--accent); font-size: 21px; }
.checkbox-label { padding: 5px 0 1px; gap: 7px; font-size: 12px; }
.checkbox-label input { min-height: 18px; width: 18px; }
.checkbox-help { color: var(--text-secondary); margin-left: auto; font-size: 11px; }
.credit-bar { margin: 13px 0 2px; padding: 10px 12px; background: var(--primary-light); color: var(--text-secondary); font-size: 11px; border-radius: 10px; }
.credit-bar strong { color: var(--primary); }
.login-tip { margin: 13px 0 1px; text-align: center; color: var(--text-secondary); font-size: 11px; }
.login-tip a { color: var(--primary); font-weight: 700; }
.generate-button { min-height: 50px; margin-top: 14px; font-size: 14px; box-shadow: var(--shadow-primary); }
.generate-button:hover { background: var(--primary-hover); }
.background-group { margin-top: 2px; }
.background-picker { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px 6px; }
.bg-swatch { min-width: 0; padding: 0; border: 0; background: transparent; color: var(--text-secondary); cursor: pointer; text-align: center; }
.bg-swatch span { display: block; width: 28px; height: 28px; margin: 0 auto 4px; border: 1px solid rgba(31,42,55,.14); border-radius: 50%; background: var(--swatch); box-shadow: 0 2px 5px rgba(24,34,48,.06); transition: transform .18s ease, box-shadow .18s ease; }
.bg-swatch em { display: block; overflow: hidden; font-size: 10px; font-style: normal; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; }
.bg-swatch:hover span { transform: translateY(-2px); box-shadow: 0 5px 12px rgba(24,34,48,.14); }
.bg-swatch.active span { outline: 2px solid var(--primary); outline-offset: 2px; box-shadow: 0 3px 10px rgba(36,107,254,.22); }
.bg-swatch.active em { color: var(--primary); font-weight: 700; }
.background-help { margin-top: 8px; color: var(--text-secondary); font-size: 10px; }

.right-header { margin-bottom: 18px; align-items: flex-end; }
.right-header h2 { margin-top: 6px; font-size: 26px; letter-spacing: -.8px; }
.right-header h2::before { display: none; }
.right-subtitle { margin-top: 5px; color: var(--text-secondary); font-size: 12px; }
.result-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 38px; padding: 0 2px 15px; border-bottom: 1px solid var(--border); }
.toolbar-chip { display: inline-flex; align-items: center; gap: 7px; color: var(--text-secondary); font-size: 11px; }
.toolbar-dot { width: 7px; height: 7px; border-radius: 50%; background: #C2CBD7; }
.toolbar-note { color: #A1ACBA; font-size: 11px; }
#rightActions { gap: 8px; }

#genProgress { padding: 16px 18px; margin: 18px 0; border: 1px solid #DDE7FF; border-radius: 14px; background: linear-gradient(100deg, #F7FAFF, #FBF9FF); box-shadow: none; }
.progress-top { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--text); font-size: 12px; font-weight: 600; }
.progress-top strong { color: var(--primary); }
.progress-bar-bg { height: 8px; background: #E6EDFA; }
.progress-bar-fill { background: linear-gradient(90deg, var(--primary), var(--accent)); }
.help-text { margin-top: 8px; text-align: left; font-size: 11px; }
.empty-state { min-height: 550px; padding: 48px 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: radial-gradient(circle at 50% 30%, rgba(238,244,255,.88), rgba(255,255,255,.76) 48%, rgba(255,255,255,.95)); }
.empty-art { position: relative; width: 190px; height: 130px; margin: 18px auto 22px; }
.empty-art-card { position: absolute; width: 92px; height: 112px; border: 5px solid white; border-radius: 15px; box-shadow: 0 16px 30px rgba(59,82,130,.12); }
.card-back { left: 22px; top: 12px; transform: rotate(-16deg); background: #E6EEFF; }
.card-mid { left: 66px; top: 5px; transform: rotate(7deg); background: #EEEAFE; }
.card-front { left: 54px; top: 16px; display: grid; place-items: center; color: white; font-size: 31px; background: linear-gradient(150deg, #246BFE, #7657F5); transform: rotate(4deg); }
.empty-state h3 { font-size: 19px; letter-spacing: -.35px; }
.empty-state p { margin: 8px auto 20px; max-width: 300px; color: var(--text-secondary); font-size: 12px; line-height: 1.7; }
.empty-steps { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text-secondary); font-size: 11px; }
.empty-steps b { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 3px; border-radius: 50%; color: var(--primary); background: var(--primary-light); font-size: 10px; }
.empty-steps i { color: #C4CBD5; font-style: normal; }
.results-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
.gen-result-card { border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); }
.gen-result-card:hover { box-shadow: var(--shadow-lg); }
.gen-result-card .card-img { background: #F1F3F7; }
.gen-result-card .card-body { min-height: 52px; padding: 11px 13px; }
.gen-result-card .card-label { font-size: 12px; font-weight: 700; }
.gen-result-card .card-meta { font-size: 10px; }
.regen-btn { opacity: 0; top: 10px; right: 10px; padding: 7px 11px; border-color: rgba(255,255,255,.75); color: var(--text); box-shadow: 0 4px 12px rgba(24,34,48,.1); }
.gen-result-card:hover .regen-btn { opacity: 1; }

/* 弹窗与后台沿用原结构，只统一细节 */
.modal-dialog { border: 1px solid var(--border); box-shadow: 0 25px 70px rgba(24,34,48,.2); }
.modal-dialog h3 { letter-spacing: -.5px; }

@media (max-width: 1080px) {
    .app-layout { gap: 24px; padding-left: 22px; padding-right: 22px; }
    .left-panel { width: 350px; min-width: 350px; }
    .results-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .header-inner { padding: 0 18px; }
    .header-status { display: none; }
    .app-layout { padding: 24px 16px 52px; }
    .left-panel { width: 100%; min-width: auto; }
    .right-panel { padding-top: 4px; }
    .generate-card { position: static; }
    .empty-state { min-height: 390px; }
}
@media (max-width: 480px) {
    .brand-subtitle { display: none; }
    .workspace-intro h2 { font-size: 27px; }
    .panel-card { padding: 18px; }
    .type-switch { gap: 6px; }
    .type-option { min-height: 88px; padding: 10px 8px; }
    .type-option small { font-size: 9px; }
    .right-header { align-items: flex-start; }
    .right-header h2 { font-size: 22px; }
    .toolbar-note { display: none; }
    .results-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .form-row { flex-direction: row; gap: 8px; }
    .form-row .half { min-width: 0; }
    .compact-row { gap: 8px; }
    .background-picker { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px 3px; }
    .bg-swatch span { width: 25px; height: 25px; }
    .bg-swatch em { font-size: 9px; }
}

/* ============================================================
   阶段 7：网页端固定导航与统一图标
   ============================================================ */
html, body { min-height: 100%; }
body { padding-top: 50px; padding-bottom: 96px; }
.header {
    position: fixed;
    inset: 0 0 auto;
    height: 50px;
    z-index: 1000;
}
.header-inner { height: 50px; min-height: 50px; }
.app-layout { scroll-margin-top: 62px; }
.left-panel, .right-panel { scroll-margin-top: 62px; }
.credit-bar { align-items: center; gap: 5px; flex-wrap: wrap; }
.credit-bar strong { color: var(--primary); font-size: 15px; }

.fixed-output-summary {
    min-height: 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #F8FAFD;
}
.fixed-output-summary strong { color: var(--text-primary); font-size: 13px; }
.fixed-output-summary span { color: var(--text-secondary); font-size: 10px; }
.gen-result-card.detail-long-card { grid-column: 1 / -1; }
.gen-result-card.detail-long-card .result-image-wrap { max-height: 680px; background: #EEF2F8; }
.gen-result-card.detail-long-card .card-img { width: 100%; height: auto; max-height: 680px; object-fit: contain; }
.web-bottom-nav {
    position: fixed;
    left: 50%;
    bottom: max(14px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(560px, calc(100vw - 32px));
    height: 64px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: stretch;
    padding: 6px;
    border: 1px solid rgba(227, 232, 241, .95);
    border-radius: 22px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 12px 34px rgba(32, 53, 91, .16);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    z-index: 1200;
}
.web-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    border: 0;
    border-radius: 16px;
    color: #7E8794;
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}
.web-tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.web-tab.active { color: var(--primary); background: #EEF5FF; }
.web-tab:active { transform: scale(.96); }

@media (max-width: 900px) {
    body { padding-bottom: 92px; }
    .app-layout { padding-bottom: 28px; }
}
@media (max-width: 480px) {
    .web-bottom-nav { width: calc(100vw - 24px); bottom: max(10px, env(safe-area-inset-bottom)); }
    .web-tab { font-size: 11px; }
    .web-tab svg { width: 23px; height: 23px; }
}

/* ============================================================
   P0 商用工作台：真实视图、五步流程、任务中心与移动操作条
   ============================================================ */
:root {
    --text-secondary: #667085;
    --text-placeholder: #6B7280;
}

body { padding-bottom: 0; }
[hidden] { display: none !important; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(36,107,254,.28);
    outline-offset: 2px;
}

.workspace-view { min-height: calc(100vh - 50px); }
.workspace-view:not(.is-active) { display: none; }
.workspace-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 38px 32px 72px;
}
.workspace-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}
.workspace-page-header h2 { margin: 6px 0 4px; font-size: 30px; letter-spacing: -.8px; }
.workspace-page-header p { color: var(--text-secondary); font-size: 13px; }

/* 桌面端导航位于顶部栏中央，移动端再切换为底部 Dock。 */
.web-bottom-nav {
    top: 7px;
    bottom: auto;
    width: 356px;
    height: 36px;
    padding: 3px;
    border-color: #E6EBF3;
    border-radius: 12px;
    background: #F5F7FB;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 1100;
}
.web-tab {
    flex-direction: row;
    gap: 7px;
    border-radius: 9px;
    font-size: 12px;
}
.web-tab svg { width: 17px; height: 17px; }
.web-tab.active { background: #FFFFFF; box-shadow: 0 2px 8px rgba(31,52,88,.08); }

.flow-stepper {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    margin: 0 4px 8px;
    padding: 0;
    list-style: none;
}
.flow-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 0;
    color: #8A94A3;
    font-size: 10px;
    text-align: center;
}
.flow-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 13px;
    left: calc(50% + 15px);
    width: calc(100% - 30px);
    height: 2px;
    border-radius: 999px;
    background: #E2E8F2;
}
.flow-step span {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border: 2px solid #DDE4EF;
    border-radius: 50%;
    background: #FFFFFF;
    font-size: 10px;
    font-weight: 800;
}
.flow-step strong { overflow: hidden; width: 100%; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.flow-step.is-done { color: #386FCA; }
.flow-step.is-done span { border-color: #CFE0FF; color: var(--primary); background: var(--primary-light); }
.flow-step.is-done:not(:last-child)::after { background: #BFD5FF; }
.flow-step.is-active { color: var(--primary); }
.flow-step.is-active span { border-color: var(--primary); color: #FFFFFF; background: var(--primary); box-shadow: 0 0 0 4px rgba(36,107,254,.10); }
.flow-status {
    margin: 0 4px 4px;
    padding: 9px 12px;
    border: 1px solid #DFE8F7;
    border-radius: 10px;
    color: #42526A;
    background: rgba(247,250,255,.9);
    font-size: 11px;
    text-align: center;
}

.upload-selection-status {
    display: none;
    margin-top: 10px;
    color: #50627A;
    font-size: 11px;
    font-weight: 600;
}
.upload-zone.has-files .upload-selection-status { display: block; }
.btn:disabled { cursor: not-allowed; opacity: .56; transform: none !important; box-shadow: none; }
.generate-card.flow-reveal { animation: p0-reveal .24s ease both; }
@keyframes p0-reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.analysis-card { scroll-margin-top: 66px; }
#genConfigCard { scroll-margin-top: 66px; }
#analysisGenerateAction { display: none !important; }
.toolbar-note { color: var(--text-secondary); }

.task-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.task-summary-grid > div {
    min-height: 106px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #FFFFFF;
    box-shadow: var(--shadow-sm);
}
.task-summary-grid small { display: block; margin-bottom: 9px; color: var(--text-secondary); font-size: 12px; }
.task-summary-grid strong { font-size: 28px; letter-spacing: -.8px; }
.task-list { display: grid; gap: 12px; }
.task-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: #FFFFFF;
    box-shadow: var(--shadow-sm);
}
.task-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) auto;
    align-items: center;
    gap: 20px;
    width: 100%;
    padding: 17px 18px;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.task-card-head:hover { background: #FAFBFD; }
.task-card-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.task-type-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    color: var(--primary);
    background: var(--primary-light);
    font-size: 12px;
    font-weight: 800;
}
.task-card-title strong { display: block; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.task-card-title small,
.task-meta-line { color: var(--text-secondary); font-size: 11px; }
.task-status-wrap { min-width: 0; }
.task-status-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.task-status {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    border-radius: 999px;
    color: #50627A;
    background: #EFF3F8;
    font-size: 10px;
    font-weight: 750;
}
.task-status.queued,
.task-status.loading { color: #8A5A00; background: #FFF5D8; }
.task-status.generating,
.task-status.analyzing { color: #2459B8; background: #EAF2FF; }
.task-status.completed { color: #157A46; background: #E8F7EF; }
.task-status.partial_failed { color: #A05A00; background: #FFF1DD; }
.task-status.failed { color: #B42318; background: #FEECEB; }
.task-mini-progress { overflow: hidden; height: 5px; border-radius: 99px; background: #E8EDF5; }
.task-mini-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.task-card-action { color: var(--primary); font-size: 12px; font-weight: 700; white-space: nowrap; }
.task-results { display: none; padding: 0 18px 18px; border-top: 1px solid var(--border-light); }
.task-card.is-expanded .task-results { display: block; }
.task-result-summary { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 13px 0; color: var(--text-secondary); font-size: 11px; }
.task-result-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.task-result-item { position: relative; overflow: hidden; aspect-ratio: 1; border-radius: 11px; background: #F0F3F7; }
.task-result-item img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.task-result-item.is-long { grid-column: span 2; aspect-ratio: 4 / 5; }
.task-result-error { display: grid; place-items: center; width: 100%; height: 100%; padding: 8px; color: #B42318; font-size: 10px; text-align: center; }
.task-load-more { display: block; margin: 18px auto 0; }
.view-loading,
.view-empty,
.view-error { padding: 70px 20px; border: 1px dashed #D6DFEC; border-radius: 17px; color: var(--text-secondary); background: rgba(255,255,255,.55); text-align: center; }
.view-empty strong,
.view-error strong { display: block; margin-bottom: 7px; color: var(--text); font-size: 17px; }
.view-empty .btn,
.view-error .btn { margin-top: 16px; }

.account-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; }
.account-profile-card,
.account-credit-card,
.account-actions-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #FFFFFF;
    box-shadow: var(--shadow-sm);
}
.account-profile-card { display: flex; align-items: center; gap: 16px; padding: 24px; }
.account-avatar {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    border-radius: 19px;
    color: #FFFFFF;
    background: linear-gradient(145deg, var(--primary), var(--accent));
    font-size: 24px;
    font-weight: 750;
}
.account-profile-main { min-width: 0; flex: 1; }
.account-profile-main small { color: var(--text-secondary); font-size: 11px; }
.account-profile-main h3 { overflow: hidden; margin: 4px 0; font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
.account-profile-main p { color: var(--text-secondary); font-size: 12px; }
.account-credit-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    background: linear-gradient(135deg, #F7FAFF, #F4F1FF);
}
.account-credit-card small { display: block; margin-bottom: 5px; color: var(--text-secondary); font-size: 12px; }
.account-credit-card strong { color: var(--primary); font-size: 34px; letter-spacing: -1px; }
.account-credit-card em { margin-left: 6px; color: var(--text-secondary); font-size: 12px; font-style: normal; font-weight: 500; }
.account-actions-card { grid-column: 1 / -1; overflow: hidden; }
.account-action {
    display: grid;
    grid-template-columns: minmax(120px, .35fr) 1fr auto;
    align-items: center;
    gap: 20px;
    width: 100%;
    min-height: 68px;
    padding: 15px 20px;
    border: 0;
    border-bottom: 1px solid var(--border-light);
    color: inherit;
    background: #FFFFFF;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.account-action:last-child { border-bottom: 0; }
.account-action:hover { background: #FAFBFD; }
.account-action strong { font-size: 14px; }
.account-action span { color: var(--text-secondary); font-size: 12px; }
.account-action b { color: #8A94A3; font-size: 22px; font-weight: 400; }
.account-logout strong { color: #B42318; }

.mobile-action-bar { display: none; }
.toast-region {
    position: fixed;
    top: 66px;
    left: 50%;
    z-index: 2200;
    display: grid;
    gap: 8px;
    width: min(430px, calc(100vw - 24px));
    transform: translateX(-50%);
    pointer-events: none;
}
.app-toast {
    padding: 12px 15px;
    border: 1px solid #DCE5F2;
    border-radius: 12px;
    color: #243447;
    background: rgba(255,255,255,.97);
    box-shadow: 0 12px 32px rgba(31,52,88,.15);
    font-size: 12px;
    line-height: 1.55;
    animation: toast-in .2s ease both;
}
.app-toast.success { border-color: #BFE7D0; color: #12673C; }
.app-toast.warning { border-color: #F4D9A4; color: #845400; }
.app-toast.error { border-color: #F2C0BC; color: #A82A20; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 900px) {
    body { padding-bottom: calc(158px + env(safe-area-inset-bottom)); }
    .header-inner { padding: 0 16px; }
    .workspace-page { padding: 24px 16px 42px; }
    .workspace-page-header { align-items: flex-start; }
    .workspace-page-header h2 { font-size: 25px; }
    .web-bottom-nav {
        top: auto;
        bottom: max(10px, env(safe-area-inset-bottom));
        width: calc(100vw - 24px);
        height: 58px;
        padding: 5px;
        border-radius: 19px;
        background: rgba(255,255,255,.96);
        box-shadow: 0 12px 34px rgba(32,53,91,.16);
        backdrop-filter: blur(18px) saturate(150%);
        -webkit-backdrop-filter: blur(18px) saturate(150%);
    }
    .web-tab { flex-direction: column; gap: 2px; border-radius: 14px; font-size: 10px; }
    .web-tab svg { width: 21px; height: 21px; }
    .mobile-action-bar.is-visible {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(78px + env(safe-area-inset-bottom));
        z-index: 1190;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 58px;
        padding: 8px 9px 8px 14px;
        border: 1px solid rgba(221,229,241,.96);
        border-radius: 17px;
        background: rgba(255,255,255,.96);
        box-shadow: 0 10px 28px rgba(32,53,91,.15);
        backdrop-filter: blur(18px) saturate(150%);
        -webkit-backdrop-filter: blur(18px) saturate(150%);
    }
    body[data-workspace-view="tasks"] .mobile-action-bar,
    body[data-workspace-view="projects"] .mobile-action-bar,
    body[data-workspace-view="account"] .mobile-action-bar { display: none; }
    .mobile-action-bar small { display: block; color: var(--text-secondary); font-size: 9px; }
    .mobile-action-bar strong { display: block; max-width: 190px; overflow: hidden; margin-top: 1px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
    .mobile-action-bar .btn { min-width: 116px; min-height: 42px; padding: 9px 14px; font-size: 12px; }
    .flow-stepper { margin-top: 2px; }
    .flow-status { margin-bottom: 0; }
    .task-summary-grid { grid-template-columns: 1fr 1fr; }
    .task-summary-grid > div { min-height: 86px; padding: 16px; }
    .task-summary-grid strong { font-size: 23px; }
    .task-card-head { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 15px; }
    .task-status-wrap { grid-column: 1 / -1; }
    .task-card-action { grid-column: 2; grid-row: 1; }
    .task-results { padding: 0 14px 14px; }
    .task-result-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .account-layout { grid-template-columns: 1fr; }
    .account-actions-card { grid-column: auto; }
    .account-profile-card,
    .account-credit-card { padding: 18px; }
    .account-action { grid-template-columns: minmax(100px, .48fr) 1fr auto; gap: 12px; padding: 14px 16px; }
}

@media (max-width: 480px) {
    .app-layout { padding-top: 20px; }
    .workspace-intro { padding-top: 0; }
    .flow-step strong { font-size: 9px; }
    .flow-step span { width: 25px; height: 25px; }
    .flow-step:not(:last-child)::after { top: 12px; }
    .empty-state { min-height: 360px; padding-left: 14px; padding-right: 14px; }
    .empty-steps { flex-wrap: wrap; gap: 7px; }
    .account-profile-card { align-items: flex-start; flex-wrap: wrap; }
    .account-profile-card .btn { width: 100%; }
    .account-credit-card { align-items: flex-end; }
    .account-credit-card strong { font-size: 29px; }
    .account-action { grid-template-columns: 1fr auto; }
    .account-action span { grid-column: 1; }
    .account-action b { grid-column: 2; grid-row: 1 / span 2; }
}

/* ============================================================
   P1 体验细化：上传反馈、任务筛选、图片预览与无障碍操作
   ============================================================ */
.upload-zone { cursor: pointer; }
.upload-zone:focus-visible { border-color: var(--primary); background: #F7FAFF; }
.upload-actions { display: flex; align-items: center; justify-content: center; gap: 8px; }
.upload-actions .btn[hidden] { display: none !important; }
.workspace-page-actions { display: flex; align-items: center; gap: 10px; }
.workspace-page-actions select {
    min-height: 38px;
    padding: 0 32px 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    background: #FFFFFF;
    font: inherit;
    font-size: 12px;
}
.task-card.is-filtered-out { display: none; }
.task-filter-empty { grid-column: 1 / -1; }
.task-error-note { margin-top: 12px; padding: 10px 12px; border-radius: 9px; color: #8C2B24; background: #FFF5F4; }
.image-preview-overlay { z-index: 2300; }
.image-preview-dialog {
    width: min(820px, calc(100vw - 32px));
    max-height: min(90vh, 900px);
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #FFFFFF;
    box-shadow: 0 22px 70px rgba(21, 34, 58, .25);
}
.image-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.image-preview-head strong { font-size: 14px; }
.image-preview-dialog > img { display: block; width: 100%; max-height: 72vh; object-fit: contain; border-radius: 11px; background: #F3F5F8; }
.image-preview-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.image-preview-actions .btn { min-width: 96px; text-align: center; text-decoration: none; }

@media (max-width: 900px) {
    .workspace-page-actions { width: 100%; justify-content: space-between; }
    .workspace-page-header { flex-direction: column; gap: 14px; }
    .workspace-page-actions select { flex: 1; }
}

@media (max-width: 480px) {
    .upload-actions { flex-wrap: wrap; }
    .workspace-page-actions { gap: 8px; }
    .workspace-page-actions .btn { padding-left: 12px; padding-right: 12px; }
    .image-preview-dialog { padding: 12px; }
}

/* ============================================================
   P2 效率增强：设置草稿、结果预览与状态细化
   ============================================================ */
.draft-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 4px 10px;
    padding: 9px 12px;
    border: 1px solid #DDE8FA;
    border-radius: 10px;
    color: #50627A;
    background: #F7FAFF;
    font-size: 11px;
}
.draft-status button {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    color: var(--primary);
    background: transparent;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.draft-status button:hover { text-decoration: underline; }
.result-preview-image { cursor: zoom-in; }
.result-preview-image:focus-visible { outline: 3px solid rgba(36,107,254,.28); outline-offset: -3px; }
.result-toolbar-note { max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-result-image { cursor: zoom-in; }
.task-result-image:focus-visible { outline: 3px solid rgba(36,107,254,.28); outline-offset: -3px; }

@media (max-width: 600px) {
    .draft-status { align-items: flex-start; font-size: 10px; }
    .result-toolbar-note { max-width: 55%; font-size: 10px; }
}

/* 最终布局覆盖：放在历史阶段样式之后，确保 P0/P1/P2 旧规则不会覆盖本次收口。 */
.app-layout { display: grid; grid-template-columns: minmax(320px, 360px) minmax(0, 1fr); max-width: 1380px; gap: 32px; }
.left-panel { width: auto; min-width: 0; }
.web-bottom-nav { width: 470px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1080px) {
    .app-layout { grid-template-columns: minmax(300px, 350px) minmax(0, 1fr); gap: 22px; }
    .web-bottom-nav { width: 440px; }
}
@media (max-width: 900px) {
    .app-layout { display: flex; gap: 24px; }
    .web-bottom-nav { width: calc(100vw - 24px); grid-template-columns: repeat(4, minmax(0, 1fr)); }
    body[data-workspace-view="projects"] .mobile-action-bar { display: none; }
}

/* Final P1/P2 readability and empty-state tuning. */
.empty-state { min-height: 360px; }
.form-group label,
.field-label,
.step-hint,
.upload-hint,
.login-tip { font-size: 12px; }

@media (max-width: 480px) {
    .type-option small { font-size: 11px; }
    .bg-swatch em { font-size: 10px; }
}

/* 视觉整改 1/2：空状态更有层次，移动端固定操作区更轻量。 */
.empty-state {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(270px, .95fr);
    align-items: center;
    gap: 28px;
    min-height: 390px;
    padding: 30px;
    text-align: left;
}
.empty-state-main { display: flex; align-items: center; gap: 22px; min-width: 0; }
.empty-art { flex: 0 0 150px; width: 150px; margin: 0; }
.empty-copy { min-width: 0; }
.empty-kicker { display: block; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: 1.4px; }
.empty-copy h3 { margin: 8px 0 6px; color: var(--text); font-size: 21px; }
.empty-copy p { margin: 0 0 14px; max-width: 280px; color: var(--text-secondary); font-size: 12px; line-height: 1.7; }
.empty-steps { justify-content: flex-start; flex-wrap: wrap; gap: 7px 9px; }
.empty-create-btn { align-self: flex-start; margin-top: 18px; }
.empty-state-side { min-width: 0; padding: 17px; border: 1px solid #E0E8F5; border-radius: 16px; background: rgba(255,255,255,.72); }
.empty-state-side-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.empty-state-side-head strong { display: block; margin-top: 4px; color: var(--text); font-size: 14px; }
.empty-state-side-head small { color: var(--text-secondary); font-size: 10px; white-space: nowrap; }
.empty-showcase { display: grid; grid-template-columns: 1fr; gap: 8px; max-width: none; margin: 0; text-align: left; }
.empty-showcase article { grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 10px; padding: 9px; }
.empty-showcase strong { display: block; font-size: 12px; }
.empty-showcase small { display: block; font-size: 10px; }
.showcase-visual { width: 64px; height: 54px; }
.type-option { width: 100%; min-width: 0; }
.type-option small { width: 100%; overflow: hidden; line-height: 1.35; white-space: normal; }

@media (max-width: 900px) {
    .empty-state { grid-template-columns: 1fr; gap: 20px; min-height: 340px; padding: 24px; }
    .empty-state-main { align-items: flex-start; }
    .empty-state-side { width: 100%; }
    .empty-showcase { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .empty-showcase article { grid-template-columns: 1fr; gap: 6px; }
    .showcase-visual { width: 100%; height: 56px; }
    body { padding-bottom: calc(136px + env(safe-area-inset-bottom)); }
    .web-bottom-nav { height: 56px; bottom: max(8px, env(safe-area-inset-bottom)); }
    .mobile-action-bar.is-visible { bottom: calc(70px + env(safe-area-inset-bottom)); min-height: 48px; padding: 6px 8px 6px 12px; border-radius: 15px; }
    .mobile-action-bar.is-visible .btn { min-width: 108px; min-height: 36px; padding: 7px 12px; }
}
@media (max-width: 480px) {
    .empty-state { padding: 20px 16px; }
    .empty-state-main { display: block; text-align: center; }
    .empty-art { margin: 0 auto 12px; }
    .empty-copy p { margin-right: auto; margin-left: auto; }
    .empty-steps { justify-content: center; }
    .empty-create-btn { align-self: center; }
    .empty-showcase { grid-template-columns: 1fr; max-width: none; }
    .empty-showcase article { grid-template-columns: 56px minmax(0, 1fr); }
    .showcase-visual { width: 56px; height: 50px; }
    .type-option { align-items: center; padding-right: 7px; padding-left: 7px; text-align: center; }
}
