/* ===== CSS 变量（配色方案 - 参考微软云） ===== */
:root {
    --primary: #0078d4;
    --primary-dark: #106ebe;
    --primary-light: #e8f4fd;
    --primary-lighter: #f0f7ff;
    --text-primary: #1a1a1a;
    --text-secondary: #616161;
    --text-muted: #9e9e9e;
    --border: #e0e0e0;
    --border-light: #f0f0f0;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --success: #107c10;
    --danger: #c42b1c;
    --warning: #ff8c00;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    line-height: 1.6;
    background: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== 排版 ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }

/* ===== 容器 ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== 导航栏 ===== */
.navbar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.navbar .logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 28px;
    align-items: center;
    height: 100%;
}

.nav-links a {
    display: flex;
    align-items: center;
    height: 100%;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 2px 2px 0 0;
}

/* 导航栏里的注册按钮：保持正常高度，不被拉伸，文字白色 */
.nav-links a.nav-btn {
    height: auto;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    line-height: 1.5;
    color: #ffffff;
}

.nav-links a.nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.nav-links a.nav-btn::after {
    display: none;
}

/* 注册按钮当前页高亮：白色边框 + 外发光 */
.nav-links a.nav-btn-active {
    border: 2px solid #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    padding: 6px 18px;
}

.nav-links .welcome-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.logout-form {
    display: inline;
    margin: 0;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    padding: 0;
    transition: color 0.2s;
}

.logout-btn:hover {
    color: var(--primary);
}

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
    line-height: 1.5;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--bg-white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: var(--bg-white);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-lighter);
    color: var(--primary-dark);
}

.btn-lg {
    padding: 14px 36px;
    font-size: 1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ===== 卡片 ===== */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 32px;
    transition: all 0.3s;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.card h3 {
    font-size: 1.15rem;
    margin-bottom: 12px;
}

.card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* ===== Hero 区域 ===== */
.hero {
    text-align: center;
    padding: 80px 0 60px;
}

.hero h1 {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 40px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== 区块 ===== */
.section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 48px;
    font-weight: 700;
}

.section-bg {
    background: var(--bg-light);
    margin: 0 -40px;
    padding-left: 40px;
    padding-right: 40px;
}

/* ===== 网格布局 ===== */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ===== 数据统计 ===== */
.stats {
    text-align: center;
}

.stats-number {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.stats-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-primary);
    transition: all 0.2s;
    background: var(--bg-white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-card {
    background: var(--bg-white);
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.form-error {
    background: #fde7e9;
    color: var(--danger);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.875rem;
}

.form-error ul {
    margin-top: 8px;
    padding-left: 20px;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== 认证页面（登录/注册） ===== */
.auth-container {
    max-width: 480px;
    margin: 40px auto;
}

.auth-title {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 32px;
    font-weight: 700;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ===== 联系页 ===== */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.contact-item-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.contact-item h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.contact-item p {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0;
    font-weight: 600;
}

.contact-item .contact-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}

.contact-map-placeholder {
    background: var(--border-light);
    border-radius: var(--radius-md);
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.contact-privacy {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 16px;
    line-height: 1.6;
}

/* ===== 成功页面 ===== */
.success-page {
    text-align: center;
    padding: 80px 0;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #e8f8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 24px;
}

.success-page h1 {
    font-size: 2rem;
    margin-bottom: 16px;
}

.success-page p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 32px;
}

.success-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== 页脚 ===== */
.footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    padding: 32px 40px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 60px;
}

.footer p {
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer a {
    color: var(--text-muted);
}

.footer a:hover {
    color: var(--primary);
}

/* ===== 工具类 ===== */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* ===== 响应式 ===== */
@media (max-width: 968px) {
    .contact-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
        flex-wrap: wrap;
        height: auto;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .nav-links {
        gap: 16px;
        flex-wrap: wrap;
        margin-top: 8px;
        width: 100%;
        justify-content: center;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }

    .section-bg {
        margin: 0 -16px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .card {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .hero-actions .btn {
        width: 100%;
        max-width: 280px;
    }
}
