/* ===== CSS Variables (Design Tokens) ===== */
:root {
    /* Colors */
    --color-primary: #0071e3;
    --color-primary-hover: #0077ed;
    --color-primary-light: rgba(0, 113, 227, 0.1);
    --color-secondary: #ff9500;
    --color-secondary-hover: #e68600;
    --color-secondary-light: rgba(255, 149, 0, 0.1);
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-danger: #dc3545;

    /* Neutrals */
    --color-text: #1d1d1f;
    --color-text-secondary: #86868b;
    --color-bg: #f5f5f7;
    --color-bg-card: #ffffff;
    --color-border: #d2d2d7;
    --color-border-light: #e5e5e5;

    /* Spacing (4px base) */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

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

/* ===== Base ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-lg);
}

/* ===== Header ===== */
header {
    text-align: center;
    margin-bottom: var(--space-xl);
    padding: var(--space-lg) 0;
    position: relative;
}

/* Favorite Button */
.btn-favorite {
    position: absolute;
    top: var(--space-lg);
    right: 0;
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    color: var(--color-text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-favorite svg {
    width: 16px;
    height: 16px;
}

.btn-favorite:hover {
    background: var(--color-secondary-light);
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}

.btn-favorite:hover svg {
    fill: var(--color-secondary);
    stroke: var(--color-secondary);
}

header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

header h1 .logo-link {
    text-decoration: none;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: var(--transition-fast);
}

header h1 .logo-link:hover {
    opacity: 0.85;
}

.subtitle {
    color: var(--color-text-secondary);
    font-size: 15px;
    letter-spacing: -0.01em;
}

.header-feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #fff3cd, #ffeeba);
    border-radius: 16px;
    font-size: 13px;
    color: #856404;
    font-weight: 500;
}

.header-feature-badge .new-tag {
    background: #f5b400;
    color: #1a1a2e;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.editor-hint {
    color: var(--color-primary);
    font-size: 14px;
    margin-top: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background-color: var(--color-primary-light);
    border-radius: var(--radius-md);
    display: inline-block;
}

/* ===== Upload Zone ===== */
.upload-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-bg-card);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-secondary-light));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.upload-zone:hover::before,
.upload-zone.dragover::before {
    opacity: 1;
}

.upload-zone:focus-within {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

.upload-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.upload-icon {
    width: 56px;
    height: 56px;
    color: var(--color-primary);
    margin-bottom: var(--space-md);
    transition: transform var(--transition-normal);
}

.upload-zone:hover .upload-icon {
    transform: translateY(-4px);
}

.upload-content p {
    font-size: 17px;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    color: var(--color-text);
}

.upload-hint {
    font-size: 13px;
    color: var(--color-text-secondary);
}

/* ===== Sample Files - Horizontal Strip ===== */
.sample-files-section {
    margin-top: var(--space-xl);
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(180deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.04) 100%);
    border-radius: var(--radius-lg);
}

.sample-section-header {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.sample-section-header::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 14px;
    background: var(--color-primary);
    border-radius: 2px;
}

.sample-files-strip {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    overflow-y: hidden;
    padding: var(--space-sm) var(--space-xs);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sample-files-strip::-webkit-scrollbar {
    display: none;
}

.sample-card {
    flex: 0 0 auto;
    width: 130px;
    background: var(--color-bg-card);
    border: 2px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.sample-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    transition: border-color var(--transition-fast);
    pointer-events: none;
}

.sample-card:hover {
    border-color: var(--color-success);
    box-shadow: var(--shadow-md), 0 0 0 3px rgba(40, 167, 69, 0.15);
    transform: translateY(-2px);
}

.sample-card:hover::before {
    border-color: var(--color-success);
}

.sample-card:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md), 0 0 0 3px var(--color-primary-light);
}

.sample-card:active {
    transform: translateY(0);
}

.sample-card-thumbnail {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}

.sample-card-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text);
    display: block;
    text-align: center;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 var(--space-xs);
}

@media (max-width: 480px) {
    .sample-files-section {
        padding: var(--space-sm) var(--space-md);
        margin-top: var(--space-lg);
    }

    .sample-card {
        width: 110px;
    }

    .sample-card-thumbnail {
        height: 80px;
    }

    .sample-card-name {
        font-size: 10px;
    }
}

/* ===== Loading ===== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--color-border-light);
    border-top-color: var(--color-primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
    margin-bottom: var(--space-md);
}

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

#loadingText {
    font-size: 15px;
    color: var(--color-text-secondary);
}

/* Progress Bar */
.progress-container {
    width: 320px;
    margin-top: var(--space-lg);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--color-border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
    width: 0%;
}

.progress-text {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-top: var(--space-sm);
    text-align: center;
}

/* ===== Editor Container ===== */
.editor-container {
    display: flex;
    gap: var(--space-lg);
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    min-height: 500px;
    box-shadow: var(--shadow-sm);
}

.editor-main {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: auto;
    max-height: 80vh;
}

/* ===== Pages Container ===== */
.pages-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    width: 100%;
    padding: var(--space-sm);
}

/* ===== Page Wrapper ===== */
.page-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    border: 1px solid var(--color-border-light);
    transition: box-shadow var(--transition-fast);
}

.page-wrapper:hover {
    box-shadow: var(--shadow-sm);
}

/* Page Delete Button */
.page-delete-btn {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 20;
    backdrop-filter: blur(4px);
}

.page-delete-btn:hover {
    background: var(--color-danger);
    transform: scale(1.1);
}

.page-delete-btn:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Page Header */
.page-header {
    width: 100%;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-number {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.page-number::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: var(--radius-full);
}

/* ===== Image Wrapper ===== */
.image-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.page-image,
.page-image-edited {
    max-width: 100%;
    max-height: 60vh;
    display: block;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

/* ===== Text Overlay ===== */
.text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.text-box {
    position: absolute;
    border: 2px solid rgba(0, 113, 227, 0.6);
    background: rgba(0, 113, 227, 0.08);
    cursor: pointer;
    pointer-events: auto;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
}

.text-box:hover,
.text-box.highlight {
    border-color: var(--color-secondary);
    background: rgba(255, 149, 0, 0.15);
    z-index: 10;
    transform: scale(1.01);
}

.text-box.selected {
    border-color: var(--color-primary);
    background: rgba(0, 113, 227, 0.15);
    border-width: 3px;
    z-index: 11;
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.text-box.modified {
    border-color: var(--color-secondary);
    background: rgba(255, 149, 0, 0.12);
}

.text-box.modified::after {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 10px;
    height: 10px;
    background: var(--color-secondary);
    border-radius: var(--radius-full);
    border: 2px solid white;
}

/* ===== Edit Panel ===== */
.edit-panel {
    flex: 1;
    min-width: 340px;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--color-border-light);
    padding-left: var(--space-lg);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--color-border-light);
}

.panel-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
}

.region-count {
    font-size: 12px;
    color: var(--color-text-secondary);
    background: var(--color-bg);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
}

.panel-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--color-border-light);
    color: var(--color-text);
}

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

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

/* ===== Selected Edit Panel ===== */
.selected-edit {
    background: linear-gradient(135deg, #fff8f0, #fff5eb);
    border: 2px solid var(--color-secondary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-sm);
}

.selected-edit-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.selected-id {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-secondary);
}

.selected-page {
    font-size: 11px;
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-full);
    font-weight: 500;
}

.selected-confidence {
    font-size: 11px;
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-border-light);
    color: var(--color-text-secondary);
    border-radius: var(--radius-full);
    font-weight: 500;
}

.selected-input {
    width: 100%;
    padding: var(--space-md);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
    transition: all var(--transition-fast);
}

.selected-input:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 4px var(--color-secondary-light);
}

/* ===== Font Options ===== */
.font-options {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-md);
    flex-wrap: wrap;
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-md);
}

.font-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.font-option label {
    font-size: 12px;
    color: var(--color-text-secondary);
    white-space: nowrap;
    font-weight: 500;
}

.font-option input[type="number"] {
    width: 65px;
    padding: var(--space-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: all var(--transition-fast);
}

.font-option input[type="number"]:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px var(--color-secondary-light);
}

.font-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--color-secondary);
    border-radius: var(--radius-sm);
}

.font-option input[type="color"] {
    width: 36px;
    height: 28px;
    padding: 2px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.font-option input[type="color"]:hover {
    border-color: var(--color-secondary);
}

.font-option input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.font-option input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

/* 即時文字樣式預覽 */
.font-preview-container {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-md);
}

.font-preview-container label {
    display: block;
    font-size: 12px;
    color: var(--color-text-secondary);
    font-weight: 500;
    margin-bottom: var(--space-sm);
}

.font-preview-box {
    background: #f8f8f8;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#fontPreviewText {
    transition: all var(--transition-fast);
    text-align: center;
    word-break: break-word;
}

.selected-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

/* ===== Edit Hint ===== */
.edit-hint {
    text-align: center;
    padding: var(--space-2xl) var(--space-md);
    color: var(--color-text-secondary);
    font-size: 14px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border: 2px dashed var(--color-border-light);
}

.edit-hint p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.edit-hint p::before {
    content: '👆';
    font-size: 20px;
}

/* ===== Watermark Option ===== */
.watermark-option {
    padding: var(--space-md);
    margin-top: var(--space-md);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
}

.watermark-option .checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 14px;
    color: var(--color-text);
    user-select: none;
}

.watermark-option .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--color-primary);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.watermark-option .checkbox-label span {
    line-height: 1.4;
}

.panel-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: auto;
    padding-top: var(--space-md);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
    pointer-events: none;
}

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

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

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.btn-primary {
    background: linear-gradient(180deg, #0077ed, var(--color-primary));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(180deg, #008aff, var(--color-primary-hover));
}

.btn-primary:disabled {
    background: var(--color-text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--color-border-light);
    color: var(--color-text);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-border);
}

.btn-small {
    padding: var(--space-sm) var(--space-md);
    font-size: 13px;
}

.btn-small.btn-primary {
    flex: 1;
}

/* ===== Preview Toggle ===== */
.preview-toggle {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--space-md);
    padding: var(--space-xs);
    background: var(--color-bg);
    border-radius: var(--radius-md);
}

.toggle-btn {
    padding: var(--space-sm) var(--space-md);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.toggle-btn:hover {
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.05);
}

.toggle-btn.active {
    background: var(--color-bg-card);
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

.toggle-btn:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ===== Result Container ===== */
.result-container {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.result-container h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    color: var(--color-success);
}

.result-container h3::before {
    content: '✓ ';
}

.result-preview {
    margin-bottom: var(--space-lg);
}

.result-preview img {
    max-width: 100%;
    max-height: 60vh;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* ===== Text List (Legacy) ===== */
.text-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: var(--space-md);
}

.text-item {
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.text-item:hover {
    background: #eef6ff;
    border-color: var(--color-primary-light);
}

.text-item.modified {
    border-color: var(--color-secondary);
    background: #fff8f0;
}

.text-item.selected {
    border-color: var(--color-primary);
    background: #eef6ff;
}

.text-preview {
    font-size: 14px;
    color: var(--color-text);
    line-height: 1.5;
    word-break: break-all;
}

.text-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.text-id {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.confidence {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.confidence.high {
    background: #d4edda;
    color: #155724;
}

.confidence.medium {
    background: #fff3cd;
    color: #856404;
}

.confidence.low {
    background: #f8d7da;
    color: #721c24;
}

.text-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.text-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* ===== Responsive Design ===== */
@media (max-width: 992px) {
    .editor-container {
        flex-direction: column;
    }

    .edit-panel {
        max-width: 100%;
        min-width: auto;
        border-left: none;
        border-top: 1px solid var(--color-border-light);
        padding-left: 0;
        padding-top: var(--space-lg);
    }

    .text-list {
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    :root {
        --space-lg: 16px;
        --space-xl: 24px;
    }

    header h1 {
        font-size: 26px;
    }

    .upload-zone {
        min-height: 260px;
    }

    .font-options {
        gap: var(--space-sm);
    }
}

@media (max-width: 576px) {
    .container {
        padding: var(--space-md);
    }

    header h1 {
        font-size: 22px;
    }

    .subtitle {
        font-size: 13px;
    }

    .result-actions {
        flex-direction: column;
    }

    .result-actions .btn {
        width: 100%;
    }

    .selected-actions {
        flex-direction: column;
    }

    .btn-small.btn-primary {
        order: -1;
    }
}

/* ===== Analyze Prompt (Lazy OCR) ===== */
.analyze-prompt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: var(--space-lg) var(--space-xl);
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-md);
    z-index: 10;
    pointer-events: auto;
}

.analyze-prompt p {
    margin: 0 0 var(--space-md) 0;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

.analyze-btn {
    background: var(--color-primary);
    color: white;
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: background var(--transition-fast);
}

.analyze-btn:hover {
    background: var(--color-primary-hover);
}

.analyze-btn:disabled,
.analyze-btn.disabled {
    background: var(--color-text-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

/* 達到上限時的樣式（仍可點擊，點擊顯示升級彈窗） */
.analyze-btn.limit-reached {
    background: var(--color-secondary);
    cursor: pointer;
}

.analyze-btn.limit-reached:hover {
    background: var(--color-secondary-hover);
}

.analyzing-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: var(--space-lg) var(--space-xl);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    pointer-events: auto;
}

.analyzing-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--color-border-light);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.analyzing-state p {
    margin: 0;
    font-weight: 500;
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard users */
.btn:focus-visible,
.toggle-btn:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* Screen reader only */
.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;
}

/* ===== System Notice ===== */
.system-notice {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, #fff3cd, #ffeeba);
    border: 1px solid #ffc107;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    position: relative;
}

.system-notice.hidden {
    display: none;
}

.notice-icon {
    width: 24px;
    height: 24px;
    color: #856404;
    flex-shrink: 0;
}

.system-notice p {
    flex: 1;
    font-size: 14px;
    color: #856404;
    margin: 0;
    line-height: 1.5;
}

.system-notice a {
    color: #533f03;
    font-weight: 600;
    text-decoration: underline;
}

.system-notice a:hover {
    color: #1d1606;
}

.notice-close {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(133, 100, 4, 0.1);
    color: #856404;
    border-radius: var(--radius-full);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.notice-close:hover {
    background: rgba(133, 100, 4, 0.2);
}

/* ===== Authentication ===== */
.auth-container {
    margin-bottom: var(--space-lg);
}

.auth-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-xl);
    background: linear-gradient(135deg, #fff8f0, #f0f7ff);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--color-border);
}

.auth-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: var(--space-lg);
    text-align: center;
}

.lock-icon {
    width: 48px;
    height: 48px;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
}

.auth-message p {
    color: var(--color-text-secondary);
    font-size: 15px;
}

.btn-google {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: white;
    color: var(--color-text);
    border: 2px solid var(--color-border);
    padding: 12px 24px;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    font-size: 14px;
}

.btn-google:hover {
    background: var(--color-bg);
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.google-icon {
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.user-controls {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-left: auto;
    flex-wrap: wrap;
}

.checkbox-label-inline {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text);
    user-select: none;
    white-space: nowrap;
}

.checkbox-label-inline input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--color-primary);
    flex-shrink: 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--color-border-light);
}

/* Pro User Avatar Styling */
.avatar-container {
    position: relative;
    display: inline-block;
}

/* Pro 用戶頭像樣式 */
.avatar-container.pro .user-avatar {
    border: 3px solid #f97316;
    box-shadow: 0 0 12px rgba(249, 115, 22, 0.5);
}

/* Basic 用戶頭像樣式 */
.avatar-container.basic .user-avatar {
    border: 3px solid #86868b;
    box-shadow: 0 0 8px rgba(134, 134, 139, 0.3);
}

/* 方案標籤基礎樣式 */
.plan-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.plan-badge:hover {
    transform: scale(1.1);
}

/* Pro 標籤樣式 */
.plan-badge.pro-badge,
.pro-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    cursor: pointer;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.4);
}

.pro-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.6);
}

/* Basic 標籤樣式 */
.plan-badge.basic-badge,
.basic-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    cursor: pointer;
    background: linear-gradient(135deg, #86868b 0%, #6e6e73 100%);
    box-shadow: 0 2px 6px rgba(134, 134, 139, 0.4);
}

.basic-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(134, 134, 139, 0.6);
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    flex: 1;
}

/* ===== Language Selector ===== */
.language-selector {
    position: relative;
    display: inline-block;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--color-text);
}

.lang-toggle:hover {
    background: var(--color-border-light);
    border-color: var(--color-primary);
}

.globe-icon {
    width: 16px;
    height: 16px;
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.chevron-icon {
    width: 14px;
    height: 14px;
    color: var(--color-text-secondary);
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.lang-dropdown.open + .lang-toggle .chevron-icon,
.lang-toggle:focus + .lang-dropdown.open ~ .chevron-icon {
    transform: rotate(180deg);
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--space-xs);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 200px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
}

.lang-dropdown.open {
    display: block;
}

.lang-option {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: background var(--transition-fast);
    color: var(--color-text);
}

.lang-option:hover {
    background: var(--color-bg);
}

.lang-option.active {
    background: rgba(0, 113, 227, 0.05);
}

.lang-option.active .lang-native {
    color: var(--color-primary);
    font-weight: 500;
}

.lang-check {
    width: 16px;
    text-align: center;
    color: var(--color-primary);
    font-size: 12px;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Dual-line language display */
.lang-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lang-native {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.3;
}

.lang-english {
    font-size: 12px;
    color: var(--color-text-secondary);
    line-height: 1.3;
}

/* Language selector in auth-prompt (unauthenticated) */
.auth-prompt .language-selector {
    margin-top: var(--space-lg);
}

/* Responsive language selector */
@media (max-width: 768px) {
    .language-selector {
        order: -1;
    }

    .auth-prompt .language-selector {
        position: absolute;
        top: var(--space-md);
        right: var(--space-md);
        margin-top: 0;
    }

    .lang-dropdown {
        right: 0;
        left: auto;
    }
}

/* Upload zone disabled state */
.upload-zone.disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}

.upload-zone.disabled::before {
    opacity: 0;
}

/* Responsive auth styles */
@media (max-width: 768px) {
    .system-notice {
        flex-direction: column;
        text-align: center;
        gap: var(--space-sm);
    }

    .system-notice .notice-close {
        position: absolute;
        top: var(--space-sm);
        right: var(--space-sm);
    }

    .user-info {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-sm);
    }

    .user-profile {
        justify-content: center;
    }

    .user-controls {
        justify-content: center;
        margin-left: 0;
        padding-top: var(--space-sm);
        border-top: 1px solid var(--color-border-light);
    }

    #logoutBtn {
        align-self: center;
    }
}

@media (max-width: 576px) {
    .auth-prompt {
        padding: var(--space-lg);
    }

    .user-controls {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .checkbox-label-inline {
        font-size: 12px;
    }

    #downloadBtnTop {
        width: 100%;
    }
}

/* ===== Landing Page Styles ===== */

/* Hero Section */
.landing-page {
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    gap: 60px;
    flex-wrap: wrap;
}

.hero-content {
    max-width: 600px;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

/* 新功能公告樣式 */
.feature-announcement {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(255, 180, 0, 0.9), rgba(255, 140, 0, 0.9));
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 24px;
    color: #1a1a2e;
    box-shadow: 0 4px 15px rgba(255, 180, 0, 0.4);
    animation: pulse-glow 2s ease-in-out infinite;
}

.announcement-tag {
    background: #1a1a2e;
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(255, 180, 0, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(255, 180, 0, 0.6);
    }
}

.hero h1 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero h1 .highlight {
    color: #ffd700;
    text-decoration: underline;
    text-decoration-color: rgba(255, 215, 0, 0.5);
    text-underline-offset: 8px;
}

.hero-subtitle {
    font-size: 20px;
    opacity: 0.9;
    line-height: 1.6;
    margin-bottom: 30px;
}

.hero-cta {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
}

.btn-outline {
    background: transparent;
    border: 2px solid white;
    color: white;
}

.btn-outline:hover {
    background: white;
    color: #667eea;
}

.hero-stats {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 36px;
    font-weight: 700;
}

.stat-label {
    font-size: 14px;
    opacity: 0.8;
}

.hero-visual {
    flex-shrink: 0;
}

.demo-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-width: 320px;
}

.demo-header {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.demo-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.demo-dot.red { background: #ff5f57; }
.demo-dot.yellow { background: #febc2e; }
.demo-dot.green { background: #28c840; }

.demo-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
}

.demo-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    border-radius: 12px;
    background: #f5f5f7;
    transition: all 0.3s;
}

.demo-step.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.step-icon {
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.demo-step.active .step-icon {
    background: rgba(255, 255, 255, 0.2);
}

.demo-arrow {
    width: 20px;
    height: 2px;
    background: #ddd;
}

/* Section Styles */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 50px;
    color: var(--color-text);
}

/* Pain Points */
.pain-points {
    background: #f8f9fa;
}

.pain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.pain-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s;
}

.pain-card:hover {
    transform: translateY(-5px);
}

.pain-icon {
    width: 60px;
    height: 60px;
    background: #fee2e2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.pain-icon svg {
    width: 30px;
    height: 30px;
    stroke: #dc2626;
}

.pain-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--color-text);
}

.pain-card p {
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* Features */
.features {
    background: white;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    padding: 30px;
    border-radius: 16px;
    background: #f8f9fa;
    transition: all 0.3s;
}

.feature-card:hover {
    background: white;
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.feature-icon svg {
    width: 24px;
    height: 24px;
}

.feature-icon.blue {
    background: #dbeafe;
}
.feature-icon.blue svg { stroke: #2563eb; }

.feature-icon.green {
    background: #dcfce7;
}
.feature-icon.green svg { stroke: #16a34a; }

.feature-icon.purple {
    background: #f3e8ff;
}
.feature-icon.purple svg { stroke: #9333ea; }

.feature-icon.orange {
    background: #ffedd5;
}
.feature-icon.orange svg { stroke: #ea580c; }

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--color-text);
}

.feature-card p {
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* How It Works */
.how-it-works {
    background: #f8f9fa;
}

.steps-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.step-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-md);
    max-width: 280px;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin: 0 auto 20px;
}

.step-content h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--color-text);
}

.step-content p {
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.step-connector {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 80px 20px;
}

.cta-section h2 {
    font-size: 36px;
    margin-bottom: 15px;
}

.cta-section p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 30px;
}

/* App Section */
.app-section {
    background: var(--color-bg);
    padding-top: 40px;
}

/* Footer - Multi-column Design */
.footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px 24px;
}

/* Footer Grid - 3 columns */
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid #e9ecef;
}

/* Brand column */
.footer-brand {
    max-width: 320px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #1a1a2e;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-logo:hover {
    color: #667eea;
}

.footer-logo-icon {
    flex-shrink: 0;
    border-radius: 8px;
}

.footer-tagline {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
}

/* Footer columns */
.footer-column {
    min-width: 140px;
}

.footer-column-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links-list li {
    margin-bottom: 12px;
}

.footer-links-list a {
    font-size: 14px;
    color: #495057;
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-links-list a:hover {
    color: #667eea;
}

/* Footer bottom */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

/* Social links */
.footer-social {
    display: flex;
    gap: 12px;
}

.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #dee2e6;
    color: #495057;
    transition: all 0.15s ease;
}

.footer-social-link:hover {
    border-color: #667eea;
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

/* Copyright */
.footer-copyright {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 13px;
    color: #6c757d;
    flex-wrap: wrap;
}

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

.footer-legal-links a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-legal-links a:hover {
    color: #667eea;
}

/* Footer Responsive */
@media (max-width: 768px) {
    .footer-container {
        padding: 32px 20px 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-brand {
        max-width: 100%;
        text-align: center;
    }

    .footer-logo {
        justify-content: center;
    }

    .footer-column {
        text-align: center;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-copyright {
        flex-direction: column;
        gap: 12px;
    }

    .footer-legal-links {
        justify-content: center;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 40px 20px;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .hero-cta {
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .demo-card {
        min-width: auto;
        width: 100%;
    }
    
    .demo-content {
        flex-direction: column;
    }
    
    .demo-arrow {
        width: 2px;
        height: 20px;
    }
    
    .step-connector {
        display: none;
    }
    
    .steps-container {
        flex-direction: column;
    }
}

/* ===== Export Progress Overlay ===== */
.export-progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.export-progress-modal {
    background: white;
    padding: 40px 60px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
}

.export-progress-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-border-light);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

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

.export-progress-text {
    font-size: 18px;
    color: var(--color-text);
    margin-bottom: 20px;
    font-weight: 500;
}

.export-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--color-border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.export-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    width: 0%;
}

/* ===== Disabled Checkbox ===== */
.checkbox-label.disabled,
.checkbox-label-inline.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkbox-label.disabled input,
.checkbox-label-inline.disabled input {
    cursor: not-allowed;
}

.checkbox-label.disabled small,
.checkbox-label-inline.disabled small {
    color: var(--color-text-secondary);
    font-size: 11px;
}

/* ========================================
   PPTX Export Modal Styles
   ======================================== */

/* Overlay */
.pptx-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(2px);
}

.pptx-modal-overlay.active {
    display: flex;
}

/* Modal Container */
.pptx-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: pptxModalSlideIn 0.2s ease-out;
}

@keyframes pptxModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.pptx-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e8eaed;
}

.pptx-modal__title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 500;
    color: #202124;
}

.pptx-modal__icon {
    flex-shrink: 0;
}

.pptx-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    color: #5f6368;
    transition: background 0.15s ease;
}

.pptx-modal__close:hover {
    background: #f1f3f4;
}

.pptx-modal__close:focus {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
}

/* Subheader */
.pptx-modal__subheader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e8eaed;
}

.pptx-modal__info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #5f6368;
}

.pptx-modal__folder-icon {
    font-size: 16px;
}

.pptx-modal__filename {
    color: #202124;
    font-weight: 500;
}

.pptx-modal__selected-count {
    color: #4285f4;
    font-weight: 500;
}

.pptx-modal__actions {
    display: flex;
    gap: 8px;
}

.pptx-modal__action-btn {
    padding: 8px 16px;
    border: 1px solid #dadce0;
    background: #fff;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #3c4043;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pptx-modal__action-btn:hover {
    background: #f1f3f4;
    border-color: #d2d2d2;
}

.pptx-modal__action-btn:focus {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
}

/* Description */
.pptx-modal__description {
    padding: 12px 20px;
    background: #fff8e1;
    border-bottom: 1px solid #e8eaed;
    font-size: 13px;
    color: #5f6368;
}

.pptx-modal__description p {
    margin: 0;
}

/* Page Grid */
.pptx-modal__grid {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    min-height: 250px;
    max-height: 400px;
}

/* Page Item */
.pptx-page-item {
    cursor: pointer;
    transition: transform 0.15s ease;
}

.pptx-page-item:hover {
    transform: translateY(-2px);
}

.pptx-page-item__preview {
    position: relative;
    aspect-ratio: 4 / 3;
    border: 3px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f3f4;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pptx-page-item__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pptx-page-item__check {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: #4285f4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.15s ease;
}

.pptx-page-item__check svg {
    width: 14px;
    height: 14px;
    stroke: #fff;
}

.pptx-page-item__number {
    margin-top: 8px;
    font-size: 13px;
    color: #5f6368;
    text-align: center;
}

/* Selected State */
.pptx-page-item.selected .pptx-page-item__preview {
    border-color: #4285f4;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}

.pptx-page-item.selected .pptx-page-item__check {
    opacity: 1;
    transform: scale(1);
}

.pptx-page-item.selected .pptx-page-item__number {
    color: #4285f4;
    font-weight: 500;
}

/* Edited indicator */
.pptx-page-item.edited .pptx-page-item__preview::before {
    content: '✏️';
    position: absolute;
    top: 8px;
    left: 8px;
    background: #fff;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    z-index: 1;
}


/* Footer */
.pptx-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid #e8eaed;
    background: #fff;
    gap: 16px;
    flex-wrap: wrap;
}

.pptx-modal__checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #5f6368;
    cursor: pointer;
}

.pptx-modal__checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #4285f4;
    cursor: pointer;
}

.pptx-modal__footer-info {
    font-size: 14px;
    color: #5f6368;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pptx-modal__usage-info {
    font-size: 13px;
    color: #f5b400;
    font-weight: 500;
}

.pptx-modal__usage-info.exhausted {
    color: #dc3545;
}

.pptx-modal__footer-actions {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

/* Buttons */
.pptx-modal__btn {
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

.pptx-modal__btn--secondary {
    background: #fff;
    border: 1px solid #dadce0;
    color: #3c4043;
}

.pptx-modal__btn--secondary:hover {
    background: #f1f3f4;
}

.pptx-modal__btn--primary {
    background: #f5b400;
    color: #202124;
}

.pptx-modal__btn--primary:hover {
    background: #e6a800;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(245, 180, 0, 0.4);
}

.pptx-modal__btn--primary:active {
    transform: translateY(0);
}

.pptx-modal__btn--primary:disabled {
    background: #dadce0;
    color: #9aa0a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pptx-modal__btn:focus {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pptx-modal {
        max-height: 95vh;
        margin: 8px;
    }

    .pptx-modal__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 16px;
    }

    .pptx-modal__subheader {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .pptx-modal__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .pptx-modal__footer-actions {
        margin-left: 0;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .pptx-modal__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pptx-modal__actions {
        flex-direction: column;
        width: 100%;
    }

    .pptx-modal__action-btn {
        width: 100%;
        text-align: center;
    }
}

/* ==================== Pricing Page Styles ==================== */

/* Pricing page specific variables */
:root {
    --pricing-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --pro-glow: 0 0 40px rgba(102, 126, 234, 0.3);
    --save-badge-bg: linear-gradient(135deg, #28a745, #20c997);
}

.pricing-body {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--color-bg) 0%, #e8e8ed 100%);
}

.pricing-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Pricing Header */
.pricing-header {
    padding: var(--space-lg) var(--space-xl);
    text-align: center;
}

.pricing-header .logo-link {
    text-decoration: none;
    font-size: 24px;
    font-weight: 700;
}

.pricing-header .logo-link h1 {
    font-size: 24px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pricing-header .highlight {
    color: var(--color-secondary);
}

/* Pricing Main */
.pricing-main {
    flex: 1;
    padding: 0 var(--space-lg) var(--space-2xl);
}

.pricing-section {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.pricing-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.pricing-subtitle {
    font-size: 18px;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
}

/* Billing Toggle */
.billing-toggle {
    display: inline-flex;
    background: var(--color-bg-card);
    border-radius: var(--radius-full);
    padding: 4px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    margin-bottom: var(--space-xl);
}

.toggle-btn {
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-btn:hover {
    color: var(--color-text);
}

.toggle-btn.active {
    background: var(--color-primary);
    color: white;
}

.save-badge {
    display: inline-block;
    padding: 3px 10px;
    background: var(--save-badge-bg);
    color: white;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

/* Pricing Cards Container */
.pricing-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    max-width: 800px;
    margin: 0 auto var(--space-2xl);
}

/* Pricing Card */
.pricing-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl) var(--space-lg);
    border: 2px solid var(--color-border);
    position: relative;
    transition: all var(--transition-normal);
    text-align: left;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Pro Card Special Styling */
.pricing-card.pro {
    border-color: var(--color-primary);
    box-shadow: var(--pro-glow);
    transform: scale(1.02);
}

.pricing-card.pro:hover {
    transform: scale(1.02) translateY(-4px);
}

.pricing-card.pro::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 4px;
    background: var(--pricing-gradient);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Current Plan Badge */
.pricing-card.current-plan::after {
    content: '✓';
    position: absolute;
    top: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    background: var(--color-success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Recommend Badge */
.recommend-badge {
    position: absolute;
    top: -14px;
    right: 24px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--pricing-gradient);
    color: white;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.badge-icon {
    font-size: 14px;
}

/* Plan Name */
.plan-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-md);
}

/* Price Display */
.price-display {
    text-align: center;
    margin: var(--space-lg) 0;
    padding: var(--space-md) 0;
    border-top: 1px solid var(--color-border-light);
    border-bottom: 1px solid var(--color-border-light);
}

.price-main {
    font-size: 52px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
}

.price-period {
    font-size: 20px;
    color: var(--color-text-secondary);
    font-weight: 400;
}

.price-original {
    font-size: 14px;
    color: var(--color-text-secondary);
    text-decoration: line-through;
    margin-top: 8px;
}

.price-savings {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 14px;
    background: rgba(40, 167, 69, 0.1);
    color: var(--color-success);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
}

/* Feature List */
.pricing-card .feature-list {
    list-style: none;
    margin: var(--space-lg) 0;
    padding: 0;
}

.pricing-card .feature-list li {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.pricing-card .feature-list li:last-child {
    border-bottom: none;
}

.feature-check {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-success);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    flex-shrink: 0;
}

.feature-name {
    flex: 1;
    color: var(--color-text);
    font-size: 15px;
}

.feature-value {
    color: var(--color-text-secondary);
    font-size: 14px;
}

.feature-value.feature-unlimited {
    color: var(--color-primary);
    font-weight: 600;
}

/* Plan Buttons */
.btn-plan {
    width: 100%;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.btn-current {
    background: var(--color-bg);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    cursor: default;
}

.btn-upgrade {
    background: var(--pricing-gradient);
    color: white;
}

.btn-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

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

.btn-manage {
    background: var(--color-bg-card);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-manage:hover {
    background: var(--color-primary-light);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

/* FAQ Section */
.pricing-faq {
    max-width: 600px;
    margin: var(--space-2xl) auto;
    text-align: left;
}

.pricing-faq h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.faq-item {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-md);
    border: 1px solid var(--color-border-light);
}

.faq-item h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.faq-item p {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* Back Link */
.back-link {
    text-align: center;
    margin-top: var(--space-xl);
}

.back-link a {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Pricing Footer */
.pricing-footer {
    padding: var(--space-lg);
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 14px;
    border-top: 1px solid var(--color-border-light);
}

/* Success Banner */
.success-banner {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #28a745;
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.success-icon {
    font-size: 24px;
}

.success-text {
    color: #155724;
    font-weight: 500;
}

.success-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #155724;
    cursor: pointer;
    margin-left: var(--space-md);
}

/* Login Modal */
.pricing-page .modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.pricing-page .modal-content {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.pricing-page .modal-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.pricing-page .modal-content p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
}

.modal-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

.modal-actions .btn-cancel {
    padding: 10px 20px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.modal-actions .btn-primary {
    padding: 10px 20px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 500;
}

/* Pricing Page Responsive */
@media (max-width: 768px) {
    .pricing-title {
        font-size: 28px;
    }

    .pricing-subtitle {
        font-size: 16px;
    }

    .pricing-cards {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .pricing-card.pro {
        transform: none;
        order: -1; /* Show Pro card first on mobile */
    }

    .pricing-card.pro:hover {
        transform: translateY(-4px);
    }

    .price-main {
        font-size: 42px;
    }

    .toggle-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .pricing-header {
        padding: var(--space-md);
    }

    .pricing-main {
        padding: 0 var(--space-md) var(--space-xl);
    }

    .pricing-card {
        padding: var(--space-lg) var(--space-md);
    }

    .billing-toggle {
        flex-direction: column;
        width: 100%;
        max-width: 280px;
    }

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

    .modal-actions {
        flex-direction: column;
    }
}

/* ==================== Usage Limit Modal ==================== */

.limit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.limit-modal {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.limit-modal__icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
}

.limit-modal__title {
    font-size: 22px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.limit-modal__desc {
    font-size: 15px;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.5;
}

.limit-modal__actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

.limit-modal__btn {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.limit-modal__btn--secondary {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.limit-modal__btn--primary {
    background: var(--pricing-gradient);
    border: none;
    color: white;
}

.limit-modal__btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* User Plan Badge */
.user-plan-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.user-plan-badge.basic {
    background: var(--color-bg);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.user-plan-badge.pro {
    background: var(--pricing-gradient);
    color: white;
}

/* ==================== Home Pricing Section ==================== */

.home-pricing {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    padding: var(--space-3xl) 0;
}

.home-pricing .section-title {
    text-align: center;
    margin-bottom: var(--space-sm);
}

.home-pricing .section-subtitle {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 18px;
    margin-bottom: var(--space-xl);
}

.home-billing-toggle {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-xl);
    background: var(--color-bg);
    padding: 4px;
    border-radius: var(--radius-full);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--color-border);
}

.home-billing-toggle .toggle-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 12px 24px;
    border: none;
    background: transparent;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.home-billing-toggle .toggle-btn:hover {
    color: var(--color-text);
}

.home-billing-toggle .toggle-btn.active {
    background: var(--color-bg-card);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.home-billing-toggle .save-badge {
    background: var(--color-success-bg);
    color: var(--color-success);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.home-pricing-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    max-width: 800px;
    margin: 0 auto var(--space-xl);
}

.home-pricing-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    border: 1px solid var(--color-border);
    position: relative;
    transition: all var(--transition-normal);
}

.home-pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.home-pricing-card.pro {
    border: 2px solid var(--color-primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
}

.home-pricing-card.pro:hover {
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.2);
}

.home-pricing-card .recommend-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--pricing-gradient);
    color: white;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.home-pricing-card .plan-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-md);
    text-align: center;
}

.home-pricing-card .price-display {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.home-pricing-card .price-main {
    font-size: 36px;
    font-weight: 700;
    color: var(--color-text);
}

.home-pricing-card .price-period {
    font-size: 16px;
    color: var(--color-text-secondary);
}

.home-pricing-card .price-original {
    font-size: 14px;
    color: var(--color-text-muted);
    text-decoration: line-through;
    margin-top: var(--space-xs);
}

.home-pricing-card .price-savings {
    display: inline-block;
    background: var(--color-success-bg);
    color: var(--color-success);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    margin-top: var(--space-sm);
}

.home-pricing-card .feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-lg);
}

.home-pricing-card .feature-list li {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 14px;
}

.home-pricing-card .feature-list li:last-child {
    border-bottom: none;
}

.home-pricing-card .feature-check {
    color: var(--color-success);
    font-weight: bold;
    flex-shrink: 0;
}

.home-pricing-card .feature-name {
    flex: 1;
    color: var(--color-text);
}

.home-pricing-card .feature-value {
    color: var(--color-text-secondary);
    font-weight: 500;
}

.home-pricing-card .feature-value.feature-unlimited {
    color: var(--color-primary);
    font-weight: 600;
}

.home-pricing-card .btn-plan {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.home-pricing-card .btn-current {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

.home-pricing-card .btn-upgrade {
    background: var(--pricing-gradient);
    border: none;
    color: white;
}

.home-pricing-card .btn-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.pricing-more-link {
    text-align: center;
}

.pricing-more-link a {
    color: var(--color-primary);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pricing-more-link a:hover {
    text-decoration: underline;
}

/* Home Pricing Responsive */
@media (max-width: 768px) {
    .home-pricing-cards {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .home-pricing-card.pro {
        order: -1;
    }

    .home-billing-toggle .toggle-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .home-pricing {
        padding: var(--space-2xl) 0;
    }

    .home-pricing-card {
        padding: var(--space-lg);
    }

    .home-billing-toggle {
        flex-direction: column;
        width: 100%;
        max-width: 280px;
    }

    .home-billing-toggle .toggle-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== Draft Recovery Modal ===== */
.draft-recovery-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.draft-recovery-modal {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.draft-recovery-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.draft-recovery-title {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
}

.draft-recovery-message {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 20px;
}

.draft-recovery-info {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    text-align: left;
}

.draft-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

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

.draft-info-label {
    font-size: 13px;
    color: #64748b;
}

.draft-info-value {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.draft-recovery-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.draft-btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.draft-btn-secondary {
    background: #f1f5f9;
    color: #64748b;
}

.draft-btn-secondary:hover {
    background: #e2e8f0;
    color: #475569;
}

.draft-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.draft-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}
