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

:root {
    color-scheme: light;
    --bg: #f8fafc;
    --bg-elevated: #f1f5f9;
    --panel: #ffffff;
    --surface: #f8fafc;
    --surface-2: #f1f5f9;
    --input-bg: #ffffff;
    --preview-bg: #f1f5f9;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #dc4a3f;
    --primary-dark: #c93d33;
    --primary-light: #e76e66;
    --primary-rgb: 220, 74, 63;
    --primary-deep-rgb: 201, 61, 51;
    --primary-gradient: linear-gradient(135deg, #e76e66 0%, #dc4a3f 50%, #c93d33 100%);
    --primary-gradient-hover: linear-gradient(135deg, #dc4a3f 0%, #b83328 100%);
    --primary-soft: rgba(220, 74, 63, 0.06);
    --primary-border: rgba(220, 74, 63, 0.18);
    --primary-muted: rgba(220, 74, 63, 0.10);
    --success: #059669;
    --success-bg: #ecfdf5;
    --success-text: #047857;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-text: #b91c1c;
    --warning-bg: #fffbeb;
    --warning-text: #b45309;
    --on-primary: #ffffff;
    --radius: 12px;
    --radius-pill: 999px;
    --radius-btn: 999px;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 8px 30px rgba(15, 23, 42, 0.12);
    --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    overflow: hidden;
}

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100vh;
    min-width: 0;
}

.app-header {
    flex-shrink: 0;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    z-index: 40;
}

.app-header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 24px;
    height: 96px;
    min-width: 0;
}

.app-header-brand {
    flex-shrink: 0;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.brand-lockup:hover .brand-name {
    color: var(--primary-dark);
}

.brand-logo {
    flex-shrink: 0;
    display: block;
    border-radius: 8px;
    object-fit: contain;
}

.brand-name {
    font-weight: 700;
    font-size: 1.08rem;
    color: var(--text);
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.brand-lockup-header .brand-name {
    font-size: 1.12rem;
    background: linear-gradient(135deg, #1e293b 0%, #1e293b 12%, #e8453c 50%, #f06b63 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.brand-lockup-header:hover .brand-name {
    background: linear-gradient(135deg, #0f172a 0%, #0f172a 12%, #d13530 50%, #e8453c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.brand-lockup-nav {
    padding: 2px 0 10px;
}

.brand-lockup-nav .brand-name {
    font-size: 1rem;
}

.app-header-announce {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--primary-soft);
    border: 1px solid var(--primary-border);
}

.app-announce-icon {
    display: inline-flex;
    color: var(--primary);
    flex-shrink: 0;
}

.app-announce-icon svg {
    width: 20px;
    height: 20px;
}

.app-announce-badge {
    flex-shrink: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary-dark);
    background: var(--panel);
    border: 1px solid var(--primary-border);
    border-radius: 999px;
    padding: 4px 10px;
}

.app-announce-track {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}

.app-announce-marquee {
    display: flex;
    align-items: center;
    width: max-content;
    will-change: transform;
}

.app-announce-segment {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    white-space: nowrap;
    padding-right: 4rem;
}

.app-announce-marquee.is-scroll {
    animation: app-announce-scroll var(--marquee-duration, 24s) linear infinite;
}

.app-announce-marquee.is-scroll:hover {
    animation-play-state: paused;
}

.app-announce-text {
    font-size: 0.92rem;
    color: var(--primary-dark);
}

@keyframes app-announce-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.app-header-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-header-btn {
    /* 联系客服：保持方角圆角，不用全圆角胶囊 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    color: var(--muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.app-header-btn svg {
    width: 22px;
    height: 22px;
}

.app-header-btn:hover {
    border-color: var(--primary-border);
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.app-header-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 52px;
    padding: 0 18px;
    border: 1px solid var(--primary-border);
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.app-header-pill svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.app-header-pill:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--primary-muted);
    box-shadow: 0 1px 4px rgba(176, 90, 90, 0.12);
}

.app-header-pill:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--muted);
}

.app-header-points svg {
    color: #06b6d4;
    flex-shrink: 0;
}

.app-header-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    overflow: hidden;
}

.app-header-user-avatar.has-user {
    background: var(--primary-gradient);
    color: var(--on-primary);
}

.app-header-user-avatar svg {
    display: block;
    width: 18px;
    height: 18px;
}

.app-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.45);
}

.app-modal[hidden] {
    display: none !important;
}

.app-modal-card {
    width: min(420px, 100%);
    background: var(--panel);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 20px;
}

.app-modal-card-sm {
    width: min(380px, 100%);
}

.app-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.app-modal-head h3 {
    font-size: 1.05rem;
    font-weight: 700;
}

.app-modal-close {
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.app-modal-close:hover {
    color: var(--text);
}

.app-modal-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.app-modal-tab {
    flex: 1;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    border-radius: var(--radius-pill);
    padding: 8px 12px;
    font-size: 0.88rem;
    cursor: pointer;
}

.app-modal-tab.active {
    border-color: var(--primary-border);
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 600;
}

.app-auth-form .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.app-auth-code-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.app-auth-code-row input {
    flex: 1 1 auto;
    min-width: 0;
    /* 与上方邮箱/密码等同高，勿被按钮撑开 */
    box-sizing: border-box;
    height: 40px;
    padding: 0 12px;
}

.app-auth-code-row .btn {
    flex: 0 0 auto;
    white-space: nowrap;
    box-sizing: border-box;
    height: 40px;
    padding: 0 14px;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: var(--radius-btn); /* 胶囊弧形，勿用输入框的小圆角 */
    line-height: 1;
    gap: 0;
}

.app-auth-code-field .app-auth-hint {
    margin-top: 0.45rem;
}

.app-auth-form .field span {
    font-size: 0.82rem;
    color: var(--muted);
}

.app-auth-form input {
    width: 100%;
    box-sizing: border-box;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 12px;
    font-size: 0.9rem;
    background: var(--input-bg);
    color: var(--text);
}

.app-auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 69, 60, 0.12);
}

.app-auth-error {
    color: var(--danger);
    font-size: 0.82rem;
    margin-bottom: 10px;
}

.app-auth-hint {
    color: var(--primary-dark);
    font-size: 0.82rem;
    line-height: 1.5;
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--primary-soft);
    border: 1px solid var(--primary-border);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* 登录按钮与密码框间距 30px */
#loginForm > .field:last-of-type {
    margin-bottom: 0;
}

#loginForm > .btn.btn-primary.btn-block {
    margin-top: 30px;
}

.app-support-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-support-qr-wrap {
    display: flex;
    justify-content: center;
    padding: 8px 0 4px;
}

.app-support-qr {
    width: 200px;
    height: 200px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
}

.app-support-row {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 8px;
    align-items: center;
    font-size: 0.88rem;
}

.app-support-label {
    color: var(--muted);
}

.app-support-value {
    font-weight: 600;
    word-break: break-all;
}

.app-support-hint {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 4px;
}

.app-account-menu {
    position: relative;
}

.app-account-menu-close {
    position: absolute;
    top: 14px;
    right: 14px;
}

.app-account-menu-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-right: 28px;
}

.app-account-menu-avatar {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: var(--on-primary);
    font-weight: 700;
    font-size: 1rem;
}

.app-account-menu-name {
    font-weight: 700;
    font-size: 1rem;
}

.app-account-menu-email {
    font-size: 0.82rem;
    color: var(--muted);
}

.app-account-menu-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    margin-bottom: 12px;
    font-size: 0.88rem;
}

.app-account-menu-meta strong {
    font-size: 0.86rem;
    color: var(--text);
    font-weight: 500;
}

.app-account-menu-points {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--primary-soft);
    border: 1px solid var(--primary-border);
    margin-bottom: 12px;
    font-size: 0.88rem;
}

.app-account-menu-points strong {
    font-size: 1.1rem;
    color: var(--primary-dark);
}

.app-account-ledger {
    margin-bottom: 12px;
}

.app-account-menu.is-ledger-only .app-account-ledger {
    margin-bottom: 0;
}

.app-account-menu.is-ledger-only .app-account-ledger-list {
    max-height: min(360px, 52vh);
}

.app-account-menu-actions {
    display: grid;
    gap: 12px;
    margin-bottom: 4px;
}

.app-account-ledger-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}

.app-account-ledger-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--input-bg);
}

.app-account-ledger-list li {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    line-height: 1.4;
}

.app-account-ledger-list li:last-child {
    border-bottom: none;
}

.app-account-ledger-item-note {
    color: var(--text);
    margin-bottom: 2px;
}

.app-account-ledger-item-meta {
    color: var(--muted);
    font-size: 0.68rem;
}

.app-account-ledger-delta.plus {
    color: #059669;
    font-weight: 600;
}

.app-account-ledger-delta.minus {
    color: var(--danger-text);
    font-weight: 600;
}

.app-account-ledger-empty {
    color: var(--muted);
    text-align: center;
}

.app-recharge-card {
    max-width: 420px;
}

.app-recharge-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--primary-soft);
    border: 1px solid var(--primary-border);
    margin-bottom: 12px;
    font-size: 0.88rem;
}

.app-recharge-balance strong {
    font-size: 1.15rem;
    color: var(--primary-dark);
}

.app-recharge-hint {
    margin: 0 0 12px;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.5;
}

.app-recharge-packages {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.app-recharge-package {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--panel);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.app-recharge-package:hover {
    border-color: var(--primary-border);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.app-recharge-package.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-soft);
}

.app-recharge-package-top {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.app-recharge-package-title {
    font-weight: 700;
    font-size: 0.92rem;
}

.app-recharge-package-badge {
    font-size: 0.68rem;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    border: 1px solid var(--primary-border);
}

.app-recharge-package-points {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.app-recharge-package-price {
    font-size: 0.82rem;
    color: var(--muted);
}

.app-recharge-error {
    margin: 0 0 10px;
    font-size: 0.82rem;
    color: #dc2626;
}

.app-recharge-actions {
    display: grid;
    gap: 12px;
}

.select,
select.input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 2.25rem;
    background-color: var(--input-bg);
    background-image: var(--select-chevron);
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px 12px;
    cursor: pointer;
}

.select option,
select.input option {
    background: var(--panel);
    color: var(--text);
}

/* 自绘下拉（custom-select.js） */
.ui-select {
    position: relative;
    display: block;
    width: 100%;
}

.ui-select-native {
    display: none !important;
}

.ui-select-trigger {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    padding-right: 2.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    font: inherit;
    font-size: 0.88rem;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ui-select-trigger:hover:not(:disabled) {
    border-color: var(--primary-border);
}

.ui-select-trigger[aria-expanded="true"],
.ui-select-trigger:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(176, 90, 90, 0.14);
}

.ui-select-trigger:disabled,
.ui-select.is-disabled .ui-select-trigger {
    opacity: 0.6;
    cursor: not-allowed;
}

.ui-select-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ui-select-chevron {
    flex-shrink: 0;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1;
}

.ui-select-menu {
    overflow-y: auto;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
}

.ui-select-option {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    font: inherit;
    font-size: 0.875rem;
    color: var(--text);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.ui-select-option:hover:not(.is-disabled),
.ui-select-option:focus-visible {
    outline: none;
    background: var(--surface-2);
}

.ui-select-option.is-selected {
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 600;
}

.ui-select-option.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ui-select--input-sm .ui-select-trigger {
    min-height: 32px;
    padding: 6px 10px;
    padding-right: 2rem;
    font-size: 0.8125rem;
}

.workspace {
    display: flex;
    flex: 1;
    min-height: 0;
    min-width: 0;
}

.nav-rail {
    width: 242px;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    padding: 16px 10px;
    flex-shrink: 0;
    overflow-y: auto;
}

.nav-brand {
    padding: 0 4px 12px;
}

.app-shell .nav-brand {
    display: none;
}

.nav-group-title {
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0 10px 8px;
}

.nav-group-tools {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.nav-group-space {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

a.nav-item {
    text-decoration: none;
    display: flex;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    padding: 10px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.88rem;
    cursor: pointer;
    color: var(--text);
    margin-bottom: 4px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.nav-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--muted);
}

.nav-item-icon svg {
    display: block;
    width: 18px;
    height: 18px;
}

.nav-item:hover:not(.active):not(.disabled) {
    background: var(--surface-2);
}

.nav-item.active .nav-item-icon {
    color: var(--primary-dark);
}

.nav-item.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 600;
    border-color: var(--primary-border);
}
.nav-item.disabled { opacity: 0.45; cursor: not-allowed; }

.workspace-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.workspace-topbar {
    padding: 20px 28px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--panel);
}

.workspace-topbar h1 { font-size: 1.35rem; font-weight: 700; }
.workspace-topbar p { display: none; }

.workspace-panels {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    gap: 16px;
    padding: 16px;
    background: var(--bg);
}

.config-panel {
    flex: 1 1 0;
    width: 50%;
    min-width: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    border-right: none;
    background: transparent;
    display: flex;
    flex-direction: column;
}

.config-panel-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-border) transparent;
}

.config-panel-body > .config-card:last-child {
    margin-bottom: 0;
}

.history-panel {
    flex: 1 1 0;
    width: 50%;
    min-width: 0;
    padding: 0;
    height: 100%;
    min-height: 0;
    background: transparent;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.side-panel-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
    height: 100%;
    min-height: 0;
    overflow: visible;
}

.side-panel-stack > .config-card {
    margin-bottom: 0;
}

.titles-card {
    flex: 0 0 auto;
    max-height: min(36vh, 340px);
    min-height: 0;
    margin-bottom: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 20;
}

.titles-card .card-head,
.titles-card .titles-toolbar,
.titles-card .hint-text,
.titles-card .tabs,
.titles-card .btn {
    flex-shrink: 0;
}

.titles-toolbar {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 6px;
    overflow: visible;
    position: relative;
    z-index: 30;
}

.platform-multi-select {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 40;
}

.platform-multi-trigger {
    width: 100%;
    height: 100%;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--input-bg);
    font-size: 0.84rem;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.platform-multi-trigger:hover {
    border-color: var(--primary-border);
}

.platform-multi-trigger[aria-expanded="true"] {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-soft);
}

.platform-multi-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.platform-multi-chevron {
    flex-shrink: 0;
    color: var(--muted);
    font-size: 0.75rem;
}

.platform-multi-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    max-height: min(220px, 40vh);
    overflow-y: auto;
    padding: 6px;
}

.platform-multi-menu.is-fixed {
    position: fixed;
    right: auto;
}

.platform-multi-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 0.82rem;
    user-select: none;
}

.platform-multi-option:hover {
    background: var(--surface-2);
}

.platform-multi-option input {
    accent-color: var(--primary);
    flex-shrink: 0;
}

.titles-generate-btn {
    flex-shrink: 0;
    white-space: nowrap;
    min-height: 36px;
    padding-left: 14px;
    padding-right: 14px;
}

.titles-card .title-content {
    flex: 0 1 auto;
    min-height: 0;
    max-height: min(24vh, 220px);
    overflow-y: auto;
}

.titles-card .platform-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.history-card {
    flex: 1 1 0;
    min-height: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.history-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.history-card .history-list {
    flex: 0 1 auto;
    min-height: 0;
    overflow: visible;
}

.history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.history-head h2 { font-size: 1rem; font-weight: 600; }

.config-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}

.config-card.compact { padding: 14px 16px; }

.card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.card-head.sub { margin-top: 14px; justify-content: space-between; }
.card-head h2, .card-head h3 { font-size: 0.92rem; font-weight: 600; flex: 1; min-width: 0; }

.field-grid { display: grid; gap: 10px; }
.field-grid.two { grid-template-columns: 1fr 1fr; margin-bottom: 14px; }
.field-grid.three { grid-template-columns: repeat(3, 1fr); margin-bottom: 14px; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 0.75rem; color: var(--muted); font-weight: 500; }

.input, .select, .textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    font-size: 0.88rem;
    background: var(--input-bg);
}

.textarea { min-height: 64px; resize: vertical; margin-top: 0; }
.input-readonly,
.input[readonly] {
    background: var(--surface);
    color: var(--text);
    cursor: default;
}
.config-card > .input { margin-bottom: 12px; }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(176, 90, 90, 0.14);
}

.drop-zone {
    border: 1.5px dashed var(--border);
    border-radius: 10px;
    padding: 28px 16px;
    text-align: center;
    background: var(--surface);
    cursor: pointer;
    margin-bottom: 12px;
    transition: border-color 0.15s, background 0.15s;
}

/* A+ / 主图套图：参考图区紧凑，缩略图不必占满整行 */
.drop-zone:not(.studio-drop) {
    padding: 14px 12px;
}

.drop-zone:not(.studio-drop) .drop-hint {
    margin: 4px 0 10px;
}

.drop-zone:not(.studio-drop):has(.preview-grid:not(:empty)) {
    padding: 10px 12px;
    text-align: left;
}

.drop-zone:not(.studio-drop) .preview-area {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

.drop-zone:not(.studio-drop) .preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: auto;
    max-width: 100%;
}

.drop-zone:not(.studio-drop) .preview-item {
    width: 64px;
    height: 64px;
    aspect-ratio: unset;
}

.drop-zone:not(.studio-drop) .preview-item.is-selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-soft);
}

.drop-zone:not(.studio-drop) .preview-area .btn,
.drop-zone:not(.studio-drop) .studio-ref-actions {
    flex-shrink: 0;
    margin: 0;
}

.studio-ref-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.drop-zone.drag-over, .drop-zone:hover { border-color: var(--primary); background: var(--primary-soft); }
.drop-title { font-weight: 600; font-size: 0.92rem; }
.drop-hint { color: var(--muted); font-size: 0.78rem; margin: 6px 0 12px; }
.analyze-time-hint {
    margin: 8px 0 0;
    line-height: 1.45;
    text-align: center;
}

.preview-area { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 12px; }

.preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--input-bg);
}

.preview-item.is-previewable {
    cursor: zoom-in;
}

.preview-item.is-previewable .preview-remove {
    cursor: pointer;
}

.preview-item.is-previewable img {
    cursor: zoom-in;
    pointer-events: auto;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.72);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }

.preset-btn {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
}

.preset-btn.active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.preset-btn:hover:not(.active) {
    border-color: var(--primary-border);
    background: var(--surface-2);
    color: var(--text);
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.module-card {
    position: relative;
    display: block;
    padding: 8px 28px 8px 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    background: var(--input-bg);
    transition: border-color 0.15s, background 0.15s;
}

.module-card:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.module-card input {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--primary);
}

.module-card-title {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    padding-right: 4px;
}

.module-card-desc {
    display: block;
    margin-top: 2px;
    font-size: 0.68rem;
    color: var(--muted);
    line-height: 1.35;
}

.module-card.module-recommended:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.module-rec-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 0 4px;
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--primary-dark);
    background: var(--primary-muted);
    border-radius: 4px;
    vertical-align: middle;
}

.module-select-count,
.module-select-hint {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
}

.info-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 2px;
    padding: 0;
    font-size: 0.62rem;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1;
    color: var(--primary);
    border: 1px solid var(--primary-border);
    border-radius: 50%;
    background: var(--input-bg);
    cursor: pointer;
    vertical-align: middle;
}

.info-popover-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.module-type-head h2 {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--text);
}

.workspace-topbar h1,
.card-head h2,
.history-head h2 {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.analysis-head h2 {
    flex: 1;
    min-width: 0;
}

.info-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 80;
    width: min(340px, calc(100vw - 48px));
    padding: 12px 14px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.55;
    color: var(--text);
    text-align: left;
}

.info-popover.is-fixed {
    position: fixed;
    top: auto;
    left: auto;
    z-index: 1000;
    width: min(340px, calc(100vw - 24px));
}

.info-popover-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.info-popover-list li {
    margin-bottom: 8px;
}

.info-popover-list li:last-child {
    margin-bottom: 0;
}

.info-popover-list li::before {
    content: "· ";
    color: var(--muted);
}

.main-type-card {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 36px 10px 10px;
}

.main-type-card .module-card-body {
    flex: 1;
    min-width: 0;
}

.main-type-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.main-type-card .module-check-indicator {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 50%;
    background: var(--input-bg);
    transition: background 0.15s, border-color 0.15s;
}

.main-type-card:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.main-type-card:has(input:checked) .module-check-indicator {
    border-color: var(--primary);
    background: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2.5 6l2.5 2.5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 11px 11px;
}

.main-type-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.module-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    background: var(--input-bg);
    transition: all 0.15s;
}

.module-chip:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.module-chip input { accent-color: var(--primary); }

.generate-bar {
    flex-shrink: 0;
    position: relative;
    z-index: 5;
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 12px 0 14px;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 -6px 16px rgba(15, 23, 42, 0.06);
}

.generate-bar .btn {
    width: 100%;
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 500;
    min-height: 40px;
    box-sizing: border-box;
}

.generate-bar .btn-primary {
    border: 1px solid transparent;
}

.hint-text {
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 10px;
}

.generate-hint { font-size: 0.75rem; color: var(--muted); text-align: center; margin-top: 8px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-btn);
    border: none;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.is-loading:disabled {
    opacity: 1;
    cursor: wait;
}
.btn-primary.is-loading {
    box-shadow: 0 0 0 3px rgba(176, 90, 90, 0.2);
}
.btn-primary.is-loading .spinner {
    display: inline-block !important;
    flex-shrink: 0;
}
.btn-primary { background: var(--primary-gradient); color: var(--on-primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-gradient-hover); }

.btn-label-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.btn-point-cost {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: none;
}
.btn-point-cost-value {
    color: inherit;
    font-variant-numeric: tabular-nums;
}
.btn-point-cost svg {
    width: 15px;
    height: 15px;
    color: #67e8f9;
    flex-shrink: 0;
}
.btn-primary .btn-point-cost,
.btn-primary .btn-point-cost-value {
    color: #fff;
}
.btn-secondary .btn-point-cost,
.btn-secondary .btn-point-cost-value {
    color: var(--primary-dark);
}
.btn:disabled .btn-point-cost {
    opacity: 0.85;
}
.btn-secondary { background: var(--primary-soft); color: var(--primary-dark); border: 1px solid var(--primary-border); }
.btn-outline { background: transparent; color: var(--primary-dark); border: 1px solid var(--primary); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border); }
.btn-ghost:active:not(:disabled) { background: var(--surface); transform: scale(0.98); }
.btn-outline:hover:not(:disabled) { background: var(--primary-soft); }
.btn-outline:active:not(:disabled) { background: var(--primary-muted); transform: scale(0.98); }
.btn.is-loading { pointer-events: none; }
.analysis-head {
    justify-content: space-between;
    margin-bottom: 10px;
}

.analysis-head h2 {
    flex: 1;
}

.analysis-head .btn-reanalyze {
    margin-top: 0;
    flex-shrink: 0;
}

.btn-reanalyze { margin-top: 4px; }
.btn-reanalyze.is-loading {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(176, 90, 90, 0.15);
}
.btn-sm { padding: 6px 14px; font-size: 0.78rem; }
.btn-block { width: 100%; }
.btn-xl { width: 100%; padding: 14px 20px; font-size: 1rem; font-weight: 600; border-radius: var(--radius-btn); }

.badge {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-secondary { background: var(--surface-2); color: var(--muted); }
.badge-primary { background: var(--primary-soft); color: var(--primary-dark); }

.analysis-scroll {
    max-height: min(340px, 42vh);
    overflow-y: auto;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-elevated);
    scrollbar-width: thin;
    scrollbar-color: var(--primary-border) transparent;
}

.analysis-scroll::-webkit-scrollbar { width: 6px; }
.analysis-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-border);
    border-radius: 999px;
}

.analysis-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 0;
}

.analysis-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.analysis-head-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.analysis-edit-input,
.analysis-edit-text,
.analysis-edit-lines {
    width: 100%;
    font-size: 0.82rem;
}
.analysis-edit-lines {
    min-height: 96px;
    resize: vertical;
}
.history-preview-item.is-failed .preview-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: 1px dashed var(--border);
    min-height: 120px;
}
.history-preview-item.is-loading .preview-image-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--surface) 0%, var(--primary-soft) 100%);
    border: 1px solid var(--primary-border);
    min-height: 120px;
}
.history-preview-item.is-loading .preview-image-loading::after {
    display: none;
}
.preview-loading-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    z-index: 2;
}
.preview-loading-text {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
}
.preview-failed-body {
    text-align: center;
    padding: 12px;
    color: var(--muted, #6b7280);
    font-size: 0.78rem;
}
.preview-failed-body strong {
    display: block;
    color: var(--danger);
    margin-bottom: 6px;
}
.preview-retry-btn {
    margin-top: 8px;
}
.btn-cancel-generate {
    margin-top: 10px;
}
.analysis-item {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.8rem;
}

.analysis-item.full { grid-column: unset; }
.analysis-item .label { font-size: 0.68rem; color: var(--muted); margin-bottom: 3px; }

.tag-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag { background: var(--primary-gradient); color: #fff; padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; }

.history-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--muted);
    flex: 1;
}

.history-empty-art {
    width: 100%;
    max-width: 280px;
    height: 160px;
    margin: 0 auto 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fef2f1 0%, #f5f3ff 100%);
    border: 1px solid var(--border);
}

.history-empty h3 { color: var(--text); font-size: 1rem; margin-bottom: 6px; }
.history-empty p { font-size: 0.82rem; line-height: 1.6; }

#historyGenerating {
    flex-shrink: 0;
}

.history-item-card.is-generating .history-progress-panel {
    margin-top: 4px;
}

.history-item-card.is-generating .progress-panel-body {
    padding: 14px 14px 10px;
    gap: 12px;
}

.history-item-card.is-generating .progress-panel-spinner {
    width: 40px;
    height: 40px;
}

.history-failed-card {
    background: var(--danger-bg);
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 16px;
    color: var(--danger-text);
}

.history-failed-card strong {
    display: block;
    font-size: 0.92rem;
    margin-bottom: 8px;
}

.history-failed-card p {
    font-size: 0.82rem;
    line-height: 1.5;
    margin: 0;
}

.history-failed-hint {
    margin-top: 8px !important;
    color: var(--warning-text) !important;
    font-size: 0.78rem !important;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.history-date-divider {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 600;
    padding: 4px 2px 0;
}

.history-item-card {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.history-item-card.is-generating {
    border-color: var(--primary-border);
    background: linear-gradient(180deg, var(--panel) 0%, var(--primary-soft) 100%);
}

.history-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.history-item-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    flex: 1;
    min-width: 0;
}

.history-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 100%;
}

.history-item-actions .btn-cancel-generate,
.history-item-actions .btn-status-generating {
    box-sizing: border-box;
    height: 32px;
    min-width: unset;
    min-height: unset;
    padding: 0 12px;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1;
    border-radius: var(--radius-btn);
    flex-shrink: 0;
    white-space: nowrap;
    margin-top: 0;
    font-family: inherit;
}

.history-item-actions .btn-status-generating {
    width: auto;
    min-width: 6.75rem;
}

.history-item-actions .btn-cancel-generate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 6rem;
    border: 1px solid var(--primary-border);
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.history-item-actions .btn-status-generating {
    display: inline-grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    place-items: center;
    border: 1px solid transparent;
    background: var(--primary-gradient);
    color: #fff;
    cursor: default;
}

.history-item-actions .btn-status-generating:disabled {
    opacity: 1;
    cursor: default;
}

.history-item-actions .btn-status-generating .history-spinner.sm {
    grid-area: 1 / 1;
    justify-self: start;
    align-self: center;
}

.history-item-actions .btn-status-generating .btn-status-generating-text {
    grid-area: 1 / 1;
    justify-self: center;
    align-self: center;
    line-height: 1.2;
}

.history-item-actions .btn-download-all {
    width: auto;
    margin-bottom: 0;
    padding: 7px 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-history-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--panel);
    color: var(--muted);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-history-delete:hover {
    color: var(--danger-text);
    border-color: #fecaca;
    background: var(--danger-bg);
}

.preview-delete-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
}

.preview-delete-btn:hover {
    background: rgba(185, 28, 28, 0.88);
}

.btn-status-generating {
    cursor: default;
    white-space: nowrap;
}

.history-item-actions .btn-status-generating {
    min-width: 0;
    margin: 0;
}

.btn-status-generating-text {
    line-height: 1.2;
}

.btn-download-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-pill);
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 4px;
}

.btn-download-all:hover:not(:disabled) {
    border-color: var(--primary-border);
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.btn-download-all.is-disabled,
.btn-download-all:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.history-meta-tags,
.history-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.history-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 500;
    background: var(--surface-2);
    color: var(--muted);
    border: 1px solid var(--border);
}

.history-tag.time { background: var(--surface); }
.history-tag.warn {
    background: var(--warning-bg);
    color: var(--warning-text);
    border-color: #fcd34d;
}
.history-tag.done {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: #a7f3d0;
}
.history-tag.platform {
    background: var(--primary-soft);
    color: var(--primary-dark);
    border-color: var(--primary-border);
}

.history-scene-desc {
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 12px;
}

.history-scene-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.82rem;
    color: var(--text);
}

.history-mini-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border);
    cursor: zoom-in;
    flex-shrink: 0;
    pointer-events: auto;
}

.history-progress-panel {
    border: 1px solid var(--primary-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--input-bg);
}

.progress-panel-head {
    padding: 8px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-dark);
    background: var(--primary-soft);
    border-bottom: 1px solid var(--primary-muted);
}

.progress-panel-body {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 16px 12px;
}

.progress-panel-spinner {
    width: 52px;
    height: 52px;
    border: 3px solid var(--primary-muted);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.progress-panel-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.progress-panel-text strong {
    font-size: 0.92rem;
    color: var(--text);
}

.progress-message {
    font-size: 0.78rem;
    color: var(--muted);
}

.progress-sub {
    font-size: 0.72rem;
    color: var(--muted);
}

.progress-panel-bar {
    height: 4px;
    background: var(--primary-soft);
    margin: 0 16px 12px;
    border-radius: 999px;
    overflow: hidden;
}

.progress-panel-bar .progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.35s ease;
}

.progress-panel-workflow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px 12px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--muted);
}

.workflow-step.active {
    color: var(--primary-dark);
    font-weight: 700;
}

.workflow-step.done {
    color: var(--muted);
}

.workflow-arrow {
    color: var(--border);
    font-size: 0.7rem;
}

.history-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 14px;
}

/* 详情套图 / 主图套图：生成历史一行 3 张 */
.page-listing-set .history-preview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.history-preview-item {
    min-width: 0;
}

.preview-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.preview-image {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--preview-bg);
    position: relative;
}

.preview-image.is-previewable {
    cursor: zoom-in;
    aspect-ratio: 1;
}

.preview-image.is-previewable img {
    cursor: zoom-in;
    pointer-events: auto;
    position: relative;
    z-index: 0;
}

.preview-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0);
    transition: background 0.2s;
    pointer-events: none;
    z-index: 1;
}

.preview-image:hover::after {
    background: rgba(15, 23, 42, 0.12);
}

.preview-image-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.preview-image:hover .preview-image-overlay {
    opacity: 1;
    visibility: visible;
}

.preview-overlay-btn {
    pointer-events: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, background 0.15s;
}

.preview-image:hover .preview-overlay-btn {
    pointer-events: auto;
}

.preview-overlay-btn:hover {
    transform: scale(1.05);
}

.preview-view-btn {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--primary-dark);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
}

.preview-download-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
}

.preview-download-btn:hover {
    background: rgba(30, 41, 59, 0.92);
}

.preview-edit-btn {
    position: absolute;
    right: 10px;
    bottom: 10px;
    pointer-events: none;
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    background: rgba(15, 23, 42, 0.82);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    z-index: 3;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, background 0.15s;
}

.preview-image:hover .preview-edit-btn {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#studioDrop .preview-item.is-previewable,
#studioDrop .preview-item.is-previewable img,
.studio-drop .preview-item.is-previewable,
.studio-drop .preview-item.is-previewable img {
    cursor: zoom-in;
}

.preview-edit-btn:hover {
    background: rgba(15, 23, 42, 0.95);
}

.remake-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.remake-modal.show {
    display: flex;
}

.remake-modal-card {
    width: min(520px, 100%);
    background: var(--input-bg);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

.remake-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.remake-modal-head h3 {
    margin: 0;
    font-size: 1rem;
}

.remake-modal-close {
    border: none;
    background: transparent;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
}

.remake-modal-preview {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.remake-modal-label {
    margin: 10px 0 8px;
    font-size: 0.82rem;
    color: var(--muted);
}

.remake-modal-input {
    min-height: 88px;
    margin-bottom: 12px;
}

.remake-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.generating-live-grid {
    margin-bottom: 12px;
}

.history-spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--primary-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.history-spinner.sm {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.image-cell {
    aspect-ratio: 1;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.image-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }

.progress-fill { height: 100%; width: 0; background: var(--primary-gradient); transition: width 0.3s; }

.prompt-tabs { display: flex; gap: 6px; margin: 10px 0; }
.prompt-tab, .tab-btn {
    padding: 6px 16px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.prompt-tab:not(.active):hover,
.tab-btn:not(.active):hover {
    border-color: var(--primary-border);
    background: var(--primary-soft);
    color: var(--primary-dark);
}
.prompt-tab.active, .tab-btn.active { background: var(--primary-gradient); color: #fff; border-color: transparent; }

.prompt-editor-content { display: none; max-height: 280px; overflow-y: auto; }
.prompt-editor-content.active { display: block; }
.prompt-item { margin-bottom: 8px; }
.prompt-item label { font-size: 0.72rem; color: var(--muted); }
.prompt-item-meta {
    font-size: 0.68rem;
    color: var(--muted);
    margin-bottom: 4px;
}

.prompt-item textarea { width: 100%; min-height: 56px; margin-top: 2px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.78rem; }

.platform-checkboxes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.checkbox-label, .radio-label { font-size: 0.82rem; display: flex; align-items: center; gap: 4px; cursor: pointer; }
.title-lang-row { display: flex; gap: 12px; margin-bottom: 10px; }
.title-card { background: var(--surface); border-radius: 8px; padding: 14px; margin-top: 10px; font-size: 0.85rem; }
.title-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.keyword-list { display: flex; flex-wrap: wrap; gap: 4px; }
.bullet-list { list-style: none; font-size: 0.82rem; }
.bullet-list li::before { content: "✓ "; color: var(--success); }
.reasoning { margin-top: 8px; padding: 8px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 6px; font-size: 0.78rem; color: var(--muted); }

.spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.spinner-dark {
    border-color: rgba(232, 69, 60, 0.25);
    border-top-color: var(--primary);
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
    position: fixed; bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #111827; color: #fff;
    padding: 12px 22px; border-radius: var(--radius-pill);
    opacity: 0; transition: all 0.3s; z-index: 1000; font-size: 0.88rem;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* —— 图片生成板块 —— */
.studio-shell {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.studio-layout {
    display: grid;
    grid-template-columns: minmax(360px, 400px) minmax(0, 1fr) minmax(240px, 280px);
    gap: 16px;
    flex: 1;
    min-height: 0;
    padding: 16px;
    background: var(--bg);
}

/* 工具页（去背景/去水印/高清放大/图片翻译）：两栏布局，左侧栏与图片生成页同宽 */
.studio-layout.tool-layout {
    grid-template-columns: minmax(330px, 375px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
}
.studio-layout.tool-layout .studio-canvas-wrap {
    max-height: calc(100vh - 120px);
}

/* 图片生成页：左侧设置栏（约为原宽度的 75%）+ 右侧大画布 */
.studio-layout:not(.tool-layout) {
    grid-template-columns: minmax(330px, 375px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
}
.studio-layout:not(.tool-layout) .studio-canvas-wrap {
    max-height: calc(100vh - 120px);
}
.studio-sidebar,
.studio-history {
    overflow-y: auto;
    max-height: calc(100vh - 120px);
    min-width: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-border) transparent;
}
.studio-sidebar::-webkit-scrollbar,
.studio-history::-webkit-scrollbar {
    width: 6px;
}
.studio-sidebar::-webkit-scrollbar-thumb,
.studio-history::-webkit-scrollbar-thumb {
    background: var(--primary-border);
    border-radius: 999px;
}
.studio-add-ref-btn {
    margin-top: 8px;
}

.studio-ref-actions .btn.active-ref {
    border-color: var(--primary);
    color: var(--primary-dark);
    background: var(--primary-soft);
}
.preview-ref-btn.is-active-ref {
    border-color: var(--primary);
    color: var(--primary-dark);
    background: var(--primary-soft);
}
.studio-sidebar .config-card,
.studio-history .config-card {
    width: 100%;
}
.studio-sidebar .select,
.studio-sidebar .textarea,
.studio-sidebar .btn-block {
    width: 100%;
    min-width: 0;
}
.studio-generate-prompt,
.studio-region-prompt {
    min-height: 90px;
}
.studio-generate-prompt {
    margin-bottom: 8px;
}
.studio-region-prompt {
    margin-bottom: 10px;
}
.studio-sidebar .config-card > .field + .studio-region-prompt,
.studio-sidebar .config-card > .field + .studio-generate-prompt {
    margin-top: 12px;
}
.studio-batch-row {
    margin-bottom: 0;
}
.studio-sidebar .config-card > .field:has(#studioModel) + .field {
    margin-top: 4px;
}
.studio-sidebar .config-card > .field:has(.studio-batch-row) {
    margin-bottom: 0;
}
.studio-sidebar .config-card > .field:has(.studio-batch-row) + .studio-spec-row {
    margin-top: 4px;
}
.studio-batch-row .preset-btn {
    flex: 1;
    min-width: 0;
    text-align: center;
}
.studio-ref-hint {
    margin: 0 0 10px;
    font-size: 0.75rem;
    line-height: 1.45;
}
.studio-image-stack.studio-has-ref::before {
    content: "参考图";
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 6;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--primary-gradient);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}
.studio-sidebar .select {
    padding-right: 28px;
}
.studio-field-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}
.studio-spec-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 10px;
}
.studio-spec-row .field {
    min-width: 0;
    gap: 4px;
}
.studio-spec-row .field span {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    margin: 0;
}
.studio-spec-row .select {
    width: 100%;
    min-width: 0;
}

/* 工具页：小标题与下拉框间距对齐图片生成页 */
.tool-layout .studio-sidebar .config-card > .field,
.tool-layout .tool-settings-panel > .field {
    gap: 4px;
}
.tool-layout .studio-sidebar .config-card > .field > span,
.tool-layout .tool-settings-panel > .field > span {
    margin: 0;
}
.tool-layout .studio-sidebar .config-card > .field:has(#toolModel) + .studio-spec-row {
    margin-top: 4px;
}
.tool-layout .studio-sidebar .config-card > .studio-spec-row {
    margin-bottom: 0;
}
.tool-layout .tool-settings-panel {
    margin-top: 4px;
}
body[data-tool-id="去水印"] .tool-layout .tool-settings-panel,
body[data-tool-id="高清放大"] .tool-layout .tool-settings-panel {
    margin-top: 12px;
}
body[data-tool-id="去水印"] .tool-settings-panel .btn-block,
body[data-tool-id="高清放大"] .tool-settings-panel .btn-block {
    margin-top: 0;
}

.studio-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 8px 0 12px;
    font-size: 0.82rem;
    line-height: 1.45;
}
.studio-check input {
    flex-shrink: 0;
    margin-top: 3px;
}
.studio-sidebar .btn-block {
    white-space: nowrap;
}
.studio-canvas-wrap {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 12px;
}
.studio-canvas-stage {
    flex: 1;
    display: grid;
    place-items: center;
    min-height: 0;
    position: relative;
    overflow: hidden;
}
.studio-canvas-loading {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(3px);
    border-radius: 8px;
}
.studio-canvas-loading[hidden] {
    display: none !important;
}
.studio-canvas-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--primary-muted);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}
.studio-canvas-loading-text {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
    padding: 0 16px;
}
.studio-canvas-stage.is-canvas-loading > .studio-empty,
.tool-canvas-stage.is-canvas-loading > .studio-empty {
    visibility: hidden;
}
.studio-empty { color: var(--muted); text-align: center; }
.studio-empty-hint { font-size: 13px; margin-top: 8px; opacity: 0.85; }
.studio-canvas-video {
    width: min(100%, 720px);
    max-height: 100%;
}
.studio-canvas-video video {
    width: 100%;
    max-height: min(70vh, 520px);
    border-radius: 10px;
    background: #111;
}
.studio-video-actions-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.studio-history-card--video {
    min-width: 88px;
    min-height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.studio-history-thumb--video {
    cursor: pointer;
    position: relative;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.studio-history-strip .studio-history-preview--video {
    width: auto;
    max-width: 140px;
}
.studio-history-strip .studio-history-thumb--video {
    width: auto;
    height: auto;
    min-width: 72px;
    min-height: 48px;
    max-width: 132px;
    max-height: 96px;
    aspect-ratio: unset;
}
.studio-history-thumb--video video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    pointer-events: none;
    background: #111;
}
.studio-history-thumb--video .studio-history-poster {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    pointer-events: none;
    background: #111;
}
.preview-image.studio-history-thumb--video img.studio-history-poster {
    object-fit: contain;
}
.studio-history-video-badge {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.studio-canvas-inner {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: auto;
}
.studio-canvas-inner.preview-image,
.studio-image-stack.preview-image {
    aspect-ratio: unset;
    border: none;
    background: transparent;
}
.studio-image-stack.preview-image {
    border-radius: 8px;
    overflow: visible;
}
.studio-image-stack {
    position: relative;
    display: inline-block;
    line-height: 0;
    max-width: 100%;
    max-height: 100%;
    flex-shrink: 0;
    vertical-align: middle;
}
/* 覆盖 .preview-image img 的 cover 裁剪，画布需完整显示全图 */
.studio-image-stack.preview-image img,
.studio-image-stack img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    border-radius: 8px;
    vertical-align: top;
    position: relative;
    z-index: 2;
    cursor: zoom-in;
}
.studio-image-stack #studioMaskCanvas,
.studio-image-stack #reMaskCanvas {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    z-index: 3;
}
.studio-canvas-inner:not(.studio-editing) .studio-image-stack #studioMaskCanvas,
.studio-canvas-inner:not(.studio-editing) .studio-image-stack #reMaskCanvas {
    pointer-events: none;
    z-index: 1;
}
.studio-canvas-inner.studio-editing .studio-image-stack #studioMaskCanvas,
.studio-canvas-inner.studio-editing .studio-image-stack #reMaskCanvas {
    pointer-events: auto;
    z-index: 5;
    cursor: crosshair;
}
.studio-image-stack .preview-image-overlay,
.studio-image-stack .preview-edit-btn,
.studio-image-stack .preview-ref-btn {
    z-index: 4;
}
.studio-canvas-inner:not(.studio-editing) #studioMaskCanvas,
.studio-canvas-inner:not(.studio-editing) #reMaskCanvas {
    pointer-events: none;
}
.studio-canvas-inner.studio-editing .studio-image-stack .preview-image-overlay,
.studio-canvas-inner.studio-editing .studio-image-stack .preview-edit-btn,
.studio-canvas-inner.studio-editing .studio-image-stack .preview-ref-btn {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
.preview-ref-btn {
    position: absolute;
    left: 10px;
    bottom: 10px;
    pointer-events: auto;
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    background: var(--primary-gradient-hover);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 3;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, background 0.15s;
}
.preview-image:hover .preview-ref-btn {
    opacity: 1;
    visibility: visible;
}
.preview-ref-btn:hover {
    background: var(--primary-gradient-hover);
}
.studio-history-list { display: flex; flex-direction: column; gap: 12px; }
.studio-canvas-history {
    flex-shrink: 0;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.studio-canvas-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.studio-canvas-history-head h2 {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.studio-history-toggle {
    flex-shrink: 0;
    font-size: 0.75rem;
    padding: 4px 10px;
}
.studio-canvas-history.is-collapsed .studio-history-list,
.studio-canvas-history.is-collapsed .studio-history-empty {
    display: none;
}
.studio-canvas-history.is-collapsed {
    margin-top: 8px;
    padding-top: 8px;
}
.studio-canvas-history.is-collapsed .studio-canvas-history-head {
    margin-bottom: 0;
}
.studio-history-strip {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    min-height: 108px;
    scrollbar-width: thin;
}
.studio-history-strip::-webkit-scrollbar {
    height: 6px;
}
.studio-history-strip::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
}
.studio-history-strip .studio-history-preview {
    flex: 0 0 auto;
    width: 88px;
}
.studio-history-strip .studio-history-preview .preview-label {
    font-size: 0.68rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--muted);
}
.studio-history-strip .studio-history-thumb {
    width: 88px;
    height: 88px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--input-bg);
}
.studio-history-strip .studio-history-thumb.is-active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-soft);
}
.studio-history-strip .preview-edit-btn,
.studio-history-strip .preview-ref-btn {
    display: none;
}
.studio-history-strip .preview-delete-btn,
.studio-history-strip .preview-download-btn {
    top: 2px;
    width: 26px;
    height: 26px;
}
.studio-history-strip .preview-delete-btn {
    left: 2px;
}
.studio-history-strip .preview-download-btn {
    right: 2px;
}
.studio-history-strip .preview-overlay-btn svg {
    width: 14px;
    height: 14px;
}
.studio-history-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 88px;
    color: var(--muted);
    font-size: 0.78rem;
}
.studio-history-preview .preview-label {
    font-size: 0.75rem;
    margin-bottom: 4px;
}
.studio-history-thumb {
    aspect-ratio: 1;
    cursor: pointer;
}
.studio-history-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
}
#studioMaskCanvas,
#reMaskCanvas {
    cursor: crosshair;
    touch-action: none;
}

.tool-layout .tool-canvas-stage {
    flex: 1;
    display: grid;
    place-items: center;
    min-height: 0;
    position: relative;
    overflow: hidden;
}
.tool-layout .tool-result-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
}
.tool-layout .tool-result-pane {
    position: relative;
    min-height: 0;
    padding: 0;
    border: none;
    background: transparent;
    overflow: visible;
    line-height: 0;
}
.tool-layout .tool-result-pane.has-alpha {
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
        linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    border-radius: 8px;
}
.tool-layout .tool-result-pane img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    border-radius: 8px;
    cursor: zoom-in;
}

.tool-layout .tool-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    flex: 1;
    min-height: 0;
    padding: 16px;
}

.tool-pane-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 8px;
}

.tool-pane-body {
    position: relative;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tool-pane-body.has-alpha {
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
        linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.tool-pane-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.tool-opt {
    display: none;
}
.tool-settings-panel {
    margin-top: 4px;
    padding-top: 0;
    border-top: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.tool-settings-panel > .field {
    margin: 0;
    gap: 4px;
}
.tool-settings-panel > .field > span {
    margin: 0;
}
.tool-settings-panel .btn-block {
    margin-top: 2px;
}
.studio-tool-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.studio-brush-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.studio-brush-row[hidden] {
    display: none !important;
}
.studio-brush-label {
    font-size: 0.82rem;
    color: var(--muted);
    flex-shrink: 0;
}
.studio-brush-presets {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    flex: 1;
}
.brush-size-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.brush-size-btn:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}
.brush-size-btn.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-soft);
    background: var(--primary-soft);
    color: var(--primary-dark);
}
.brush-size-dot {
    display: block;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.brush-size-btn[data-brush="10"] .brush-size-dot {
    width: 8px;
    height: 8px;
}
.brush-size-btn[data-brush="18"] .brush-size-dot {
    width: 14px;
    height: 14px;
}
.brush-size-btn[data-brush="32"] .brush-size-dot {
    width: 22px;
    height: 22px;
}
.studio-tool.active { background: var(--primary-gradient); color: #fff; border-color: transparent; }
.studio-drop { cursor: pointer; padding: 20px; text-align: center; }
.studio-drop.has-preview { padding: 12px; }
.studio-drop.dragover { border-color: var(--primary); background: var(--primary-soft); }
.studio-upload-preview {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--input-bg);
}
.studio-upload-preview img {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    display: block;
    background: var(--input-bg);
    cursor: zoom-in;
    pointer-events: auto;
}
.studio-upload-preview-hint {
    margin: 0;
    padding: 8px 10px;
    font-size: 0.72rem;
    color: var(--muted);
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
}
.studio-upload-preview-hint:hover {
    color: var(--primary-dark);
    background: var(--primary-soft);
}
.studio-canvas-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.studio-placeholder {
    margin: 40px auto;
    max-width: 480px;
    text-align: center;
    padding: 48px 24px;
    background: var(--input-bg);
    border-radius: 16px;
    border: 1px solid var(--border);
}
.studio-placeholder h2 { margin-top: 0; }

@media (max-width: 1099px) {
    body { overflow: auto; }
    .app-shell {
        height: auto;
        min-height: 100dvh;
    }
    .app-header-inner {
        height: auto;
        min-height: 72px;
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }
    .app-header-announce {
        order: 3;
        flex: 1 1 100%;
    }
    .workspace-shell {
        height: auto;
        overflow: visible;
    }
    .workspace-panels {
        flex-direction: column;
        overflow: visible;
        min-height: auto;
    }
    .config-panel,
    .history-panel {
        width: 100%;
        flex: none;
        height: auto;
        min-height: 240px;
        max-height: none;
    }
    .side-panel-stack {
        height: auto;
        min-height: 0;
    }
    .titles-card {
        max-height: none;
    }
    .studio-layout,
    .studio-layout.tool-layout,
    .studio-layout:not(.tool-layout) {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .studio-sidebar,
    .studio-history {
        max-height: none;
    }
    .studio-layout:not(.tool-layout) .studio-canvas-wrap,
    .studio-layout.tool-layout .studio-canvas-wrap {
        max-height: none;
        min-height: 320px;
    }
    .nav-rail {
        width: 200px;
    }
}

@media (max-width: 960px) {
    .studio-layout { grid-template-columns: 1fr; }
    .studio-sidebar, .studio-history { max-height: none; }
    .studio-layout:not(.tool-layout) .studio-canvas-wrap {
        max-height: none;
    }
}

.lightbox {
    position: fixed; inset: 0; background: rgba(0,0,0,0.88);
    display: flex; align-items: center; justify-content: center; z-index: 15000; cursor: zoom-out;
}
.lightbox img { max-width: 92vw; max-height: 92vh; object-fit: contain; pointer-events: none; }

@media (max-width: 720px) {
    body { overflow: auto; }
    .app-shell {
        height: auto;
        min-height: 100dvh;
    }
    .app-header-inner {
        padding: 8px 12px;
        gap: 8px;
        min-height: 64px;
    }
    .app-header-brand .brand-name {
        font-size: 0.95rem;
    }
    .app-header-announce {
        padding: 8px 12px;
    }
    .app-announce-badge {
        display: none;
    }
    .app-header-btn,
    .app-header-pill {
        width: 44px;
        height: 44px;
    }
    .app-header-points {
        width: auto;
        min-width: 44px;
        padding: 0 10px;
        gap: 4px;
    }
    .app-header-points #pointsValue {
        font-size: 0.82rem;
    }
    .app-header-user #accountLabel {
        display: none;
    }
    .workspace {
        flex-direction: column;
        height: auto;
        min-height: 0;
        min-width: 0;
    }
    .workspace-shell { height: auto; overflow: visible; }
    .nav-rail {
        width: 100%;
        display: flex;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 10px 12px;
    }
    .nav-brand { display: none; }
    .nav-group {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }
    .nav-group-tools,
    .nav-group-space {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }
    .nav-group-title { display: none; }
    .nav-item {
        flex-shrink: 0;
        white-space: nowrap;
        margin-bottom: 0;
        padding: 8px 12px;
    }
    .workspace-panels { flex-direction: column; overflow: visible; padding: 12px; gap: 12px; }
    .config-panel, .history-panel { width: 100%; }
    .module-grid { grid-template-columns: 1fr; }
    .preview-grid { grid-template-columns: repeat(2, 1fr); }
    .field-grid.three, .field-grid.two { grid-template-columns: 1fr; }
    .workspace-topbar { padding: 14px 16px 10px; }
    .workspace-topbar h1 { font-size: 1.12rem; }
    .app-modal { padding: 12px; align-items: flex-end; }
    .app-modal-card { width: 100%; max-height: calc(100dvh - 24px); overflow: auto; }
}

/* ── Task monitor ── */
body.monitor-standalone {
    margin: 0;
    min-height: 100vh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--bg);
}
.monitor-layout {
    max-width: min(100%, 1680px);
    margin: 0 auto;
    padding: 16px 24px 48px;
    min-height: 100vh;
}
.monitor-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg);
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.monitor-main {
    padding-top: 8px;
}
.monitor-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 4px 4px;
}
.monitor-tab {
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--muted);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}
.monitor-tab:hover {
    color: var(--text);
    border-color: var(--primary-border);
}
.monitor-tab.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
    border-color: var(--primary-border);
}
.monitor-tab-panel {
    display: none;
}
.monitor-tab-panel.active {
    display: block;
}
.monitor-grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.monitor-panels-single {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}
.monitor-panel-scroll {
    max-height: none;
    overflow: visible;
}
.monitor-shell { padding: 0; overflow: visible; }
.monitor-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px 0;
    flex-shrink: 0;
    margin-bottom: 16px;
}
.monitor-topbar-title h1 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.3;
}
.monitor-topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.monitor-subtitle { color: var(--muted); font-size: 0.875rem; margin: 4px 0 0; }
.monitor-overview-meta {
    margin: 0 0 12px;
    font-size: 0.78rem;
    color: var(--muted);
}
.monitor-alerts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.monitor-alert {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--panel);
}
.monitor-alert-warn {
    border-color: var(--warning-text);
    background: var(--warning-bg);
    color: var(--warning-text);
}
.monitor-alert-error {
    border-color: var(--danger-text);
    background: var(--danger-bg);
    color: var(--danger-text);
}
.monitor-overview-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.monitor-overview-block { margin-bottom: 0; }
.monitor-table-compact th,
.monitor-table-compact td { padding: 8px 8px; }
.monitor-section-link { flex-shrink: 0; }
.monitor-topbar-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.monitor-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--muted); cursor: pointer; user-select: none; }
.monitor-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.monitor-grid-business { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.monitor-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.monitor-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 8px 0 12px;
    color: var(--text);
}
.monitor-subtable-wrap { max-height: 220px; margin-bottom: 20px; }
.monitor-ledger-panel { margin-top: 16px; }
.monitor-ledger-wrap { max-height: 320px; }
.monitor-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.monitor-card-label { font-size: 0.75rem; color: var(--muted); margin-bottom: 6px; }
.monitor-card-value { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.monitor-card-hint { font-size: 0.72rem; color: var(--muted); margin-top: 6px; }
.monitor-panels { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.monitor-panels.monitor-panels-single {
    grid-template-columns: minmax(0, 1fr);
}
.monitor-gen-panel .monitor-table-wrap {
    width: 100%;
}
.monitor-gen-panel .monitor-table {
    min-width: 100%;
    table-layout: auto;
}
.monitor-gen-panel .monitor-message {
    max-width: 320px;
}
.monitor-gen-panel .monitor-table th,
.monitor-gen-panel .monitor-table td {
    padding: 10px 10px;
}
.monitor-panel { margin-bottom: 0; }
.monitor-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.monitor-gen-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 12px;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}
.monitor-gen-filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 108px;
}
.monitor-gen-filter-grow { flex: 1 1 160px; min-width: 140px; }
.monitor-gen-filter > span {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 600;
}
.monitor-gen-filters .input-sm {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 0.8125rem;
}
.monitor-gen-filters select.input-sm {
    padding-right: 2rem;
    background-position: right 0.55rem center;
}
.monitor-image-item video {
    display: block;
    width: 100%;
    max-height: 360px;
    border-radius: var(--radius-sm, 6px);
    background: #000;
}
.monitor-table-wrap { overflow-x: auto; }
.monitor-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.monitor-table th, .monitor-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.monitor-table th { position: sticky; top: 0; background: var(--panel); color: var(--muted); font-weight: 600; z-index: 1; }
.monitor-table tr.is-stuck { background: var(--warning-bg); }
.monitor-empty { text-align: center; color: var(--muted); padding: 24px !important; }
.monitor-status { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.monitor-status.is-active { background: var(--primary-soft); color: var(--primary-dark); }
.monitor-status.is-warn { background: var(--warning-bg); color: var(--warning-text); }
.monitor-status.is-error { background: var(--danger-bg); color: var(--danger-text); }
.monitor-status.is-ok { background: var(--success-bg); color: var(--success-text); }
.monitor-status.is-muted { background: var(--surface-2); color: var(--muted); }
.monitor-tag.warn { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 999px; background: var(--warning-bg); color: var(--warning-text); font-size: 0.68rem; font-weight: 700; }
.monitor-message { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.monitor-actions { white-space: nowrap; }
.monitor-link { border: none; background: none; color: var(--primary-dark); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.monitor-side { display: flex; flex-direction: column; gap: 16px; }
.monitor-kv { display: grid; grid-template-columns: 88px 1fr; gap: 8px 10px; font-size: 0.8125rem; }
.monitor-kv dt { color: var(--muted); }
.monitor-kv dd { margin: 0; word-break: break-all; }
.monitor-events { max-height: 320px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.monitor-event { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 0.78rem; }
.monitor-event-time { color: var(--muted); margin-bottom: 2px; }
.monitor-event-body { display: flex; gap: 8px; flex-wrap: wrap; }
.monitor-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; }
.monitor-modal[hidden] { display: none !important; }
.monitor-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.35); }
.monitor-modal-card { position: relative; width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--panel); border-radius: var(--radius); box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18); display: flex; flex-direction: column; }
.monitor-modal-card-wide { width: min(960px, calc(100vw - 32px)); }
.monitor-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.monitor-modal-body { margin: 0; padding: 16px; overflow: auto; font-size: 0.78rem; line-height: 1.45; background: var(--surface); }
.monitor-modal-body-split { display: flex; flex-direction: column; gap: 12px; }
.monitor-modal-json { margin: 0; padding: 12px; overflow: auto; font-size: 0.78rem; line-height: 1.45; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; max-height: 40vh; }
.monitor-panel-hint { margin: 0; color: var(--muted); font-size: 0.8125rem; }
.monitor-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.monitor-image-item { display: flex; flex-direction: column; gap: 6px; }
.monitor-image-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: #fff; cursor: zoom-in; }
.monitor-image-item figcaption { font-size: 0.75rem; color: var(--muted); text-align: center; word-break: break-all; }
.monitor-view-link { color: var(--primary); font-weight: 600; background: none; border: none; padding: 0; cursor: pointer; font-size: inherit; }
.monitor-view-link:hover { text-decoration: underline; }
.monitor-view-link[disabled] { color: var(--muted); cursor: default; text-decoration: none; }

.monitor-whitelist-card .card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.monitor-whitelist-status {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--muted);
}
.monitor-whitelist-hint {
    margin: 0 0 14px;
    font-size: 0.8125rem;
    color: var(--muted);
    line-height: 1.6;
}
.monitor-whitelist-field {
    margin-bottom: 14px;
}
.monitor-whitelist-input {
    width: 100%;
    min-height: 280px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.55;
}
.monitor-whitelist-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.monitor-whitelist-msg {
    font-size: 0.8125rem;
    font-weight: 600;
}
.monitor-whitelist-msg.is-ok { color: var(--success-text); }
.monitor-whitelist-msg.is-error { color: var(--danger-text); }
.monitor-whitelist-extra {
    margin-top: 16px;
    font-size: 0.8125rem;
    color: var(--muted);
    line-height: 1.6;
}
.monitor-whitelist-extra p { margin: 0 0 8px; }
.monitor-whitelist-warn { color: var(--warning-text); }

.monitor-points-adjust-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.monitor-points-adjust-note {
    grid-column: 1 / -1;
}

@media (max-width: 960px) {
    .monitor-points-adjust-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1200px) {
    .monitor-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .monitor-grid-business,
    .monitor-grid-5,
    .monitor-grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .monitor-panels { grid-template-columns: 1fr; }
    .monitor-overview-sections { grid-template-columns: 1fr; }
}

/* —— 邀请有礼 —— */
.invite-shell {
    overflow: auto;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.invite-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 28px 24px 40px;
    background: var(--bg);
    min-height: 0;
}
.invite-card {
    width: min(920px, 100%);
    padding: 28px 32px 24px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}
.invite-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.invite-gift-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary-dark);
}
.invite-card-head h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.invite-rules {
    margin: 0 0 22px;
    padding-left: 1.2em;
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.7;
}
.invite-rules li + li {
    margin-top: 6px;
}
.invite-share {
    background: linear-gradient(180deg, rgba(176, 90, 90, 0.05) 0%, rgba(148, 74, 74, 0.03) 100%);
    border: 1px solid var(--primary-border);
    border-radius: 14px;
    padding: 18px 18px 16px;
    margin-bottom: 22px;
}
.invite-share h2 {
    margin: 0 0 6px;
    font-size: 0.98rem;
    font-weight: 700;
}
.invite-share-hint {
    margin: 0 0 14px;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.55;
}
.invite-link-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.invite-link-field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
}
.invite-link-icon {
    color: var(--muted);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}
.invite-link-input {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 10px 0;
    min-width: 0;
    font-size: 0.84rem;
}
.invite-link-input:focus {
    outline: none;
    box-shadow: none;
}
.invite-link-row .btn-primary {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0 18px;
}
.invite-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
}
.invite-stat {
    display: flex;
    gap: 14px;
    padding: 20px 22px;
    background: var(--panel);
}
.invite-stat + .invite-stat {
    border-left: 1px solid var(--border);
}
.invite-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.invite-stat-icon-user {
    background: rgba(176, 90, 90, 0.1);
    color: var(--primary-dark);
}
.invite-stat-icon-points {
    background: rgba(148, 74, 74, 0.08);
    color: var(--primary-dark);
}
.invite-stat-label {
    margin: 0 0 6px;
    font-size: 0.82rem;
    color: var(--muted);
}
.invite-stat-value {
    margin: 0 0 6px;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}
.invite-stat-sub {
    margin: 0;
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.5;
}
.invite-footnote {
    margin: 0;
    text-align: center;
    font-size: 0.78rem;
    color: var(--muted);
}
.invite-records-link-wrap {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}
.invite-records-link {
    border: 1px solid var(--primary-border);
    background: var(--primary-soft);
    color: var(--primary-dark);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    transition: background 0.15s, border-color 0.15s;
}
.invite-records-link:hover {
    text-decoration: none;
    background: var(--primary-muted);
    border-color: var(--primary);
}
.invite-records-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: center;
}
.invite-records-modal[hidden] {
    display: none !important;
}
.invite-records-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
}
.invite-records-card {
    position: relative;
    width: min(520px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
}
.invite-records-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.invite-records-list {
    padding: 0 16px 16px;
    overflow: auto;
    max-height: 420px;
}
.invite-records-empty {
    margin: 0;
    padding: 24px 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.84rem;
}
.invite-record-row {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.invite-record-row:last-child {
    border-bottom: none;
}
.invite-record-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}
.invite-record-email {
    font-size: 0.88rem;
    font-weight: 600;
}
.invite-record-status {
    font-size: 0.75rem;
    color: var(--primary-dark);
    background: var(--primary-soft);
    padding: 2px 8px;
    border-radius: 999px;
}
.invite-record-meta {
    font-size: 0.75rem;
    color: var(--muted);
}

.app-points-divider {
    margin: 1.25rem 0 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border, #e8e8e8);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text, #222);
}

.app-points-invite {
    margin-top: 0.25rem;
}

.app-points-invite .app-invite-rules {
    margin: 0 0 0.75rem;
    padding-left: 1.1rem;
    font-size: 0.82rem;
    color: var(--muted, #666);
    line-height: 1.55;
}

.app-points-invite .invite-link-row {
    margin-bottom: 0.75rem;
}

.app-invite-stats-compact {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.app-invite-stats-compact .invite-stat {
    padding: 0.65rem 0.75rem;
}

.app-invite-stats-compact .invite-stat-value {
    font-size: 1.25rem;
}

.app-points-invite--ledger {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border, #e8e8e8);
}

.app-points-invite--standalone {
    margin-top: 0;
}

@media (max-width: 720px) {
    .invite-card {
        padding: 20px 18px 18px;
    }
    .invite-stats {
        grid-template-columns: 1fr;
    }
    .invite-stat + .invite-stat {
        border-left: none;
        border-top: 1px solid var(--border);
    }
    .invite-link-row {
        flex-direction: column;
    }
}

/* —— 首页 —— */
body.home-page {
    background: #ffffff;
    color: var(--text);
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
}

body.home-page .app-header {
    position: relative;
    z-index: 2;
    background: transparent;
    border-bottom: none;
    backdrop-filter: none;
}

body.home-page .app-header-announce {
    display: none;
}

body.home-page .app-header-inner {
    justify-content: space-between;
}

body.home-page .brand-lockup-header .brand-logo {
    width: 50px;
    height: 50px;
}

body.home-page .brand-lockup-header .brand-name {
    font-size: 1.57rem;
}

.home-shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.home-shell > .home-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 100vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(ellipse 130% 90% at 50% -18%, rgba(255, 250, 250, 0.94) 0%, transparent 52%),
        radial-gradient(ellipse 55% 42% at 88% 12%, rgba(255, 255, 255, 0.55) 0%, transparent 48%),
        radial-gradient(ellipse 45% 38% at 8% 22%, rgba(255, 240, 240, 0.42) 0%, transparent 50%),
        radial-gradient(ellipse 80% 60% at 10% 0%, rgba(var(--primary-rgb), 0.22) 0%, transparent 58%),
        radial-gradient(ellipse 60% 50% at 92% 18%, rgba(var(--primary-deep-rgb), 0.14) 0%, transparent 52%),
        radial-gradient(ellipse 70% 50% at 50% 100%, rgba(var(--primary-rgb), 0.08) 0%, transparent 55%),
        linear-gradient(
            168deg,
            #faf5f5 0%,
            #ecd8d8 22%,
            #f5e8e8 44%,
            #dfc8c8 66%,
            #eedede 82%,
            #eedede 100%
        );
}

.home-shell > .home-hero-bg::after {
    content: "";
    position: absolute;
    inset: -10% -5%;
    background: linear-gradient(
        118deg,
        transparent 36%,
        rgba(255, 252, 252, 0.5) 47%,
        rgba(255, 230, 230, 0.24) 53%,
        transparent 64%
    );
    opacity: 0.58;
    pointer-events: none;
}

.home-shell > .home-hero-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
    background-size: 48px 48px;
    opacity: 0.35;
    pointer-events: none;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, transparent 72%);
}

.home-main {
    position: relative;
    z-index: 1;
    flex: 1;
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding-bottom: 56px;
}

.home-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 28px;
    margin: 8px 0 12px;
    padding: 0 8px;
}

.home-nav-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    background: none;
    border: none;
    padding: 6px 2px;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s;
}

.home-nav-link:hover,
.home-nav-link:focus-visible {
    color: var(--primary-dark);
}

/* Hero */
.home-hero {
    position: relative;
    margin: 0 -20px 48px;
    padding: 24px 20px 56px;
}

.home-hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
    gap: 40px;
    align-items: center;
}

.home-hero--center {
    text-align: center;
    padding-top: 12px;
}

.home-hero--center .home-lead {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.home-hero-actions--center {
    justify-content: center;
}

.home-title-line {
    display: block;
}

.home-title-accent {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.home-section-head--center {
    text-align: center;
    margin-bottom: 24px;
}

.home-section-head--center p {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* Showcase placeholders */
.home-showcase-board {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--border);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

.home-showcase-panel,
.home-showcase-tile {
    border-radius: 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    overflow: hidden;
}

a.home-showcase-panel,
a.home-showcase-tile {
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

a.home-showcase-panel:hover,
a.home-showcase-tile:hover {
    border-color: var(--primary-border);
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.12);
    transform: translateY(-1px);
}

.home-showcase-panel--long,
.home-showcase-panel--hero {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    width: 100%;
}

.home-showcase-long-viewport {
    max-height: min(640px, 72vh);
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 10px;
    border: 1px dashed var(--primary-border);
    background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.08) 0%, rgba(255, 255, 255, 0.95) 100%);
    scrollbar-width: thin;
    scrollbar-color: var(--primary-border) transparent;
}

.home-showcase-long-viewport::-webkit-scrollbar {
    width: 6px;
}

.home-showcase-long-viewport::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--primary-border);
}

.home-showcase-long-strip {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    min-height: 960px;
}

.home-showcase-long-section {
    flex: 1;
    min-height: 168px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    background:
        linear-gradient(145deg, rgba(var(--primary-rgb), 0.16) 0%, rgba(255, 255, 255, 0.92) 55%, rgba(var(--primary-deep-rgb), 0.1) 100%);
    border: 1px dashed rgba(var(--primary-rgb), 0.25);
}

.home-showcase-long-img {
    display: block;
    width: 100%;
    height: auto;
}

.home-showcase-long-note {
    margin: 0;
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
}

.home-showcase-panel-head,
.home-showcase-tile {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.home-showcase-tile {
    padding: 12px;
}

.home-showcase-panel-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text);
}

.home-showcase-tag {
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--primary-dark);
    background: var(--primary-soft);
    border: 1px solid var(--primary-border);
}

.home-showcase-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-content: start;
}

.home-showcase-tile-num {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--primary);
}

.home-showcase-tile-label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text);
}

.home-showcase-tile--wide,
.home-showcase-tile--tools {
    grid-column: 1 / -1;
}

.home-showcase-tile--tools {
    cursor: default;
}

.home-showcase-tile--tools:hover {
    transform: none;
    box-shadow: none;
}

.home-showcase-placeholder {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    background:
        linear-gradient(145deg, rgba(var(--primary-rgb), 0.18) 0%, rgba(255, 255, 255, 0.9) 55%, rgba(var(--primary-deep-rgb), 0.12) 100%);
    border: 1px dashed var(--primary-border);
}

.home-showcase-placeholder span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
    padding: 8px;
}

.home-showcase-placeholder--long {
    display: none;
}

.home-showcase-placeholder--lg {
    aspect-ratio: 4 / 5;
    min-height: 260px;
}

.home-showcase-placeholder--lg span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--muted);
}

.home-showcase-tools {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.home-showcase-tool-chip {
    display: grid;
    place-items: center;
    min-height: 72px;
    padding: 10px 8px;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    text-align: center;
    background:
        linear-gradient(145deg, rgba(var(--primary-rgb), 0.14) 0%, rgba(255, 255, 255, 0.95) 60%, rgba(var(--primary-deep-rgb), 0.1) 100%);
    border: 1px dashed var(--primary-border);
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.home-showcase-tool-chip:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    transform: translateY(-1px);
}

.home-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    margin-bottom: 16px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--primary-dark);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--primary-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.home-title {
    margin: 0 0 16px;
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: clamp(2rem, 4.5vw, 2.75rem);
    line-height: 1.22;
    font-weight: 900;
    letter-spacing: 0.01em;
    color: var(--text);
}

.home-lead {
    margin: 0 0 28px;
    max-width: 520px;
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--muted);
}

.home-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}

.home-cta-primary {
    min-height: 44px;
    padding: 12px 40px;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius-btn);
    border: 1px solid transparent;
    box-shadow: 0 4px 14px rgba(var(--primary-deep-rgb), 0.2);
}

.home-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0;
    font-size: 0.8125rem;
    color: var(--muted);
}

.home-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.home-meta-item svg {
    color: var(--primary);
    flex-shrink: 0;
}

.home-hero-note {
    margin: 14px 0 0;
    font-size: 0.8125rem;
    color: var(--muted);
}

.home-hero-note a {
    color: var(--primary-dark);
    font-weight: 600;
    text-decoration: none;
}

.home-hero-note a:hover {
    color: var(--primary);
}

.home-login-link {
    display: inline-flex;
    align-items: center;
    margin-top: 12px;
    padding: 8px 16px;
    border: 1px solid var(--primary-border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.75);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary-dark);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.home-login-link:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
}

/* Hero visual mock */
.home-hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 280px;
}

.home-mock-stack {
    position: relative;
    width: min(100%, 320px);
    height: 280px;
}

.home-mock-card {
    position: absolute;
    width: 72%;
    padding: 14px;
    border-radius: 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.home-mock-card-1 {
    top: 0;
    left: 0;
    transform: rotate(-4deg);
    z-index: 1;
}

.home-mock-card-2 {
    top: 52px;
    right: 0;
    transform: rotate(3deg);
    z-index: 2;
}

.home-mock-card-3 {
    bottom: 0;
    left: 12%;
    width: 64%;
    transform: rotate(-1deg);
    z-index: 3;
}

.home-mock-tag {
    display: inline-block;
    margin-bottom: 10px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.home-mock-lines {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.home-mock-lines i {
    display: block;
    height: 8px;
    border-radius: 4px;
    background: var(--surface-2);
}

.home-mock-lines i:nth-child(1) { width: 100%; }
.home-mock-lines i:nth-child(2) { width: 78%; }
.home-mock-lines i:nth-child(3) { width: 55%; background: rgba(var(--primary-rgb), 0.15); }

.home-mock-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.home-mock-grid span {
    aspect-ratio: 1;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--surface-2), rgba(var(--primary-rgb), 0.12));
}

.home-mock-circle {
    width: 64px;
    height: 64px;
    margin: 8px auto 0;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff, rgba(var(--primary-rgb), 0.2));
    border: 2px dashed var(--primary-border);
}

/* Sections */
.home-section {
    margin-bottom: 48px;
}

.home-section-head {
    margin-bottom: 20px;
}

.home-section-head h2 {
    margin: 0 0 6px;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.home-section-head p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--muted);
}

/* Feature cards */
.home-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

a.home-feature-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.home-feature-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px 20px 20px;
    border-radius: 16px;
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    border-color: var(--primary-border);
}

.home-feature-card.is-featured {
    border-color: rgba(var(--primary-rgb), 0.35);
    background: linear-gradient(165deg, #fff 0%, rgba(var(--primary-rgb), 0.04) 100%);
    box-shadow: 0 8px 28px rgba(var(--primary-rgb), 0.1);
}

.home-card-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--on-primary);
    background: var(--primary-gradient);
}

.home-feature-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--primary-dark);
    background: var(--primary-soft);
    border: 1px solid var(--primary-border);
}

.home-feature-card h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.home-feature-card p {
    margin: 0;
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--muted);
}

.home-card-link {
    margin-top: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-dark);
    text-decoration: none;
}

.home-card-link:hover {
    color: var(--primary);
}

/* Tools */
.home-tools-section {
    padding: 28px;
    border-radius: 20px;
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.home-tools-section .home-section-head {
    margin-bottom: 16px;
}

.home-tool-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.home-tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 10px;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    background: var(--bg);
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.home-tool-card:hover {
    background: var(--primary-soft);
    border-color: var(--primary-border);
    transform: translateY(-2px);
}

.home-tool-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--primary-dark);
    background: #fff;
    border: 1px solid var(--primary-border);
}

.home-tool-name {
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: center;
}

/* Steps */
.home-steps-panel {
    padding: 28px 32px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.06) 0%, var(--panel) 45%);
    border: 1px solid var(--primary-border);
}

.home-steps-panel > h2 {
    margin: 0 0 20px;
    font-size: 1.2rem;
    font-weight: 800;
}

.home-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-steps li {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.home-step-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 0.9375rem;
    font-weight: 800;
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
    background: var(--primary-gradient);
    box-shadow: 0 4px 12px rgba(var(--primary-deep-rgb), 0.25);
}

.home-steps li strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9375rem;
}

.home-steps li > div span {
    font-size: 0.8125rem;
    color: var(--muted);
    line-height: 1.5;
}

/* Trust bar */
.home-trust-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px 24px;
    padding: 24px 28px;
    border-radius: 16px;
    background: var(--panel);
    border: 1px solid var(--border);
}

.home-trust-item {
    flex: 1;
    min-width: 160px;
}

.home-trust-item strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
}

.home-trust-item span,
.home-trust-item a {
    font-size: 0.8125rem;
    color: var(--muted);
    line-height: 1.5;
}

.home-trust-item a {
    color: var(--primary-dark);
    font-weight: 600;
    text-decoration: none;
}

.home-trust-item a:hover {
    color: var(--primary);
}

.home-trust-divider {
    width: 1px;
    align-self: stretch;
    min-height: 48px;
    background: var(--border);
}

.home-platform-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.home-platform-pills span {
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
}

/* Footer */
.home-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--muted);
}

.home-footer-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-btn);
    background: var(--panel);
    font: inherit;
    color: var(--primary-dark);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8125rem;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.home-footer-link:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
}

@media (max-width: 960px) {
    .home-showcase-board {
        grid-template-columns: 1fr;
    }
    .home-showcase-panel--long {
        max-width: 320px;
        margin: 0 auto;
        width: 100%;
    }
    .home-showcase-long-viewport {
        max-height: min(520px, 60vh);
    }
    .home-showcase-tools {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .home-hero-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .home-hero-visual {
        min-height: 220px;
    }
    .home-mock-stack {
        height: 220px;
        margin: 0 auto;
    }
    .home-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .home-steps {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 560px) {
    .home-nav {
        gap: 6px 16px;
    }
    .home-showcase-board {
        padding: 12px;
    }
    .home-showcase-tools {
        grid-template-columns: 1fr 1fr;
    }
    .home-hero {
        margin: 0 -20px 36px;
        padding: 16px 16px 40px;
    }
    .home-main {
        width: min(1120px, calc(100% - 32px));
    }
    .home-hero-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .home-hero-actions .btn {
        width: 100%;
        justify-content: center;
    }
    .home-card-grid {
        grid-template-columns: 1fr;
    }
    .home-steps-panel {
        padding: 20px 18px;
    }
    .home-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* —— 首页 V2：白底 + 草莓红按钮/描边 —— */
body.home-page {
    background: #ffffff;
}

body.home-page .app-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(226, 232, 240, 0.78);
    backdrop-filter: blur(18px);
}

.home-shell > .home-hero-bg {
    background:
        radial-gradient(ellipse 52% 38% at 74% 6%, rgba(var(--primary-rgb), 0.12) 0%, transparent 62%),
        radial-gradient(ellipse 42% 32% at 10% 12%, rgba(var(--primary-rgb), 0.08) 0%, transparent 58%),
        linear-gradient(180deg, #ffffff 0%, #fffafa 48%, #ffffff 100%);
}

.home-shell > .home-hero-bg::before {
    opacity: 0.18;
    background-image:
        linear-gradient(rgba(var(--primary-rgb), 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--primary-rgb), 0.07) 1px, transparent 1px);
}

.home-shell > .home-hero-bg::after {
    opacity: 0.34;
    background: linear-gradient(118deg, transparent 38%, rgba(var(--primary-rgb), 0.08) 50%, transparent 64%);
}

.home-main {
    width: min(1180px, calc(100% - 48px));
}

.home-hero-v2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 0.95fr);
    gap: 54px;
    align-items: center;
    margin: 0;
    padding: 64px 0 42px;
}

.home-hero-copy {
    min-width: 0;
}

.home-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    margin-bottom: 18px;
    border-radius: var(--radius-pill);
    color: var(--primary-dark);
    background: #fff;
    border: 1px solid var(--primary-border);
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.08);
    font-size: 0.8125rem;
    font-weight: 800;
}

.home-hero-v2 .home-title {
    max-width: 640px;
    font-size: clamp(1.88rem, 3.84vw, 3.48rem);
    line-height: 1.12;
    letter-spacing: -0.045em;
}

.home-hero-v2 .home-title-accent {
    background: linear-gradient(135deg, var(--text) 0%, var(--text) 34%, var(--primary) 35%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.home-hero-v2 .home-lead {
    max-width: 600px;
    font-size: 1.08rem;
    color: #5f6b7a;
}

.home-cta-secondary {
    min-height: 44px;
    padding: 12px 32px;
    border-color: var(--primary-border);
    color: var(--primary-dark);
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.home-hero-v2 .home-hero-meta {
    gap: 10px;
}

.home-hero-v2 .home-meta-item {
    padding: 7px 12px;
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-pill);
    background: #fff;
    color: #6b7280;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.home-hero-visual-v2 {
    min-height: 430px;
}

.home-product-stage {
    position: relative;
    width: min(100%, 520px);
    height: 430px;
}

.home-product-card {
    position: absolute;
    color: inherit;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--primary-border);
    box-shadow: 0 28px 70px rgba(var(--primary-rgb), 0.16);
}

.home-product-card-main {
    inset: 24px 72px 26px 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    padding: 24px;
    overflow: hidden;
    border-radius: 30px;
}

.home-product-badge {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    color: #fff;
    background: var(--primary-gradient);
    font-size: 0.75rem;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.24);
}

.home-product-art {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 26% 24%, rgba(255, 255, 255, 0.95) 0 8%, transparent 9%),
        radial-gradient(circle at 78% 30%, rgba(var(--primary-rgb), 0.16) 0 11%, transparent 12%),
        radial-gradient(circle at 54% 54%, rgba(var(--primary-rgb), 0.2) 0 28%, transparent 45%),
        linear-gradient(145deg, rgba(var(--primary-rgb), 0.08) 0%, #fff 48%, rgba(var(--primary-rgb), 0.12) 100%);
}

.home-product-bottle {
    position: absolute;
    left: 50%;
    top: 45%;
    width: 132px;
    height: 182px;
    transform: translate(-50%, -50%);
    border-radius: 34px 34px 28px 28px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.72), transparent 20% 76%, rgba(255, 255, 255, 0.42)),
        linear-gradient(180deg, #ffe9e9 0%, rgba(var(--primary-rgb), 0.58) 100%);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
    box-shadow: 0 24px 44px rgba(var(--primary-rgb), 0.22);
}

.home-product-bottle::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -46px;
    width: 34px;
    height: 54px;
    transform: translateX(-50%);
    border-radius: 18px 18px 8px 8px;
    background: #ffffff;
    border: 1px solid rgba(var(--primary-rgb), 0.22);
}

.home-product-bottle::after {
    content: "AI";
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 36px;
    display: grid;
    place-items: center;
    height: 44px;
    border-radius: 14px;
    color: var(--primary-dark);
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(255, 255, 255, 0.6);
    font-weight: 900;
    letter-spacing: 0.12em;
}

.home-product-orbit {
    position: absolute;
    border-radius: 999px;
    border: 1px solid rgba(var(--primary-rgb), 0.18);
    background: rgba(255, 255, 255, 0.42);
}

.home-product-orbit-a {
    width: 108px;
    height: 108px;
    left: 28px;
    bottom: 84px;
}

.home-product-orbit-b {
    width: 82px;
    height: 82px;
    right: 40px;
    top: 112px;
}

.home-product-card-main strong,
.home-product-card-main span:not(.home-product-badge) {
    position: relative;
    z-index: 1;
}

.home-product-card-main strong {
    font-size: 1.15rem;
}

.home-product-card-main span:not(.home-product-badge) {
    color: var(--muted);
    font-size: 0.875rem;
}

.home-float-card {
    position: absolute;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 178px;
    padding: 16px 18px;
    border-radius: 18px;
    color: inherit;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--primary-border);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
    transition: transform 0.16s ease, border-color 0.16s ease;
}

.home-float-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.home-float-card span {
    color: var(--primary-dark);
    font-size: 0.76rem;
    font-weight: 800;
}

.home-float-card strong {
    font-size: 0.9rem;
}

.home-float-card-a {
    right: 0;
    top: 62px;
}

.home-float-card-b {
    right: 18px;
    bottom: 54px;
}

.home-float-card-c {
    left: 0;
    bottom: 12px;
}

.home-capability-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    margin: 0 0 48px;
    padding: 16px;
    border-radius: 24px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.06);
}

.home-capability-strip a {
    min-height: 88px;
    padding: 16px 18px;
    color: inherit;
    text-decoration: none;
    border-radius: 18px;
    border: 1px solid transparent;
    transition: background 0.16s, border-color 0.16s, transform 0.16s;
}

.home-capability-strip a:hover {
    background: var(--primary-soft);
    border-color: var(--primary-border);
    transform: translateY(-1px);
}

.home-capability-strip span {
    display: block;
    margin-bottom: 6px;
    color: var(--primary-dark);
    font-weight: 850;
}

.home-capability-strip strong {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.5;
    font-weight: 500;
}

.home-generator-panel {
    padding: 32px;
    border-radius: 28px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.06);
}

.home-generator-panel .home-section-head--center {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.home-generator-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
    padding: 22px;
    border-radius: 22px;
    background: #fff;
    border: 1px solid var(--primary-border);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7), 0 18px 44px rgba(var(--primary-rgb), 0.08);
}

.home-generator-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.home-generator-tab {
    padding: 10px 24px;
    border-radius: var(--radius-pill);
    color: var(--primary-dark);
    text-decoration: none;
    border: 1px solid var(--primary-border);
    background: #fff;
    font-weight: 800;
}

.home-generator-tab.active {
    color: #fff;
    background: var(--primary-gradient);
    border-color: transparent;
}

.home-prompt-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
}

.home-prompt-box span {
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 700;
}

.home-prompt-box textarea {
    width: 100%;
    min-height: 150px;
    resize: none;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--primary-border);
    background: #fff;
    color: #8a6570;
    font: inherit;
    line-height: 1.65;
    outline: none;
}

.home-generator-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.home-generator-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.home-generator-chips a {
    padding: 8px 12px;
    color: var(--muted);
    text-decoration: none;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.home-generator-chips a:hover {
    color: var(--primary-dark);
    border-color: var(--primary-border);
    background: var(--primary-soft);
}

.home-generator-submit {
    min-width: 132px;
    justify-content: center;
}

.home-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.home-section-link {
    flex-shrink: 0;
    color: var(--primary-dark);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 800;
}

.home-template-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}

.home-template-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    color: inherit;
    text-decoration: none;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
    transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}

.home-template-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-border);
    box-shadow: 0 20px 42px rgba(var(--primary-rgb), 0.1);
}

.home-template-preview {
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    border: 1px solid var(--primary-border);
    background:
        radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.9) 0 12%, transparent 13%),
        linear-gradient(145deg, rgba(var(--primary-rgb), 0.1), #fff 52%, rgba(var(--primary-rgb), 0.18));
}

.home-template-preview-b {
    background:
        radial-gradient(circle at 50% 48%, rgba(var(--primary-rgb), 0.22) 0 23%, transparent 24%),
        linear-gradient(145deg, #fff, #fff7f7);
}

.home-template-preview-c {
    background:
        linear-gradient(145deg, rgba(47, 99, 72, 0.12), transparent 45%),
        radial-gradient(circle at 64% 40%, rgba(var(--primary-rgb), 0.18) 0 22%, transparent 23%),
        #ffffff;
}

.home-template-preview-d {
    background:
        linear-gradient(135deg, rgba(var(--primary-rgb), 0.28), rgba(var(--primary-rgb), 0.05)),
        #ffffff;
}

.home-template-preview-e {
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.92) 0 15%, transparent 16%),
        linear-gradient(145deg, rgba(var(--primary-deep-rgb), 0.2), rgba(var(--primary-rgb), 0.06));
}

.home-template-preview-f {
    background:
        linear-gradient(135deg, #fff 0 36%, rgba(var(--primary-rgb), 0.1) 36% 64%, #fff 64%),
        #fffafa;
}

.home-template-card strong {
    font-size: 0.94rem;
}

.home-template-card span {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.home-tools-section-v2 {
    padding: 30px;
    border-radius: 26px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.05);
}

.home-tool-list-v2 {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.home-tool-list-v2 a {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 118px;
    padding: 18px;
    color: inherit;
    text-decoration: none;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--primary-border);
    transition: transform 0.16s, background 0.16s, border-color 0.16s;
}

.home-tool-list-v2 a:hover {
    transform: translateY(-2px);
    background: var(--primary-soft);
    border-color: var(--primary);
}

.home-tool-list-v2 strong {
    color: var(--primary-dark);
    font-size: 0.95rem;
}

.home-tool-list-v2 span {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.55;
}

.home-trust-bar-v2 {
    border-color: var(--border);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

@media (max-width: 1040px) {
    .home-hero-v2 {
        grid-template-columns: 1fr;
        gap: 28px;
        padding-top: 42px;
    }
    .home-hero-visual-v2 {
        min-height: 380px;
    }
    .home-product-stage {
        margin: 0 auto;
        height: 380px;
    }
    .home-capability-strip,
    .home-template-grid,
    .home-tool-list-v2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .home-main {
        width: min(1180px, calc(100% - 32px));
    }
    .home-hero-v2 {
        padding-top: 28px;
    }
    .home-hero-v2 .home-title {
        font-size: clamp(1.6rem, 9.6vw, 2.4rem);
    }
    .home-product-stage {
        height: 350px;
    }
    .home-product-card-main {
        inset: 20px 18px 36px;
    }
    .home-float-card {
        min-width: 148px;
        padding: 12px 14px;
    }
    .home-float-card-a {
        right: 0;
        top: 18px;
    }
    .home-float-card-b {
        right: 0;
        bottom: 18px;
    }
    .home-float-card-c {
        left: 0;
        bottom: 0;
    }
    .home-capability-strip,
    .home-template-grid,
    .home-tool-list-v2 {
        grid-template-columns: 1fr;
    }
    .home-generator-panel,
    .home-tools-section-v2 {
        padding: 20px;
    }
    .home-generator-actions,
    .home-section-head {
        align-items: stretch;
        flex-direction: column;
    }
    .home-generator-submit {
        width: 100%;
    }
}

/* —— 首页 V3：更接近参考图 2，白底、大留白、少装饰 —— */
.home-shell-clean {
    background: #ffffff;
}

.home-shell-clean > .home-hero-bg {
    display: none;
}

.home-main-clean {
    width: min(1120px, calc(100% - 48px));
}

.home-clean-hero--ref {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
    gap: 48px;
    align-items: center;
    padding: 36px 0 28px;
}

.home-clean-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 0;
    padding: 0;
    border: none;
    background: transparent;
    overflow: hidden;
}

.home-clean-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0.96) 10%, rgba(255, 255, 255, 0.55) 28%, transparent 52%);
}

.home-hero-photo {
    position: relative;
    z-index: 0;
    display: block;
    width: min(100%, 540px);
    max-height: 380px;
    height: auto;
    object-fit: cover;
    object-position: 58% center;
    border: none;
    border-radius: 0;
    box-shadow: none;
    outline: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.35) 14%, #000 32%, #000 100%);
    mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.35) 14%, #000 32%, #000 100%);
}

.home-clean-title {
    margin: 0 0 18px;
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: clamp(2.25rem, 4.1vw, 3.7rem);
    line-height: 1.16;
    font-weight: 900;
    letter-spacing: -0.055em;
    color: #16181c;
}

.home-clean-title span {
    color: var(--primary);
}

.home-clean-lead {
    max-width: 560px;
    margin: 0 0 26px;
    color: #69717d;
    font-size: 1.03rem;
    line-height: 1.8;
}

.home-clean-points {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, max-content));
    gap: 18px 26px;
    margin-bottom: 28px;
}

.home-clean-points span {
    position: relative;
    padding-left: 20px;
    color: #454b55;
    font-size: 0.9rem;
    font-weight: 700;
}

.home-clean-points span::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 0 5px rgba(var(--primary-rgb), 0.09);
}

.home-clean-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.home-clean-actions .home-cta-primary,
.home-clean-actions .home-cta-secondary {
    min-height: 50px;
    padding: 13px 34px;
    border-radius: 12px;
    font-weight: 800;
}

.home-clean-actions .home-cta-secondary {
    background: #fff;
    color: var(--primary-dark);
    border: 1px solid var(--primary-border);
}

.home-stage-card {
    position: relative;
    height: 390px;
    border-radius: 34px;
    background:
        radial-gradient(circle at 48% 34%, rgba(255, 255, 255, 0.95) 0 14%, transparent 15%),
        linear-gradient(145deg, rgba(var(--primary-rgb), 0.1) 0%, rgba(255, 255, 255, 0.9) 44%, rgba(var(--primary-rgb), 0.16) 100%);
    border: 1px solid rgba(var(--primary-rgb), 0.14);
    box-shadow: 0 28px 70px rgba(var(--primary-rgb), 0.12);
    overflow: hidden;
}

.home-stage-card::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 54px;
    width: 360px;
    height: 86px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: rgba(var(--primary-rgb), 0.16);
    filter: blur(4px);
}

.home-stage-base {
    position: absolute;
    left: 50%;
    bottom: 72px;
    width: 360px;
    height: 118px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: linear-gradient(180deg, #fff 0%, #fff0f0 100%);
    border: 1px solid rgba(var(--primary-rgb), 0.16);
    box-shadow: 0 18px 42px rgba(var(--primary-rgb), 0.14);
}

.home-stage-product {
    position: absolute;
    bottom: 62px;
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    box-shadow: 0 18px 36px rgba(var(--primary-rgb), 0.14);
}

.home-stage-product-bag {
    left: 130px;
    width: 112px;
    height: 112px;
    border-radius: 26px 26px 20px 20px;
    background: linear-gradient(145deg, #fff 0%, #f4b7b7 100%);
}

.home-stage-product-bag::before {
    content: "";
    position: absolute;
    left: 27px;
    top: -38px;
    width: 56px;
    height: 62px;
    border: 9px solid rgba(var(--primary-rgb), 0.56);
    border-bottom: none;
    border-radius: 42px 42px 0 0;
}

.home-stage-product-bottle {
    left: 52px;
    bottom: 58px;
    width: 58px;
    height: 118px;
    border-radius: 24px 24px 16px 16px;
    background: linear-gradient(180deg, #fff 0%, #ffd8d8 38%, rgba(var(--primary-rgb), 0.48) 100%);
}

.home-stage-product-box {
    right: 56px;
    bottom: 58px;
    width: 68px;
    height: 138px;
    border-radius: 24px;
    background: linear-gradient(180deg, #fff 0%, #fff5f5 50%, #edb7b7 100%);
}

.home-stage-chip {
    position: absolute;
    display: inline-flex;
    align-items: center;
    padding: 11px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--primary-dark);
    border: 1px solid var(--primary-border);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    font-size: 0.84rem;
    font-weight: 850;
}

.home-stage-chip-left {
    left: 48px;
    top: 54px;
}

.home-stage-chip-right {
    right: 42px;
    top: 134px;
}

.home-stage-chip-bottom {
    right: 70px;
    bottom: 46px;
}

.home-demo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-bottom: 32px;
}

.home-demo-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 380px;
    padding: 26px;
    color: inherit;
    text-decoration: none;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.045);
}

.home-demo-head strong {
    display: block;
    margin-bottom: 4px;
    color: #1c2028;
    font-size: 1.15rem;
}

.home-demo-head span {
    color: var(--muted);
    font-size: 0.86rem;
}

.home-demo-prompt {
    align-self: flex-end;
    max-width: 78%;
    padding: 9px 14px;
    border-radius: 999px;
    color: var(--primary-dark);
    background: rgba(var(--primary-rgb), 0.08);
    font-size: 0.78rem;
    font-weight: 700;
}

.home-demo-result {
    flex: 1;
    min-height: 160px;
    padding: 14px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #edf0f4;
}

.home-demo-result-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.home-demo-result-grid i {
    display: block;
    border-radius: 14px;
    background:
        radial-gradient(circle at 50% 38%, rgba(var(--primary-rgb), 0.42) 0 18%, transparent 19%),
        linear-gradient(145deg, #fff 0%, #fff3f3 48%, rgba(var(--primary-rgb), 0.22) 100%);
    border: 1px solid rgba(var(--primary-rgb), 0.1);
}

.home-demo-video {
    position: relative;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.85) 0 10%, transparent 11%),
        linear-gradient(145deg, rgba(var(--primary-rgb), 0.28), rgba(var(--primary-rgb), 0.08));
}

.home-demo-video span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 54px;
    height: 54px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 14px 30px rgba(var(--primary-rgb), 0.16);
}

.home-demo-video span::after {
    content: "";
    position: absolute;
    left: 22px;
    top: 17px;
    border-left: 15px solid var(--primary);
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
}

.home-demo-input {
    padding: 12px 16px;
    border-radius: 999px;
    color: #9aa1ad;
    background: #fff;
    border: 1px solid #eceff3;
    font-size: 0.82rem;
}

.home-capability-strip-clean {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 46px;
    box-shadow: none;
    border-color: rgba(var(--primary-rgb), 0.1);
}

.home-scenes-clean {
    padding: 0;
}

.home-scene-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.home-scene-row a {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 168px;
    padding: 18px;
    color: inherit;
    text-decoration: none;
    border-radius: 20px;
    background: #fff;
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.035);
    transition: transform 0.16s, border-color 0.16s;
}

.home-scene-row a:hover {
    transform: translateY(-2px);
    border-color: var(--primary-border);
}

.home-scene-row span {
    height: 74px;
    margin-bottom: 8px;
    border-radius: 16px;
    background:
        radial-gradient(circle at 52% 40%, rgba(var(--primary-rgb), 0.26) 0 18%, transparent 19%),
        linear-gradient(145deg, #fff 0%, rgba(var(--primary-rgb), 0.08) 100%);
    border: 1px solid rgba(var(--primary-rgb), 0.08);
}

.home-scene-row strong {
    color: #1d222b;
    font-size: 0.96rem;
}

.home-scene-row em {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.5;
    font-style: normal;
}

@media (max-width: 1040px) {
    .home-clean-hero,
    .home-demo-grid {
        grid-template-columns: 1fr;
    }
    .home-clean-visual {
        min-height: 0;
    }
    .home-stage-card {
        height: 360px;
    }
    .home-capability-strip-clean,
    .home-scene-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .home-main-clean {
        width: min(1180px, calc(100% - 32px));
    }
    .home-clean-hero {
        gap: 28px;
        padding: 34px 0 34px;
    }
    .home-clean-title {
        font-size: clamp(1.9rem, 10vw, 2.65rem);
    }
    .home-clean-points {
        grid-template-columns: repeat(2, minmax(0, max-content));
    }
    .home-clean-actions {
        flex-direction: column;
    }
    .home-clean-actions .btn {
        justify-content: center;
        width: 100%;
    }
    .home-demo-card {
        min-height: 330px;
        padding: 20px;
    }
    .home-demo-result-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .home-capability-strip-clean,
    .home-scene-row {
        grid-template-columns: 1fr;
    }
}

/* —— 首页 V4：参考图工作台 + 纯白底 —— */
.home-workbench {
    margin: 0 0 40px;
    padding: 0;
    background: #ffffff;
}

.home-wb-unit {
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.home-wb-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 18px;
    margin-bottom: 0;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.home-wb-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    padding: 12px 2px;
    margin-right: 20px;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.home-wb-tab.active {
    color: var(--primary-dark);
    border-bottom-color: var(--primary);
}

.home-workbench-login-hint {
    margin: 0;
    padding: 8px 18px 0;
    font-size: 0.82rem;
    color: var(--primary-dark);
    font-weight: 650;
    background: transparent;
    border: none;
    border-radius: 0;
    width: auto;
}

.home-wb-card {
    border: none;
    box-shadow: none;
    border-radius: 0;
    background: #ffffff;
    overflow: visible;
}

.home-wb-panel {
    display: none;
    flex-direction: column;
    padding: 14px 18px 12px;
}

.home-wb-panel.active {
    display: flex;
}

.home-wb-compose {
    display: flex;
    gap: 14px;
    align-items: center;
    min-height: 96px;
    margin-bottom: 12px;
    padding: 0;
}

.home-wb-upload {
    flex: 0 0 auto;
    width: 72px;
    height: 92px;
    display: grid;
    place-items: center;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    transform: rotate(-6deg);
    cursor: pointer;
    overflow: hidden;
    position: relative;
    box-shadow: none;
}

.home-wb-upload.has-preview {
    transform: none;
    background: #fff;
    border: 1px solid var(--border);
}

.home-wb-upload-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.home-wb-input {
    flex: 1;
    width: 100%;
    min-height: 72px;
    max-height: 120px;
    resize: none;
    border: none;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.94rem;
    line-height: 1.65;
    padding: 4px 0;
    outline: none;
}

.home-wb-file {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.home-wb-input::placeholder {
    color: #94a3b8;
}

.home-wb-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 4px;
}

.home-wb-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.home-wb-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 650;
    white-space: nowrap;
}

.home-wb-chip-model {
    color: #334155;
}

.home-wb-generate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    min-width: 68px;
    padding: 0 14px;
    border: none;
    border-radius: 999px;
    background: #3f4654;
    color: #ffffff;
    font: inherit;
    cursor: pointer;
}

.home-wb-generate:hover {
    background: #323844;
}

.home-wb-generate .btn-label-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.home-wb-generate .btn-text {
    display: none;
}

.home-wb-generate .btn-point-cost,
.home-wb-generate .btn-point-cost-value {
    color: #ffffff;
}

.home-wb-generate .btn-point-cost {
    background: transparent;
    border: none;
    padding: 0;
    min-height: 0;
}

.home-benefits {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 52px;
}

.home-benefit-card {
    min-height: 148px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 18px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.03);
}

.home-benefit-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    border: 1px solid var(--primary-border);
}

.home-benefit-card strong {
    color: #1c2028;
    font-size: 0.98rem;
}

.home-benefit-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

.home-tools-section,
.home-steps-section {
    margin-bottom: 52px;
}

.home-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.home-tool-card {
    aspect-ratio: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 16px 16px;
    color: inherit;
    text-decoration: none;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.03);
    transition: transform 0.16s, border-color 0.16s;
}

.home-tool-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-border);
}

.home-tool-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    border: 1px solid var(--primary-border);
}

.home-tool-card strong {
    color: #1c2028;
    font-size: 0.96rem;
    line-height: 1.35;
}

.home-tool-card span {
    flex: 1;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.home-tool-card em {
    align-self: flex-end;
    margin-top: auto;
    color: var(--primary);
    font-style: normal;
    font-weight: 800;
}

.home-steps-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.home-step-card {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 18px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.03);
}

.home-step-num {
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.06em;
}

.home-step-card strong {
    color: #1c2028;
    font-size: 0.98rem;
}

.home-step-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

.home-step-visual-input {
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.home-step-visual-generate {
    background:
        radial-gradient(circle at 50% 40%, rgba(var(--primary-rgb), 0.12) 0 16%, transparent 17%),
        linear-gradient(145deg, #fff 0%, #f8fafc 100%);
}

.home-step-visual-download {
    background: linear-gradient(145deg, #f8fafc 0%, #fff 100%);
}

.home-step-visual {
    margin-top: auto;
    height: 88px;
    border-radius: 14px;
    border: 1px solid var(--border);
}

.home-step-arrow {
    align-self: center;
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 800;
    padding: 0 2px;
}

@media (max-width: 1040px) {
    .home-clean-hero--ref {
        grid-template-columns: 1fr;
    }
    .home-benefits {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .home-tools-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .home-steps-row {
        grid-template-columns: 1fr;
    }
    .home-step-arrow {
        display: none;
    }
    .home-wb-compose {
        min-height: 120px;
    }
    .home-wb-upload {
        transform: none;
    }
}

@media (max-width: 640px) {
    .home-benefits,
    .home-tools-grid {
        grid-template-columns: 1fr;
    }
    .home-workbench {
        margin-top: 0;
    }
    .home-wb-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .home-wb-generate {
        width: 100%;
        min-height: 44px;
    }
}

/* —— 首页 V5：设计稿结构（草莓红 + 保守文案） —— */
.home-page-v5 {
    background: #ffffff;
}

.home-page-v5 .app-header {
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
}

.home-v5 {
    background: #ffffff;
}

.home-v5-main {
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto;
}

/* Hero */
.home-v5-hero {
    background: linear-gradient(160deg, #fff5f3 0%, #fef7f6 30%, #ffffff 65%, #f8faff 100%);
    margin: 0 calc(50% - 50vw);
    width: 100vw;
    max-width: 100vw;
    position: relative;
    overflow: hidden;
}

.home-v5-hero::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -80px;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 69, 60, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.home-v5-hero::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: 10%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

.home-v5-hero-inner {
    display: grid;
    grid-template-columns: 620px minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto;
    min-height: 589px;
}

.home-v5-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 24px;
    justify-content: center;
    padding: 60px 80px;
    box-sizing: border-box;
}

.home-v5-wb {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px 60px 32px 20px;
    box-sizing: border-box;
}

.home-v5-wb-card {
    width: 100%;
    max-width: 540px;
    border-radius: 20px;
    border: 1px solid rgba(232, 69, 60, 0.08);
    background: #fff;
    box-shadow: 0 12px 48px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.home-v5-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid var(--primary-border);
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 600;
    margin: 0;
    width: fit-content;
}

.home-v5-title-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.home-v5-title {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #1a1a1a;
}

.home-v5-title-line {
    display: block;
    font-size: 52px;
    line-height: 1.05;
    letter-spacing: -1.5px;
    margin: 0;
}

.home-v5-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.home-v5-title-accent {
    font-size: 52px;
    line-height: 1.05;
    letter-spacing: -1.5px;
    color: var(--primary);
    position: relative;
}

.home-v5-title-plain {
    font-size: 52px;
    line-height: 1.05;
    letter-spacing: -1.5px;
    color: #1a1a1a;
}

.home-v5-lead {
    margin: 0;
    max-width: 460px;
    color: #666;
    font-size: 16px;
    line-height: 1.7;
}

.home-v5-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0;
}

.home-v5-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 50px;
    padding: 0 32px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 4px 14px -2px rgba(var(--primary-rgb), 0.4), 0 1px 3px rgba(var(--primary-rgb), 0.15);
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.home-v5-btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px -2px rgba(var(--primary-rgb), 0.45), 0 2px 6px rgba(var(--primary-rgb), 0.2);
}

.home-v5-btn-outline {
    display: inline-flex;
    align-items: center;
    height: 48px;
    padding: 0 28px;
    border-radius: 8px;
    border: 1.5px solid #e0e0e0;
    background: #fff;
    color: #333;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
}

.home-v5-btn-outline:hover {
    border-color: var(--primary-border);
    color: var(--primary-dark);
}

.home-v5-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 32px;
    margin: 0;
}

.home-v5-stats div:not(.home-v5-stat-sep) {
    margin: 0;
    padding: 0;
}

.home-v5-stat-sep {
    width: 1px;
    height: 32px;
    background: #e8e8e8;
    flex-shrink: 0;
    margin: 0;
}

.home-v5-stats dt {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.home-v5-stats dd {
    margin: 0;
    font-size: 12px;
    color: #999;
}

/* Workbench card */
.home-v5-wb-tabs {
    display: flex;
    gap: 4px;
    padding: 6px;
    background: #f7f7f8;
    border-bottom: 1px solid rgba(226, 232, 240, 0.4);
}

.home-v5-wb-tabs .home-wb-tab {
    flex: 1;
    position: relative;
    z-index: 1;
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    margin: 0;
    padding: 0 8px;
    border: none;
    border-radius: 12px;
    border-bottom: none;
    background: transparent;
    color: #888;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.home-v5-wb-tabs .home-wb-tab img {
    flex-shrink: 0;
}

.home-v5-tab-icon-overlay {
    position: absolute;
    left: calc(50% - 18px);
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.home-v5-wb-hint {
    margin: 0;
    padding: 10px 20px 0;
    font-size: 0.82rem;
    color: var(--primary-dark);
    font-weight: 600;
}

.home-v5-wb-card .home-wb-panel {
    display: none;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
}

.home-v5-wb-card .home-wb-panel.active {
    display: flex;
}

.home-v5-prompt-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.home-v5-prompt-hint {
    font-size: 12px;
    color: #aaa;
    white-space: nowrap;
}

.home-v5-field-label {
    display: block;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

.home-v5-upload-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.home-v5-prompt-box {
    width: 100%;
    height: 100px;
    box-sizing: border-box;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.home-v5-prompt-box:focus-within {
    border-color: var(--primary-border);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.06);
}

.home-v5-textarea {
    display: block;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    min-height: 52px;
    padding: 0;
    border: none;
    background: transparent;
    resize: none;
    overflow-y: hidden;
    box-sizing: border-box;
    font: inherit;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    outline: none;
}

.home-v5-textarea::placeholder {
    color: #bbb;
}

.home-v5-prompt-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0;
    margin-top: auto;
}

.home-v5-char-count {
    font-size: 11px;
    color: #ccc;
}

.home-v5-dropzone {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 72px;
    min-height: 72px;
    max-height: 72px;
    padding: 0 16px;
    border: 1.5px dashed #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
    overflow: hidden;
}

.home-v5-dropzone.has-preview {
    padding: 0;
    border-style: solid;
}

.home-v5-dropzone-empty {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    color: #888;
    text-align: left;
}

.home-v5-dropzone-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    line-height: 1.35;
}

.home-v5-dropzone-text small {
    font-size: 11px;
    color: #aaa;
}

.home-v5-dropzone-preview {
    width: 100%;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
}

.home-v5-dropzone:hover,
.home-v5-dropzone.drag-over {
    border-color: var(--primary-border);
    background: var(--primary-soft);
}

.home-v5-wb-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
}

.home-v5-wb-tabs .home-wb-tab.active {
    background: #fff;
    color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.home-v5-chip {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: 1 1 0;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    background: #f7f7f8;
    font-size: 13px;
    color: #333;
}

.home-v5-wb-note {
    margin: 0;
    text-align: center;
    font-size: 12px;
    color: #888;
}

.home-v5-generate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 0 20px;
    border: none;
    border-radius: 12px;
    background: var(--primary-gradient);
    color: #fff;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.28);
    transition: background 0.15s, transform 0.15s;
}

.home-v5-generate:hover {
    background: var(--primary-gradient-hover);
    transform: translateY(-1px);
}

.home-v5-generate .btn-label-row,
.home-v5-generate .btn-text {
    color: #fff;
}

.home-v5-generate .btn-point-cost,
.home-v5-generate .btn-point-cost-value {
    color: #fff;
}

.home-wb-file {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

/* Showcase */
/* Showcase */
.home-v5-showcase {
    margin: 0 calc(50% - 50vw);
    width: 100vw;
    max-width: 100vw;
    background: linear-gradient(160deg, #fff5f3 0%, #ffffff 50%, #f8faff 100%);
    padding: 56px 0 64px;
}

.home-v5-showcase .home-v5-section-head,
.home-v5-showcase-grid,
.home-v5-showcase-stats {
    width: min(1280px, calc(100% - 48px));
    margin-left: auto;
    margin-right: auto;
}

.home-v5-solutions,
.home-v5-tools {
    padding: 56px 0;
}

.home-v5-section-head {
    text-align: center;
    margin-bottom: 32px;
}

.home-v5-section-head--left {
    text-align: left;
    margin-bottom: 0;
}

.home-v5-section-head h2 {
    margin: 0 0 10px;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #1a1a1a;
}

.home-v5-section-head p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.home-v5-showcase-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.home-v5-showcase-card {
    display: flex;
    flex-direction: column;
    height: 260px;
    border-radius: 16px;
    overflow: hidden;
    border: none;
    background: #f5f5f5;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.home-v5-showcase-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.home-v5-showcase-img {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
    flex-shrink: 0;
}

.home-v5-showcase-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: 1;
    padding: 10px 14px;
    background: #fff;
}

.home-v5-showcase-meta strong {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1a1a1a;
}

.home-v5-tag {
    flex-shrink: 0;
    height: 20px;
    line-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 600;
}

.home-v5-tag--img {
    background: #e8f5e9;
    color: #2e7d32;
}

.home-v5-tag--video {
    background: #e3f2fd;
    color: #1565c0;
}

.home-v5-tag--set {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.home-v5-showcase-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px 40px;
    list-style: none;
    margin: 32px auto 0;
    padding: 0;
    width: 100%;
    text-align: center;
}

.home-v5-showcase-stats li {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #666;
}

.home-v5-showcase-stats img {
    flex-shrink: 0;
}

/* Solutions */
.home-v5-solutions-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.home-v5-solution-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 240px;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    background: #fff;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s;
}

.home-v5-solution-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-border);
    box-shadow: 0 8px 28px rgba(var(--primary-rgb), 0.10), 0 2px 8px rgba(15, 23, 42, 0.04);
}

.home-v5-solution-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
}

.home-v5-solution-badge--alt {
    background: #555;
}

.home-v5-solution-icon {
    position: relative;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--primary-soft);
    border: none;
}

.home-v5-solution-icon svg {
    display: block;
    color: var(--primary);
}

.home-v5-solution-icon img {
    display: block;
    max-width: 22px;
    max-height: 22px;
}

.home-v5-solution-icon--detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    place-items: center;
    padding: 8px;
}

.home-v5-solution-icon--detail img {
    max-width: 14px;
    max-height: 14px;
}

.home-v5-icon-overlay {
    position: absolute;
    inset: 0;
    margin: auto;
    max-width: 18px;
    max-height: 18px;
}

.home-v5-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.home-v5-solution-card strong {
    font-size: 1rem;
    color: #1a1a1a;
}

.home-v5-solution-card p {
    flex: 1;
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #888;
}

/* Tools */
.home-v5-tools-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.home-v5-tools-all {
    flex-shrink: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary-dark);
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
}

.home-v5-tools-all:hover {
    border-color: var(--primary-border);
}

.home-v5-tools-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.home-v5-tool-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.home-v5-tool-card:hover {
    border-color: var(--primary-border);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.08);
}

.home-v5-tool-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--primary-soft);
}

.home-v5-tool-icon svg {
    display: block;
    color: var(--primary);
}

.home-v5-tool-icon img {
    display: block;
}

.home-v5-tool-card strong {
    font-size: 0.92rem;
    color: #1a1a1a;
}

.home-v5-tool-card p {
    flex: 1;
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #888;
}

.home-v5-tool-action {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary-dark);
}

/* Footer */
.home-v5-footer {
    margin: 0 calc(50% - 50vw);
    width: 100vw;
    padding: 56px 0 36px;
    background: linear-gradient(180deg, #fafafa 0%, #f5f5f7 100%);
    border-top: 1px solid rgba(226, 232, 240, 0.5);
}

.home-v5-footer-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr);
    gap: 40px;
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto 32px;
}

.home-v5-footer-brand strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.home-v5-footer-brand p {
    margin: 0;
    max-width: 320px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #888;
}

.home-v5-footer-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.home-v5-footer-links h3 {
    margin: 0 0 12px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #1a1a1a;
}

.home-v5-footer-links a,
.home-v5-footer-btn {
    display: block;
    margin-bottom: 8px;
    font-size: 0.82rem;
    color: #666;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-align: left;
}

.home-v5-footer-links a:hover,
.home-v5-footer-btn:hover {
    color: var(--primary-dark);
}

.home-v5-copyright {
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid #e8e8e8;
    text-align: center;
    font-size: 0.78rem;
    color: #aaa;
}

@media (max-width: 1100px) {
    .home-v5-hero-inner {
        grid-template-columns: 1fr;
        min-height: 0;
    }
    .home-v5-hero-copy {
        padding: 40px 0 24px;
    }
    .home-v5-title-line,
    .home-v5-title-accent,
    .home-v5-title-plain {
        font-size: clamp(2rem, 8vw, 52px);
    }
    .home-v5-wb {
        padding: 0 0 40px;
    }
    .home-v5-solutions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .home-v5-tools-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .home-v5-main {
        width: min(1280px, calc(100% - 32px));
    }
    .home-v5-showcase-grid {
        grid-template-columns: 1fr;
    }
    .home-v5-solutions-grid,
    .home-v5-tools-grid {
        grid-template-columns: 1fr;
    }
    .home-v5-tools-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .home-v5-footer-inner {
        grid-template-columns: 1fr;
    }
    .home-v5-footer-links {
        grid-template-columns: 1fr 1fr;
    }
    .home-v5-stats {
        gap: 16px 24px;
    }
}
