:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #f1f5f9;
    --secondary-dark: #161c26;
    --text: #1e293b;
    --text-light: #f1f5f9;
    --card-bg: #fff;
    --card-bg-dark: #1a1f2c;
    --border: #e5e7eb;
    --border-dark: #2d3340;
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --radius: 12px;
    --shadow: 0 4px 12px rgba(30, 41, 59, 0.08);
    --shadow-hover: 0 8px 20px rgba(37, 99, 235, 0.15);
    --transition: 0.25s cubic-bezier(.4, 0, .2, 1);
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

@media (prefers-color-scheme: dark) {
    :root {
        --secondary: var(--secondary-dark);
        --card-bg: var(--card-bg-dark);
        --text: var(--text-light);
        --border: var(--border-dark);
    }

    body {
        background: var(--secondary-dark);
    }
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans', 'Arial', sans-serif;
    background: #f5f5f7;
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

header {
    background: #ffffff;
    color: #333;
    padding: 24px 0 16px 0;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    color: #333;
}

header p {
    margin: 14px auto 0 auto;
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 400;
    max-width: 800px;
    position: relative;
    z-index: 1;
    color: #666;
}

.lang-switcher {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
}

.lang-select {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 6px 28px 6px 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: auto;
    min-width: 100px;
}

/* 自定义下拉箭头 */
.lang-select {
    background-image: linear-gradient(45deg, transparent 50%, rgba(0, 0, 0, 0.4) 50%),
    linear-gradient(135deg, rgba(0, 0, 0, 0.4) 50%, transparent 50%);
    background-position:
            calc(100% - 15px) calc(50% - 2px),
            calc(100% - 10px) calc(50% - 2px);
    background-size:
            5px 5px,
            5px 5px;
    background-repeat: no-repeat;
}

.lang-select:hover {
    background-color: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.2);
}

.lang-select:focus {
    outline: none;
    background-color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* 下拉选项样式 */
.lang-select option {
    background-color: var(--card-bg);
    color: var(--text);
    padding: 8px;
}

/* 导航条样式 - 更新为App风格 */
nav {
    background: var(--card-bg);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    max-width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    justify-content: flex-start;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
    position: relative;
    z-index: 2;
}

nav::-webkit-scrollbar {
    display: none;
}

nav a {
    color: #666;
    text-decoration: none;
    font-weight: 500;
    padding: 12px 18px;
    margin: 0;
    font-size: 0.95rem;
    position: relative;
    transition: color var(--transition);
    white-space: nowrap;
    outline: none;
    border: none;
    background: none;
    cursor: pointer;
}

nav a:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 16px;
    background: var(--border);
    opacity: 0.7;
}

nav a.active {
    color: var(--primary);
    font-weight: 600;
    position: relative;
}

nav a.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--primary);
    opacity: 1;
}

nav a:hover, nav a:focus {
    color: var(--primary);
}

main {
    max-width: 950px;
    margin: 15px auto 25px auto;
    padding: 0 15px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    transition: box-shadow var(--transition), transform var(--transition), border var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    opacity: 0;
    transition: opacity var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card:hover::before {
    opacity: 1;
}

.card h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    position: relative;
}

ul, ol {
    margin: 18px 0;
    padding-left: 18px;
    line-height: 1.7;
}

ul li, ol li {
    margin-bottom: 10px;
}

strong {
    color: #333;
    font-weight: 600;
}

/* FAQ样式 */
.faq {
    margin-top: 20px;
}

.faq-item {
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

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

.faq-question {
    padding: 14px 40px 14px 5px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    color: #333;
    font-size: 1rem;
}

.faq-question::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    transition: transform var(--transition);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition);
    opacity: 0;
    padding: 0 5px;
}

.faq-answer div {
    padding-bottom: 15px;
    color: #666;
    font-size: 0.95rem;
}

.faq-item.open .faq-answer {
    max-height: 1000px;
    opacity: 1;
}

.faq-item.open .faq-answer div {
    padding-top: 5px;
}

.faq-item.open .faq-question {
    color: var(--primary);
}

.faq-item.open .faq-question::after {
    transform: translateY(-50%) rotate(180deg);
}

/* 视频列表样式 */
.video-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 24px;
}

.video-item {
    flex: 1;
    min-width: 280px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.02);
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
}

.video-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.video-item iframe, .video-item video {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    display: block;
    background: #000;
}

.video-item:hover iframe, .video-item:hover video {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.video-title {
    padding: 14px 16px;
    font-weight: 500;
    text-align: center;
    color: #333;
    font-size: 1rem;
}

.video-list + p {
    margin-top: 20px;
    text-align: center;
    font-size: 0.95rem;
    color: #666;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:focus {
    outline: none;
}

.link-button {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background var(--transition), transform var(--transition);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
    margin-top: 16px;
}

.link-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* 反馈表单样式 */
.feedback-form {
    margin-top: 24px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text);
    font-family: inherit;
    background: #fff;
    transition: border var(--transition), box-shadow var(--transition);
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-control::placeholder {
    color: #aaa;
}

.btn {
    display: inline-block;
    background: var(--primary);
    color: white;
    font-weight: 500;
    text-align: center;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

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

.btn-block {
    display: block;
    width: 100%;
}

.feedback-types {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 5px;
}

.feedback-type-btn {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
}

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

.form-footer {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.chars-counter {
    position: absolute;
    right: 5px;
    bottom: 5px;
    font-size: 0.8rem;
    color: #999;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 8px;
    border-radius: 4px;
}

.form-message {
    margin: 15px 0;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
    animation: fadeIn 0.3s forwards;
}

.form-message.success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.form-message.error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.form-message.active {
    display: block;
}

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

.rating-container {
    display: flex;
    align-items: center;
    margin: 5px 0;
}

.rating-stars {
    display: flex;
    gap: 10px;
}

.star {
    font-size: 1.8rem;
    cursor: pointer;
    color: #e2e8f0;
    transition: color var(--transition);
}

.star:hover, .star.active {
    color: #f59e0b;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background-color: #fff;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 99;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* 客服聊天窗口样式 */
.chat-container {
    width: 100%;
    max-width: 380px;
    height: 550px;
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: var(--transition);
}

.chat-container.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.3);
    font-size: 20px;
    cursor: pointer;
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.chat-toggle:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.4);
}

/* 移动端适配 */
@media (max-width: 768px) {
    header {
        padding: 18px 0 12px 0;
    }

    header h1 {
        font-size: 1.6rem;
    }

    header p {
        font-size: 0.9rem;
        padding: 0 15px;
    }

    .lang-switcher {
        top: 10px;
        right: 10px;
    }

    nav {
        padding: 0 5px;
    }

    nav a {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    main {
        padding: 0 12px;
        margin-top: 12px;
    }

    .card {
        padding: 16px 15px;
        margin-bottom: 15px;
    }

    .card h2 {
        font-size: 1.25rem;
        margin-bottom: 15px;
    }

    .card::before {
        width: 3px;
    }

    ul, ol {
        margin: 12px 0;
        padding-left: 18px;
    }

    .video-list {
        gap: 15px;
        margin-top: 15px;
    }

    .video-item {
        min-width: 100%;
        margin-bottom: 10px;
    }

    .video-title {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .faq-question {
        padding: 12px 40px 12px 5px;
        font-size: 0.9rem;
    }

    .faq-answer {
        padding: 0 5px;
    }

    .feedback-form {
        padding: 15px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-footer {
        margin-top: 20px;
    }

    .btn-block {
        padding: 10px;
    }

    .form-message {
        margin: 12px 0;
        font-size: 0.85rem;
    }
    
    .chat-container {
        width: 100%;
        height: 100vh;
        max-width: none;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .chat-toggle {
        bottom: 15px;
        right: 15px;
        width: 44px;
        height: 44px;
    }
    
    .back-to-top {
        bottom: 70px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 400px) {
    header h1 {
        font-size: 1.4rem;
    }

    .card {
        padding: 15px 12px;
    }

    .card h2 {
        font-size: 1.2rem;
    }

    .faq-question {
        font-size: 0.9rem;
    }

    nav a {
        padding: 10px 8px;
        font-size: 0.8rem;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: #121212;
    }

    header {
        background: #1e1e1e;
        color: #eee;
    }

    header h1 {
        color: #fff;
    }

    header p {
        color: #ccc;
    }

    nav {
        background: #1e1e1e;
        border-bottom: 1px solid #333;
    }

    nav a {
        color: #bbb;
    }

    nav a:not(:last-child)::after {
        background: #444;
    }

    .card {
        background: #1e1e1e;
        border: 1px solid #333;
    }

    .card h2 {
        color: #eee;
    }

    strong {
        color: #eee;
    }

    .faq-item {
        border-bottom: 1px solid #333;
    }

    .faq-question {
        color: #ddd;
    }

    .faq-answer div {
        color: #aaa;
    }

    .video-title {
        color: #ddd;
    }

    .form-label {
        color: #ddd;
    }

    .form-control {
        background: #2a2a2a;
        border-color: #444;
        color: #eee;
    }

    .form-control:focus {
        border-color: var(--primary);
    }

    .form-control::placeholder {
        color: #777;
    }

    .feedback-type-btn {
        background: #2a2a2a;
        border-color: #444;
        color: #ddd;
    }

    .back-to-top {
        background-color: rgba(40, 40, 40, 0.9);
        color: var(--primary-light);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .feedback-form {
        background: rgba(30, 30, 30, 0.7);
    }
    
    .lang-select {
        background-color: #2a2a2a;
        color: #ddd;
        border-color: #444;
    }
    
    .lang-select option {
        background-color: #2a2a2a;
        color: #ddd;
    }
}
