:root {
    /* === TapNow Design System v2.0 === */
    /* Surfaces — 5-Layer Depth */
    --dark-bg: #0f0f0f;
    --color-bg-primary: #0f0f0f;
    --color-bg-sidebar: #1c1c1c;
    --card-bg: #1f1f1f;
    --color-bg-card: #1f1f1f;
    --card-hover: #262626;
    --color-bg-elevated: #262626;
    --color-bg-chat: #141414;

    /* Brand — TapNow Blue */
    --primary-color: #1fa2dc;
    --color-primary: #1fa2dc;
    --primary-dark: #198dbc;
    --color-primary-dark: #198dbc;
    --secondary-color: #33a8ff;
    --color-primary-light: #c6edfa;
    --color-primary-bg: rgba(31, 162, 220, 0.1);

    /* Text */
    --text-primary: #f5f5f5;
    --color-text-primary: #f5f5f5;
    --text-secondary: #9c9c9c;
    --color-text-secondary: #9c9c9c;
    --color-text-tertiary: #737373;
    --text-on-dark: #f5f5f5;
    --text-on-dark-muted: #cbd5e1;
    --text-on-light: #0f172a;
    --text-on-light-muted: #475569;
    --surface-light: #f8fafc;
    --surface-light-muted: #eef2f7;
    --surface-light-border: rgba(15, 23, 42, 0.12);

    /* Borders — Translucent (key TapNow pattern) */
    --border-color: rgba(255, 255, 255, 0.1);
    --color-border: rgba(255, 255, 255, 0.1);
    --color-border-hover: rgba(255, 255, 255, 0.15);
    --color-border-focus: #1fa2dc;
    --color-border-subtle: rgba(255, 255, 255, 0.06);

    /* Semantic */
    --accent-color: #1fa2dc;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --color-success: #4caf50;
    --color-warning: #ff9800;
    --color-danger: #f44336;
    --color-info: #2196f3;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #1fa2dc 0%, #33a8ff 100%);
    --gradient-dark: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);

    /* Shadows — Lighter, TapNow-style */
    --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.2);

    /* Radius */
    --border-radius: 12px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* Spacing */
    --space-1: 8px;
    --space-2: 12px;
    --space-3: 16px;
    --space-4: 24px;

    /* Button */
    --btn-padding-y: 12px;
    --btn-padding-x: 24px;
    --btn-font-size: 14px;
    --btn-radius: 12px;
    --btn-min-height: 44px;

    /* Focus */
    --focus-ring: 0 0 0 3px rgba(31, 162, 220, 0.2);

    /* Transitions & Blur */
    --transition: all 0.3s ease;
    --blur-sm: 8px;
    --blur-md: 12px;
    --blur-lg: 16px;

    /* Z-Index */
    --z-dropdown: 50;
    --z-modal: 10000;
}

:where(button, input, select, textarea) {
    font-family: inherit;
}

:where(button) {
    color: inherit;
}

.ui-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 24px;
}

.ui-card.is-hoverable:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
}

.ui-label {
    display: block;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.ui-control,
.ui-input,
.ui-select,
.ui-textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.5;
    transition: var(--transition);
}

.ui-input,
.ui-select {
    min-height: 46px;
    padding: 12px 16px;
}

.ui-textarea {
    min-height: 120px;
    padding: 16px;
    resize: vertical;
}

:where(input[type="text"], input[type="password"], input[type="number"], input[type="email"], input[type="search"], input[type="url"], select, textarea) {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.5;
    transition: var(--transition);
}

:where(input[type="text"], input[type="password"], input[type="number"], input[type="email"], input[type="search"], input[type="url"]) {
    min-height: 46px;
    padding: 12px 16px;
}

:where(textarea) {
    min-height: 120px;
    padding: 16px;
    resize: vertical;
}

:where(select) {
    min-height: 46px;
    padding: 12px 16px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23cbd5e1' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1.0 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 16px;
    cursor: pointer;
}

:where(input, select, textarea):hover {
    border-color: rgba(255, 255, 255, 0.22);
}

:where(input, select, textarea):focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
}

:where(input, textarea)::placeholder {
    color: rgba(203, 213, 225, 0.7);
}

/* Native dropdown lists render on a light surface on Windows, so force dark text. */
:where(select) option,
:where(select) optgroup {
    background: var(--surface-light);
    color: var(--text-on-light);
}

/* Browser autofill often paints a light background; keep text readable. */
:where(input, textarea):-webkit-autofill,
:where(input, textarea):-webkit-autofill:hover,
:where(input, textarea):-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-on-light);
    caret-color: var(--text-on-light);
    box-shadow: 0 0 0 1000px var(--surface-light) inset;
}

.dark-surface,
.theme-dark-surface {
    background: var(--card-bg);
    color: var(--text-on-dark);
    border-color: var(--border-color);
}

.dark-surface :where(h1, h2, h3, h4, h5, h6, p, span, strong, label, a, li, td, th, small),
.theme-dark-surface :where(h1, h2, h3, h4, h5, h6, p, span, strong, label, a, li, td, th, small) {
    color: inherit;
}

.light-surface,
.theme-light-surface,
.light-panel,
.bg-light-panel {
    background: var(--surface-light);
    color: var(--text-on-light);
    border-color: var(--surface-light-border);
}

.light-surface :where(h1, h2, h3, h4, h5, h6, p, span, strong, label, a, li, td, th, small),
.theme-light-surface :where(h1, h2, h3, h4, h5, h6, p, span, strong, label, a, li, td, th, small),
.light-panel :where(h1, h2, h3, h4, h5, h6, p, span, strong, label, a, li, td, th, small),
.bg-light-panel :where(h1, h2, h3, h4, h5, h6, p, span, strong, label, a, li, td, th, small) {
    color: inherit;
}

.light-surface .muted,
.theme-light-surface .muted,
.light-panel .muted,
.bg-light-panel .muted {
    color: var(--text-on-light-muted);
}

.ui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: var(--btn-padding-y) var(--btn-padding-x);
    min-height: var(--btn-min-height);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.ui-btn--primary {
    background: var(--gradient-primary);
    color: #fff;
    border-color: rgba(99, 102, 241, 0.35);
}

.ui-btn--primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.ui-btn--secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.ui-btn--secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.14);
}

.ui-btn--danger {
    background: rgba(239, 68, 68, 0.14);
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.35);
}

.ui-btn--danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.22);
}

.ui-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ui-btn:focus-visible,
:where(button):focus-visible,
.app-user-btn:focus-visible,
.app-dropdown-item:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.action-btn,
.primary-btn,
.secondary-btn,
.danger-btn,
.download-btn,
#generateImageBtn,
#generateImageV2Btn,
#startColorizeBtn,
#startColorizeMultipleBtn,
#startPaletteColorizeBtn,
#startPaletteColorizeMultipleBtn,
#startInpaintingBtn,
#startOutpaintingBtn,
#startWanSketchBtn,
#startWanMultiBtn,
#startWanExpandBtn,
#startMultiImageBtn,
#startPoseModificationBtn {
    border-radius: 999px;
    min-height: var(--btn-min-height);
    padding: var(--btn-padding-y) var(--btn-padding-x);
    font-weight: 700;
}

.ui-prompt,
.question-section,
.prompt-section {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.prompt-tips,
.prompt-guide {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(99, 102, 241, 0.10);
    color: var(--text-on-dark-muted);
    font-size: 14px;
    line-height: 1.6;
}

.prompt-tips strong,
.prompt-guide-title {
    color: var(--text-on-dark);
    display: block;
}

.prompt-tips ul,
.prompt-guide-list {
    margin: 6px 0 0 18px;
    padding: 0;
}

.prompt-tips li,
.prompt-guide-list li {
    margin: 4px 0;
    color: var(--text-on-dark-muted);
}

.ui-result,
.result-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.result-content {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-md);
    color: var(--text-primary);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.result-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-lg);
    padding: 14px;
}

.result-image-container {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(0, 0, 0, 0.25);
}

.generated-image {
    width: 100%;
    display: block;
}

.result-image {
    width: 100%;
    display: block;
}

.single-result-card,
.history-item,
.palette-item,
.wan-sketch-card,
.wan-multi-card,
.wan-expand-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.app-user-dropdown {
    z-index: var(--z-dropdown);
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 16px;
}

.login-card {
    width: min(420px, 100%);
}

.login-title {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 800;
}

.login-subtitle {
    margin: 0 0 20px;
    color: var(--text-on-dark-muted);
    font-size: 14px;
}

.login-hint {
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-on-dark-muted);
    text-align: center;
}

.login-error {
    min-height: 20px;
    margin-top: 12px;
    font-size: 13px;
    color: #fecaca;
}

.login-field-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-on-dark-muted);
}

.auth-divider {
    position: relative;
    margin: 18px 0 14px;
    text-align: center;
    font-size: 12px;
    color: var(--text-on-dark-muted);
}

.auth-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    transform: translateY(-50%);
}

.auth-divider span {
    position: relative;
    padding: 0 10px;
    background: var(--surface-primary);
}

.social-auth-list {
    display: grid;
    gap: 10px;
}

.social-auth-list > .ui-btn {
    width: 100%;
    justify-content: flex-start;
    position: relative;
    padding-left: 18px;
    font-weight: 700;
}

.social-auth-list > .ui-btn::before {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 24px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    content: "";
}

.social-auth-list > .ui-btn[data-auth-provider="google"] {
    background: #ffffff;
    color: #202124;
    border-color: #dadce0;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.social-auth-list > .ui-btn[data-auth-provider="google"]:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #c7cbd1;
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.12);
}

.social-auth-list > .ui-btn[data-auth-provider="google"]::before {
    content: "G";
    background: linear-gradient(135deg, #4285f4 0 25%, #34a853 25% 50%, #fbbc05 50% 75%, #ea4335 75% 100%);
    color: #ffffff;
}

.social-auth-list > .ui-btn[data-auth-provider="wechat"] {
    background: linear-gradient(180deg, #2dc653 0%, #22a447 100%);
    color: #ffffff;
    border-color: rgba(34, 164, 71, 0.75);
}

.social-auth-list > .ui-btn[data-auth-provider="wechat"]:hover:not(:disabled) {
    background: linear-gradient(180deg, #36d65b 0%, #1f9b42 100%);
    box-shadow: 0 10px 22px rgba(34, 164, 71, 0.24);
}

.social-auth-list > .ui-btn[data-auth-provider="wechat"]::before {
    content: "W";
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.login-provider-note {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-on-dark-muted);
    text-align: center;
}

.works-card {
    padding: 22px;
}

.works-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.works-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.works-title-text {
    font-weight: 800;
    font-size: 18px;
    color: var(--text-primary);
}

.works-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.works-tabs {
    display: flex;
    gap: 6px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.works-tab {
    padding: 8px 12px;
    border-radius: 999px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.82);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.works-tab:hover {
    background: rgba(255, 255, 255, 0.10);
}

.works-tab.is-active {
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25);
}

.works-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.works-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.works-search i {
    color: rgba(255, 255, 255, 0.65);
}

.works-search .ui-input {
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
    min-height: auto;
    font-size: 13px;
}

.works-search .ui-input:focus {
    box-shadow: none;
}

.works-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 12px;
}

.works-banner {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.works-banner.is-error {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.10);
    color: #fecaca;
}

.works-banner.is-info {
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.10);
    color: rgba(255, 255, 255, 0.86);
}

.works-table-wrap {
    width: 100%;
    overflow: auto;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(0, 0, 0, 0.12);
}

.works-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

.works-table th,
.works-table td {
    padding: 12px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    font-size: 13px;
}

.works-table th {
    position: sticky;
    top: 0;
    background: rgba(17, 24, 39, 0.92);
    color: rgba(255, 255, 255, 0.88);
    z-index: 1;
}

.works-table tr:hover td {
    background: rgba(255, 255, 255, 0.04);
}

.works-row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.works-mini {
    padding: 8px 12px;
    min-height: 36px;
    font-size: 13px;
}

.works-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.2px;
}

.works-tag--ok {
    border-color: rgba(34, 197, 94, 0.40);
    background: rgba(34, 197, 94, 0.10);
    color: rgba(167, 243, 208, 0.95);
}

.works-tag--info {
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(99, 102, 241, 0.12);
    color: rgba(199, 210, 254, 0.98);
}

.works-tag--warn {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.12);
    color: rgba(253, 230, 138, 0.98);
}

.works-tag--bad {
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.12);
    color: rgba(254, 202, 202, 0.98);
}

.works-tag--muted {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.75);
}

.works-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.works-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.works-progress-bar {
    width: 130px;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
}

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

.works-progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 42px;
}

.works-empty {
    margin-top: 18px;
    padding: 40px 20px;
    border-radius: var(--radius-lg);
    border: 1px dashed rgba(255, 255, 255, 0.18);
    text-align: center;
    color: var(--text-secondary);
}

.works-empty-icon {
    font-size: 40px;
    opacity: 0.55;
    margin-bottom: 8px;
}

.works-empty-title {
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.works-empty-desc {
    font-size: 13px;
}

.works-preview-body {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
}

.works-preview-media video {
    width: 100%;
    max-height: min(70vh, 560px);
    border-radius: 12px;
    background: #000;
}

.works-preview-info {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.06);
}

.works-kv {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.works-kv:last-child {
    border-bottom: none;
}

.works-k {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-weight: 700;
}

.works-v {
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
}

.works-preview-footer {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.account-card {
    padding: 22px;
}

.account-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.account-title {
    font-weight: 900;
    font-size: 18px;
    color: var(--text-primary);
}

.account-desc {
    font-size: 12px;
    color: var(--text-on-dark-muted);
}

.account-section {
    padding: 16px;
    margin-top: 14px;
}

.account-section-title {
    font-weight: 900;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.92);
}

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

.account-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-label {
    font-size: 12px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.82);
}

.account-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.account-password {
    position: relative;
}

.account-eye {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.82);
    cursor: pointer;
}

.account-eye:hover {
    background: rgba(255, 255, 255, 0.12);
}

.account-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.74);
}

.account-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

@media (max-width: 768px) {
    .account-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .works-preview-body {
        grid-template-columns: 1fr;
    }

    .works-table {
        min-width: 860px;
    }
}

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

html {
    font-size: 16px;
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    background: var(--gradient-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
}

/* 头部样式 */
header {
    text-align: center;
    padding: 40px 0 30px;
    margin-bottom: 30px;
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

h1 {
    font-size: 2.8rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    /*-webkit-text-fill-color: transparent;*/
    background-clip: text;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-weight: 400;
}

.version {
    display: inline-block;
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.3);
    backdrop-filter: blur(10px);
}

/* NEW HEADER */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}
.main-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    transform: rotate(30deg);
    pointer-events: none;
}

.app-user-dropdown-portal {
    position: fixed;
    right: auto;
    top: 0;
    left: 0;
}
.header-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.is-hidden {
    display: none;
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.app-header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(10px);
}

.app-nav-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-nav-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.22);
    margin: 0 4px;
}

.app-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.92);
    font-weight: 600;
    font-size: 13px;
    transition: var(--transition);
}

.app-nav-item:hover {
    background: rgba(255, 255, 255, 0.18);
}

.app-nav-item.is-active {
    background: rgba(255, 255, 255, 0.28);
    color: var(--text-on-light);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

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

.app-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.app-chip:hover {
    background: rgba(255, 255, 255, 0.18);
}

.app-chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 12px;
    line-height: 1;
}

.app-user {
    position: relative;
}

.app-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    transition: var(--transition);
}

.app-user-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.app-user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-weight: 800;
    color: #fff;
}

.app-user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-user-caret {
    font-size: 12px;
    opacity: 0.75;
    transition: transform 0.16s ease;
}

.app-user-btn.is-open .app-user-caret {
    transform: rotate(180deg);
}

.app-user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 170px;
    padding: 8px;
    border-radius: 14px;
    background: rgba(17, 24, 39, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    z-index: 50;
}

.app-dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 10px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.92);
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

.app-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.10);
}

.app-dropdown-danger {
    color: #fecaca;
}

.app-mobile-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-mobile-user {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
}

.app-mobile-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-mobile-group-title {
    margin-top: 6px;
    padding: 8px 10px 2px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: rgba(255, 255, 255, 0.72);
}

.app-mobile-group-title:first-child {
    margin-top: 0;
}

.app-mobile-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    cursor: pointer;
    font-weight: 700;
}

.app-mobile-item:hover {
    background: rgba(255, 255, 255, 0.14);
}

.app-mobile-danger {
    color: #fecaca;
}
.header-badges {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
}
.global-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}
.header-account {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}
.badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-on-dark);
}
.badge.nav-badge {
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.badge.nav-badge:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.45);
    color: var(--text-on-light);
}
.badge.nav-badge.is-active {
    background: rgba(255, 255, 255, 0.36);
    border-color: rgba(255, 255, 255, 0.7);
    color: var(--text-on-light);
    font-weight: 700;
}

.header-badges .app-nav-item.is-active {
    background: rgba(255, 255, 255, 0.28);
}

.badge.nav-badge .nav-icon {
    font-size: 0.95em;
    line-height: 1;
    opacity: 0.65;
    transition: var(--transition);
}

.badge.nav-badge.is-active .nav-icon {
    opacity: 1;
    color: currentColor;
}

.badge.nav-badge .nav-icon--video {
    color: #22c55e;
}

.badge.nav-badge .nav-icon--image {
    color: #38bdf8;
}

.task-drawer-backdrop,
.task-preview-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    z-index: 9998;
}

.task-drawer {
    position: fixed;
    top: 16px;
    right: 16px;
    width: min(420px, calc(100vw - 32px));
    height: min(620px, calc(100vh - 32px));
    background: rgba(17, 24, 39, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    color: #fff;
}

.task-drawer-header,
.task-drawer-footer {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.task-drawer-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.task-drawer-title {
    font-weight: 700;
    letter-spacing: 0.2px;
}

.task-drawer-close,
.task-preview-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
}

.task-drawer-close:hover,
.task-preview-close:hover {
    background: rgba(255, 255, 255, 0.14);
}

.task-drawer-body {
    padding: 12px 14px;
    overflow: auto;
    flex: 1;
}

.task-empty {
    padding: 18px 12px;
    opacity: 0.85;
}

.task-item {
    padding: 12px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
}

.task-item + .task-item {
    margin-top: 10px;
}

.task-item.is-done {
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(34, 197, 94, 0.08);
}

.task-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.task-title {
    font-weight: 700;
}

.task-status {
    font-size: 0.85em;
    opacity: 0.9;
}

.task-sub {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.82em;
    opacity: 0.85;
}

.task-meta {
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
}

.task-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.task-action {
    padding: 7px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    font-size: 0.88em;
}

.task-action:hover {
    background: rgba(255, 255, 255, 0.14);
}

.task-drawer-btn {
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
}

.task-drawer-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

.task-preview {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(920px, calc(100vw - 32px));
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
    z-index: 10000;
    color: #fff;
}

.task-preview-header {
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.task-preview-title {
    font-weight: 700;
}

.task-preview-body {
    padding: 12px 14px 14px;
}

#globalTaskPreviewVideo {
    width: 100%;
    max-height: min(70vh, 560px);
    border-radius: 12px;
    background: #000;
}
.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}
.logo-text h1 {
    font-size: 1.5em;
    margin: 0 0 5px 0;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
header h1 {
    color: #ffffff;
    margin-bottom: 10px;
}
.logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    /* border: 2px solid rgba(255, 255, 255, 0.3); */
}

/* 标签页样式 */
.tab-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

/* Unified button sizing */
.btn,
.btn-secondary,
.tab-btn,
.preset-btn {
    padding: var(--btn-padding-y) var(--btn-padding-x);
    font-size: var(--btn-font-size);
    border-radius: var(--btn-radius);
    min-height: var(--btn-min-height);
    line-height: 1.2;
}

.tab-btn {
    flex: 1;
    min-width: 160px;
    padding: 16px 24px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.tab-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tab-btn.active::after {
    transform: scaleX(1);
}

.tab-content {
    display: block;
    animation: fadeIn 0.5s ease;
}

.tab-content.is-hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.upload-section,
.result-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.upload-section:hover,
.result-section:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 6px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 3px;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.04);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.upload-area.dragover {
    border-color: var(--accent-color);
    background: rgba(16, 185, 129, 0.05);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.file-types {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* 预览容器 */
.preview-container {
    margin: 20px 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    max-height: 300px;
    border: 1px solid var(--border-color);
}

.preview-container img,
.preview-container video {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    display: none;
}

/* 模式选择 */
.mode-section {
    margin: 25px 0;
}

.mode-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.mode-select {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23cbd5e1' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 16px;
    cursor: pointer;
}

.mode-select:hover,
.mode-select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.mode-description {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

/* 专业控制面板 */
.professional-studio-controls {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 25px;
    margin: 25px 0;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.professional-studio-controls h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.control-group {
    margin-bottom: 20px;
}

.control-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.control-label .icon {
    font-size: 1.2rem;
}

.professional-select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.professional-select:hover,
.professional-select:focus {
    border-color: var(--primary-color);
    outline: none;
}

.control-description {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding-left: 22px;
}

.preset-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.preset-section h4 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.preset-btn {
    padding: 10px 18px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.preset-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

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

/* 提示词区域 */
.prompt-section {
    margin: 25px 0;
}

.prompt-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    transition: var(--transition);
}

textarea:hover,
textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 32px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    margin-top: 20px;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-color) 100%);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
}

.btn-icon {
    font-size: 1.2rem;
}

/* 加载指示器 */
.loading {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin: 20px 0;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 25px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading p {
    margin: 10px 0;
    color: var(--text-secondary);
}

/* 视频容器 */
.video-container {
    margin: 25px 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
}

video {
    width: 100%;
    display: block;
    max-height: 400px;
}

/* 状态消息 */
.status-message {
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin: 20px 0;
    font-weight: 600;
    display: none;
}

.status-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-message.info {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.billing-preview-card {
    margin: 18px 0 10px;
    padding: 16px 18px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(31, 162, 220, 0.22);
    background: linear-gradient(135deg, rgba(31, 162, 220, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
}

.billing-preview-card.is-loading {
    border-color: rgba(99, 102, 241, 0.35);
}

.billing-preview-card.is-error {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
}

.billing-preview-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.billing-preview-card__title {
    font-weight: 700;
    color: var(--text-primary);
}

.billing-preview-card__badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 0.8rem;
    white-space: nowrap;
}

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

.billing-preview-card__section {
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.billing-preview-card__section--actual {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(96, 165, 250, 0.2);
}

.billing-preview-card__section-title {
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 600;
}

.billing-preview-card__section .billing-preview-card__values {
    margin-bottom: 0;
}

.billing-preview-card__value {
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.billing-preview-card__label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.billing-preview-card__value strong {
    color: var(--text-primary);
    font-size: 1.05rem;
}

.billing-preview-card__meta {
    margin-bottom: 6px;
    color: var(--text-primary);
    font-size: 0.92rem;
}

.billing-preview-card__hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* 描述容器 */
.description-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 20px 0;
    border: 1px solid var(--border-color);
    display: none;
}

.description-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

#aiDescription {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* 双图上传容器 */
.two-images-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 25px 0;
}

@media (max-width: 768px) {
    .two-images-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        overflow-x: hidden;
    }

    .container {
        padding: 0 10px;
    }

    header {
        padding: 22px 0 16px;
        margin-bottom: 16px;
    }

    .ui-card {
        padding: 16px;
    }

    .ui-prompt,
    .question-section,
    .prompt-section {
        padding: 12px;
    }

    .prompt-tips,
    .prompt-guide {
        padding: 10px;
    }

    .result-item {
        padding: 12px;
    }

    .works-card {
        padding: 14px;
    }

    .works-toolbar {
        gap: 10px;
    }

    .works-tabs {
        width: 100%;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    .works-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .works-search {
        width: 100%;
        flex: 1;
    }

    .works-table {
        min-width: 720px;
    }

    .works-table th,
    .works-table td {
        padding: 10px 10px;
    }

    .works-progress-bar {
        width: 96px;
    }

    .works-mini {
        min-height: 34px;
        padding: 7px 10px;
        font-size: 12px;
    }

    .progress-steps {
        justify-content: flex-start;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        margin: 18px 0;
    }

    .progress-steps::before {
        display: none;
    }

    .step {
        min-width: 96px;
        padding: 8px 10px;
        font-size: 12px;
        white-space: nowrap;
    }

    .content-area table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .content-area table th,
    .content-area table td {
        white-space: nowrap;
    }

    .billing-preview-card__values {
        grid-template-columns: 1fr;
    }
}

.image-upload-group h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.two-image-upload,
.multi-image-upload,
.video-upload {
    padding: 30px 20px;
}

/* 进度步骤 */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
}

.step {
    position: relative;
    z-index: 2;
    background: var(--card-bg);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    min-width: 120px;
}

.step.active {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.step.completed {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background: rgba(16, 185, 129, 0.1);
}

.processing-time {
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

footer p {
    margin: 8px 0;
}

#apiStatus {
    color: var(--accent-color);
    font-weight: 600;
}

/* 特色描述 */
.feature-description {
    background: rgba(99, 102, 241, 0.1);
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin: 20px 0;
    border-left: 4px solid var(--primary-color);
    color: var(--text-primary);
}

/* 视频规格 */
.video-specs {
    background: rgba(255, 255, 255, 0.06);
    padding: 20px;
    border-radius: var(--border-radius);
    margin: 20px 0;
    border: 1px solid var(--border-color);
}

.video-specs h4 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.spec-item {
    background: rgba(15, 23, 42, 0.5);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    border: 1px solid var(--border-color);
}

.spec-label {
    font-weight: 600;
    color: var(--text-primary);
}

.spec-value {
    color: var(--accent-color);
}

/* 生成信息 */
.generation-info {
    background: rgba(255, 255, 255, 0.06);
    padding: 25px;
    border-radius: var(--border-radius);
    margin: 25px 0;
    border: 1px solid var(--border-color);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-item:last-child {
    border-bottom: none;
}

.info-item label {
    font-weight: 600;
    color: var(--text-primary);
}

.info-item span {
    color: var(--accent-color);
}

/* 过渡预览 */
.transition-preview {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: var(--border-radius);
    margin: 25px 0;
    border: 1px solid var(--border-color);
}

.images-comparison {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.image-frame {
    flex: 1;
    min-width: 200px;
    text-align: center;
}

.image-frame img {
    max-width: 100%;
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
}

.image-frame span {
    display: block;
    margin-top: 10px;
    font-weight: 600;
    color: var(--text-primary);
}

.transition-arrow {
    padding: 15px 25px;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--border-radius);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 比较区域 */
.comparison-section {
    background: rgba(255, 255, 255, 0.06);
    padding: 25px;
    border-radius: var(--border-radius);
    margin: 25px 0;
    border: 1px solid var(--border-color);
}

.comparison-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .comparison-container {
        grid-template-columns: 1fr;
    }
}

.comparison-column h5 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    text-align: center;
}

/* 进度条 */
.progress-container {
    margin: 25px 0;
}

.progress-text {
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.progress-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 5px;
    transition: width 0.5s ease;
}

/* 响应式调整 */
@media (max-width: 768px) {
    h1 {
        font-size: 2.2rem;
    }

    .tab-menu {
        flex-direction: column;
    }

    .tab-btn {
        min-width: 100%;
    }

    .professional-studio-controls {
        padding: 20px;
    }

    .control-grid {
        grid-template-columns: 1fr;
    }

    .progress-steps {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .progress-steps::before {
        display: none;
    }

    .step {
        width: 100%;
        max-width: 300px;
    }
}

/* ============================================================
   微交互動畫系統 (A4)
   按鈕回饋、表單聚焦、卡片懸停、頁面進場、骨架屏、Toast
   全面尊重 prefers-reduced-motion
   ============================================================ */

/* === 基礎 Keyframes === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
@keyframes slideInRight {
    from { transform: translateX(24px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}
@keyframes shimmer-bar {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes border-glow {
    0%, 100% { border-color: var(--border-color, rgba(255,255,255,0.1)); }
    50%      { border-color: var(--color-primary, #1fa2dc); }
}

/* === 按鈕微交互 === */
.btn, button[type="submit"], .action-btn, .professional-btn,
.tab-btn, .pricing-btn, .chip, .nav-item {
    transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:active, button[type="submit"]:active, .action-btn:active,
.professional-btn:active, .tab-btn:active, .chip:active, .nav-item:active {
    transform: scale(0.97);
}
.btn:focus-visible, button[type="submit"]:focus-visible,
.action-btn:focus-visible, .professional-btn:focus-visible {
    outline: 2px solid var(--color-primary, #1fa2dc);
    outline-offset: 2px;
    border-radius: 6px;
}

/* === 表單聚焦動畫 === */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"], textarea, select,
.professional-input, .ui-prompt textarea {
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.2s ease;
}
input:focus, textarea:focus, select:focus,
.professional-input:focus, .ui-prompt textarea:focus {
    border-color: var(--color-primary, #1fa2dc);
    box-shadow: 0 0 0 3px rgba(31, 162, 220, 0.15);
    outline: none;
    background: rgba(255, 255, 255, 0.08);
}

/* === 卡片懸停增強 === */
.ui-card, .upload-section, .result-section,
.pricing-card, .works-card, .account-section {
    transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.3s ease;
}
.ui-card:hover, .upload-section:hover, .result-section:hover {
    border-color: var(--color-primary, #1fa2dc);
    box-shadow: 0 4px 24px rgba(31, 162, 220, 0.12);
}
.pricing-card:hover {
    border-color: var(--color-primary, #1fa2dc);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(31, 162, 220, 0.15);
}
.works-card:hover {
    border-color: var(--color-primary, #1fa2dc);
}
/* 觸控裝置上仍保留懸停效果 (透過 :active 降級) */
@media (hover: none) {
    .pricing-card:hover { transform: none; }
}

/* === Tab 滑動底線 === */
.tab-btn {
    position: relative;
    transition: color 0.2s ease, background 0.2s ease;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-primary, #1fa2dc);
    transition: width 0.25s ease, left 0.25s ease;
    border-radius: 1px;
}
.tab-btn.active::after,
.tab-btn:hover::after {
    width: 40%;
    left: 30%;
}
.tab-btn.active::after {
    width: 70%;
    left: 15%;
}

/* === 模態框進場 === */
.modal-content, .dialog, .sc-toast {
    animation: scaleIn 0.2s ease forwards;
}

/* === 進度條流光 === */
.progress-fill {
    background: linear-gradient(
        90deg,
        var(--color-primary, #1fa2dc) 0%,
        var(--color-primary-dark, #1a8fc5) 30%,
        var(--color-primary, #1fa2dc) 60%,
        var(--color-primary-dark, #1a8fc5) 100%
    );
    background-size: 200% 100%;
    animation: shimmer-bar 2s linear infinite;
}

/* === 骨架屏脈動 === */
.sc-skeleton, .sc-shimmer {
    animation: sc-shimmer 1.5s ease-in-out infinite;
}

/* === 頁面區塊進場 (僅首次載入) === */
.animate-once {
    animation: fadeInUp 0.5s ease both;
}
.animate-stagger > * {
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}
.animate-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.animate-stagger > *:nth-child(6) { animation-delay: 0.3s; }

/* === 狀態指示器 === */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}
.status-dot.online  { background: #22c55e; animation: pulse 2s ease-in-out infinite; }
.status-dot.offline { background: #ef4444; }
.status-dot.busy    { background: #f59e0b; animation: pulse 1.5s ease-in-out infinite; }

/* === 複製/點擊回饋 === */
.copied-flash {
    animation: border-glow 0.4s ease 2;
}

/* === reduced-motion: 禁用所有動畫 === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .progress-fill { animation: none; background-size: 100% 100%; }
    .status-dot.online, .status-dot.busy { animation: none; }
}

/* ============================================================
   無障礙強化 (A5)
   跳轉連結、螢幕閱讀器、焦點指示器、aria 視覺支援
   ============================================================ */

/* === 螢幕閱讀器專用 === */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.sr-only-focusable:focus,
.sr-only-focusable:focus-visible {
    position: static;
    width: auto;
    height: auto;
    padding: 12px 20px;
    margin: 8px;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--color-primary, #1fa2dc);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 6px;
    z-index: 10000;
    text-decoration: none;
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* === Skip-to-content 連結 === */
.skip-link {
    position: absolute;
    top: -100px;
    left: 8px;
    padding: 12px 20px;
    background: var(--color-primary, #1fa2dc);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 6px;
    z-index: 9999;
    text-decoration: none;
    transition: top 0.2s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
    top: 8px;
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* === 鍵盤焦點增強 (全域) === */
:focus-visible {
    outline: 2px solid var(--color-primary, #1fa2dc) !important;
    outline-offset: 2px;
    border-radius: 4px;
}
/* 移除 Firefox 預設虛線 */
:focus:not(:focus-visible) {
    outline: none;
}
/* 自訂焦點樣式覆蓋（較不突兀） */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--color-primary, #1fa2dc);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(31, 162, 220, 0.2);
}

/* === aria-current 視覺標記 === */
[aria-current="page"] {
    color: var(--color-primary, #1fa2dc);
    font-weight: 600;
    border-bottom: 2px solid var(--color-primary, #1fa2dc);
}

/* === aria-expanded 指示器 === */
[aria-expanded="true"] > .indicator,

/* === aria-invalid 錯誤指示 === */
[aria-invalid="true"] {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}
[aria-invalid="true"]:focus-visible {
    outline-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25);
}
[aria-invalid] .error-message {
    color: #fca5a5;
    font-size: 0.8125rem;
    margin-top: 4px;
}
[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* === aria-disabled 樣式 === */
[aria-disabled="true"] {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* === aria-live 區域 (動態內容公告) === */
[aria-live="polite"],
[aria-live="assertive"] {
    /* 視覺隱藏但螢幕閱讀器可訪問 */
    /* 若需可見內容則不加此樣式，由元素自行控制 */
}
/* toast 內的 aria-live 保持可見 */
.sc-toast[aria-live] {
    /* 不隱藏 — 由 toast 自身樣式控制 */
}

/* === 高對比模式支援 === */
@media (forced-colors: active) {
    .btn, button, .tab-btn, .chip {
        border: 2px solid ButtonText;
    }
    .btn:hover, button:hover {
        background: Highlight;
        color: HighlightText;
    }
    .ui-card, .upload-section, .result-section,
    .pricing-card, .works-card {
        border: 2px solid ButtonText;
    }
    input, select, textarea, .professional-input {
        border: 2px solid ButtonText;
    }
    :focus-visible {
        outline: 3px solid Highlight !important;
    }
}

/* === 減少動畫 (prefers-reduced-motion 已在 A4 處理) === */

/* ============================================================
   響應式設計 — 手機/小平板斷點 (A3)
   480px (手機) / 640px (小平板)
   現有 768px / 1024px 斷點保留於上方各區塊
   ============================================================ */

/* --- 640px: 小平板直向 --- */
@media (max-width: 640px) {
    /* Navigation & tabs */
    .tab-menu {
        gap: 4px;
    }
    .tab-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    /* Works toolbar */
    .works-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }
    .works-search {
        min-width: 100%;
        order: -1;
    }

    /* Upload areas */
    .upload-area {
        padding: 24px 14px;
    }
    .upload-icon {
        font-size: 2.2rem;
    }

    /* Image analysis sections */
    .section-header h2 {
        font-size: 1.2rem;
    }
    .section-header p {
        font-size: 0.82rem;
    }
    .control-group.model-control-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* Header */
    header {
        padding: 24px 0 16px;
    }

    /* Form controls */
    .action-section {
        flex-wrap: wrap;
    }
    .action-section button {
        flex: 1;
        min-width: 140px;
    }
}

/* --- 480px: 手機 --- */
@media (max-width: 480px) {
    /* === TYPOGRAPHY === */
    h1 { font-size: 1.5rem; letter-spacing: -0.2px; }
    h2 { font-size: 1.2rem; }
    h3 { font-size: 1.05rem; }
    .section-title { font-size: 1.15rem; gap: 6px; }
    .section-title::before { width: 4px; height: 18px; }
    .subtitle { font-size: 0.9rem; }
    body { font-size: 0.88rem; }

    /* === LAYOUT === */
    body { padding: 6px; }
    .container { padding: 0 6px; }
    header { padding: 14px 0 10px; margin-bottom: 10px; }
    header::after { width: 100px; height: 3px; }

    /* === CARDS & SECTIONS === */
    .ui-card, .upload-section, .result-section {
        padding: 12px;
        border-radius: 8px;
    }
    .ui-card:hover, .result-section:hover {
        transform: none; /* disable hover lift on touch */
    }
    .result-item { padding: 10px; }

    /* === BUTTONS — full width + touch target === */
    .btn, button[type="submit"], .action-btn,
    .action-section button, .professional-btn {
        width: 100%;
        min-height: 44px;
        padding: 12px 16px;
        font-size: 0.95rem;
        justify-content: center;
    }
    .btn-group {
        flex-direction: column;
        gap: 8px;
    }
    .btn-group .btn { width: 100%; }

    /* === FORMS === */
    input[type="text"], input[type="email"], input[type="password"],
    input[type="number"], input[type="url"], textarea, select,
    .professional-input, .ui-prompt textarea {
        font-size: 16px; /* prevent iOS auto-zoom */
        padding: 10px 12px;
        min-height: 44px;
    }
    .control-group { gap: 6px; }
    .control-label { font-size: 0.88rem; }

    /* === TABS — vertical stack === */
    .tab-menu {
        flex-direction: column;
        gap: 4px;
        width: 100%;
    }
    .tab-btn {
        width: 100%;
        justify-content: center;
        min-height: 40px;
        font-size: 0.88rem;
    }

    /* === GRID LAYOUTS — collapse to single column === */
    .main-content,
    .control-grid,
    .two-images-container,
    .comparison-container,
    .account-grid,
    .split {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* === UPLOAD AREAS === */
    .upload-area, .two-image-upload, .multi-image-upload, .video-upload {
        padding: 18px 10px;
    }
    .upload-icon { font-size: 1.8rem; margin-bottom: 8px; }
    .file-types { font-size: 0.8rem; }

    /* === VIDEO & RESULT === */
    .video-container video { border-radius: 6px; }
    .description-container { padding: 10px; }
    #aiDescription { font-size: 0.85rem; }

    /* === WORKS PAGE === */
    .works-toolbar { flex-direction: column; align-items: stretch; }
    .works-search { width: 100%; }
    .works-tabs {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .works-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }
    .works-table {
        min-width: 520px;
        font-size: 0.78rem;
    }
    .works-table th, .works-table td { padding: 6px 8px; }
    .works-card { padding: 10px; }
    .works-empty, .sc-empty { padding: 24px 12px; }
    .sc-empty__icon { width: 48px; height: 48px; }
    .sc-empty__title { font-size: 1rem; }

    /* === PROGRESS STEPS === */
    .progress-steps {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        gap: 6px;
    }
    .step {
        min-width: 72px;
        padding: 6px 8px;
        font-size: 11px;
    }

    /* === HEADER/NAV === */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .section-icon { font-size: 1.1rem; }

    /* === LOADING & STATE === */
    .sc-loading__text { font-size: 0.82rem; }
    .sc-spinner { width: 32px; height: 32px; }

    /* === PRICING / CARDS === */
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .pricing-card { padding: 20px 16px; }

    /* === AUTH PAGES === */
    .auth-container {
        width: 100%;
        max-width: 100%;
        padding: 20px 12px;
    }
    .auth-card { padding: 20px 16px; }

    /* === MODALS / OVERLAYS === */
    .modal-content, .dialog {
        width: calc(100% - 24px);
        margin: 12px;
        padding: 16px;
        border-radius: 10px;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* 输入框文件类型 */
input[type="file"] {
    display: none;
}






/* ... existing code ... */

/* 万相-图生动作功能区样式 */
#animateMoveSection {
    margin-bottom: 40px;
    padding: 30px 0;
}

#animateMoveSection .control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin: 25px 0;
}

#animateMoveSection .control-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#animateMoveSection .control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#animateMoveSection .control-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

#animateMoveSection .control-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

#animateMoveSection .slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

#animateMoveSection .slider-container input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
}

#animateMoveSection .slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#animateMoveSection .professional-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

#animateMoveSection .professional-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#animateMoveSection .video-specs {
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 25px 0;
    border: 1px solid var(--border-color);
}

#animateMoveSection .video-specs h4 {
    margin: 0 0 15px 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

#animateMoveSection .specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

#animateMoveSection .spec-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#animateMoveSection .spec-label {
    font-weight: 600;
    color: var(--text-secondary);
}

#animateMoveSection .spec-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* ... existing code ... */


/* ============================================================


/* ============================================================


/* ============================================================


/* ============================================================


/* ============================================================


/* ============================================================
   Merged from css/style.css (Phase E cleanup)
   TapNow v2.0 color palette applied
   ============================================================ */


.logo-text p {
    font-size: 0.9em;
    margin: 0;
    opacity: 0.9;
    font-weight: 500;
}

.hamburger-menu {
    display: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
}

.hamburger-menu:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mobile-menu {
    display: none;
    padding-top: 15px;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.desktop-nav {
    display: flex;
}

.feature-nav {
    display: flex;
    gap: 5px;
    margin: 10px 0;
    padding: 10px 5px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    overflow-x: auto;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 90px;
    
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
}

.nav-item:hover {
    background: rgba(31, 162, 220, 0.08);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(31, 162, 220, 0.15);
}

.nav-item.active {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(31, 162, 220, 0.2);
}

.nav-item i {
    font-size: 24px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.nav-item.active i {
    color: white;
}

.nav-item span {
    font-size: 0.65rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-item.active span {
    color: white;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    
    padding-top: 8px;
}

.section-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-icon i {
    font-size: 24px;
    color: white;
}

.section-title h2 {
    margin: 0 0 5px 0;
    color: var(--text-primary);
    font-size: 1.5em;
    font-weight: 600;
}

.section-title p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95em;
}

.feature-section {
    display: none;
}

.feature-section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.upload-placeholder .upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.upload-placeholder p {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.upload-placeholder small {
    color: var(--text-secondary);
}

.preview-area {
    position: relative;
    margin-top: 20px;
    text-align: center;
}

#imagePreview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
}

.question-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

.question-textarea {
    width: 100%;
    padding: 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    font-family: inherit;
    min-height: 110px;
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-on-dark);
}

.question-textarea:hover {
    border-color: var(--border-color);
    background: rgba(255, 255, 255, 0.04);
}

.question-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(31, 162, 220, 0.15), 0 0 0 3px rgba(31, 162, 220, 0.15);
    background: var(--card-bg);
}

.question-textarea::placeholder {
    color: var(--text-secondary);
}

/* Keep all prompt-related inputs on the same readable font color. */
#promptInput,
#t2vPrompt,
#startEndPrompt,
#ref2VideoPrompt,
#multiRefPrompt,
#extensionPrompt,
#textToImagePrompt,
#wanMultiPrompt,
#wanExpandPrompt,
#colorizePrompt,
#paletteColorizePrompt,
#inpaintingPrompt,
#outpaintingPrompt,
#multiImagePrompt,
#poseModificationPrompt,
#animateMovePrompt {
    color: var(--text-on-dark);
}

#promptInput::placeholder,
#t2vPrompt::placeholder,
#startEndPrompt::placeholder,
#ref2VideoPrompt::placeholder,
#multiRefPrompt::placeholder,
#extensionPrompt::placeholder,
#textToImagePrompt::placeholder,
#wanMultiPrompt::placeholder,
#wanExpandPrompt::placeholder,
#colorizePrompt::placeholder,
#paletteColorizePrompt::placeholder,
#inpaintingPrompt::placeholder,
#outpaintingPrompt::placeholder,
#multiImagePrompt::placeholder,
#poseModificationPrompt::placeholder,
#animateMovePrompt::placeholder {
    color: var(--text-on-dark-muted);
}

#inpaintingPrompt {
    background: var(--dark-bg);
    color: #ffffff;
    border-color: var(--text-primary);
}

#inpaintingPrompt::placeholder {
    color: #cbd5e1;
}

.wan-sketch-options, .wan-multi-options, .wan-expand-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.wan-sketch-card, .wan-multi-card, .wan-expand-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.04) 100%);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    transition: transform 0.1s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.wan-sketch-card:hover, .wan-multi-card:hover, .wan-expand-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(31, 162, 220, 0.15);
    border-color: var(--border-color);
}

.wan-sketch-card label, .wan-multi-card label, .wan-expand-card label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--text-primary);
}

.wan-sketch-card label i, .wan-multi-card label i, .wan-expand-card label i {
    color: var(--primary-color);
}

.wan-sketch-card input, .wan-sketch-card select, .wan-multi-card input, .wan-multi-card select, .wan-expand-card input, .wan-expand-card select {
    width: 100%;
    margin-top: 2px;
}

.wan-sketch-card .checkbox-grid, .wan-multi-card .checkbox-grid, .wan-expand-card .checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    margin: 4px 0 10px;
}

.wan-sketch-hint, .wan-multi-hint, .wan-expand-hint {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

#questionInput {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#questionInput:focus {
    outline: none;
    border-color: var(--primary-color);
}

.prompt-guide-title {
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.prompt-guide-title i {
    color: var(--primary-color);
}

.prompt-guide-list {
    margin: 6px 0 10px;
    padding-left: 18px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.prompt-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.prompt-pill {
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.prompt-pill:hover {
    border-color: var(--primary-color);
    color: #c7d2fe;
    box-shadow: 0 2px 6px rgba(31, 162, 220, 0.15);
}

.colorization-section {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.colorization-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

#colorizationMode {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    background: var(--card-bg);
}

.action-section {
    text-align: center;
    margin-bottom: 30px 0px;
    padding: 15px 0px;
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 14px;
}

.download-btn {
    background: var(--gradient-primary);
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    font-size: 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(31, 162, 220, 0.25);
}

.download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(31, 162, 220, 0.3);
    filter: brightness(1.05);
}

.download-btn:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(31, 162, 220, 0.2);
}

.download-btn:focus-visible {
    outline: 3px solid rgba(31, 162, 220, 0.3);
    outline-offset: 2px;
}

.download-btn i {
    font-size: 14px;
}

#analyzeImageBtn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 14px 36px;
    font-size: 16px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(31, 162, 220, 0.25);
}

#analyzeImageBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(31, 162, 220, 0.35);
    background: var(--gradient-primary);
}

#analyzeImageBtn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#analyzeImageBtn:active:not(:disabled) {
    transform: translateY(0);
}

#generateImageBtn, #generateImageV2Btn, #startColorizeBtn, #startColorizeMultipleBtn, #startPaletteColorizeBtn, #startPaletteColorizeMultipleBtn, #startInpaintingBtn, #startOutpaintingBtn, #startWanSketchBtn, #startWanMultiBtn, #startWanExpandBtn, #startMultiImageBtn, #startPoseModificationBtn, .primary-btn, .secondary-btn, .danger-btn, .action-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 14px 36px;
    font-size: 16px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(31, 162, 220, 0.25);
}

#generateImageBtn:hover:not(:disabled), #generateImageV2Btn:hover:not(:disabled), #startColorizeBtn:hover:not(:disabled), #startColorizeMultipleBtn:hover:not(:disabled), #startPaletteColorizeBtn:hover:not(:disabled), #startPaletteColorizeMultipleBtn:hover:not(:disabled), #startInpaintingBtn:hover:not(:disabled), #startOutpaintingBtn:hover:not(:disabled), #startWanSketchBtn:hover:not(:disabled), #startWanMultiBtn:hover:not(:disabled), #startWanExpandBtn:hover:not(:disabled), #startMultiImageBtn:hover:not(:disabled), #startPoseModificationBtn:hover:not(:disabled), .primary-btn:hover:not(:disabled), .secondary-btn:hover:not(:disabled), .danger-btn:hover:not(:disabled), .action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(31, 162, 220, 0.35);
    background: var(--gradient-primary);
}

#generateImageBtn:disabled, #generateImageV2Btn:disabled, #startColorizeBtn:disabled, #startColorizeMultipleBtn:disabled, #startPaletteColorizeBtn:disabled, #startPaletteColorizeMultipleBtn:disabled, #startInpaintingBtn:disabled, #startOutpaintingBtn:disabled, #startWanSketchBtn:disabled, #startWanMultiBtn:disabled, #startWanExpandBtn:disabled, #startMultiImageBtn:disabled, #startPoseModificationBtn:disabled, .primary-btn:disabled, .secondary-btn:disabled, .danger-btn:disabled, .action-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    margin: 5px 0px;
}

#generateImageBtn:active:not(:disabled), #generateImageV2Btn:active:not(:disabled), #startColorizeBtn:active:not(:disabled), #startColorizeMultipleBtn:active:not(:disabled), #startPaletteColorizeBtn:active:not(:disabled), #startPaletteColorizeMultipleBtn:active:not(:disabled), #startInpaintingBtn:active:not(:disabled), #startOutpaintingBtn:active:not(:disabled), #startWanSketchBtn:active:not(:disabled), #startWanMultiBtn:active:not(:disabled), #startWanExpandBtn:active:not(:disabled), #startMultiImageBtn:active:not(:disabled), #startPoseModificationBtn:active:not(:disabled), .primary-btn:active:not(:disabled), .secondary-btn:active:not(:disabled), .danger-btn:active:not(:disabled), .action-btn:active:not(:disabled) {
    transform: translateY(0);
}

#analyzeBtn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 12px 36px;
    font-size: 16px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#analyzeBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(31, 162, 220, 0.35);
}

#analyzeBtn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: none;
}

.result-section h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
}

.result-meta {
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.loading-section {
    text-align: center;
    padding: 40px;
}

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin: 10px 0 18px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(31, 162, 220, 0.1) 100%);
    border: 1px solid rgba(31, 162, 220, 0.2);
    border-radius: 12px;
    color: var(--text-secondary);
    box-shadow: 0 6px 18px rgba(31, 162, 220, 0.12);
}

.loading-overlay p {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
}

.loading-spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.9s linear infinite;
    margin: 0;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.main-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-info p {
    margin: 0 0 5px 0;
    color: var(--text-secondary);
    font-size: 0.95em;
}

.footer-logo {
    height: 22px;
    width: auto;
    vertical-align: middle;
    margin-right: 8px;
}

.footer-info a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-info a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.footer-note {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}

.color-box {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 5px;
}

.color-value {
    font-size: 0.8em;
    color: var(--text-secondary);
    text-align: center;
    word-break: break-all;
    max-width: 60px;
}

.mode-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
}

.mode-option {
    flex: 1;
    padding: 20px;
    text-align: center;
    background: var(--card-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.mode-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mode-option.active {
    border-color: var(--primary-color);
    background: rgba(31, 162, 220, 0.08);
}

.mode-option i {
    display: block;
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.mode-option span {
    font-weight: 600;
    color: var(--text-secondary);
}

.style-presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.preset-option {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.preset-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.preset-option.active {
    border-color: var(--primary-color);
    background: rgba(31, 162, 220, 0.08);
}

.preset-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 20px;
}

.preset-option span {
    display: block;
    font-weight: 500;
    color: var(--text-secondary);
}

.edit-mode-selector, .wan-mode-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.edit-mode-option, .wan-mode-option {
    flex: 1;
    padding: 20px;
    text-align: center;
    background: var(--card-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
}

.edit-mode-option:hover, .wan-mode-option:hover {
    border-color: var(--primary-color);
}

.edit-mode-option.active, .wan-mode-option.active {
    border-color: var(--primary-color);
    background: rgba(31, 162, 220, 0.08);
}

.edit-mode-option i, .wan-mode-option i {
    display: block;
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.edit-mode-option span, .wan-mode-option span {
    font-weight: 600;
    color: var(--text-secondary);
}

.edit-interface {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.edit-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.edit-upload-area {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
}

.edit-upload-area .upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-upload-area .upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(31, 162, 220, 0.08);
}

.edit-upload-area .upload-area i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.edit-upload-area .upload-area p {
    margin: 0;
    font-weight: 500;
    color: var(--text-secondary);
}

.edit-instructions, .outpainting-options {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.mask-editor-panel {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 16px;
    margin-bottom: 20px;
}

.mask-editor-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
}

.mask-editor-header p {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.mask-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
}

.mask-editor-toolbar .secondary-btn.active {
    border-color: var(--primary-color);
    background: rgba(31, 162, 220, 0.1);
    color: var(--primary-color);
}

.mask-editor-toolbar label {
    font-weight: 600;
    color: var(--text-primary);
}

.mask-editor-canvas-wrap {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: var(--dark-bg);
}

#maskEditorCanvas {
    width: 100%;
    height: auto;
    display: block;
    cursor: crosshair;
}

.mask-editor-actions {
    margin-top: 12px;
}

.pose-draw-panel {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
}

.pose-draw-header h4 {
    margin: 0;
    color: var(--text-primary);
}

.pose-draw-header p {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.pose-draw-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
}

.pose-draw-toolbar .secondary-btn.active {
    border-color: var(--primary-color);
    background: rgba(31, 162, 220, 0.1);
    color: var(--primary-color);
}

.pose-draw-toolbar label {
    color: var(--text-primary);
    font-weight: 600;
}

.pose-draw-tip {
    color: var(--text-primary);
    font-weight: 600;
}

.pose-draw-canvas-wrap {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: #000000;
}

#poseReferenceCanvas {
    width: 100%;
    height: auto;
    display: block;
    cursor: crosshair;
    touch-action: none;
}

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

.outpainting-options .option-group {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
}

.outpainting-options .option-group:nth-child(3) {
    grid-column: 1 / -1;
}

.outpainting-options .option-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

.outpainting-options .option-group input[type="number"] {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    background: var(--card-bg);
    color: var(--dark-bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.outpainting-options .option-group input[type="number"]:hover {
    border-color: var(--border-color);
}

.outpainting-options .option-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(31, 162, 220, 0.15);
}

.coming-soon {
    text-align: center;
    padding: 60px;
    color: var(--text-secondary);
}

.coming-soon i {
    font-size: 64px;
    margin-bottom: 20px;
    color: var(--border-color);
}

.coming-soon h3 {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.suitability-check {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.suitability-result {
    background: var(--card-bg);
    border-radius: 6px;
    padding: 15px;
}

.suitability-score {
    display: inline-block;
    padding: 8px 20px;
    background: var(--color-success);
    color: white;
    border-radius: 20px;
    font-weight: bold;
    margin-bottom: 15px;
}

.suitability-details {
    margin-top: 15px;
}

.suitability-details ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.suitability-details li {
    margin-bottom: 5px;
    color: var(--text-secondary);
}

img {
    max-width: 100%;
    height: auto;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 15px;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label:hover .checkbox-custom {
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
}

.checkbox-text {
    color: var(--text-secondary);
    font-weight: 500;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px 12px;
    margin-top: 8px;
    margin-bottom: 6px;
}

.palette-selector {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    border-left: 4px solid var(--primary-color);
}

.palette-selector h3 {
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.palette-selector .palette-actions {
    text-align: center;
    margin-top: 20px;
}

.palette-selector .palette-actions button {
    padding: 10px 20px;
    border: 2px solid var(--primary-color);
    background: var(--card-bg);
    color: var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.palette-selector .palette-actions button:hover {
    background: var(--primary-color);
    color: white;
}

.palette-item {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.palette-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.palette-item.selected {
    border-color: var(--primary-color);
    background: rgba(31, 162, 220, 0.08);
}

.palette-preview {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
    display: block;
}

.palette-colors {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.palette-color {
    flex: 1;
    min-width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.palette-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.palette-date {
    font-weight: 500;
}

.palette-preview-container {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid var(--border-color);
}

.palette-preview-container h4 {
    margin: 0 0 10px 0;
    color: var(--text-secondary);
    font-size: 1em;
}

.selected-palette-colors {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.selected-palette-color {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.formatted-result {
    line-height: 1.8;
    font-size: 1em;
}

.formatted-result p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.formatted-result h1 {
    font-size: 1.5em;
    color: inherit;
    margin: 20px 0 10px 0;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 5px;
}

.formatted-result h2 {
    font-size: 1.3em;
    color: inherit;
    margin: 18px 0 8px 0;
}

.formatted-result h3 {
    font-size: 1.1em;
    color: inherit;
    margin: 16px 0 6px 0;
}

.formatted-result ul {
    margin: 10px 0 10px 20px;
    list-style-type: disc;
}

.formatted-result li {
    margin-bottom: 5px;
    line-height: 1.5;
}

.result-content .analysis-result, .result-content .suggestion, .result-content .formatted-result {
    color: inherit;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.history-item {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.history-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.history-header h4 {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1em;
    flex: 1;
}

.history-date {
    font-size: 0.8em;
    color: var(--text-secondary);
    white-space: nowrap;
    margin-left: 10px;
}

.history-content {
    margin-bottom: 15px;
}

.history-result p {
    margin: 0 0 10px 0;
    line-height: 1.5;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.history-palette {
    margin-top: 10px;
}

.history-palette p {
    margin: 0 0 8px 0;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.history-actions {
    text-align: right;
}

.history-actions .secondary-btn {
    padding: 6px 12px;
    font-size: 0.85em;
}

.no-history {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-history i {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
    color: var(--border-color);
}

.no-history p {
    margin: 10px 0;
    font-size: 1.1em;
}

.no-history .subtext {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.mobile-nav .nav-item {
    width: 100%;
        min-width: auto;
        padding: 12px 15px;
}

table {
    display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
}

th, td {
    white-space: nowrap;
}

.mode-selector, .edit-mode-selector, .wan-mode-selector {
    flex-direction: column;
}

.single-result-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    background-color: var(--card-bg);
}

.result-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.result-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.result-body {
    margin-bottom: 10px;
}

.result-body p {
    color: #ffffff;
}

.result-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    text-align: right;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.upload-placeholder p, .question-section label {
    color: var(--text-secondary);
}

.result-section, .single-result-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.result-header, .result-footer {
    border-color: var(--border-color);
}

.result-header h3, .result-footer {
    color: var(--text-primary);
}

/* ============================================================
   Auth page light-mode overrides
   ============================================================ */
html.light .login-page {
    background: var(--surface-light);
    color: var(--text-on-light);
}

html.light .login-card {
    background: var(--surface-light);
    border-color: var(--surface-light-border);
}

html.light .login-title,
html.light .login-subtitle,
html.light .login-hint,
html.light .login-field-hint,
html.light .auth-divider,
html.light .ui-label {
    color: var(--text-on-light);
}

html.light .ui-input,
html.light .ui-select,
html.light .ui-textarea,
html.light input[type="text"],
html.light input[type="password"],
html.light input[type="email"] {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-on-light);
    border-color: var(--surface-light-border);
}

html.light .ui-btn--secondary {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-on-light);
    border-color: var(--surface-light-border);
}

html.light .login-error {
    color: #991b1b;
}

html.light .login-hint a {
    color: var(--primary-dark);
}

/* ================================================================
   Light-mode overrides — video workspace & shared components
   The :root vars are dark-mode-first; these fix text visibility
   when the page background is light.
   ================================================================ */

/* --- Prompt tips / guide box --- */
html.light .prompt-tips,
html.light .prompt-guide {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.18);
    color: #334155;
}

html.light .prompt-tips strong,
html.light .prompt-guide-title {
    color: #6d28d9;
}

html.light .prompt-tips li,
html.light .prompt-guide-list li {
    color: #475569;
}

/* --- Section titles --- */
html.light .section-title {
    color: #1e293b;
}

/* --- Upload / prompt / question sections --- */
html.light .ui-prompt,
html.light .question-section,
html.light .prompt-section {
    background: rgba(248, 250, 252, 0.92);
    border-color: rgba(15, 23, 42, 0.10);
}

/* --- Result sections --- */
html.light .ui-result,
html.light .result-section {
    background: rgba(255, 255, 255, 0.86);
    border-color: rgba(15, 23, 42, 0.10);
}

html.light .result-content {
    background: rgba(248, 250, 252, 0.92);
    border-color: rgba(15, 23, 42, 0.10);
    color: #1e293b;
}

html.light .result-item {
    background: rgba(248, 250, 252, 0.92);
    border-color: rgba(15, 23, 42, 0.10);
}

/* --- Generic labels & text --- */
html.light .ui-label,
html.light .control-label,
html.light .control-description {
    color: #334155;
}

html.light .muted-note {
    color: #64748b;
}

html.light .upload-area {
    border-color: rgba(15, 23, 42, 0.18);
    background: rgba(248, 250, 252, 0.6);
    color: #475569;
}

html.light .upload-area:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.06);
}

/* --- Video specs section (light mode) --- */
html.light .video-specs {
    background: rgba(241, 245, 249, 0.8);
    border-color: rgba(15, 23, 42, 0.10);
}

html.light .video-specs h4 {
    color: #1e293b;
}

html.light .spec-item {
    background: rgba(241, 245, 249, 0.9);
    border-color: rgba(15, 23, 42, 0.08);
}

html.light .spec-label {
    color: #334155;
}

html.light .spec-value {
    color: #4f46e5;
}

/* --- Prompt inputs (light mode) --- */
html.light #promptInput,
html.light #t2vPrompt,
html.light #startEndPrompt,
html.light #ref2VideoPrompt,
html.light #multiRefPrompt,
html.light #extensionPrompt,
html.light #textToImagePrompt,
html.light #wanMultiPrompt,
html.light #wanExpandPrompt,
html.light #colorizePrompt,
html.light #paletteColorizePrompt,
html.light #inpaintingPrompt,
html.light #outpaintingPrompt,
html.light #multiImagePrompt,
html.light #poseModificationPrompt,
html.light #animateMovePrompt {
    color: #1e293b;
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.15);
}

html.light #promptInput::placeholder,
html.light #t2vPrompt::placeholder,
html.light #startEndPrompt::placeholder,
html.light #ref2VideoPrompt::placeholder,
html.light #multiRefPrompt::placeholder,
html.light #extensionPrompt::placeholder,
html.light #textToImagePrompt::placeholder,
html.light #wanMultiPrompt::placeholder,
html.light #wanExpandPrompt::placeholder,
html.light #colorizePrompt::placeholder,
html.light #paletteColorizePrompt::placeholder,
html.light #inpaintingPrompt::placeholder,
html.light #outpaintingPrompt::placeholder,
html.light #multiImagePrompt::placeholder,
html.light #poseModificationPrompt::placeholder,
html.light #animateMovePrompt::placeholder {
    color: #94a3b8;
}
