:root {
    /* Color Palette - Tech Light/Mixed Theme */
    --bg-base: #f0f4f8; /* Very Light Blue/Grey */
    --bg-surface: #ffffff;
    --bg-surface-hover: #e2e8f0;
    --bg-surface-glass: rgba(255, 255, 255, 0.85);
    --navbar-height: 0px;
    --navbar-safe-top: env(safe-area-inset-top, 0px);
    
    --primary-color: #0284c7; /* Vivid Blue */
    --primary-hover: #0369a1;
    --primary-glow: rgba(2, 132, 199, 0.3);
    
    --accent-color: #7c3aed; /* Vibrant Purple */
    --accent-hover: #6d28d9;
    --accent-glow: rgba(124, 58, 237, 0.3);
    
    --success-color: #059669;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    
    --text-main: #0f172a; /* Deep Dark Blue for strong contrast */
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --border-color: rgba(15, 23, 42, 0.1);
    --border-hover: rgba(15, 23, 42, 0.2);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px var(--primary-glow);
    --shadow-glow-accent: 0 0 20px var(--accent-glow);
    
    --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
    margin: 0;
    padding: 0;
    min-height: 100%;
    scroll-padding-top: var(--navbar-height);
}

html, body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-family);
    line-height: 1.6;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(2, 132, 199, 0.05), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(124, 58, 237, 0.05), transparent 25%);
    background-attachment: fixed;
}

body.has-fixed-navbar {
    padding-top: var(--navbar-height);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

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

ul {
    list-style: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-surface-hover);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.flex { display: flex; }
.flex-1 { flex: 1; }
.justify-center { justify-content: center; }
.items-center, .align-center { align-items: center; }
.gap-4 { gap: 4px; }
.gap-sm { gap: 12px; }
.gap-md { gap: 24px; }
.gap-lg { gap: 48px; }

.d-none { display: none !important; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }

.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-md { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-3xl { font-size: 1.875rem; }

.font-500 { font-weight: 500; }
.font-600 { font-weight: 600; }
.font-bold { font-weight: 700; }

.color-primary { color: var(--primary-color); }
.color-secondary { color: var(--text-secondary); }
.color-warning { color: var(--warning-color); }
.color-danger { color: var(--danger-color); }
.color-accent { color: var(--accent-color); }

.m-0 { margin: 0; }
.mb-sm { margin-bottom: 12px; }
.mb-md { margin-bottom: 24px; }
.mb-lg { margin-bottom: 48px; }
.mt-sm { margin-top: 12px; }
.mt-md { margin-top: 24px; }
.mt-lg { margin-top: 48px; }
.mr-sm { margin-right: 12px; }

.p-xs { padding: 4px 8px; }
.p-sm { padding: 12px; }
.p-md { padding: 24px; }

.w-100 { width: 100%; }
.max-w-160 { max-width: 160px; }
.h-28 { height: 28px; }
.white-space-nowrap { white-space: nowrap; }
.cursor-pointer { cursor: pointer; }
.overflow-y-auto { overflow-y: auto; }
.border-t { border-top: 1px solid var(--border-color); }
.bg-transparent { background-color: transparent; }

/* Typography */
h1, h2, h3, h4, h5 {
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.2;
}

h1 { font-size: 3rem; letter-spacing: -0.02em; }
h2 { font-size: 2.25rem; letter-spacing: -0.01em; }
h3 { font-size: 1.5rem; }

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    background: var(--bg-surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: calc(16px + var(--navbar-safe-top)) 0 16px;
    margin: 0;
    box-shadow: var(--shadow-sm);
}

.navbar .scroll-fade-up {
    opacity: 1;
    animation: none;
}

.nav-container {
    display: flex;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.logo span {
    -webkit-text-fill-color: initial; /* Emoji fix */
}

.nav-links {
    display: flex;
    gap: 32px;
    flex: 1;
    justify-content: center;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    padding: 4px 0;
}

.nav-link:hover {
    color: var(--text-main);
}

.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--primary-glow);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-family: inherit;
    outline: none;
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.1rem;
    border-radius: var(--radius-lg);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    color: #fff;
    box-shadow: var(--shadow-md);
}

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

.btn-accent {
    background: linear-gradient(135deg, var(--accent-color), #6d28d9);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.btn-accent:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-accent);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(2, 132, 199, 0.05);
}

.btn-outline.border-danger {
    border-color: rgba(220, 38, 38, 0.3);
    color: var(--danger-color);
}
.btn-outline.border-danger:hover:not(:disabled) {
    border-color: var(--danger-color);
    background: rgba(220, 38, 38, 0.05);
}

/* Nav Invite Button (New Style) */
.nav-invite-btn {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(90deg, #7c3aed, #6d28d9, #4f46e5);
    border-radius: 999px;
    padding: 3px 16px 3px 4px;
    text-decoration: none;
    height: 38px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.2);
    position: relative;
    border: 1px solid rgba(167, 139, 250, 0.5);
    overflow: visible;
}

.nav-invite-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    filter: brightness(1.1);
}

.nav-invite-badge {
    background: #1e1b4b;
    color: #a78bfa;
    font-size: 0.85rem;
    font-weight: 850;
    font-style: italic;
    padding: 4px 12px;
    border-radius: 999px;
    margin-right: 10px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5), 0 1px 2px rgba(255,255,255,0.2);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.nav-invite-text {
    color: #ffffff;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-input, .form-select, .range-slider {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    font-family: inherit;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

.inline {
    display: flex;
    gap: 12px;
}

.helper {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}
.helper.is-error { color: var(--danger-color); }
.helper.is-success { color: var(--success-color); }

/* Range Slider Styling */
.range-slider {
    -webkit-appearance: none;
    padding: 0;
    height: 6px;
    background: var(--bg-surface-hover);
    border-radius: var(--radius-full);
    border: none;
}
.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary-glow);
    transition: transform 0.1s;
}
.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

/* Hero Section */
.hero {
    padding: 52px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(2, 132, 199, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: rotate 30s linear infinite;
}

.hero h1 {
    font-size: 4rem;
    background: linear-gradient(to right, var(--text-main), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 24px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 40px;
}

.hero-inline-figure {
    margin: 0 auto 22px;
}

.hero-inline-image-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    width: 100%;
}

.hero-inline-image {
    display: block;
    width: min(100%, 900px);
    margin: 0 auto;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(2, 132, 199, 0.14);
}

.hero-start-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 45%, var(--accent-color) 100%);
    color: #fff;
    -webkit-text-fill-color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    min-width: 180px;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 13px 30px;
    letter-spacing: 0.02em;
    box-shadow:
        0 12px 28px rgba(2, 132, 199, 0.34),
        0 8px 20px rgba(124, 58, 237, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    gap: 12px;
}

.hero-start-btn:visited,
.hero-start-btn:hover,
.hero-start-btn:active,
.hero-start-btn:focus,
.hero-start-btn:focus-visible {
    color: #fff;
    -webkit-text-fill-color: #fff;
    text-decoration: none;
}

.hero-start-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow:
        0 16px 32px rgba(2, 132, 199, 0.4),
        0 10px 24px rgba(124, 58, 237, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.hero-start-arrow {
    display: inline-block;
    font-size: 1.12rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(180deg, #ffffff 0%, #dbeafe 45%, #bfdbfe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 1px 6px rgba(191, 219, 254, 0.5);
    transition: transform 0.2s ease, text-shadow 0.2s ease, filter 0.2s ease;
}

.hero-start-btn:hover .hero-start-arrow {
    transform: translateX(2px);
    text-shadow: 0 1px 10px rgba(224, 231, 255, 0.72);
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.45));
}

/* Features */
.features {
    padding: 60px 0;
}
.feature-card {
    text-align: center;
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
}
.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: inline-block;
    padding: 16px;
    background: rgba(2, 132, 199, 0.05);
    border-radius: 20px;
    box-shadow: inset 0 0 20px rgba(2, 132, 199, 0.05);
}

/* Workflow Section */
.workflow-section {
    padding: 80px 0;
    background: linear-gradient(180deg, var(--bg-base) 0%, rgba(2, 132, 199, 0.03) 100%);
}
.workflow-steps {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 40px;
}
.step-item {
    flex: 1;
    min-width: 200px;
    text-align: center;
    position: relative;
}
.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 2;
}
.step-item h4 {
    margin-bottom: 12px;
    color: var(--text-main);
}
.step-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}
.step-divider {
    flex: 0 0 40px;
    height: 2px;
    background: var(--border-color);
    margin-top: 30px;
    position: relative;
}
@media (max-width: 768px) {
    .step-divider { display: none; }
    .workflow-steps { flex-direction: column; align-items: center; gap: 40px; }
}

/* Audience Section */
.audience-section {
    padding: 60px 0;
}
.audience-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}
.audience-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    display: flex;
    gap: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}
.audience-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}
.audience-img {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 58, 237, 0.05);
    border-radius: 16px;
    flex-shrink: 0;
}
.audience-content h4 { margin-bottom: 8px; }
.audience-content p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; }

/* Stats Section */
.stats-section {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 60px 0;
}
.stats-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 40px;
    text-align: center;
}
.stat-num {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    line-height: 1;
}
.stat-desc {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1.1rem;
}

/* Pricing Preview */
.pricing-preview {
    padding: 60px 0 100px;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 60px 0 24px;
    background: var(--bg-surface);
    color: var(--text-secondary);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-col {
    flex: 1;
    min-width: 200px;
}
.footer-col h4 {
    color: var(--text-main);
}

.footer-links li {
    margin-bottom: 12px;
}
.footer-links a {
    color: var(--text-secondary);
}
.footer-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Auth Pages */
.auth-container {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
}
.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}
.auth-logo {
    font-size: 2.5rem;
    display: inline-block;
    margin-bottom: 16px;
}

/* Workshop Layout */
.workshop-container {
    display: flex;
    height: calc(100vh - var(--workshop-nav-offset, 86px) - 8px);
    overflow: hidden;
    background: #f5f7fb;
    align-items: stretch;
    position: fixed;
    top: calc(var(--workshop-nav-offset, 86px) + 8px);
    left: 0;
    right: 0;
    bottom: auto;
    padding: 10px;
    gap: 14px;
}

.workshop-container::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: transparent;
    z-index: 0;
}

body.workshop-fixed-page {
    overflow: hidden;
    height: 100vh;
}

.sidebar {
    flex: 0 0 300px;
    max-width: 320px;
    min-width: 280px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
    position: relative;
    z-index: 1;
}

.workspace {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    min-width: 0;
    background: transparent;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.sidebar-title {
    margin-bottom: 20px;
    font-size: 1rem !important;
    letter-spacing: 0.2px;
}

.step-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.step-card:hover {
    transform: none;
    border-color: #cbd5e1;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.step-title {
    font-size: 0.82rem;
    letter-spacing: 0.4px;
    color: #64748b;
    margin-bottom: 12px;
    font-weight: 600;
}

.tabs {
    display: flex;
    background: #f3f4f6;
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 4px;
    border: 1px solid #e5e7eb;
}
.tab {
    flex: 1;
    background: transparent;
    border: none;
    color: #475569;
    padding: 7px 0;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.22s ease;
}
.tab.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.usage-info {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    text-align: left;
}

.usage-line {
    margin-bottom: 8px;
}

.novel-search-inline {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    align-items: stretch;
    min-height: 42px;
}

.novel-search-inline .form-input,
.novel-search-inline .btn {
    min-height: 42px;
}

.novel-search-status {
    display: block;
    width: 100%;
    line-height: 1.45;
}

.btn-nowrap {
    white-space: nowrap;
}

.generate-action-btn {
    font-size: 14px;
}

/* Workspace Settings Panel */
.top-settings-panel {
    flex: 0 0 340px;
    max-width: 360px;
    height: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: auto;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
    position: relative;
    z-index: 1;
}

.settings-panel-header {
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 2;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.settings-panel-title {
    margin: 0;
    font-size: 1.02rem;
}

.settings-panel-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.settings-row {
    display: flex;
    min-width: 0;
}

.settings-row-inline {
    gap: 8px;
    align-items: flex-end;
}

.settings-row-inline > .compact-group {
    min-width: 0;
    flex: 1;
}

.settings-row-inline.two-col > .compact-group {
    flex: 1 1 0;
}

.settings-group-chapter {
    flex: 0 0 88px;
}

.settings-group-length {
    flex: 0 0 82px;
}

.settings-tag-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.compact-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.compact-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.compact-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.2;
}

.settings-input {
    width: 100%;
    padding: 9px 11px;
    min-height: 38px;
    border-radius: 10px;
}

.chapter-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
}

.chapter-number-input {
    width: 42px;
    padding: 7px 2px;
}

.compact-tabs {
    padding: 3px;
    gap: 3px;
    min-height: 36px;
}

.compact-tabs .tab {
    padding: 6px 0;
    font-size: 0.82rem;
}

.section-disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(100%);
}

.outline-wrapper textarea {
    min-height: 74px;
    height: 74px;
    transition: height 0.2s;
    width: 100%;
}
.outline-wrapper textarea:focus {
    height: 120px;
}

.outline-input {
    padding: 8px 10px;
    resize: vertical;
    line-height: 1.6;
}

.similarity-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.range-slider {
    margin: 0;
}

/* Editor/Chat Panel */
.editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    margin: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.06);
    position: relative;
    z-index: 1;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-main);
}

.editor-body {
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    background: transparent;
}

.chat-container-inner {
    min-height: 0;
    padding: 18px;
    background: #ffffff;
}

.chat-message {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease forwards;
}

.ai-message .message-content {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px 14px 14px 14px;
    padding: 14px 16px;
    color: var(--text-main);
    align-self: flex-start;
    max-width: 88%;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: none;
}

.ai-message .message-content.rich-text p {
    margin: 0 0 14px;
    text-indent: 2em;
}

.ai-message .message-content.rich-text p:last-child {
    margin-bottom: 0;
}

.ai-message .message-content.rich-text .story-heading {
    font-weight: 600;
    margin-bottom: 16px;
    text-indent: 0;
}

.ai-message .message-content.rich-text .loading-line {
    text-indent: 0;
    display: flex;
    align-items: center;
    gap: 2px;
}

.loading-dots {
    display: inline-flex;
    min-width: 30px;
}

.loading-dots span {
    opacity: 0.2;
    animation: loadingDotPulse 1.2s infinite ease-in-out;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

.loading-dots span:nth-child(4) {
    animation-delay: 0.45s;
}

@keyframes loadingDotPulse {
    0%,
    80%,
    100% {
        opacity: 0.2;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-1px);
    }
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    color: #fff;
    border-radius: 14px 12px 14px 14px;
    padding: 12px 16px;
    align-self: flex-end;
    max-width: 80%;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}

.chat-input-area {
    background: #ffffff;
    backdrop-filter: none;
    flex-shrink: 0;
    padding: 12px !important;
    border-top: 1px solid #e2e8f0;
}

.chat-input-area .form-input {
    min-height: 40px;
    border-radius: 12px;
    border-color: #d1d5db;
    background: #ffffff;
}

#send-msg-btn {
    border-radius: 12px;
    min-width: 78px;
}

#generate-btn {
    min-height: 42px;
    border-radius: 12px;
    background: #2563eb;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.22);
}

#generate-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.26);
}

.usage-info {
    margin-top: 14px;
    border-top: none;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
}

.usage-line {
    margin-bottom: 4px;
}

.novel-search-inline .form-input {
    min-height: 36px;
    border-radius: 10px;
}

.novel-search-inline .btn {
    min-width: 62px;
    border-radius: 10px;
}

@media (max-width: 1200px) {
    .workshop-container {
        flex-direction: column;
        height: calc(100vh - var(--workshop-nav-offset, 86px) - 12px);
        min-height: 0;
        overflow: auto;
        position: fixed;
        top: calc(var(--workshop-nav-offset, 86px) + 12px);
        left: 0;
        right: 0;
        bottom: auto;
        padding: 10px;
        gap: 10px;
    }

    .sidebar,
    .workspace,
    .top-settings-panel,
    .editor-panel {
        flex: none;
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .workspace {
        flex-direction: column;
    }

    .sidebar,
    .top-settings-panel {
        border-right: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
    }

    .editor-panel {
        min-height: 60vh;
    }
}

/* Works Grid */
.works-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

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

.work-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}
.work-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

.work-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.work-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.work-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.work-actions {
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-color);
}
.col-span-full { grid-column: 1 / -1; }

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}
.modal-close:hover { color: var(--text-main); }

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

.work-modal-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.work-toc {
    width: 250px;
    border-right: 1px solid var(--border-color);
    background: var(--bg-base);
    display: flex;
    flex-direction: column;
}
.work-toc-title {
    padding: 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}
#modal-chapter-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}
#modal-chapter-list a {
    display: block;
    padding: 10px 12px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    font-size: 0.9rem;
}
#modal-chapter-list a:hover {
    background: var(--bg-surface-hover);
    color: var(--text-main);
}
.work-toc-pagination {
    padding: 12px
}

/* 会员提示框样式 */
.member-notice {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 9999;
    animation: slideInRight 0.3s ease-out;
}

.member-notice-content {
    background: var(--bg-surface);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 10px 30px -10px rgba(2, 132, 199, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    max-width: 400px;
}

.member-notice-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.member-notice-text {
    flex: 1;
    min-width: 0;
}

.member-notice-title {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.member-notice-message {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
}

.member-notice-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 6px 12px;
    font-size: 0.8rem;
}

.member-notice.fade-out {
    animation: slideOutRight 0.3s ease-in forwards;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* 调整章节、标题、字数对齐 */
.settings-row-inline > .compact-group {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.settings-group-chapter {
    flex: 0 0 100px;
}

.settings-group-length {
    flex: 0 0 100px;
}

.compact-group.flex-1 {
    flex: 1;
}

.compact-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 4px;
    min-height: 18px;
    display: flex;
    align-items: flex-end;
}

.chapter-input-row {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-start;
    height: 36px;
}

.chapter-number-input {
    width: 60px;
    text-align: center;
    padding: 7px 4px;
}

.settings-input {
    width: 100%;
    padding: 7px 10px;
    min-height: 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-main);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.settings-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.work-toc-pageinfo { font-size: 0.85rem; color: var(--text-muted); }

#modal-chapters {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.chapter {
    margin-bottom: 48px;
    padding-bottom: 48px;
    border-bottom: 1px dashed var(--border-color);
}
.chapter h4 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 24px;
}
.chapter-block-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
    letter-spacing: 1px;
}
.chapter-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-main);
    white-space: pre-wrap;
}
.chapter-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

/* Pricing Page */
.pricing-header {
    text-align: center;
    margin: 60px 0 40px;
}
.max-w-600 { max-width: 600px; }
.mx-auto { margin-left: auto; margin-right: auto; }

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    margin-bottom: 80px;
}
.pricing-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    text-align: center;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
}
.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.3);
    border-color: var(--primary-color);
}
.pricing-card.popular {
    border: 2px solid var(--accent-color);
    transform: scale(1.05);
    background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(139, 92, 246, 0.05) 100%);
}
.pricing-card.popular:hover {
    transform: scale(1.05) translateY(-8px);
}
.popular-badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, var(--accent-color), #d946ef);
    color: #fff;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
}
.price-tag {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 24px 0;
    line-height: 1;
}
.price-period {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}
.features-list {
    text-align: left;
    margin-bottom: 32px;
}
.features-list li {
    margin-bottom: 16px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}
.check-icon {
    color: var(--success-color);
    font-weight: bold;
}

.faq-section {
    max-width: 800px;
    margin: 0 auto 80px;
}
.faq-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    padding: 20px 24px;
}
.faq-question {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--primary-color);
}
.faq-answer {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Profile Page */
.profile-container {
    max-width: 900px;
    margin-top: 40px;
    margin-bottom: 80px;
}
.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 40px;
    padding: 32px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}
.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
}
.user-info h2 { margin: 0 0 8px 0; }
.user-email { color: var(--text-muted); font-size: 1.1rem; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-4px); border-color: var(--primary-color); }
.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    line-height: 1;
}
.stat-label { color: var(--text-secondary); font-size: 0.95rem; }

.subscription-card {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 40px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px -10px rgba(124, 58, 237, 0.4);
}
.subscription-card h3 { color: #fff; margin-bottom: 24px; }
.plan-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    padding: 8px 20px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,0.3);
}

/* Terms / Privacy */
.max-w-900 { max-width: 900px; margin-left: auto; margin-right: auto; }
.my-lg-mb-md { margin-top: 48px; margin-bottom: 24px; }
.line-height-lg { line-height: 1.8; color: var(--text-secondary); }



/* Dark Theme Overrides */
html[data-theme='dark'] {
    --bg-base: #0f172a;
    --bg-surface: #1e293b;
    --bg-surface-hover: #334155;
    --bg-surface-glass: rgba(30, 41, 59, 0.85);
    
    --primary-color: #38bdf8;
    --primary-hover: #7dd3fc;
    
    --accent-color: #a78bfa;
    --accent-hover: #c4b5fd;
    
    --text-main: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Invite Modal Styles */
.invite-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 6, 23, 0.56);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.invite-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.invite-modal {
    background: #ffffff;
    width: min(640px, 92vw);
    max-height: 88vh;
    border-radius: 28px;
    overflow: hidden;
    position: relative;
    transform: scale(0.95) translateY(30px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.25);
}

.invite-modal-overlay.active .invite-modal {
    transform: scale(1) translateY(0);
}

.invite-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(15, 23, 42, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s;
}

.invite-modal-close:hover {
    color: #ef4444;
    background: #fff;
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.invite-modal-header {
    height: 140px;
    background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 30%, #ecfeff 100%);
    position: relative;
    overflow: hidden;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.04);
}

.invite-modal-header::before {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 999px;
    right: -60px;
    top: -100px;
    background: radial-gradient(circle at center, rgba(14, 165, 233, 0.22) 0%, rgba(14, 165, 233, 0) 70%);
    animation: pulse-glow 4s infinite alternate;
}

.invite-modal-header::after {
    content: "";
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 999px;
    left: -80px;
    bottom: -100px;
    background: radial-gradient(circle at center, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0) 70%);
    animation: pulse-glow 5s infinite alternate-reverse;
}

@keyframes pulse-glow {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.1); opacity: 0.8; }
}

.header-decor {
    position: absolute;
    right: -24px;
    top: -36px;
    width: 210px;
    height: 210px;
    background: #ef4444;
    border-radius: 30px;
    transform: rotate(15deg);
    box-shadow: -4px 8px 18px rgba(0,0,0,0.12);
    z-index: 1;
    opacity: 0.1;
}

.header-content {
    position: relative;
    z-index: 2;
}

.header-title {
    font-size: 2.4rem;
    font-weight: 950;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-tag {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f97316, #f59e0b);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.invite-modal-body {
    padding: 24px;
    max-height: calc(88vh - 140px);
    overflow-y: auto;
    background: linear-gradient(to bottom, #ffffff, #f8fafc);
}

.invite-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.invite-title {
    font-size: 1.2rem;
    font-weight: 850;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    line-height: 1.2;
}

.invite-title::before {
    content: "";
    width: 4px;
    height: 18px;
    background: #f59e0b;
    border-radius: 4px;
}

.invite-rule-link {
    display: inline-flex;
    align-items: center;
    font-size: 0.78rem;
    color: #f59e0b;
    padding: 3px 10px;
    line-height: 1;
    border-radius: 999px;
    border: 1px solid rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.08);
    font-weight: 600;
}

.invite-stats-box {
    background: #ffffff;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.04);
    margin-bottom: 20px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.invite-stats-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.invite-stats-box::before {
    content: none;
}

.invite-contact-row {
    display: flex;
    justify-content: flex-end;
}

.invite-contact-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    height: 40px;
    padding: 0 20px;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.25);
}

.invite-contact-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
    filter: brightness(1.05);
}

.invite-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
    gap: 10px;
}

.stat-item-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.stat-item-label {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 3px;
}

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

.btn-green-solid {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.btn-green-solid:hover { 
    opacity: 0.9; 
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.3);
}

.btn-green-outline {
    background: transparent;
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.btn-green-outline:hover { 
    background: rgba(16, 185, 129, 0.05); 
    border-color: #10b981;
}

.invite-reward-box {
    background: #ffffff;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.04);
    position: relative;
    transition: transform 0.3s ease;
}

.invite-reward-box:hover {
    transform: translateY(-2px);
}

.reward-text-center {
    text-align: left;
    font-size: 1rem;
    color: #475569;
    line-height: 1.8;
    margin-bottom: 0;
    padding-left: 12px;
}

.reward-highlight { 
    color: #10b981; 
    font-weight: 900; 
    font-size: 1.1rem;
    text-decoration: underline wavy rgba(16, 185, 129, 0.3);
    text-underline-offset: 4px;
}

.reward-slogan {
    text-align: left;
    color: #0f172a;
    font-weight: 850;
    font-size: 1.05rem;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.reward-slogan::before {
    content: none;
}

.reward-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0 4px;
    gap: 12px;
    flex-wrap: nowrap;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.step-icon {
    width: 52px;
    height: 52px;
    background: #f0fdf4;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10b981;
    transition: all 0.3s ease;
    border: 1px solid rgba(16, 185, 129, 0.1);
}

.step-item:nth-child(1) .step-icon { background: #f0fdfa; color: #0d9488; }
.step-item:nth-child(3) .step-icon { background: #fff7ed; color: #ea580c; }
.step-item:nth-child(5) .step-icon { background: #f0fdf4; color: #16a34a; }

.step-item:hover .step-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

.step-icon svg { width: 26px; height: 26px; }

.step-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748b;
    text-align: center;
    white-space: normal;
    line-height: 1.4;
    max-width: 9em;
    min-height: 2.8em;
}

.step-line {
    flex: 0.5;
    height: 2px;
    background: linear-gradient(to right, transparent, #e2e8f0, transparent);
    margin-top: -24px;
}

.invite-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.invite-input-label {
    font-size: 0.84rem;
    color: #1e293b;
    white-space: nowrap;
    font-weight: 600;
}

.invite-input-group {
    display: flex;
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    height: 36px;
}

.invite-input-group input {
    flex: 1;
    border: none;
    padding: 0 12px;
    font-size: 0.9rem;
    outline: none;
}

.invite-input-group button {
    background: linear-gradient(90deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 0 18px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 0 10px 10px 0;
    transition: opacity 0.2s;
}

.invite-input-group button:hover {
    opacity: 0.9;
}

.invite-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
    padding-top: 16px;
    border-top: 1px solid rgba(226, 232, 240, 0.5);
}

.invite-footer span {
    position: relative;
    padding: 0 15px;
    background: transparent;
}

.invite-footer span::before,
.invite-footer span::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 20px;
    height: 1px;
    background: #e2e8f0;
}

.invite-footer span::before { left: -25px; }
.invite-footer span::after { right: -25px; }

.service-qr-overlay {
    position: fixed;
    inset: 0;
    z-index: 10020;
    background: rgba(2, 6, 23, 0.56);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.service-qr-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.service-qr-modal {
    width: min(340px, 90vw);
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
    padding: 16px 16px 14px;
    text-align: center;
    position: relative;
}

.service-qr-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.service-qr-title {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 10px;
}

.service-qr-box {
    width: 240px;
    height: 240px;
    margin: 0 auto 10px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.service-qr-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.service-qr-desc {
    font-size: 0.82rem;
    color: #64748b;
}

@media (max-width: 640px) {
    .invite-modal {
        width: 92vw;
        border-radius: 14px;
    }

    .invite-modal-header {
        height: 104px;
    }

    .invite-modal-body {
        padding: 12px;
        max-height: calc(86vh - 104px);
    }


    .invite-stats-grid {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .invite-btn-row {
        flex-direction: column;
    }

    .reward-steps {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .step-item {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        min-width: 0;
        gap: 8px;
    }

    .step-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .step-icon svg {
        width: 18px;
        height: 18px;
    }

    .step-line {
        display: none;
    }

    .step-label {
        text-align: left;
        max-width: none;
        min-height: 0;
    }

    .invite-input-row {
        flex-direction: column;
        align-items: stretch;
    }
}
