/* 基础字体设置 */
:root {
    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --font-family-chinese: 'Noto Sans SC', var(--font-family-base);
    --spacing-base: 16px;
    --spacing-small: 8px;
    
    /* 明亮主题变量 */
    --light-background: #ffffff;
    --light-background-card: #f8fafc;
    --light-text-primary: #1a202c;
    --light-text-secondary: #4a5568;
    --light-border-color: rgba(0, 0, 0, 0.1);
    --light-card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    --light-card-hover-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    /* 暗色主题变量 */
    --dark-background: #1a1b1e;
    --dark-background-card: #2a2b2e;
    --dark-text-primary: #ffffff;
    --dark-text-secondary: rgba(255, 255, 255, 0.85);
    --dark-border-color: rgba(255, 255, 255, 0.1);
    --dark-card-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    --dark-card-hover-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);
    
    /* 主色调 */
    --primary-color: #6366f1;
    --primary-color-rgb: 99, 102, 241;
    --primary-hover: #4f46e5;
    
    /* 默认使用暗色主题 */
    --background: var(--dark-background);
    --background-card: var(--dark-background-card);
    --text-primary: var(--dark-text-primary);
    --text-secondary: var(--dark-text-secondary);
    --border-color: var(--dark-border-color);
    --card-shadow: var(--dark-card-shadow);
    --card-hover-shadow: var(--dark-card-hover-shadow);
    
    /* 语言选择器样式变量 */
    --select-bg: var(--background-card);
    --select-text: var(--text-primary);
    --select-border: var(--border-color);
    --select-hover-border: var(--primary-color);
    --radius-sm: 4px;
    --spacing-sm: 8px;
    --spacing-lg: 16px;
    --text-sm: 14px;
    --primary-rgb: var(--primary-color-rgb);
}

/* RTL支持 */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .language-selector {
    margin-right: 0;
    margin-left: var(--spacing-base);
}

[dir="rtl"] .nav-links {
    margin-right: 0;
    margin-left: auto;
}

[dir="rtl"] .editor-icon {
    margin-right: 0;
    margin-left: var(--spacing-small);
}

[dir="rtl"] .benefit-card,
[dir="rtl"] .feature-card,
[dir="rtl"] .advantage-card {
    text-align: right;
}

/* 中文字体支持 */
[lang="zh"] {
    font-family: var(--font-family-chinese);
}

/* 导航栏样式 */
.nav-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--background);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle {
    order: -1; /* 确保主题切换按钮在最左边 */
}

/* 语言选择器样式 */
select.language-selector {
    background-color: var(--background) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-sm);
    font-size: var(--text-sm);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    min-width: 120px;
    transition: all 0.2s ease;
}

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

select.language-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2);
}

select.language-selector option {
    background-color: var(--background) !important;
    color: var(--text-primary) !important;
    padding: var(--spacing-sm);
}

/* 修复Webkit浏览器（Chrome、Safari等）的下拉菜单样式 */
select.language-selector::-webkit-listbox {
    background-color: var(--background);
}

select.language-selector::-webkit-list {
    background-color: var(--background);
}

/* 修复Firefox的下拉菜单样式 */
select.language-selector:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 var(--text-primary);
}

select.language-selector option:checked {
    background-color: var(--primary-color);
}

/* 中文特定样式调整 */
[lang="zh"] .hero-title {
    font-size: 2.5em; /* 调整中文标题大小 */
    line-height: 1.4; /* 增加行高 */
}

[lang="zh"] .hero-subtitle {
    line-height: 1.6; /* 增加中文副标题行高 */
}

[lang="zh"] .benefit-description,
[lang="zh"] .faq-answer {
    line-height: 1.8; /* 增加中文正文行高 */
}

/* 主题切换按钮样式 */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-right: 8px;
    order: -1;
    width: 36px;
    height: 36px;
}

.theme-toggle:hover {
    background-color: rgba(var(--primary-rgb), 0.1);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-primary);
    fill: none;
    transition: all 0.3s ease;
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
    position: absolute;
}

/* 亮色主题样式 */
[data-theme="light"] {
    --background: var(--light-background);
    --background-card: var(--light-background-card);
    --text-primary: var(--light-text-primary);
    --text-secondary: var(--light-text-secondary);
    --border-color: var(--light-border-color);
    --card-shadow: var(--light-card-shadow);
    --card-hover-shadow: var(--light-card-hover-shadow);
}

/* 暗色主题样式 */
[data-theme="dark"] {
    --background: var(--dark-background);
    --background-card: var(--dark-background-card);
    --text-primary: var(--dark-text-primary);
    --text-secondary: var(--dark-text-secondary);
    --border-color: var(--dark-border-color);
    --card-shadow: var(--dark-card-shadow);
    --card-hover-shadow: var(--dark-card-hover-shadow);
}

/* 主题切换过渡效果 */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.card, .editor-container, .feature-card, .advantage-card, .necessity-card, .benefit-card {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* 卡片和容器样式 */
.card, .editor-container, .feature-card, .advantage-card, .necessity-card, .benefit-card {
    background: var(--background-card);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.card:hover, .feature-card:hover, .advantage-card:hover, .necessity-card:hover, .benefit-card:hover {
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-2px);
}

/* 渐变背景效果 */
.gradient-bg {
    background: linear-gradient(135deg, 
        rgba(var(--primary-color-rgb), 0.1) 0%, 
        rgba(var(--primary-color-rgb), 0.05) 100%
    );
}

/* 通知系统样式 */
.floating-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background-color: #4CAF50;
    color: white;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    font-family: var(--font-family-base);
}

[lang="zh"] .floating-notification {
    font-family: var(--font-family-chinese);
}

/* 样式选项 */
.style-options {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 20px auto;
    padding: 0 15px;
    justify-content: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.style-options::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.style-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 110px;
    height: 90px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--background-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.style-option:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
    border-color: var(--primary-color);
    background: linear-gradient(135deg, 
        rgba(var(--primary-color-rgb), 0.1) 0%, 
        rgba(var(--primary-color-rgb), 0.05) 100%
    );
}
.style-option.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
.style-option.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.style-icon {
    font-size: 20px;
    line-height: 1;
    margin-bottom: 4px;
}

.style-title {
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1.2;
    margin: 0;
    text-align: center;
    white-space: nowrap;
}

.style-description {
    font-size: 0.65rem;
    line-height: 1.2;
    color: var(--text-secondary);
    text-align: center;
    margin: 0;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 3.6em;
}

.style-option.active .style-description {
    color: rgba(255, 255, 255, 0.9);
}

/* 背景色 */
body {
    background-color: var(--background);
}

/* 文本样式 */
.section-title,
.advantage-card h3,
.benefit-card h3,
.necessity-card h3,
.faq-question {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.section-description,
.advantage-card p,
.benefit-card p,
.necessity-card p,
.faq-answer {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* FAQ 样式 */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.faq-item {
    background: var(--background-card);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.faq-question {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.faq-answer {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 深色模式适配 */
[data-theme="dark"] .faq-item {
    background: var(--background-card-dark);
}

[data-theme="dark"] .faq-question {
    color: var(--text-primary-dark);
}

[data-theme="dark"] .faq-answer {
    color: var(--text-secondary-dark);
}

/* 页脚样式优化 */
.footer {
    background: var(--background-secondary);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 4rem;
}

.footer h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.footer p, .footer a, .footer li {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.footer p {
    margin-bottom: 1rem;
    overflow: hidden;
    display: block;
    text-overflow: ellipsis;
    max-height: 3.6em;
}

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

.footer ul li {
    margin-bottom: 0.75rem;
}

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

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

.footer-bottom {
    max-width: 1200px;
    margin: 3rem auto 0;
    padding: 2rem 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
    opacity: 0.8;
}

.copyright p:last-child {
    margin-top: 0.5rem;
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
}

@media (max-width: 640px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer {
        padding: 3rem 0 1.5rem;
    }

    .social-links {
        gap: 1.5rem;
    }
}

/* 深色模式适配 */
[data-theme="dark"] .footer {
    background: var(--background-secondary-dark);
    border-color: var(--border-color-dark);
}

[data-theme="dark"] .footer-bottom {
    border-color: var(--border-color-dark);
}
