/* ========== 基础重置 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #06b6d4;
    --dark: #0f172a;
    --dark-2: #1e293b;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --bg: #f8fafc;
    --white: #fff;
    --border: #e2e8f0;
    --gradient: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px -5px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 50px -10px rgba(99,102,241,0.25);
    --radius: 12px;
    --max-width: 1200px;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--dark);
    background: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }

/* ========== 导航栏 ========== */
.navbar {
    position: fixed; top: 0; width: 100%; height: 64px;
    background: rgba(255,255,255,0.85); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border); z-index: 1000;
    transition: all 0.3s;
}

.navbar.scrolled { height: 56px; box-shadow: var(--shadow); }

.nav-container {
    max-width: var(--max-width); margin: 0 auto; height: 100%;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
}

.nav-logo {
    display: flex; align-items: center; gap: 8px;
    font-size: 1.2rem; font-weight: 700; color: var(--dark);
}

.nav-links { display: flex; gap: 1.5rem; align-items: center; }

.nav-link {
    font-size: 0.95rem; font-weight: 500; color: var(--gray);
    transition: color 0.2s; position: relative;
}
.nav-link:hover, .nav-link.active { color: var(--primary); }
.nav-link.active::after {
    content: ''; position: absolute; bottom: -22px; left: 0;
    width: 100%; height: 2px; background: var(--primary);
}

.nav-user { position: relative; cursor: pointer; }
.nav-username { font-weight: 500; color: var(--dark); }
.nav-dropdown {
    display: none; position: absolute; top: 100%; right: 0;
    background: white; border: 1px solid var(--border); border-radius: 8px;
    box-shadow: var(--shadow-lg); min-width: 140px; overflow: hidden;
}
.nav-user:hover .nav-dropdown { display: block; }
.nav-dropdown a {
    display: block; padding: 10px 16px; font-size: 0.9rem; color: var(--gray);
    border-bottom: 1px solid var(--border);
}
.nav-dropdown a:last-child { border-bottom: none; }
.nav-dropdown a:hover { background: var(--bg); color: var(--primary); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; }
.nav-toggle span { width: 24px; height: 2px; background: var(--dark); border-radius: 2px; }

#userArea { display: flex; gap: 8px; align-items: center; }

/* ========== 按钮 ========== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 28px; font-size: 0.95rem; font-weight: 600;
    border-radius: 8px; cursor: pointer; transition: all 0.25s;
    border: none; font-family: inherit;
}
.btn-sm { padding: 6px 16px; font-size: 0.85rem; }
.btn-primary { background: var(--gradient); color: white; box-shadow: var(--shadow-xl); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: rgba(99,102,241,0.05); }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ========== Section 通用 ========== */
section { scroll-margin-top: 64px; }
.section-header { text-align: center; margin-bottom: 3rem; padding: 0 24px; }
.section-tag {
    display: inline-block; font-size: 0.8rem; font-weight: 700;
    color: var(--primary); letter-spacing: 2px; margin-bottom: 0.5rem;
}
.section-title { font-size: 2.2rem; font-weight: 800; color: var(--dark); margin-bottom: 0.5rem; }
.section-subtitle { font-size: 1.05rem; color: var(--gray); }

/* ========== Hero ========== */
.hero {
    min-height: 90vh; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; background: var(--dark);
}
.hero-bg { position: absolute; inset: 0; }
.hero-bg::before {
    content: ''; position: absolute; inset: 0;
    background-image: linear-gradient(rgba(99,102,241,0.06) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(99,102,241,0.06) 1px, transparent 1px);
    background-size: 50px 50px;
}
.hero-bg::after {
    content: ''; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%,-50%); width: 700px; height: 700px;
    background: radial-gradient(circle, rgba(99,102,241,0.25) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-content { position: relative; z-index: 2; text-align: center; max-width: 800px; padding: 0 24px; }
.hero-badge {
    display: inline-block; padding: 6px 16px;
    background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.3);
    border-radius: 100px; color: var(--primary-light); font-size: 0.85rem; margin-bottom: 1.5rem;
}
.hero-title { font-size: 3.5rem; font-weight: 900; color: white; line-height: 1.2; margin-bottom: 1rem; }
.gradient-text {
    background: var(--gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-desc { font-size: 1.1rem; color: var(--gray-light); line-height: 1.8; margin-bottom: 2rem; max-width: 600px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; margin-bottom: 3rem; }
.hero-stats { display: flex; align-items: center; justify-content: center; gap: 2rem; }
.stat-item { text-align: center; }
.stat-num { font-size: 1.8rem; font-weight: 700; color: white; }
.stat-label { font-size: 0.85rem; color: var(--gray-light); }
.stat-divider { width: 1px; height: 36px; background: rgba(255,255,255,0.15); }

/* ========== Agent 卡片 ========== */
.agent-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem; max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
}
.agent-card {
    background: white; border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; transition: all 0.3s; cursor: pointer;
}
.agent-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.agent-cover {
    height: 140px; background: var(--gradient);
    display: flex; align-items: center; justify-content: center; font-size: 2.5rem;
}
.agent-card-body { padding: 1.2rem; }
.agent-card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.agent-card-desc { font-size: 0.88rem; color: var(--gray); line-height: 1.5; margin-bottom: 10px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.agent-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--gray-light); }
.agent-tag { padding: 2px 8px; background: rgba(99,102,241,0.1); color: var(--primary); border-radius: 4px; }

/* ========== 新闻区域 ========== */
.news-section { padding: 80px 24px; background: var(--bg); }
.news-headline-card {
    max-width: 800px; margin: 0 auto 2rem; background: var(--gradient);
    border-radius: var(--radius); padding: 28px; color: white; text-align: center;
}
.news-headline-badge {
    display: inline-block; padding: 4px 12px; background: rgba(255,255,255,0.2);
    border-radius: 100px; font-size: 0.8rem; margin-bottom: 12px;
}
.news-headline-card h3 { font-size: 1.4rem; margin-bottom: 10px; }
.news-headline-card p { opacity: 0.9; line-height: 1.6; }
.news-list { max-width: 800px; margin: 0 auto; }
.news-item {
    display: flex; gap: 14px; padding: 14px 18px; background: white;
    border-radius: 10px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
    transition: all 0.3s; cursor: pointer;
}
.news-item:hover { box-shadow: var(--shadow-lg); transform: translateX(4px); }
.news-source {
    width: 44px; height: 44px; border-radius: 8px; background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700; color: var(--primary); flex-shrink: 0;
}
.news-info { flex: 1; }
.news-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; }
.news-summary { font-size: 0.85rem; color: var(--gray); line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-meta { display: flex; gap: 10px; margin-top: 4px; font-size: 0.78rem; color: var(--gray-light); }
.news-tag { padding: 1px 6px; background: rgba(99,102,241,0.1); color: var(--primary); border-radius: 4px; }

/* ========== 表单 ========== */
.form-card {
    max-width: 440px; margin: 80px auto; padding: 2.5rem;
    background: white; border-radius: 16px; box-shadow: var(--shadow-lg);
}
.form-card h1 { font-size: 1.6rem; margin-bottom: 0.5rem; text-align: center; }
.form-card .form-subtitle { text-align: center; color: var(--gray); margin-bottom: 2rem; font-size: 0.95rem; }
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 500; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 8px;
    font-size: 0.95rem; font-family: inherit; background: white; transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.form-hint { font-size: 0.8rem; color: var(--gray-light); margin-top: 4px; }
.form-error { color: #ef4444; font-size: 0.85rem; margin-top: 6px; display: none; }
.form-error.show { display: block; }
.form-divider { text-align: center; margin: 1.5rem 0; color: var(--gray-light); font-size: 0.85rem; position: relative; }
.form-divider::before, .form-divider::after { content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--border); }
.form-divider::before { left: 0; } .form-divider::after { right: 0; }

/* ========== Agent 详情页 ========== */
.agent-detail { max-width: 800px; margin: 80px auto 40px; padding: 0 24px; }
.agent-detail-header { text-align: center; margin-bottom: 2rem; }
.agent-detail-header h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.agent-detail-header p { color: var(--gray); }
.agent-detail-cover { height: 200px; border-radius: var(--radius); margin-bottom: 1.5rem; }

.pan-link-card {
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(6,182,212,0.08));
    border: 1px solid rgba(99,102,241,0.2); border-radius: 16px; padding: 24px; margin: 20px 0;
}
.pan-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pan-label { font-size: 0.85rem; color: var(--gray); min-width: 70px; flex-shrink: 0; }
.pan-value { flex: 1; font-size: 0.9rem; font-weight: 500; word-break: break-all; padding: 8px 12px; background: white; border-radius: 8px; border: 1px solid var(--border); }
.pan-row button { padding: 6px 14px; background: var(--primary); color: white; border: none; border-radius: 8px; cursor: pointer; font-size: 0.82rem; white-space: nowrap; }
.pan-row button:hover { background: var(--primary-dark); }
.login-prompt { text-align: center; padding: 2rem; }
.login-prompt p { font-size: 1rem; color: var(--gray); margin-bottom: 1rem; }

.tutorial-section { margin-top: 2rem; padding: 1.5rem; background: var(--bg); border-radius: var(--radius); }
.tutorial-section h2 { font-size: 1.3rem; margin-bottom: 1rem; }
.tutorial-content { line-height: 1.8; color: var(--dark-2); }
.tutorial-content h1, .tutorial-content h2, .tutorial-content h3 { margin: 1rem 0 0.5rem; }
.tutorial-content ul { margin-left: 1.5rem; margin-bottom: 1rem; }
.tutorial-content li { margin-bottom: 0.3rem; }

/* ========== 发布表单 ========== */
.upload-page { max-width: 680px; margin: 80px auto 40px; padding: 0 24px; }
.upload-form { background: white; border-radius: 16px; padding: 2.5rem; box-shadow: var(--shadow); }
.upload-form h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }

/* ========== Toast ========== */
.toast {
    position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
    background: var(--dark); color: white; padding: 10px 24px; border-radius: 8px;
    font-size: 0.9rem; opacity: 0; visibility: hidden; transition: all 0.3s; z-index: 9999;
}
.toast.show { opacity: 1; visibility: visible; }

/* ========== 回到顶部 ========== */
.back-to-top {
    position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px;
    background: var(--primary); color: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
    cursor: pointer; box-shadow: var(--shadow-xl); opacity: 0; visibility: hidden;
    transition: all 0.3s; z-index: 999; border: none;
}
.back-to-top.show { opacity: 1; visibility: visible; }

/* ========== 页脚 ========== */
.footer { background: var(--dark); color: var(--gray-light); padding: 50px 24px 0; }
.footer-container { max-width: var(--max-width); margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; padding-bottom: 30px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-logo { font-size: 1.2rem; font-weight: 700; color: white; margin-bottom: 0.5rem; }
.footer-desc { font-size: 0.88rem; line-height: 1.6; }
.footer-col h4 { color: white; font-size: 0.95rem; margin-bottom: 0.8rem; }
.footer-col a { display: block; font-size: 0.88rem; color: var(--gray-light); margin-bottom: 0.5rem; }
.footer-col a:hover { color: var(--primary-light); }
.footer-bottom { text-align: center; padding: 16px 0; font-size: 0.82rem; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .nav-links { display: none; position: absolute; top: 64px; left: 0; width: 100%; background: white; flex-direction: column; padding: 16px; gap: 0.8rem; box-shadow: var(--shadow); }
    .nav-links.active { display: flex; }
    .nav-toggle { display: flex; }
    .hero-title { font-size: 2.2rem; }
    .section-title { font-size: 1.6rem; }
    .hero-stats { gap: 1rem; }
    .footer-container { grid-template-columns: 1fr 1fr; }
    .agent-grid { grid-template-columns: 1fr; }
}
