/* -------------------------------------------------------------------------- */
/*  基础全局样式 & CSS 变量                                                  */
/* -------------------------------------------------------------------------- */

/* CSS 变量定义 - 方便主题切换 */
:root {
    /* 默认浅色主题 */
    --color-background: #ffffff;
    --color-text: #333333;
    --color-primary: #007bff; /* 蓝色 */
    --color-secondary: #6c757d; /* 灰色 */
    --color-border: #dee2e6;
    --color-shadow: rgba(0, 0, 0, 0.1);
    --color-icon: #495057;

    /* 高对比度主题 */
    --color-background-high-contrast: #000000;
    --color-text-high-contrast: #ffffff;
    --color-primary-high-contrast: #00ffff; /* 青色 */
    --color-secondary-high-contrast: #cccccc;
    --color-border-high-contrast: #ffffff;
    --color-shadow-high-contrast: rgba(255, 255, 255, 0.2);
    --color-icon-high-contrast: #ffffff;

    /* 黑暗模式 (可以与高对比度合并，或单独定义) */
    --color-background-dark: #1a1a1a;
    --color-text-dark: #e0e0e0;
    --color-primary-dark: #3a86ff; /* 较深的蓝色 */
    --color-secondary-dark: #888888;
    --color-border-dark: #444444;
    --color-shadow-dark: rgba(0, 0, 0, 0.3);
    --color-icon-dark: #cccccc;
}

/* 默认样式 (浅色 + 基础可访问性) */
body {
    margin: 0;
    font-family: 'Noto Sans SC', sans-serif, Arial, Helvetica, sans-serif; /* 确保有备用字体 */
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background);
    scroll-behavior: smooth; /* 平滑滚动 */
    text-rendering: optimizeLegibility; /* 优化文本渲染 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* -------------------------------------------------------------------------- */
/*  可访问性 & 辅助类                                                        */
/* -------------------------------------------------------------------------- */

/* 屏幕阅读器隐藏（仅为屏幕阅读器可见） */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 焦点指示器 */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 3px solid var(--color-primary); /* 默认焦点样式 */
    outline-offset: 3px;
}

/* -------------------------------------------------------------------------- */
/*  头部 - Header                                                            */
/* -------------------------------------------------------------------------- */

.site-header {
    background-color: var(--color-background);
    padding: 15px 0;
    box-shadow: 0 2px 5px var(--color-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-and-title {
    display: flex;
    align-items: center;
}

.site-title {
    margin: 0;
    font-size: 1.8em;
    font-weight: 700;
    color: var(--color-text);
}

.main-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 20px;
}

.main-nav a {
    text-decoration: none;
    color: var(--color-text);
    font-weight: 500;
    transition: color 0.3s ease;
}

.main-nav a:hover,
.main-nav a:focus {
    color: var(--color-primary);
    outline: none; /* 移除默认outline，因为focus样式已经处理 */
}

/* 模式切换按钮 */
#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: color 0.3s ease, background-color 0.3s ease;
}

#theme-toggle:hover,
#theme-toggle:focus {
    background-color: rgba(0, 0, 0, 0.05);
    outline: none;
}

#theme-toggle svg {
    stroke: var(--color-icon);
}

/* -------------------------------------------------------------------------- */
/*  Hero Section                                                             */
/* -------------------------------------------------------------------------- */

.hero-section {
    background-color: var(--color-background);
    color: var(--color-text);
    padding: 80px 0;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.hero-section .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.hero-content {
    max-width: 700px;
}

.hero-title {
    font-size: 3em;
    margin-bottom: 10px;
    font-weight: 700;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.6em;
    margin-bottom: 20px;
    font-weight: 500;
    color: var(--color-secondary);
}

.hero-description {
    font-size: 1.1em;
    margin-bottom: 30px;
}

.hero-cta .btn {
    display: inline-block;
    padding: 15px 30px;
    margin: 0 10px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    cursor: pointer; /* 确保按钮有鼠标样式 */
    border: none; /* 移除默认边框 */
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-background); /* 反色文字 */
    border: 2px solid var(--color-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--color-primary); /* 保持悬停颜色 */
    color: var(--color-background);
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.5); /* 突出阴影 */
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--color-primary);
    color: var(--color-background);
}

.btn-large {
    padding: 18px 35px;
    font-size: 1.2em;
}

.hero-visual {
    margin-top: 20px;
}

.icon-sound-wave {
    color: var(--color-primary); /* 使用主题色 */
    stroke: currentColor; /* 确保icon颜色跟随主题 */
}

/* -------------------------------------------------------------------------- */
/*  核心功能 Section                                                        */
/* -------------------------------------------------------------------------- */

.features-section {
    padding: 80px 0;
    background-color: var(--color-background); /* 保持与Hero一致，或使用稍有不同的背景 */
    transition: background-color 0.3s ease, color 0.3s ease;
}

.section-title {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 50px;
    font-weight: 700;
    color: var(--color-text);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    text-align: center;
}

.feature-item {
    background-color: var(--color-background); /* 保持一致 */
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--color-shadow); /* 柔和阴影 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--color-shadow);
}

.feature-icon {
    margin-bottom: 20px;
    color: var(--color-primary); /* 图标颜色 */
}

.feature-icon svg {
    stroke: currentColor;
}

.feature-title {
    font-size: 1.5em;
    margin-bottom: 15px;
    font-weight: 700;
    color: var(--color-text);
}

.feature-item p {
    font-size: 1em;
    color: var(--color-text);
    opacity: 0.9;
}

/* -------------------------------------------------------------------------- */
/*  如何使用 Section                                                         */
/* -------------------------------------------------------------------------- */

.how-to-section {
    padding: 80px 0;
    background-color: var(--color-background); /* 可以考虑使用稍暗的背景区分 */
    transition: background-color 0.3s ease, color 0.3s ease;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    text-align: center;
}

.step-item {
    position: relative;
    padding-top: 40px; /* 为数字留空间 */
}

.step-number {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background-color: var(--color-primary);
    color: var(--color-background);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8em;
    font-weight: 700;
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.5);
    z-index: 1;
}

.step-title {
    font-size: 1.4em;
    margin-bottom: 15px;
    font-weight: 700;
    color: var(--color-text);
}

.step-item p {
    font-size: 1em;
    color: var(--color-text);
    opacity: 0.9;
}

/* -------------------------------------------------------------------------- */
/*  用户证言 Section                                                         */
/* -------------------------------------------------------------------------- */

.testimonials-section {
    padding: 80px 0;
    background-color: var(--color-background); /* 再次使用浅色，或稍有区别 */
    transition: background-color 0.3s ease, color 0.3s ease;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.testimonial-item {
    background-color: var(--color-background);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--color-shadow);
    font-style: italic;
    margin: 0; /* 移除默认blockquote边距 */
}

.testimonial-text {
    font-size: 1.1em;
    margin-bottom: 20px;
    color: var(--color-text);
    opacity: 0.95;
}

.testimonial-author {
    font-weight: 500;
    color: var(--color-text);
    font-style: normal; /* 作者名字不倾斜 */
}

/* -------------------------------------------------------------------------- */
/*  关于我们 Section                                                         */
/* -------------------------------------------------------------------------- */

.about-section {
    padding: 80px 0;
    background-color: var(--color-background); /* 保持一致 */
    transition: background-color 0.3s ease, color 0.3s ease;
}

.about-content {
    max-width: 800px;
    margin: 30px auto 0 auto;
    font-size: 1.1em;
    color: var(--color-text);
    opacity: 0.9;
    text-align: center;
}

/* -------------------------------------------------------------------------- */
/*  下载 Section                                                             */
/* -------------------------------------------------------------------------- */

.download-section {
    padding: 80px 0;
    background-color: var(--color-background); /* 强调下载 */
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.download-cta {
    margin-top: 40px;
}

.download-cta .btn-large {
    margin-bottom: 15px;
}

.download-note {
    font-size: 0.9em;
    color: var(--color-secondary);
}

/* -------------------------------------------------------------------------- */
/*  页脚 - Footer                                                            */
/* -------------------------------------------------------------------------- */

.site-footer {
    background-color: var(--color-background); /* 保持一致 */
    color: var(--color-text);
    padding: 50px 0 20px 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.site-footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.footer-contact h3 {
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 20px;
    font-weight: 700;
    color: var(--color-text);
}

.footer-contact {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 30px;
    width: 100%;
}

.contact-item {
    text-align: center;
}

.qr-code img {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    box-shadow: 0 4px 10px var(--color-shadow);
    margin-bottom: 10px;
}

.qr-code p {
    font-size: 0.9em;
    color: var(--color-secondary);
}

.contact-item p {
    margin: 5px 0;
    font-size: 1.05em;
}

.contact-value {
    font-weight: 500;
    color: var(--color-text);
}

.contact-item a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-item a:hover,
.contact-item a:focus {
    color: var(--color-primary); /* 保持一致 */
    text-decoration: underline;
}

.footer-legal {
    text-align: center;
    margin-top: 30px;
    font-size: 0.9em;
    color: var(--color-secondary);
    width: 100%;
}

.footer-legal a {
    color: var(--color-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-legal a:hover,
.footer-legal a:focus {
    color: var(--color-primary);
    text-decoration: underline;
}


/* -------------------------------------------------------------------------- */
/*  响应式设计 & 模式切换                                                   */
/* -------------------------------------------------------------------------- */

/* 媒体查询：当屏幕宽度小于 768px 时 */
@media (min-width: 768px) {
    .hero-section .container {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    .hero-content {
        flex: 1;
        padding-right: 30px; /* 给视觉元素留出空间 */
    }
    .hero-visual {
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .hero-title {
        font-size: 3.5em;
    }
    .hero-subtitle {
        font-size: 1.8em;
    }
    .hero-cta {
        text-align: left; /* 按钮居左 */
    }

    .site-footer .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start; /* 顶部对齐 */
    }
    .footer-contact {
        flex-direction: column; /* 联系方式堆叠 */
        align-items: flex-start;
        width: auto; /* 宽度自适应 */
    }
    .footer-legal {
        text-align: right; /* 版权信息右对齐 */
    }
}

/* 媒体查询：当屏幕宽度小于 992px 时 */
@media (max-width: 991px) {
    .hero-title {
        font-size: 2.8em;
    }
    .hero-subtitle {
        font-size: 1.5em;
    }
    .section-title {
        font-size: 2.2em;
    }
}

/* 媒体查询：当屏幕宽度小于 768px 时 */
@media (max-width: 767px) {
    .site-header .container {
        flex-direction: column;
        gap: 15px;
    }
    .main-nav ul {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    #theme-toggle {
        position: absolute;
        right: 20px;
        top: 15px;
    }
    .hero-title {
        font-size: 2.5em;
    }
    .hero-subtitle {
        font-size: 1.4em;
    }
    .hero-cta .btn {
        display: block;
        width: 100%;
        margin: 10px 0;
        box-sizing: border-box; /* 确保padding和border包含在width内 */
    }
    .hero-visual {
        display: none; /* 在小屏幕上隐藏视觉元素 */
    }
    .hero-section .container {
        flex-direction: column;
        text-align: center;
    }
    .features-grid, .steps-container, .testimonial-grid {
        grid-template-columns: 1fr; /* 小屏幕时单列 */
    }
    .footer-contact {
        flex-direction: column;
        align-items: center;
    }
    .footer-legal {
        text-align: center;
    }
}

/* -------------------------------------------------------------------------- */
/*  模式切换 - Dark Mode & High Contrast                                     */
/* -------------------------------------------------------------------------- */

/* Dark Mode */
body.dark-mode {
    --color-background: var(--color-background-dark);
    --color-text: var(--color-text-dark);
    --color-primary: var(--color-primary-dark);
    --color-secondary: var(--color-secondary-dark);
    --color-border: var(--color-border-dark);
    --color-shadow: var(--color-shadow-dark);
    --color-icon: var(--color-icon-dark);
}

/* High Contrast Mode */
body.high-contrast-mode {
    --color-background: var(--color-background-high-contrast);
    --color-text: var(--color-text-high-contrast);
    --color-primary: var(--color-primary-high-contrast);
    --color-secondary: var(--color-secondary-high-contrast);
    --color-border: var(--color-border-high-contrast);
    --color-shadow: var(--color-shadow-high-contrast);
    --color-icon: var(--color-icon-high-contrast);
}

/* 针对特定元素的模式覆盖 */
.dark-mode .btn-primary {
    color: var(--color-background-dark); /* 深色模式下，主要按钮文字使用背景色 */
}
.dark-mode .btn-secondary {
    color: var(--color-primary-dark); /* 深色模式下，次要按钮文字使用主色 */
    border-color: var(--color-primary-dark);
}
.dark-mode .site-header {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); /* 深色模式阴影 */
}
.dark-mode .hero-visual .icon-sound-wave {
    color: var(--color-primary-dark); /* 深色模式下，主色调 */
}

/* 高对比度下，按钮阴影效果可能不需要或需要更强的 */
.high-contrast-mode .btn-primary {
    box-shadow: 0 0 15px var(--color-primary-high-contrast); /* 更明显的阴影 */
}
.high-contrast-mode .feature-item,
.high-contrast-mode .testimonial-item,
.high-contrast-mode .step-item {
    box-shadow: 0 0 10px var(--color-shadow-high-contrast); /* 高对比度下，阴影可能更明显 */
}

/* -------------------------------------------------------------------------- */
/*  Feather Icons 样式 (如果直接内联SVG)                                     */
/* -------------------------------------------------------------------------- */
/* 确保SVG图标能正确响应颜色变量 */
.feature-icon svg,
.hero-visual svg {
    stroke: currentColor;
    fill: none; /* 确保只有描边 */
}
