/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-hover: #5855eb;
    --secondary-color: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --background: #ffffff;
    --background-alt: #f8fafc;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --border-radius: 0.5rem;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
    /* 移动端优化 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 导航栏 */
.header {
    background: var(--background);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-auth {
    display: flex;
    gap: 0.75rem;
}

/* 用户下拉菜单 */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.user-dropdown-toggle:hover {
    background: var(--secondary-color);
    border-color: var(--primary-color);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-email {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.user-status {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dropdown-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.user-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0;
    min-width: 200px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
}

.user-dropdown.active .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
    font-size: 0.875rem;
    min-height: 44px;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--background-alt);
}

.dropdown-item-icon {
    font-size: 1rem;
    width: 16px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* 按钮样式 */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    /* 移动端友好 */
    min-height: 44px; /* iOS推荐的最小触摸目标 */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    background: var(--primary-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    /* 移动端友好 */
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-secondary:hover {
    background: var(--secondary-color);
    color: var(--text-primary);
}

.btn-secondary:active {
    background: var(--secondary-color);
    color: var(--text-primary);
}

/* 主内容 */
.main {
    margin-top: 80px;
}

/* 英雄区域 */
.hero {
    text-align: center;
    padding: 4rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.hero-tagline {
    font-size: 1rem;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.features-badges {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* 生成器区域 */
.generator-section {
    padding: 4rem 0;
    background: var(--background-alt);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.generator-card {
    background: var(--background);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    margin: 0 auto;
}

.generator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.generator-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.generator-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.generator-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.prompt-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.prompt-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.prompt-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.options-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.options-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.option-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.option-checkbox input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-radius: 3px;
    position: relative;
    transition: all 0.2s ease;
}

.option-checkbox input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.option-checkbox input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 1px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.option-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.toggle-label {
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}



#prompt-input {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}

.generator-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-group label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.option-group select,
.option-group input[type="number"],
.option-group input[type="range"] {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--background);
}

.option-group input[type="range"] {
    padding: 0;
    height: 6px;
    background: linear-gradient(to right, var(--primary-color) 0%, var(--primary-color) 30%, var(--border-color) 30%, var(--border-color) 100%);
    outline: none;
    -webkit-appearance: none;
}

.option-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid var(--background);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.option-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid var(--background);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}



.generator-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.generator-actions .btn-primary {
    padding: 0.875rem 2rem;
    font-weight: 600;
}

/* 选项下拉框 */
.options-dropdowns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.option-dropdown-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dropdown-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.option-dropdown {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.option-dropdown:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.option-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.option-dropdown option {
    padding: 0.5rem;
    background: var(--background);
    color: var(--text-primary);
}

.option-dropdown option:hover {
    background: var(--primary-color);
    color: white;
}

.btn-text {
    font-size: 1rem;
    font-weight: 600;
}

.btn-subtitle {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 400;
}

.free-trial-hint {
    margin-top: 1rem;
    text-align: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: var(--border-radius);
    color: #0369a1;
}

.free-trial-hint p {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
}

.generator-result {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-placeholder {
    width: 100%;
    height: 400px;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-alt);
}

.placeholder-content {
    text-align: center;
    color: var(--text-muted);
}

.placeholder-content svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 加载动画 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 自定义尺寸 */
.custom-dimensions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--background-alt);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

/* 高级选项 */
.advanced-options {
    margin-top: 1rem;
}

.advanced-toggle {
    width: 100%;
    padding: 0.75rem;
    background: var(--background-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    transition: all 0.2s ease;
}

.advanced-toggle:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.toggle-icon {
    transition: transform 0.2s ease;
}

.advanced-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

.advanced-content {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--background-alt);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* 画廊区域 */
.gallery-section {
    padding: 4rem 0;
}

/* 艺术感画廊样式 */
.gallery-masonry {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
    margin-top: 2rem;
    max-width: 100%;
}

.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px);
    background: white;
}

.gallery-item-visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.gallery-item-inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(99, 102, 241, 0.9) 0%, 
        rgba(118, 75, 162, 0.9) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-content {
    text-align: center;
    color: white;
    padding: 2rem;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover .gallery-item-content {
    transform: translateY(0);
}

.gallery-item-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gallery-item-content p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.gallery-item-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
}

.gallery-item-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.gallery-item-btn svg {
    transition: transform 0.3s ease;
}

.gallery-item-btn:hover svg {
    transform: translateX(4px);
}

/* 不同尺寸的图片 - 零空白布局 */
.gallery-item-large {
    grid-column: span 2;
    grid-row: span 1;
    min-height: 120px;
}

.gallery-item-medium {
    grid-column: span 1;
    grid-row: span 2;
    min-height: 200px;
}

.gallery-item-small {
    grid-column: span 1;
    grid-row: span 1;
    min-height: 100px;
}

/* 动画延迟 */
.gallery-item-delay-0 { transition-delay: 0s; }
.gallery-item-delay-1 { transition-delay: 0.1s; }
.gallery-item-delay-2 { transition-delay: 0.2s; }
.gallery-item-delay-3 { transition-delay: 0.3s; }

/* 画廊模态框样式 */
.gallery-modal .modal-content {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.gallery-modal img {
    border-radius: 0;
}

/* 特性区域 */
.features-section {
    padding: 4rem 0;
    background: var(--background-alt);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: var(--background);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* FAQ 区域 */
.faq-section {
    padding: 4rem 0;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    overflow: hidden;
}

.faq-question {
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--background);
    transition: background-color 0.2s;
}

.faq-question:hover {
    background: var(--background-alt);
}

.faq-question h3 {
    font-size: 1.1rem;
    font-weight: 500;
}

.faq-toggle {
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.2s;
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s, padding 0.3s;
}

.faq-item.active .faq-answer {
    padding: 0 1.5rem 1.5rem;
    max-height: 200px;
}

/* 页脚 */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 1rem;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--background);
    border-radius: var(--border-radius);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    margin: 1rem;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.close:hover {
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.modal-footer {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
}

.modal-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.modal-footer a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
/* 平板尺寸 */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .generator-card {
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .gallery-masonry {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.5rem;
    }
    
    .gallery-item-large {
        grid-column: span 2;
        grid-row: span 1;
        min-height: 100px;
    }
    
    .gallery-item-medium {
        min-height: 160px;
    }
    
    .gallery-item-small {
        min-height: 80px;
    }
}

/* 手机尺寸 */
@media (max-width: 768px) {
    .header {
        position: sticky; /* 改为sticky以节省空间 */
    }
    
    .nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-menu {
        gap: 1rem;
        order: 2; /* 将菜单放在认证按钮后面 */
    }
    
    .nav-auth {
        order: 1;
    }

    /* 移动端用户下拉菜单优化 */
    .user-dropdown-toggle {
        padding: 0.4rem 0.6rem;
        gap: 0.4rem;
    }

    .user-info {
        display: none; /* 移动端隐藏用户邮箱信息 */
    }

    .user-dropdown-menu {
        min-width: 180px;
        right: -10px; /* 确保不超出屏幕边缘 */
    }
    
    .main {
        margin-top: auto; /* 适配sticky导航 */
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .features-badges {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .badge {
        width: 80%;
        text-align: center;
    }
    
    .generator-section {
        padding: 2rem 0;
    }
    
    .generator-card {
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    .generator-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .options-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .option-toggle {
        width: 100%;
        justify-content: space-between;
    }
    
    /* 移动端下拉框优化 */
    .options-dropdowns {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .option-dropdown {
        padding: 0.875rem;
        font-size: 1rem;
    }
    
    .dropdown-label {
        font-size: 0.9rem;
    }
    
    .generator-options {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .generator-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .generator-actions button {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
    }
    
    .generator-actions .btn-primary {
        order: -1;
    }
    
    .btn-text {
        font-size: 1rem;
    }
    
    .btn-subtitle {
        font-size: 0.75rem;
    }
    
    .free-trial-hint {
        margin-top: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
    
    .free-trial-hint p {
        font-size: 0.8125rem;
    }
    
    #prompt-input {
        min-height: 100px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .image-placeholder {
        height: 250px;
    }
    
    .gallery-masonry {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.4rem;
    }
    
    .gallery-item-large,
    .gallery-item-medium {
        grid-column: span 1;
        grid-row: span 1;
        min-height: 100px;
    }
    
    .gallery-item-small {
        min-height: 80px;
    }
    
    .gallery-item-content {
        padding: 1.5rem;
    }
    
    .gallery-item-content h3 {
        font-size: 1.25rem;
    }
    
    .gallery-item-content p {
        font-size: 0.9rem;
    }
    
    .features-section,
    .faq-section {
        padding: 2rem 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
        max-width: 90vw;
    }
    
    .footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* 小屏手机尺寸 */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .generator-card {
        margin: 0 0.5rem;
        padding: 1rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .nav {
        padding: 0.75rem;
    }
    
    .nav-menu a {
        font-size: 0.9rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .generator-actions .btn-primary {
        padding: 0.875rem 1rem;
    }
    
    .btn-text {
        font-size: 0.9rem;
    }
    
    .btn-subtitle {
        font-size: 0.7rem;
    }
    
    .free-trial-hint {
        margin-top: 0.5rem;
        padding: 0.5rem;
    }
    
    .free-trial-hint p {
        font-size: 0.75rem;
    }

    /* 小屏幕用户下拉菜单优化 */
    .user-dropdown-toggle {
        padding: 0.3rem 0.5rem;
        gap: 0.3rem;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .user-dropdown-menu {
        min-width: 160px;
        right: -15px;
    }

    .dropdown-item {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .gallery-masonry {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.3rem;
    }
    
    .gallery-item {
        border-radius: 12px;
    }
    
    .gallery-item-content {
        padding: 1rem;
    }
    
    .gallery-item-content h3 {
        font-size: 1.1rem;
    }
    
    .gallery-item-content p {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }
    
    .gallery-item-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* 移动端专用样式 */
@media (hover: none) and (pointer: coarse) {
    /* 移除悬停效果，改为专注状态 */
    .btn-primary:hover,
    .btn-secondary:hover,
    .nav-menu a:hover,
    .faq-question:hover,
    .gallery-item:hover {
        transform: none;
    }
    
        /* 增强触摸反馈 */
    .btn-primary:active,
    .btn-secondary:active {
        transform: scale(0.98);
    }

    .gallery-item:active {
        transform: scale(0.95);
    }

    .faq-question:active {
        background: var(--background-alt) !important;
    }

    /* 用户下拉菜单触摸优化 */
    .user-dropdown-toggle:active {
        transform: scale(0.98);
        background: var(--secondary-color);
    }

    .dropdown-item:active {
        background: var(--background-alt) !important;
        transform: scale(0.98);
    }
}

/* 横屏手机优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 1rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-subtitle,
    .hero-tagline {
        margin-bottom: 0.5rem;
    }
    
    .features-badges {
        display: none; /* 在横屏时隐藏以节省空间 */
    }
    
    .generator-section {
        padding: 1.5rem 0;
    }
    
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo,
    .hero-title {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* 安全区域适配（iPhone X等） */
@supports (padding: max(0px)) {
    .header {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .footer {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* 定价部分样式 */
.pricing-section {
    padding: 4rem 0;
    background: var(--background-alt);
}

.pricing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.toggle-label {
    font-weight: 500;
    color: var(--text-primary);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.discount-badge {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.pricing-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
}

.pricing-card {
    background: var(--background);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.pricing-card.popular {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.pricing-card.popular::before {
    content: "最受欢迎";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.pricing-card.popular .pricing-header {
    margin-top: 1rem;
}

.pricing-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.pricing-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.pricing-price {
    margin-bottom: 1.5rem;
}

.price-amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.price-currency {
    font-size: 1.5rem;
    vertical-align: top;
}

.price-period {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-left: 0.25rem;
}

.price-original {
    display: block;
    font-size: 1rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-top: 0.25rem;
}

.pricing-features {
    list-style: none;
    margin: 1.5rem 0;
    text-align: left;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.pricing-features li::before {
    content: "✓";
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
}

.pricing-cta {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
}

.pricing-cta:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.pricing-cta:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.pricing-cta.current {
    background: var(--text-muted);
    cursor: default;
}

.pricing-cta.current:hover {
    background: var(--text-muted);
    transform: none;
}

/* 定价部分响应式 */
@media (max-width: 768px) {
    .pricing-section {
        padding: 2rem 0;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .pricing-card {
        padding: 1.5rem;
    }
    
    .pricing-card.popular {
        transform: none;
    }
    
    .pricing-toggle {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .toggle-switch {
        order: 2;
    }
    
    .price-amount {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .pricing-card {
        padding: 1rem;
    }
    
    .price-amount {
        font-size: 2rem;
    }
    
    .pricing-header h3 {
        font-size: 1.25rem;
    }
}

/* 图片历史记录样式 */
#image-history {
    margin-top: 40px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--background-alt);
    border-radius: var(--border-radius);
}

#image-history h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.history-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background: var(--background);
    border: 1px solid var(--border-color);
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.history-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.history-info {
    padding: 12px;
    background: var(--background);
    border-top: 1px solid var(--border-color);
}

.history-info p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 5px;
}

.history-info small {
    color: var(--text-muted);
    font-size: 11px;
}

.history-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.history-item:hover .history-actions {
    opacity: 1;
}

.history-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.history-action-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.history-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.history-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.history-empty p {
    font-size: 16px;
    margin-bottom: 8px;
}

.history-empty small {
    font-size: 14px;
    opacity: 0.8;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .history-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .history-item img {
        height: 120px;
    }
    
    .history-info {
        padding: 10px;
    }
    
    .history-info p {
        font-size: 11px;
    }
    
    .history-info small {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .history-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .history-item img {
        height: 100px;
    }
    
    .history-actions {
        opacity: 1;
        top: 4px;
        right: 4px;
    }
    
    .history-action-btn {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
} 