@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&family=Shippori+Mincho:wght@400;600&display=swap');

:root {
    --font-sans: 'Noto Sans JP', sans-serif;
    --font-serif: 'Shippori Mincho', serif;
    --bg-color: #f9f9f9;
    --text-color: #333;
    --accent-color: #333;
    --border-color: #ddd;
    --card-bg: #ffffff;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-spark {
    margin-bottom: 4px;
    /* Slight alignment adjustment */
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.3));
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-3px) rotate(10deg);
    }
}

.language-selector {
    padding: 5px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: transparent;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: #666;
    cursor: pointer;
    transition: var(--transition);
}

.language-selector:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Language Dropdown */
.language-dropdown {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: transparent;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: #666;
    cursor: pointer;
    transition: var(--transition);
}

.lang-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(0, 0, 0, 0.02);
}

.lang-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.5;
}

#current-lang-text {
    font-size: 0.8rem;
}

.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-width: 140px;
    z-index: 1000;
    overflow: hidden;
}

.lang-menu.hidden {
    display: none;
}

.lang-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
}

.lang-option:hover {
    background: #f5f5f5;
}

.lang-option.active {
    background: #f0f7ff;
    color: var(--accent-color);
}

.lang-check {
    color: var(--accent-color);
    font-size: 0.9rem;
}

.lang-check.hidden {
    display: none;
}

.user-btn {
    padding: 5px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: transparent;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: #666;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(0, 0, 0, 0.02);
}

.user-btn svg {
    width: 20px !important;
    height: 20px !important;
    stroke-width: 2;
    min-width: 20px;
    /* Prevent shrinking */
}

.header-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--accent-color);
}

/* Auth Loading State */
.user-btn.auth-loading {
    pointer-events: none;
    min-width: 50px;
}

.auth-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e0e0e0;
    border-top-color: #999;
    border-radius: 50%;
    animation: auth-spin 0.8s linear infinite;
}

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

/* Mobile Responsive Header */
@media (max-width: 768px) {
    header {
        padding: 10px 15px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo span {
        display: none;
        /* Hide "ART STUDIO" on mobile */
    }

    .header-controls {
        gap: 8px;
    }

    .language-selector {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    .user-btn {
        padding: 4px 10px;
    }
}

/* Vertical Text Decoration */
.vertical-text {
    writing-mode: vertical-rl;
    position: fixed;
    right: 40px;
    top: 150px;
    font-family: var(--font-serif);
    color: #e0e0e0;
    font-size: 0.9rem;
    letter-spacing: 0.5em;
    z-index: 0;
    pointer-events: none;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.hero-text {
    text-align: center;
    margin-bottom: 60px;
}

.hero-text h1 {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 400;
    margin-bottom: 20px;
    letter-spacing: 0.05em;
}

.hero-text p {
    color: #666;
    font-size: 1.1rem;
}

/* Studio Steps Guide */
.studio-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
    padding: 20px;
}

.studio-steps .step {
    display: flex;
    align-items: center;
    gap: 10px;
}

.studio-steps .step-num {
    width: 28px;
    height: 28px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.studio-steps .step-text {
    font-size: 0.95rem;
    color: #555;
    font-weight: 500;
}

.studio-steps .step-arrow {
    color: #ccc;
    font-size: 1.2rem;
    margin: 0 5px;
}

@media (max-width: 600px) {
    .studio-steps {
        gap: 8px;
        padding: 15px 10px;
    }

    .studio-steps .step-num {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    .studio-steps .step-text {
        font-size: 0.8rem;
    }

    .studio-steps .step-arrow {
        font-size: 1rem;
        margin: 0 2px;
    }
}

/* Studio Layout - Sidebar on PC */
.studio-layout {
    display: block;
}

@media (min-width: 900px) {
    .studio-layout {
        display: flex;
        min-height: calc(100vh - 140px);
    }

    .studio-layout .main-content {
        flex: 1;
        max-width: none;
        padding-right: 20px;
    }

    .studio-layout .user-drawer {
        position: relative;
        width: 320px;
        min-width: 320px;
        height: auto;
        pointer-events: auto;
        z-index: 1;
    }

    .studio-layout .user-drawer .drawer-overlay {
        display: none;
    }

    .studio-layout .user-drawer .drawer-content {
        position: sticky;
        top: 80px;
        transform: none;
        box-shadow: none;
        border-left: 1px solid #eee;
        background: #fafafa;
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }
}

/* Workspace Layout */
.workspace {
    display: flex;
    justify-content: center;
    gap: 60px;
    align-items: start;
    flex-wrap: wrap;
}

.upload-section,
.style-section {
    flex: 1;
    min-width: 350px;
    max-width: 550px;
    width: 100%;
    transition: var(--transition);
}

/* When style section is hidden, upload section should be centered and not too wide */
/* The flexbox with justify-content: center handles the centering. */
/* max-width prevents it from becoming too wide. */

@media (max-width: 900px) {
    .workspace {
        flex-direction: column;
        align-items: center;
    }

    .vertical-text {
        display: none;
    }
}

/* Upload Zone */
.upload-zone {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-soft);
}

.upload-zone:hover {
    border-color: #bbb;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

.upload-placeholder {
    text-align: center;
    color: #999;
}

.plus-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
    font-weight: 300;
}

#preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Delete button - top right */
.icon-btn.remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.icon-btn.remove-btn:hover {
    background: #f5f5f5;
}

.icon-btn.remove-btn:active {
    background: #eee;
}

/* Image Toolbar - below image */
.image-toolbar {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 15px 0;
}

.toolbar-btn {
    background: #fff;
    border: 1px solid #e0e0e0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.toolbar-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.toolbar-btn:active {
    background: #eee;
    transform: scale(0.95);
}

/* Crop Overlay */
.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    touch-action: none;
}

.crop-backdrop {
    display: none;  /* Using box-shadow on crop-box instead */
}

.crop-box {
    position: absolute;
    border: 2px solid #fff;
    background: transparent;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    cursor: move;
    touch-action: none;
}

.crop-handle {
    position: absolute;
    width: 24px;
    height: 24px;
    background: #fff;
    border: 2px solid #4ECDC4;
    border-radius: 50%;
    touch-action: none;
}

.crop-handle.nw {
    top: -12px;
    left: -12px;
    cursor: nwse-resize;
}

.crop-handle.ne {
    top: -12px;
    right: -12px;
    cursor: nesw-resize;
}

.crop-handle.sw {
    bottom: -12px;
    left: -12px;
    cursor: nesw-resize;
}

.crop-handle.se {
    bottom: -12px;
    right: -12px;
    cursor: nwse-resize;
}

.crop-actions {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 1000;
}

.crop-action-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.crop-action-btn.cancel {
    background: #999;
    color: white;
}

.crop-action-btn.cancel:hover {
    background: #888;
}

.crop-action-btn.apply {
    background: #333;
    color: white;
}

.crop-action-btn.apply:hover {
    background: #222;
}

/* Style Section */
.style-section {
    padding-top: 20px;
}

.style-section h2 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-bottom: 30px;
    font-weight: 400;
}

.style-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 10px 0 20px 0;
    max-height: 480px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

/* Styled scrollbar for Chrome/Safari/Opera */
.style-grid::-webkit-scrollbar {
    width: 6px;
}

.style-grid::-webkit-scrollbar-track {
    background: transparent;
}

.style-grid::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

.style-grid::-webkit-scrollbar-thumb:hover {
    background-color: #aaa;
}

.style-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    aspect-ratio: 1 / 1.1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.style-card img {
    width: 100%;
    flex: 1;
    min-height: 0;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 8px;
    filter: grayscale(20%);
    transition: var(--transition);
}

.style-card h4 {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 500;
    color: #666;
    line-height: 1.2;
    min-height: 2.4em;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.style-card:hover img {
    filter: grayscale(0%);
}

.style-card.selected {
    border-color: var(--accent-color);
}

.style-card.selected h4 {
    color: var(--accent-color);
    font-weight: 700;
}

/* Style grid responsive layout */
@media (max-width: 900px) {
    .style-grid {
        grid-template-columns: repeat(3, 1fr);
        max-height: 420px;
    }
}

@media (max-width: 600px) {
    .style-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        max-height: 380px;
    }

    .style-card {
        padding: 10px;
        border-radius: 12px;
    }

    .style-card img {
        border-radius: 8px;
    }

    .style-card h4 {
        font-size: 0.8rem;
    }
}

/* Buttons */
.btn {
    padding: 15px 40px;
    font-size: 1rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    border-radius: 2px;
    font-family: var(--font-sans);
}

.primary-btn {
    background: var(--accent-color);
    color: white;
    width: 100%;
}

.primary-btn:hover:not(:disabled) {
    background: #555;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.primary-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.secondary-btn {
    background: white;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.secondary-btn:hover {
    background: var(--accent-color);
    color: white;
}

.text-btn {
    background: transparent;
    color: #999;
    padding: 10px 20px;
}

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

/* Result Section */
.result-section {
    margin-top: 80px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 60px;
}

.result-section h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin-bottom: 40px;
    font-weight: 400;
}

.result-container {
    max-width: 600px;
    margin: 0 auto 40px;
    position: relative;
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    box-shadow: var(--shadow-soft);
    padding: 20px;
}

#result-image {
    max-width: 100%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: center;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #f0f0f0;
    border-radius: 50px;
    /* Pill shape */
    padding: 12px 28px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: auto;
    min-width: auto;
    /* Let content define width */
    max-width: 90vw;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.toast.error {
    border: 1px solid #ffcccc;
    color: #d63031;
    background: #fff5f5;
}

.toast.success {
    border: 1px solid #ccffe6;
    color: #00b894;
    background: #f0fff9;
}

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

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

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

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal-btn:hover {
    color: #333;
}

/* Secondary CTA Button */
.cta-button.secondary {
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    margin-left: 15px;
}

.cta-button.secondary:hover {
    background: var(--accent-color);
    color: white;
}

/* How To Use Modal */
.how-to-use-content {
    max-width: 1000px;
    padding: 40px 50px;
}

.how-to-use-content h2 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #333;
    text-align: center;
}

.tutorial-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.tutorial-left {
    flex: 1;
    min-width: 0;
}

.tutorial-right {
    flex: 1;
    min-width: 0;
}

.tutorial-steps {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.tutorial-step {
    text-align: center;
}

.tutorial-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
}

.tutorial-icon svg {
    width: 100%;
    height: 100%;
}

.tutorial-step h3 {
    font-size: 0.95rem;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.tutorial-step p {
    font-size: 0.85rem;
    color: #666;
}

.tutorial-left {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tutorial-left .cta-button {
    width: 80%;
}

.tutorial-video-label {
    font-size: 1rem;
    color: #666;
    margin-bottom: 12px;
    text-align: center;
}

.tutorial-video {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.tutorial-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

/* Mobile Responsive for How To Use */
@media (max-width: 768px) {
    .hero-cta .cta-button.secondary {
        margin-left: 0;
        margin-top: 10px;
    }

    .how-to-use-content {
        padding: 30px 20px;
        max-width: 95vw;
    }

    .tutorial-layout {
        flex-direction: column;
        gap: 25px;
    }

    .tutorial-steps {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .tutorial-icon {
        width: 50px;
        height: 50px;
    }
}

.login-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 30px 0;
}

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: white;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-btn:hover {
    background: #f9f9f9;
    border-color: #ddd;
    transform: translateY(-2px);
}

.auth-btn .icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-btn svg {
    width: 100%;
    height: 100%;
}

.terms-text {
    font-size: 0.8rem;
    color: #999;
    margin-top: 20px;
}

/* 免费积分提示 */
.free-credits-hint {
    font-size: 0.85rem;
    color: #4CAF50;
    margin: 15px 0 10px;
    text-align: center;
}

.free-credits-hint::before {
    content: '🎁 ';
}

/* 条款勾选框 */
.terms-checkbox-wrapper {
    margin-top: 15px;
}

.terms-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #666;
    justify-content: center;
}

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

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 4px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s;
    margin-top: 1px;
}

.terms-checkbox-label input:checked + .checkbox-custom {
    background: #4CAF50;
    border-color: #4CAF50;
}

.terms-checkbox-label input:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.terms-text-content {
    line-height: 1.6;
    text-align: left;
}

.terms-link, .privacy-link {
    color: var(--accent-color, #FF6B6B);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    font-weight: 500;
    transition: all 0.2s;
}

.terms-link:hover, .privacy-link:hover {
    text-decoration-style: solid;
    opacity: 0.8;
}

/* iframe 浮层 */
.legal-iframe-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.legal-iframe-modal.active {
    opacity: 1;
    visibility: visible;
}

.legal-iframe-modal.hidden {
    display: none;
}

.legal-iframe-content {
    width: 90%;
    max-width: 700px;
    height: 80vh;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.legal-iframe-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background 0.2s;
}

.legal-iframe-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

#legal-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 条款确认弹窗 */
.terms-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.terms-confirm-overlay.active {
    opacity: 1;
}

.terms-confirm-modal {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 360px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.terms-confirm-overlay.active .terms-confirm-modal {
    transform: scale(1);
}

.terms-confirm-modal h3 {
    margin: 0 0 12px;
    font-size: 1.1rem;
    color: #333;
}

.terms-confirm-modal p {
    margin: 0 0 20px;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

.terms-confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.terms-confirm-cancel,
.terms-confirm-agree {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.terms-confirm-cancel {
    background: #f0f0f0;
    color: #666;
}

.terms-confirm-cancel:hover {
    background: #e0e0e0;
}

.terms-confirm-agree {
    background: #4CAF50;
    color: white;
}

.terms-confirm-agree:hover {
    background: #45a049;
}

/* Email Login Form */
.email-login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.email-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #666;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 5px 0;
    margin-bottom: 10px;
    transition: color 0.2s;
}

.email-back-btn:hover {
    color: #333;
}

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

.email-form-fields input {
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.email-form-fields input:focus {
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

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

.password-field-wrapper input {
    width: 100%;
    padding-right: 45px;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    transition: color 0.2s;
}

.password-toggle-btn:hover {
    color: #333;
}

.password-toggle-btn svg.hidden {
    display: none;
}

.confirm-password-wrapper.hidden {
    display: none;
}

.email-submit-btn {
    margin-top: 10px;
    padding: 14px;
    font-size: 1rem;
    min-height: 50px;
}

.email-submit-btn.loading {
    pointer-events: none;
}

.email-submit-btn .loading-dots {
    display: inline-flex;
    gap: 4px;
}

.email-submit-btn .loading-dots span {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.email-submit-btn .loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.email-submit-btn .loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.email-submit-btn .loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    30% {
        transform: scale(1.5);
        opacity: 0.7;
    }
}

.email-toggle-mode {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin: 10px 0 0;
}

.email-toggle-mode a {
    color: #333;
    font-weight: 500;
    text-decoration: none;
}

.email-toggle-mode a:hover {
    text-decoration: underline;
}

.email-error {
    color: #e53935;
    font-size: 0.85rem;
    text-align: center;
    margin: 0;
    padding: 10px;
    background: #ffebee;
    border-radius: 8px;
}

.email-success {
    color: #2e7d32;
    font-size: 0.85rem;
    text-align: center;
    margin: 0;
    padding: 10px;
    background: #e8f5e9;
    border-radius: 8px;
}

.forgot-password-link {
    text-align: center;
    margin: 5px 0 0;
}

.forgot-password-link a {
    color: #666;
    font-size: 0.85rem;
    text-decoration: none;
}

.forgot-password-link a:hover {
    color: #333;
    text-decoration: underline;
}

/* Email Verification Pending Screen */
.verification-pending-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
    text-align: center;
}

.verification-icon {
    margin-bottom: 5px;
}

.verification-pending-screen h3 {
    font-size: 1.3rem;
    color: #333;
    margin: 0;
    font-weight: 600;
}

.verification-pending-screen p {
    color: #666;
    margin: 0;
}

.verification-email {
    font-weight: 600;
    color: #333 !important;
    background: #f5f5f5;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.95rem;
}

.verification-check-inbox {
    font-size: 0.9rem;
    max-width: 280px;
    line-height: 1.5;
}

.verification-pending-screen .btn {
    margin-top: 8px;
    min-width: 220px;
}

.verification-pending-screen .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.verification-back {
    margin-top: 8px;
}

.verification-back a {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
}

.verification-back a:hover {
    color: #333;
    text-decoration: underline;
}

/* User Drawer */
.user-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    pointer-events: none;
}

.user-drawer.active {
    pointer-events: auto;
}

.drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.user-drawer.active .drawer-overlay {
    opacity: 1;
}

.drawer-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background: white;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    z-index: 1;  /* Ensure content is above drawer-overlay */
}

.user-drawer.active .drawer-content {
    transform: translateX(0);
}

/* Drawer Login Prompt (for not logged in users on PC sidebar) */
.drawer-login-prompt {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    height: 100%;
}

.drawer-login-prompt .login-prompt-icon {
    margin-bottom: 16px;
    opacity: 0.6;
}

.drawer-login-prompt h3 {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0 0 20px;
    color: #333;
}

.drawer-login-prompt .login-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 30px;
    text-align: left;
}

.drawer-login-prompt .login-benefits li {
    padding: 6px 0;
    padding-left: 20px;
    color: #666;
    font-size: 0.9rem;
    position: relative;
}

.drawer-login-prompt .login-benefits li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-weight: bold;
}

.drawer-login-prompt .login-prompt-btn {
    width: 100%;
    max-width: 160px;
}

/* Show login prompt and hide user content based on login state */
.drawer-user-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* PC sidebar: show login prompt when not logged in */
@media (min-width: 900px) {
    .studio-layout .user-drawer[data-logged-in="false"] .drawer-login-prompt {
        display: flex;
    }

    .studio-layout .user-drawer[data-logged-in="false"] .drawer-user-content {
        display: none;
    }
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #f0f0f0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.user-details h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.username-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.plan-badge.free {
    background: #f0f0f0;
    color: #666;
}

.plan-badge.starter {
    background: #e8f5e9;
    color: #2e7d32;
}

.plan-badge.standard {
    background: #e3f2fd;
    color: #1565c0;
}

.plan-badge.pro {
    background: #f3e5f5;
    color: #7b1fa2;
}

.plan-badge.cancelled {
    opacity: 0.7;
}

.user-plan {
    font-size: 0.75rem;
    color: var(--accent-color);
    background: rgba(255, 107, 107, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.user-email {
    font-size: 0.75rem;
    color: #999;
    display: block;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

.settings-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #666;
    text-decoration: none;
    transition: all 0.2s;
}

.settings-icon-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.drawer-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.stat-item {
    flex: 1;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
}

.stat-label {
    font-size: 0.8rem;
    color: #999;
}

.drawer-section {
    flex: 1;
    overflow-y: auto;
}

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

.section-header h4 {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.view-all-btn {
    background: white;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    transition: var(--transition);
    letter-spacing: 0.02em;
}

.view-all-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.drawer-section h4 {
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.history-item {
    position: relative;
    cursor: pointer;
    width: 80%;
    margin: 0 auto;
    /* Frame effect: card paper + shadow */
    background: #fefefe;
    padding: 10px;
    border-radius: 4px;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 4px 16px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f0f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.history-item:hover {
    transform: translateY(-3px);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.12),
        0 4px 8px rgba(0, 0, 0, 0.06);
}

.history-item img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 2px;
    background: #f9f9f9;
    transition: none;
}

.history-item:hover img {
    transform: none;
}

.empty-history {
    text-align: center;
    padding: 40px 0;
    color: #ccc;
    font-size: 0.9rem;
}

/* History Loading Animation */
.loading-history {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 0;
    color: #999;
    font-size: 0.85rem;
}

.loading-history .mini-loader {
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
}

.loading-history .mini-spark {
    transform-origin: center;
    opacity: 0;
}

.loading-history .mini-spark-1 {
    animation: miniSparkle 1.5s ease-in-out infinite;
}

.loading-history .mini-spark-2 {
    animation: miniSparkle 1.5s ease-in-out infinite 0.3s;
}

.loading-history .mini-spark-3 {
    animation: miniSparkle 1.5s ease-in-out infinite 0.6s;
}

.loading-history .mini-center {
    animation: miniPulse 1.2s ease-in-out infinite;
}

@keyframes miniSparkle {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

@keyframes miniPulse {
    0%, 100% {
        transform: scale(0.7);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}

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

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Lightbox Action Buttons */
.lightbox-actions {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    z-index: 2;
}

.lightbox-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lightbox-action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.lightbox-action-btn svg {
    flex-shrink: 0;
}

.lightbox-action-btn.delete-btn:hover {
    background: rgba(255, 82, 82, 0.6);
    border-color: rgba(255, 82, 82, 0.8);
}

/* ========================================
   Lightbox Tabs & Comparison View
   ======================================== */

/* Tab container */
.lightbox-tabs {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px;
    border-radius: 30px;
    z-index: 3;
    backdrop-filter: blur(10px);
}

/* Hide tabs when no original image available */
.lightbox-tabs.hidden {
    display: none;
}

/* Single tab */
.lightbox-tab {
    padding: 8px 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lightbox-tab:hover {
    color: white;
}

.lightbox-tab.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.lightbox-tab:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* View containers */
.lightbox-views {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Single view */
.lightbox-view {
    display: none;
    max-width: 90vw;
    max-height: 80vh;
}

.lightbox-view.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-view img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

/* Comparison container */
.lightbox-comparison-container {
    position: relative;
    width: 80vw;
    max-width: 900px;
    aspect-ratio: 4 / 3;
    background-color: #fff;
    border-radius: 16px;
    overflow: hidden;
    user-select: none;
    cursor: ew-resize;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-comparison-container .img-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.lightbox-comparison-container .img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f5f5f5;
    border-radius: 0;
    box-shadow: none;
}

.lightbox-comparison-container .img-wrapper.before {
    z-index: 1;
}

.lightbox-comparison-container .img-wrapper.after {
    z-index: 2;
    clip-path: inset(0 0 0 50%);
}

.lightbox-comparison-container .slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background-color: #fff;
    z-index: 10;
    transform: translateX(-50%);
    cursor: ew-resize;
    touch-action: none;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.3));
}

/* Increase click area for handle */
.lightbox-comparison-container .slider-handle::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 100%;
    z-index: 11;
    cursor: ew-resize;
}

.lightbox-comparison-container .handle-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background-color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.lightbox-comparison-container .handle-circle svg {
    width: 20px;
    height: 20px;
    transform: rotate(90deg);
    color: #333;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .lightbox-tabs {
        top: 70px;
    }

    .lightbox-tab {
        padding: 6px 14px;
        font-size: 0.85rem;
    }

    .lightbox-comparison-container {
        width: 95vw;
    }
}

/* Simple Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f0f0f0;
    border-top-color: var(--accent-color, #4ECDC4);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.drawer-footer {
    padding-top: 20px;
    padding-bottom: 10px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #666;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.settings-link:hover {
    background: #eee;
    color: #333;
}

.settings-link svg {
    flex-shrink: 0;
}

.logout-btn {
    width: 100%;
    padding: 12px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #666;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.logout-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
}

/* Confirm Modal */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 4000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.confirm-modal.active {
    opacity: 1;
    visibility: visible;
}

.confirm-modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    max-width: 320px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.confirm-modal.active .confirm-modal-content {
    transform: scale(1);
}

.confirm-modal h3 {
    margin: 0 0 12px;
    font-size: 1.2rem;
    color: #333;
}

.confirm-modal p {
    margin: 0 0 24px;
    color: #666;
    font-size: 0.9rem;
}

.confirm-modal-buttons {
    display: flex;
    gap: 12px;
}

.confirm-modal-buttons button {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-cancel-btn {
    background: #f0f0f0;
    border: none;
    color: #666;
}

.confirm-cancel-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.confirm-logout-btn {
    background: #ff6b6b;
    border: none;
    color: #fff;
}

.confirm-logout-btn:hover {
    background: #ff5252;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* Gallery Modal */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.gallery-modal.active {
    opacity: 1;
    visibility: visible;
}

.gallery-modal-content {
    background: #f8f8f8;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.gallery-modal.active .gallery-modal-content {
    transform: translateY(0);
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    background: white;
}

.gallery-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.gallery-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.gallery-sort {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    background: white;
}

.gallery-sort:focus {
    outline: none;
    border-color: var(--accent-color);
}

.gallery-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s;
}

.gallery-close-btn:hover {
    color: #333;
}

.gallery-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 30px 20px 40px;
    overflow-y: auto;
    flex: 1;
}

.gallery-item {
    position: relative;
    width: 100%;
    max-width: 400px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Frame effect: card paper + shadow */
    background: #fefefe;
    padding: 12px;
    border-radius: 4px;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f0f0;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.12),
        0 4px 10px rgba(0, 0, 0, 0.06);
}

.gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 2px;
    background: #f9f9f9;
}

.gallery-loading,
.gallery-empty {
    padding: 40px;
    text-align: center;
    color: #999;
}

.gallery-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

/* Responsive: mobile gallery */
@media (max-width: 600px) {
    .gallery-grid {
        gap: 24px;
        padding: 20px 16px 30px;
    }

    .gallery-item {
        max-width: 100%;
        padding: 10px;
    }

    .gallery-modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 15px;
    }

    .gallery-header {
        padding: 15px;
    }

    .gallery-header h2 {
        font-size: 1.1rem;
    }

    .gallery-sort {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

/* Magic Loader Animation */
.magic-loader {
    margin: 0 auto 20px;
    overflow: visible;
}

.spark {
    transform-origin: center;
    opacity: 0;
}

.spark-1 {
    animation: sparkle 2s ease-in-out infinite;
    transform-origin: 30px 30px;
}

.spark-2 {
    animation: sparkle 2s ease-in-out infinite 0.4s;
    transform-origin: 10px 38px;
}

.spark-3 {
    animation: sparkle 2s ease-in-out infinite 0.8s;
    transform-origin: 50px 38px;
}

.spark-center {
    animation: pulse 1.5s ease-in-out infinite;
    transform-origin: 30px 30px;
}

@keyframes sparkle {
    0% {
        transform: scale(0) rotate(0deg) translate(0, 0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2) rotate(180deg) translate(0, -5px);
        opacity: 1;
    }

    100% {
        transform: scale(0) rotate(360deg) translate(0, 0);
        opacity: 0;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Loading Progress Bar */
.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 200px;
    margin-top: 12px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FF6B6B, #4ECDC4, #FFD700);
    background-size: 300% 100%;
    border-radius: 3px;
    transition: width 0.3s ease-out;
    animation: shimmer 2s ease-in-out infinite;
}

.progress-percent {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    font-variant-numeric: tabular-nums;
}

@keyframes shimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: 0 0;
    }
}

@media (max-width: 768px) {
    .hero-text h1 {
        font-size: 2rem;
    }
}

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

/* Hero Section */
.hero-section {
    padding: 60px 20px;
    background: linear-gradient(135deg, #fff 0%, #f9f9f9 100%);
    min-height: calc(100vh - 80px - 60px);
    display: flex;
    align-items: center;
}

.hero-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 80px;
    padding: 0 40px;
    box-sizing: border-box;
}

.hero-content {
    flex: 1;
    text-align: left;
    max-width: 500px;
}

.hero-content h1 {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 30px;
}

.hero-cta {
    margin-bottom: 30px;
}

.cta-hint {
    font-size: 0.9rem;
    color: #888;
    margin-top: 12px;
}

/* Trust Badges */
.trust-badges {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.trust-badge {
    font-size: 0.85rem;
    color: #555;
    background: #f0f0f0;
    padding: 8px 14px;
    border-radius: 20px;
}

/* Hero Demo */
.hero-demo {
    flex: 1.2;
    max-width: 650px;
    min-width: 400px;
}

/* Hero Carousel */
.hero-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.hero-carousel .comparison-card {
    display: none;
    width: 100%;
    max-width: none;
}

.hero-carousel .comparison-card.active {
    display: block;
}

.hero-carousel .comparison-container {
    aspect-ratio: 297 / 210;
}

.hero-carousel .style-name {
    text-align: center;
    padding: 15px 0 10px;
    background: white;
    margin: 0;
}

.hero-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.hero-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-carousel-dot.active {
    background: var(--accent-color);
    transform: scale(1.3);
}

/* Legacy Demo Comparison (keep for backwards compatibility) */
.demo-comparison {
    display: flex;
    align-items: center;
    gap: 20px;
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.demo-before, .demo-after {
    flex: 1;
    text-align: center;
}

.demo-before img, .demo-after img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.demo-label {
    display: block;
    margin-top: 10px;
    font-size: 0.85rem;
    color: #888;
}

.demo-arrow {
    font-size: 2rem;
    color: var(--accent-color);
    font-weight: bold;
}

/* CTA Buttons */
.cta-button {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    transition: var(--transition);
}

.cta-button.small {
    padding: 8px 20px;
    font-size: 0.9rem;
}

.cta-button.large {
    padding: 15px 40px;
    font-size: 1.2rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

/* Pulse Animation for CTA */
.cta-button.pulse {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.5);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(255, 107, 107, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0);
    }
}

/* Section Common */
.section-title {
    text-align: center;
    font-family: var(--font-serif);
    font-size: 2.5rem;
    margin-bottom: 60px;
}

/* Showcase Section - Carousel & Slider */
.showcase-section {
    padding: 4rem 2rem;
    background-color: var(--background-color);
    overflow: hidden;
    /* Hide scrollbar from section if needed */
}

.showcase-carousel {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    /* scroll-snap-type: x mandatory;  <-- Removed for smooth JS scroll */
    padding: 2rem 1rem;
    /* Add padding for shadow visibility */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
}

.showcase-carousel::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.comparison-card {
    flex: 0 0 auto;
    width: 85vw;
    /* Mobile width */
    max-width: 500px;
    /* Desktop max width */
    /* scroll-snap-align: center; <-- Removed for smooth JS scroll */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.comparison-container {
    position: relative;
    width: 100%;
    aspect-ratio: 297 / 210;
    /* A4 Landscape */
    background-color: #fff;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    user-select: none;
    cursor: ew-resize;
}

.img-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.img-wrapper.before {
    background-color: #ffffff;
    z-index: 1;
}

.img-wrapper.after {
    background-color: #f0f0f0;
    /* Fallback */
    z-index: 2;
    clip-path: inset(0 0 0 50%);
    /* Initial state: Clip 50% from LEFT. Shows Right half (After). Left half shows Before. */
}

/* Placeholder Content Styles - Lazy Loading Base */
.placeholder-content {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-secondary);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    /* Simple loading placeholder */
    transition: opacity 0.5s ease;
}

/* Only show complex backgrounds when loaded */
.comparison-card.loaded .placeholder-content.lineart {
    background-image: radial-gradient(#ccc 1px, transparent 1px);
    background-size: 20px 20px;
    background-color: #fff;
}

.comparison-card.loaded .placeholder-content.color.watercolor {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
    color: #fff;
}

.comparison-card.loaded .placeholder-content.color.crayon {
    background: linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%);
    color: #fff;
}

.comparison-card.loaded .placeholder-content.color.threed {
    background: linear-gradient(to top, #a18cd1 0%, #fbc2eb 100%);
    color: #fff;
}

.comparison-card.loaded .placeholder-content.color.pixel {
    background: linear-gradient(45deg, #ff9a9e 25%, #fad0c4 25%, #fad0c4 50%, #ff9a9e 50%, #ff9a9e 75%, #fad0c4 75%, #fad0c4 100%);
    background-size: 20px 20px;
    color: #fff;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
}

.comparison-card.loaded .placeholder-content.color.clay {
    background: radial-gradient(circle at 30% 30%, #ffd1ff, #a18cd1);
    color: #fff;
    box-shadow: inset -10px -10px 20px rgba(0, 0, 0, 0.1);
}

.comparison-card.loaded .placeholder-content.color.ink {
    background: linear-gradient(to bottom, #fdfbfb 0%, #ebedee 100%);
    color: #333;
    font-family: "Courier New", Courier, monospace;
    font-weight: 900;
}

/* Slider Handle */
.slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background-color: #fff;
    z-index: 10;
    transform: translateX(-50%);
    cursor: ew-resize;
    /* Show resize cursor on handle */
    touch-action: none;
    /* Prevent scrolling when dragging handle */
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.2));
}

/* Increase hit area for the handle */
.slider-handle::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    /* Much larger hit area */
    height: 100%;
    z-index: 11;
    cursor: ew-resize;
}

.handle-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    color: var(--primary-color);
}

.handle-circle svg {
    width: 20px;
    height: 20px;
    transform: rotate(90deg);
    /* Make arrows point left/right */
}

.style-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Carousel Dots */
.carousel-dots {
    display: none;
    justify-content: center;
    gap: 10px;
    margin-top: 1rem;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: var(--accent-color);
    transform: scale(1.3);
}

@media (max-width: 768px) {
    .carousel-dots {
        display: flex;
    }
}

/* How it Works */
.how-it-works {
    padding: 80px 20px;
    background: #fafafa;
}

.steps-container {
    display: flex;
    justify-content: center;
    gap: 60px;
    max-width: 1000px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.step-card {
    text-align: center;
    flex: 1;
    min-width: 250px;
}

.step-icon {
    width: 60px;
    height: 60px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 20px;
}

/* Brand Section */
.brand-section {
    padding: 120px 20px;
    text-align: center;
    background: white;
}

.brand-content h2 {
    font-family: var(--font-serif);
    font-size: 3rem;
    margin-bottom: 30px;
}

.brand-content p {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto 10px;
}

/* Gallery Entry Section */
.gallery-entry-section {
    text-align: center;
    padding: 20px 20px 40px;
    background: linear-gradient(180deg, #fff 0%, #f9f9f9 100%);
}

.gallery-entry-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #FFF5E6 0%, #FFE8CC 100%);
    border: 2px solid #FFD700;
    border-radius: 50px;
    text-decoration: none;
    color: #333;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.gallery-entry-link:hover {
    background: linear-gradient(135deg, #FFE8CC 0%, #FFD700 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.35);
}

.gallery-entry-icon {
    font-size: 1.3rem;
}

.gallery-entry-text {
    font-weight: 500;
}

.gallery-entry-arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.gallery-entry-link:hover .gallery-entry-arrow {
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .gallery-entry-section {
        padding: 15px 15px 30px;
    }

    .gallery-entry-link {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
}

/* Features Section - SEO Optimized */
.features-section {
    padding: 80px 20px;
    background: linear-gradient(180deg, #f9f9f9 0%, #fff 100%);
}

.features-container {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.features-container h2 {
    font-size: 1.8rem;
    color: var(--text-color);
    margin-bottom: 15px;
}

.features-intro {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 50px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

.feature-card {
    background: #fff;
    border-radius: 16px;
    padding: 30px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
}

.feature-icon svg {
    width: 100%;
    height: 100%;
}

.feature-card h3 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 12px;
}

.feature-card p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.7;
}

.features-summary {
    background: #FFF5F5;
    border-radius: 16px;
    padding: 30px 40px;
    max-width: 900px;
    margin: 0 auto;
}

.features-summary p {
    color: #555;
    font-size: 1rem;
    line-height: 1.8;
    margin: 0;
}

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

@media (max-width: 600px) {
    .features-section {
        padding: 50px 20px;
    }

    .features-container h2 {
        font-size: 1.4rem;
    }

    .features-intro {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .feature-card {
        padding: 25px 20px;
    }

    .features-summary {
        padding: 20px;
    }

    .features-summary p {
        font-size: 0.9rem;
    }
}

/* Blog Preview Section */
.blog-preview-section {
    padding: 60px 20px;
    background: #fff;
}

.blog-preview-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.blog-preview-container h2 {
    font-size: 1.8rem;
    color: var(--text-color);
    margin-bottom: 40px;
}

.blog-preview-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.blog-preview-card {
    background: #f9f9f9;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: left;
}

.blog-preview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.blog-preview-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.blog-preview-card-content {
    padding: 20px;
}

.blog-preview-card-content h3 {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.blog-preview-card-content p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.view-all-articles {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    padding: 12px 24px;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.view-all-articles:hover {
    background: var(--accent-color);
    color: #fff;
}

@media (max-width: 768px) {
    .blog-preview-section {
        padding: 40px 20px;
    }

    .blog-preview-container h2 {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }

    .blog-preview-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .blog-preview-card img {
        height: 160px;
    }
}

/* Footer */
footer {
    padding: 40px;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
}

.footer-links {
    margin-bottom: 15px;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.footer-divider {
    color: #ccc;
    margin: 0 12px;
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

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

/* Mobile Landing Adjustments */
@media (max-width: 768px) {
    .hero-section {
        padding: 30px 20px 40px;
        min-height: auto;
    }

    .hero-container {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }

    .hero-content {
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .trust-badges {
        justify-content: center;
    }

    .trust-badge {
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    .hero-demo {
        width: 85vw;
        max-width: 400px;
        min-width: auto;
        order: -1; /* 移动端轮播在上面 */
    }

    .hero-container {
        padding: 0 15px;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-carousel {
        border-radius: 15px;
        width: 100%;
    }

    .hero-carousel .style-name {
        padding: 12px 0 10px;
        font-size: 1.1rem;
    }

    .demo-comparison {
        padding: 15px;
        gap: 10px;
    }

    .demo-arrow {
        font-size: 1.5rem;
    }

    .showcase-section {
        padding: 2rem 1rem;
    }

    .steps-container {
        flex-direction: column;
        gap: 40px;
    }

    .brand-content h2 {
        font-size: 2rem;
    }
}

/* =====================================================
   Subscription Section Styles
   ===================================================== */

.subscription-section {
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 16px;
}

.subscription-info {
    margin-bottom: 12px;
}

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

.subscription-credits {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.subscription-date {
    font-size: 0.8rem;
    color: #888;
    display: block;
}

.subscription-date.expiring {
    color: #e57373;
    font-weight: 500;
}

.subscription-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.subscription-badge.free {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    color: #666;
}

.subscription-badge.starter {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
}

.subscription-badge.standard {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
}

.subscription-badge.pro {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    color: #7b1fa2;
}

.subscription-badge.active {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
}

.subscription-badge.canceled {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #f57c00;
}

.subscription-badge.past-due {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
}

.subscription-badge svg {
    width: 16px;
    height: 16px;
}

.subscription-status {
    font-size: 0.8rem;
    color: #888;
    margin: 0;
}

.subscription-status.canceling {
    color: #f57c00;
}

.subscription-status.past-due {
    color: #d32f2f;
}

.subscription-actions {
    display: flex;
    gap: 10px;
}

.upgrade-btn {
    flex: 1;
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
}

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

.manage-subscription-btn {
    padding: 10px 16px;
    background: #f5f5f5;
    color: #333;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.manage-subscription-btn:hover {
    background: #e8e8e8;
}

.manage-subscription-btn.hidden {
    display: none;
}

/* Credits Low Warning */
.credits-warning {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-radius: 10px;
    padding: 12px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.credits-warning svg {
    width: 20px;
    height: 20px;
    color: #f57c00;
    flex-shrink: 0;
}

.credits-warning p {
    margin: 0;
    font-size: 0.85rem;
    color: #e65100;
}

/* Insufficient Credits Modal */
.insufficient-credits-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.insufficient-credits-modal.active {
    opacity: 1;
    visibility: visible;
}

.insufficient-credits-content {
    background: #fff;
    border-radius: 20px;
    padding: 40px 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.insufficient-credits-modal.active .insufficient-credits-content {
    transform: scale(1);
}

.insufficient-credits-content h3 {
    font-size: 1.5rem;
    margin: 0 0 12px;
    color: #333;
}

.insufficient-credits-content p {
    color: #666;
    margin: 0 0 24px;
    line-height: 1.6;
}

.insufficient-credits-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.insufficient-credits-actions .upgrade-btn {
    padding: 14px 24px;
    font-size: 1rem;
}

.insufficient-credits-actions .close-btn {
    padding: 12px 24px;
    background: transparent;
    color: #666;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
}