/* ========== Base ========== */
*, *::before, *::after { box-sizing: border-box; }

:root {
    --accent: #f0a020;
    --accent2: #f57c30;
    --accent-glow: rgba(240,160,32,0.2);
    --bg: #f5f3ef;
    --surface: #fff;
    --surface2: #fafaf8;
    --border: #e8e5df;
    --border-hover: #d8d0c0;
    --text: #2c2416;
    --text2: #6b6050;
    --text3: #a09888;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 2px 12px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.03);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[v-cloak] { display: none; }

html { scroll-behavior: smooth; }

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ========== Header ========== */
header {
    text-align: center;
    padding: 64px 20px 12px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.logo-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    box-shadow: 0 0 12px var(--accent-glow);
}

header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

header h1 .accent {
    color: var(--accent);
}

.tagline {
    margin: 8px 0 0;
    color: var(--text3);
    font-size: 0.95rem;
}

/* ========== Auth Page ========== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
}

.auth-header {
    text-align: center;
    margin-bottom: 36px;
}

.auth-header .logo { display: flex; align-items: center; justify-content: center; gap: 10px; }
.auth-header h1 { margin: 0; font-size: 1.8rem; font-weight: 700; color: var(--text); }
.auth-header h1 .accent { color: var(--accent); }
.auth-header .tagline { margin-top: 6px; }

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 28px;
    border-bottom: 2px solid var(--border);
}

.auth-tabs button {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text3);
    cursor: pointer;
    transition: all var(--transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.auth-tabs button.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-form .form-group label { margin-bottom: 6px; }

.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all var(--transition);
}

.auth-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(240,160,32,0.08);
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 60px !important;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all var(--transition);
}

.password-toggle:hover {
    background: rgba(240,160,32,0.1);
}

.code-row {
    display: flex;
    gap: 10px;
}

.code-row input {
    flex: 1;
}

.send-code-btn {
    white-space: nowrap;
    padding: 12px 18px;
    border: 1.5px solid var(--accent);
    background: rgba(240,160,32,0.06);
    color: var(--accent);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition);
}

.send-code-btn:hover:not(:disabled) {
    background: rgba(240,160,32,0.12);
}

.send-code-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--border);
    color: var(--text3);
    background: var(--surface2);
}

.field-hint {
    margin: 5px 0 0 2px;
    font-size: 0.75rem;
    color: var(--text3);
}

.auth-btn {
    margin-top: 6px;
    background: linear-gradient(135deg, #2c2416, #3a3020);
    border: none;
    padding: 14px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    color: #fff;
    transition: all var(--transition);
}

.auth-btn:hover:not(:disabled) { background: linear-gradient(135deg, #3a3020, #4a3e2c); }
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-error {
    margin-top: 18px;
    text-align: center;
    color: #d04848;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ========== Forgot Password ========== */
.forgot-link {
    margin: 6px 0 0;
    text-align: center;
    font-size: 0.85rem;
}

.forgot-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition);
}

.forgot-link a:hover {
    color: var(--accent2);
    text-decoration: underline;
}

.forgot-panel {
    margin-top: 24px;
    padding: 24px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.forgot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.forgot-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.forgot-back {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text3);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color var(--transition);
}

.forgot-back:hover { color: var(--text); }

.forgot-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.forgot-form .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text2);
}

.forgot-form input {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all var(--transition);
}

.forgot-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(240,160,32,0.08);
}

.forgot-message {
    margin-top: 12px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
}

.forgot-success { color: #2a7a42; }
.forgot-error { color: #d04848; }

/* ========== Top Bar ========== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.brand-name .accent { color: var(--accent); }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.credit-chip {
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(240,160,32,0.08);
    color: var(--accent2);
    font-weight: 700;
}

.credit-chip.clickable {
    cursor: pointer;
    transition: all var(--transition);
}

.credit-chip.clickable:hover {
    background: rgba(240,160,32,0.15);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text2);
}

.logout-btn {
    padding: 6px 16px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text2);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all var(--transition);
}

.logout-btn:hover { border-color: #d04848; color: #d04848; }

/* ========== Model Selector ========== */
.model-select {
    display: flex;
    gap: 10px;
}

.model-select button {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    background: var(--surface2);
    color: var(--text2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition);
}

.model-select button:hover { border-color: var(--border-hover); }

.model-select button.active {
    border-color: var(--accent);
    background: rgba(240,160,32,0.06);
    color: var(--accent);
    box-shadow: 0 2px 12px rgba(240,160,32,0.1);
}

/* ========== Billing Overlay ========== */
.billing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 1000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.billing-overlay .topbar {
    position: sticky;
    top: 0;
    background: var(--surface);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text2);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition);
}

.back-btn:hover {
    background: var(--border);
    color: var(--text);
    border-color: var(--text3);
}

.billing-content {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 40px auto;
    padding: 0 20px 80px;
}

.billing-overlay .billing-card {
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
}

.billing-overlay .billing-header h2 {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.billing-overlay .billing-header p {
    font-size: 1rem;
}

.billing-overlay .balance-box {
    padding: 20px 30px;
}

.billing-overlay .balance-num {
    font-size: 2.5rem;
}

/* ========== Layout ========== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 28px 80px;
}

.billing-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 24px 28px;
    margin-bottom: 20px;
}

.billing-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.billing-header h2 {
    margin: 0 0 6px;
    font-size: 1.02rem;
}

.billing-header p {
    margin: 0;
    color: var(--text2);
    font-size: 0.86rem;
}

.balance-box {
    min-width: 110px;
    text-align: center;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.balance-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent2);
    line-height: 1.1;
}

.balance-label {
    font-size: 0.75rem;
    color: var(--text3);
}

/* ========== Recharge Reminder ========== */
.recharge-reminder {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #fff8e6, #fff3d0);
    border: 1.5px solid #f0a020;
    border-radius: 10px;
    color: #8b5e00;
    font-size: 0.84rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(240,160,32,0.12);
}

.recharge-reminder svg {
    flex-shrink: 0;
    color: var(--accent);
}

/* Low balance chip warning */
.credit-chip.low-warning {
    background: rgba(224,72,72,0.1);
    border-color: #e04848;
    color: #c0392b;
    animation: chip-warn 2s ease-in-out infinite;
}

@keyframes chip-warn {
    0%, 100% { box-shadow: 0 0 0 0 rgba(224,72,72,0.2); }
    50% { box-shadow: 0 0 0 8px rgba(224,72,72,0); }
}

.recharge-panel {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
}

.wechat-pay-qrcode {
    border: 1px dashed var(--border-hover);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.qrcode-placeholder {
    aspect-ratio: 1;
    width: 100%;
    border-radius: 8px;
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text3);
    font-size: 0.82rem;
    background: var(--surface2);
}

.qrcode-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
}

.wechat-pay-qrcode p {
    margin: 8px 0 0;
    font-size: 0.74rem;
    color: var(--text3);
}

.recharge-form h3 {
    margin: 0;
    font-size: 0.92rem;
}

.recharge-form p {
    margin: 6px 0 10px;
    font-size: 0.8rem;
    color: var(--text2);
}

.inline-fields {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 10px;
}

.inline-fields input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: var(--surface2);
    border-radius: 10px;
    outline: none;
}

.recharge-btn {
    margin-top: 10px;
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

.recharge-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.recharge-message {
    margin-top: 8px;
    color: #2a7a42;
    font-size: 0.82rem;
}

.recharge-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.recharge-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--text2);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface2);
    padding: 8px 10px;
}

.status-pending {
    color: #b07a00;
}

.status-approved {
    color: #2a7a42;
}

.status-rejected {
    color: #c53d3d;
}

/* ========== Audit Badges & Summary ========== */
.audit-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.badge-approved {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.badge-rejected {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.audit-summary {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.audit-count {
    padding: 4px 14px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 700;
}

.audit-pending {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.audit-approved {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.audit-rejected {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.recharge-item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.recharge-item-info {
    font-size: 0.78rem;
    color: var(--text2);
}

.recharge-item-note {
    margin-top: 6px;
    font-size: 0.76rem;
    color: var(--text2);
    line-height: 1.5;
}

.review-note-label {
    font-weight: 600;
    color: var(--text3);
}

.recharge-item-time {
    margin-top: 4px;
    font-size: 0.72rem;
    color: var(--text3);
}

.billing-tabs {
    margin-top: 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.billing-tabs h3 {
    display: inline-block;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
    margin: 0;
    font-size: 0.9rem;
    color: var(--text);
}

.sub-title {
    margin: 24px 0 12px !important;
    font-size: 0.9rem !important;
    color: var(--text2);
}

.ledger-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ledger-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.ledger-item:hover {
    border-color: var(--border-hover);
}

.ledger-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ledger-note {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.ledger-time {
    font-size: 0.75rem;
    color: var(--text3);
}

.ledger-amount {
    font-family: "SF Mono", "Monaco", "Inconsolata", monospace;
    font-size: 1rem;
    font-weight: 700;
}

.ledger-amount.plus { color: #2a7a42; }
.ledger-amount.minus { color: var(--text); }

.empty-mini {
    text-align: center;
    padding: 20px;
    color: var(--text3);
    font-size: 0.85rem;
    background: var(--surface2);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
}

/* ========== Generator Card ========== */
.generator-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--border);
}

@media (max-width: 800px) {
    .generator-card { grid-template-columns: 1fr; }
    .recharge-panel {
        grid-template-columns: 1fr;
    }
    .inline-fields {
        grid-template-columns: 1fr;
    }
}

/* ========== Upload Section ========== */
.upload-section {
    border-right: 1px solid var(--border);
    min-height: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--surface2);
}

@media (max-width: 800px) {
    .upload-section {
        border-right: none;
        border-bottom: 1px solid var(--border);
        min-height: 280px;
    }
}

.upload-section.drag-over {
    background: rgba(240,160,32,0.06);
}

.upload-placeholder {
    text-align: center;
    padding: 40px 30px;
}

.upload-icon {
    color: var(--text3);
    margin-bottom: 18px;
    transition: all var(--transition);
}

.upload-section:hover .upload-icon {
    color: var(--accent);
    transform: translateY(-3px);
}

.upload-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--text2);
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--text3);
    margin: 0 0 4px;
}

.upload-note {
    font-size: 0.8rem;
    color: var(--accent);
    margin: 4px 0 0;
    font-weight: 500;
}

/* ========== Previews ========== */
.previews-wrapper {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    padding: 24px;
    overflow-y: auto;
    align-content: start;
}

.preview-item {
    aspect-ratio: 1;
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #f0ede8;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.preview-item:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.ref-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.55);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all var(--transition);
    backdrop-filter: blur(6px);
}

.preview-item:hover .remove-btn { opacity: 1; transform: scale(1); }
.remove-btn:hover { background: #e04040; }

.add-more {
    aspect-ratio: 1;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--text3);
    cursor: pointer;
    transition: all var(--transition);
}

.add-more:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(240,160,32,0.04);
}

.ref-hint {
    margin: 4px 0 0 4px;
    font-size: 0.78rem;
    color: var(--text3);
}

/* ========== Input Section ========== */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 36px 32px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text2);
    letter-spacing: 0.02em;
}

textarea {
    width: 100%;
    height: 130px;
    padding: 16px 18px;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.7;
    resize: none;
    transition: all var(--transition);
    outline: none;
}

textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(240,160,32,0.08);
}
textarea::placeholder { color: var(--text3); }

/* ========== Ratio Buttons ========== */
.ratio-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ratio-group button {
    padding: 8px 16px;
    border: 1.5px solid var(--border);
    background: var(--surface2);
    color: var(--text2);
    border-radius: 22px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all var(--transition);
}

.ratio-group button:hover {
    border-color: var(--border-hover);
    background: #fff;
}

.ratio-group button.active {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-color: transparent;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 16px var(--accent-glow);
}

/* ========== Generate Button ========== */
.generate-btn {
    margin-top: auto;
    background: linear-gradient(135deg, #2c2416, #3a3020);
    border: none;
    padding: 18px 32px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, #3a3020, #4a3e2c);
}

.generate-btn:active:not(:disabled) { transform: translateY(0); }

.generate-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-star {
    font-size: 1.1rem;
    color: var(--accent);
}

/* ========== Generating Status ========== */
.generating-status {
    margin-top: auto;
    text-align: center;
    padding: 28px 16px;
}

.pulse-ring {
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    box-shadow: 0 0 0 0 var(--accent-glow);
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 var(--accent-glow); transform: scale(0.95); }
    50% { box-shadow: 0 0 0 22px transparent; transform: scale(1); }
    100% { box-shadow: 0 0 0 0 transparent; transform: scale(0.95); }
}

.gen-title {
    margin: 0;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text);
}

.gen-timer {
    margin: 8px 0 16px;
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.06em;
    font-variant-numeric: tabular-nums;
    color: var(--accent2);
}

.gen-hint {
    margin: 14px 0 0;
    font-size: 0.82rem;
    color: var(--text3);
}

/* ========== Progress Track ========== */
.progress-track {
    width: 100%;
    max-width: 280px;
    height: 4px;
    margin: 0 auto;
    background: #e8e5df;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 4px;
    animation: progress-wander 2.5s ease-in-out infinite;
}

@keyframes progress-wander {
    0% { width: 20%; margin-left: 0%; }
    50% { width: 50%; margin-left: 35%; }
    100% { width: 20%; margin-left: 75%; }
}

/* ========== Result Card ========== */
.result-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 40px;
    text-align: center;
    margin-top: 28px;
}

.result-card h2 {
    margin: 0 0 24px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text2);
}

.result-container img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--text);
    color: #fff;
    text-decoration: none;
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

/* ========== Error Toast ========== */
.error-toast {
    position: fixed;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    background: #e04848;
    color: #fff;
    padding: 15px 30px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 8px 30px rgba(224,72,72,0.25);
    z-index: 2000;
}

/* ========== Transitions ========== */
.fade-enter-active, .fade-leave-active {
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.fade-enter-from, .fade-leave-to {
    opacity: 0;
    transform: translateY(10px);
}

.toast-enter-active, .toast-leave-active {
    transition: all 0.3s ease;
}
.toast-enter-from, .toast-leave-to {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
}

/* ========== Admin Panel Styles ========== */
.admin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 1100;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.admin-entry-btn {
    padding: 6px 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 15px;
    transition: all var(--transition);
}

.admin-entry-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.admin-content {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px 40px;
    width: 100%;
}

.admin-section {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.admin-search input {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    width: 250px;
    outline: none;
    transition: all var(--transition);
}

.admin-search input:focus {
    border-color: var(--accent);
}

.admin-table-wrapper {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th, .admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    font-weight: 600;
    color: var(--text2);
    background: var(--surface2);
}

.balance-cell {
    font-weight: 700;
    color: var(--accent);
}

.admin-actions {
    display: flex;
    gap: 8px;
}

.admin-actions button {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-approve { background: #10b981; color: white; }
.btn-reject { background: #ef4444; color: white; }
.btn-adjust { background: var(--accent); color: white; }
.btn-adjust-minus { background: #64748b; color: white; }
.btn-delete { background: #ef4444; color: white; }
.btn-delete:hover { background: #dc2626; }

.user-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-root { background: #fef3c7; color: #92400e; }
.badge-user { background: #e0f2fe; color: #075985; }

/* ========== History Section ========== */
.history-section {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 32px;
    margin-top: 28px;
}

.history-section h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 10px;
    color: var(--text2);
}

.history-note {
    font-size: 0.78rem;
    color: var(--text3);
    margin: 0 0 18px;
    line-height: 1.5;
}

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

.history-item {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 1px solid var(--border);
    transition: all var(--transition);
    background: var(--surface2);
}

.history-item:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

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

.history-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
    backdrop-filter: blur(4px);
}

.history-item:hover .history-overlay { opacity: 1; }

.history-overlay span {
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid rgba(255,255,255,0.4);
    padding: 6px 16px;
    border-radius: 20px;
}

.empty-msg {
    color: var(--text3);
    font-size: 0.9rem;
    text-align: center;
    padding: 24px 0;
}

/* ========== Success Toast ========== */
.success-toast {
    position: fixed;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: #fff;
    padding: 15px 30px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 8px 30px rgba(16,185,129,0.25);
    z-index: 2000;
}

/* ========== Credit Low Inline Warning ========== */
.credit-low-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: rgba(224,72,72,0.08);
    border: 1.5px solid #e04848;
    border-radius: 10px;
    color: #c0392b;
    font-size: 0.84rem;
    font-weight: 600;
    animation: chip-warn 2s ease-in-out infinite;
}

.credit-low-inline svg {
    flex-shrink: 0;
    color: #e04848;
}

/* ========== Lightbox ========== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
}

.lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

/* ========== Generation History ========== */
.gen-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
}

.gen-history-item {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all var(--transition);
}

.gen-history-item:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.gen-history-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    cursor: pointer;
    transition: all var(--transition);
}

.gen-history-item img:hover {
    transform: scale(1.02);
}

.gen-history-info {
    padding: 14px;
}

.gen-history-prompt {
    margin: 0 0 8px;
    font-size: 0.82rem;
    color: var(--text);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gen-history-meta {
    margin: 0 0 12px;
    font-size: 0.72rem;
    color: var(--text3);
}

.gen-history-actions {
    display: flex;
    gap: 8px;
}

.gen-download-btn, .gen-regen-btn {
    flex: 1;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid var(--border);
}

.gen-download-btn {
    background: var(--text);
    color: #fff;
}

.gen-download-btn:hover {
    background: #4a3e2c;
}

.gen-regen-btn {
    background: var(--surface);
    color: var(--accent);
    border-color: var(--accent);
}

.gen-regen-btn:hover {
    background: rgba(240,160,32,0.08);
}

/* ========== Recharge Steps ========== */
.recharge-steps {
    margin-top: 12px;
    padding: 12px;
    background: rgba(240,160,32,0.05);
    border-radius: 8px;
}

.steps-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent2);
    margin: 0 0 8px;
}

.recharge-steps ol {
    margin: 0;
    padding-left: 18px;
    font-size: 0.76rem;
    color: var(--text2);
    line-height: 1.8;
}

/* ========== Quick Amount Buttons ========== */
.quick-amounts {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.quick-label {
    font-size: 0.78rem;
    color: var(--text2);
    font-weight: 600;
}

.quick-amt-btn {
    padding: 4px 14px;
    border: 1.5px solid var(--border);
    background: var(--surface2);
    color: var(--text2);
    border-radius: 18px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all var(--transition);
}

.quick-amt-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.quick-amt-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ========== Admin Empty State ========== */
.admin-empty-msg {
    text-align: center;
    padding: 28px 16px;
    color: var(--text3);
    font-size: 0.88rem;
    background: var(--surface2);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
}

/* ========== Custom Adjust Input ========== */
.custom-adjust-input {
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.78rem;
    width: 60px;
    text-align: center;
    background: var(--surface2);
    color: var(--text);
    outline: none;
    transition: all var(--transition);
}

.custom-adjust-input:focus {
    border-color: var(--accent);
}

.btn-adjust-custom, .btn-ledger {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-adjust-custom {
    background: #10b981;
    color: white;
}

.btn-adjust-custom:hover {
    background: #059669;
}

.btn-ledger {
    background: #3b82f6;
    color: white;
}

.btn-ledger:hover {
    background: #2563eb;
}

/* ========== Ledger Modal ========== */
.ledger-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.ledger-modal {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    width: 90%;
    max-width: 800px;
    max-height: 75vh;
    overflow-y: auto;
}

.ledger-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.ledger-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.ledger-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text3);
    padding: 0 4px;
    line-height: 1;
}

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

.ledger-modal-body {
    padding: 16px 24px 24px;
}

.text-plus { color: #2a7a42; font-weight: 700; }
.text-minus { font-weight: 700; }

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d8d4cc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #c0bab0; }

/* ========== Selection ========== */
::selection { background: var(--accent); color: #fff; }
