/* ============================================
   CWP 资讯站样式
   基于 Clash Verge观察站 · 浅色简约
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fb;
    --bg-tertiary: #f1f3f7;
    --bg-card: #ffffff;
    --bg-card-hover: #fafbfc;

    --text-primary: #1a1d23;
    --text-secondary: #5f6571;
    --text-tertiary: #9299a6;
    --text-inverse: #ffffff;

    --accent: #3b82f6;
    --accent-light: #dbeafe;
    --accent-dark: #1d4ed8;
    --accent-subtle: #eff6ff;

    --teal: #0d9488;
    --teal-light: #ccfbf1;
    --teal-dark: #0f766e;

    --amber: #d97706;
    --amber-light: #fef3c7;
    --amber-dark: #b45309;

    --red: #dc2626;
    --red-light: #fee2e2;
    --red-dark: #b91c1c;

    --green: #16a34a;
    --green-light: #dcfce7;
    --green-dark: #15803d;

    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.1);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", "Fira Code", "Cascadia Code", Consolas, monospace;

    --max-width: 1120px;
    --header-height: 64px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-primary);
}
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ---------- Container ---------- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--header-height);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
    transition: box-shadow 0.3s;
}
.header.scrolled { box-shadow: var(--shadow-sm); }
.header-inner {
    max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    height: 100%;
}
.header-brand {
    display: flex; align-items: center; gap: 10px;
    font-size: 18px; font-weight: 700; color: var(--text-primary);
}
.header-brand .brand-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--teal));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 16px;
}
.header-brand .brand-tag {
    font-size: 11px; font-weight: 500; color: var(--teal);
    background: var(--teal-light); padding: 2px 8px; border-radius: 10px;
    margin-left: 4px;
}
.header-nav { display: flex; gap: 4px; align-items: center; }
.header-nav a {
    font-size: 14px; font-weight: 500; color: var(--text-secondary);
    padding: 6px 14px; border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.header-nav a:hover { color: var(--accent); background: var(--accent-subtle); }
.header-nav a.active { color: var(--accent); background: var(--accent-light); }

/* Mobile menu toggle */
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-toggle span { display: block; width: 20px; height: 2px; background: var(--text-primary); margin: 4px 0; border-radius: 2px; transition: 0.3s; }

/* ---------- Hero ---------- */
.hero {
    padding: 140px 0 80px;
    background: linear-gradient(180deg, var(--accent-subtle) 0%, var(--bg-primary) 100%);
    text-align: center;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--bg-card); border: 1px solid var(--border);
    padding: 6px 16px; border-radius: 20px;
    font-size: 13px; color: var(--text-secondary);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}
.hero-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.hero h1 {
    font-size: 48px; font-weight: 800; line-height: 1.2;
    letter-spacing: -0.02em; margin-bottom: 16px;
    color: var(--text-primary);
}
.hero h1 .gradient {
    background: linear-gradient(135deg, var(--accent), var(--teal));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p { font-size: 18px; color: var(--text-secondary); max-width: 600px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px; border-radius: var(--radius-md);
    font-size: 14px; font-weight: 600; border: none; cursor: pointer;
    transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ---------- Section ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-secondary); }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { font-size: 32px; font-weight: 700; margin-bottom: 12px; letter-spacing: -0.01em; }
.section-header p { font-size: 16px; color: var(--text-secondary); max-width: 560px; margin: 0 auto; }

/* ---------- Card ---------- */
.card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 28px;
    transition: all 0.25s;
}
.card:hover { border-color: var(--accent-light); box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* ---------- Stats Row ---------- */
.stats-row {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
    margin: 48px 0;
}
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 24px; text-align: center;
    transition: all 0.25s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-number { font-size: 36px; font-weight: 800; color: var(--accent); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-tertiary); margin-top: 6px; }

/* ---------- Tag ---------- */
.tag {
    display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 10px;
    border-radius: 12px;
}
.tag-blue { background: var(--accent-light); color: var(--accent-dark); }
.tag-teal { background: var(--teal-light); color: var(--teal-dark); }
.tag-amber { background: var(--amber-light); color: var(--amber-dark); }
.tag-green { background: var(--green-light); color: var(--green-dark); }
.tag-red { background: var(--red-light); color: var(--red-dark); }

/* ---------- Info Box ---------- */
.info-box {
    background: var(--accent-subtle); border: 1px solid var(--accent-light);
    border-radius: var(--radius-md); padding: 16px 20px;
    font-size: 14px; color: var(--text-secondary); line-height: 1.6;
}
.info-box.warn { background: var(--amber-light); border-color: #fcd34d; }
.info-box.danger { background: var(--red-light); border-color: #fca5a5; }

/* ---------- Footer ---------- */
.footer {
    background: var(--text-primary); color: var(--text-inverse);
    padding: 60px 0 30px; margin-top: 40px;
}
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px; margin-bottom: 40px;
}
.footer-brand h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.footer-brand p { font-size: 13px; color: #9ca3af; line-height: 1.6; }
.footer-links h4 { font-size: 13px; font-weight: 700; margin-bottom: 12px; color: #d1d5db; }
.footer-links a { display: block; font-size: 13px; color: #9ca3af; padding: 4px 0; transition: color 0.2s; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid #374151; padding-top: 20px;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; color: #6b7280;
}
.footer-disclaimer { font-size: 11px; color: #6b7280; margin-top: 12px; line-height: 1.6; }

/* ============================================
   List Page — 分类页
   ============================================ */

/* 页面横幅 */
.page-banner {
    padding: 120px 0 60px;
    background: linear-gradient(180deg, var(--accent-subtle) 0%, var(--bg-primary) 100%);
    text-align: center;
}
.page-banner h1 {
    font-size: 36px; font-weight: 800; margin-bottom: 12px;
}
.page-banner p {
    font-size: 16px; color: var(--text-secondary); max-width: 520px; margin: 0 auto;
}

/* 分类筛选栏 */
.category-filter {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}
.category-filter a {
    font-size: 13px; font-weight: 600; color: var(--text-secondary);
    padding: 8px 18px; border-radius: 20px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.category-filter a:hover {
    color: var(--accent); border-color: var(--accent-light); background: var(--accent-subtle);
}
.category-filter a.active {
    color: #fff; background: var(--accent); border-color: var(--accent);
}

/* 文章列表网格 */
.article-list {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;
}
.article-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
    transition: all 0.25s; cursor: pointer;
}
.article-card:hover { border-color: var(--accent-light); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.article-card .card-thumb {
    width: 100%; height: 180px; background: var(--bg-tertiary);
    display: flex; align-items: center; justify-content: center;
    font-size: 48px; color: var(--text-tertiary);
    overflow: hidden;
}
.article-card .card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-card .card-body { padding: 20px 24px 24px; }
.article-card .card-meta {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 10px;
}
.article-card .card-meta .meta-cat {
    font-size: 11px; font-weight: 700; color: var(--accent);
    background: var(--accent-subtle); padding: 2px 10px; border-radius: 10px;
}
.article-card .card-meta .meta-date {
    font-size: 12px; color: var(--text-tertiary);
}
.article-card .card-title {
    font-size: 17px; font-weight: 700; line-height: 1.4;
    margin-bottom: 8px; color: var(--text-primary);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-card .card-excerpt {
    font-size: 13px; color: var(--text-secondary); line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 特色文章（大卡片） */
.article-card.featured {
    grid-column: 1 / -1;
    display: grid; grid-template-columns: 1fr 1fr;
}
.article-card.featured .card-thumb { height: 100%; min-height: 260px; }
.article-card.featured .card-body { padding: 28px 32px; display: flex; flex-direction: column; justify-content: center; }
.article-card.featured .card-title { font-size: 22px; -webkit-line-clamp: 3; }
.article-card.featured .card-excerpt { -webkit-line-clamp: 3; }

/* 分页 */
.pagination {
    display: flex; justify-content: center; align-items: center; gap: 8px;
    margin-top: 48px;
}
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 12px;
    border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
    transition: all 0.2s;
}
.pagination a { color: var(--text-secondary); border: 1px solid var(--border); }
.pagination a:hover { color: var(--accent); border-color: var(--accent-light); background: var(--accent-subtle); }
.pagination span.current { color: #fff; background: var(--accent); border: 1px solid var(--accent); }
.pagination span.dots { color: var(--text-tertiary); border: none; }

/* ============================================
   Single Page — 资讯单页
   ============================================ */

/* 文章头部 */
.article-header {
    padding: 120px 0 40px;
    background: linear-gradient(180deg, var(--accent-subtle) 0%, var(--bg-primary) 100%);
    text-align: center;
}
.article-header .article-cat {
    display: inline-block; font-size: 12px; font-weight: 700; color: var(--accent);
    background: var(--accent-subtle); padding: 4px 14px; border-radius: 12px;
    margin-bottom: 16px;
}
.article-header h1 {
    font-size: 36px; font-weight: 800; line-height: 1.3; max-width: 720px;
    margin: 0 auto 16px; letter-spacing: -0.01em;
}
.article-header .article-meta {
    display: flex; align-items: center; justify-content: center; gap: 16px;
    font-size: 13px; color: var(--text-tertiary);
}
.article-header .article-meta .meta-sep { color: var(--border); }

/* 文章正文 */
.article-content {
    max-width: 740px; margin: 0 auto; padding: 40px 24px;
}
.article-content h2 {
    font-size: 24px; font-weight: 700; margin: 40px 0 16px;
    padding-bottom: 10px; border-bottom: 2px solid var(--accent-light);
}
.article-content h3 {
    font-size: 20px; font-weight: 700; margin: 32px 0 12px;
}
.article-content p {
    font-size: 16px; line-height: 1.85; color: var(--text-secondary);
    margin-bottom: 20px;
}
.article-content ul, .article-content ol {
    margin-bottom: 20px; padding-left: 24px;
}
.article-content li {
    font-size: 15px; line-height: 1.8; color: var(--text-secondary);
    margin-bottom: 6px; list-style: disc;
}
.article-content ol li { list-style: decimal; }
.article-content blockquote {
    border-left: 4px solid var(--accent); background: var(--accent-subtle);
    padding: 16px 20px; margin: 24px 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 15px; color: var(--text-secondary); line-height: 1.7;
}
.article-content code {
    font-family: var(--font-mono); font-size: 14px;
    background: var(--bg-tertiary); padding: 2px 8px; border-radius: 4px;
    color: var(--accent-dark);
}
.article-content pre {
    background: var(--text-primary); color: #e5e7eb;
    padding: 20px 24px; border-radius: var(--radius-md);
    overflow-x: auto; margin: 24px 0; font-size: 14px; line-height: 1.6;
}
.article-content pre code {
    background: none; padding: 0; color: inherit; font-size: inherit;
}
.article-content img {
    border-radius: var(--radius-md); margin: 24px 0;
    box-shadow: var(--shadow-md);
}
.article-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* 文章标签 */
.article-tags {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-top: 40px; padding-top: 24px;
    border-top: 1px solid var(--border-light);
}
.article-tags .tag-label {
    font-size: 13px; font-weight: 600; color: var(--text-tertiary);
    margin-right: 4px; line-height: 26px;
}
.article-tags a {
    font-size: 12px; font-weight: 600; color: var(--accent-dark);
    background: var(--accent-subtle); padding: 4px 12px; border-radius: 12px;
    transition: all 0.2s;
}
.article-tags a:hover { background: var(--accent-light); color: var(--accent); }

/* 侧边栏 */
.article-layout {
    display: grid; grid-template-columns: 1fr 320px; gap: 48px;
    max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
}
.sidebar .widget {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px;
    margin-bottom: 24px;
}
.sidebar .widget h4 {
    font-size: 15px; font-weight: 700; margin-bottom: 16px;
    padding-bottom: 12px; border-bottom: 1px solid var(--border-light);
}
.sidebar .widget ul li {
    font-size: 13px; margin-bottom: 8px;
}
.sidebar .widget ul li a {
    color: var(--text-secondary); display: flex; justify-content: space-between; align-items: center;
}
.sidebar .widget ul li a:hover { color: var(--accent); }
.sidebar .widget ul li .post-count {
    font-size: 11px; color: var(--text-tertiary); background: var(--bg-tertiary);
    padding: 2px 8px; border-radius: 10px;
}
.sidebar .related-item {
    display: flex; gap: 12px; margin-bottom: 14px;
}
.sidebar .related-item .related-thumb {
    width: 64px; height: 48px; border-radius: var(--radius-sm);
    background: var(--bg-tertiary); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: var(--text-tertiary);
    overflow: hidden;
}
.sidebar .related-item .related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sidebar .related-item .related-title {
    font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sidebar .related-item .related-date {
    font-size: 11px; color: var(--text-tertiary); margin-top: 4px;
}

/* 作者卡片 */
.author-card {
    display: flex; gap: 16px; align-items: center;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px;
    margin: 40px 0;
}
.author-card .author-avatar {
    width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--teal));
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: #fff; flex-shrink: 0;
}
.author-card .author-info h4 { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.author-card .author-info p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* 前后导航 */
.article-nav {
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
    margin-top: 40px;
}
.article-nav a {
    display: block; padding: 20px 24px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.2s;
}
.article-nav a:hover { border-color: var(--accent-light); box-shadow: var(--shadow-sm); }
.article-nav .nav-label { font-size: 12px; color: var(--text-tertiary); margin-bottom: 6px; }
.article-nav .nav-title { font-size: 14px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.article-nav a:hover .nav-title { color: var(--accent); }
.article-nav .nav-next { text-align: right; }

/* ---------- Index Page Observatory Grid ---------- */
.observatory-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.observatory-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 28px;
    transition: all 0.25s; cursor: pointer;
}
.observatory-card:hover { border-color: var(--accent-light); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.observatory-card .obs-icon { font-size: 28px; margin-bottom: 14px; }
.observatory-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.observatory-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.observatory-card .obs-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--accent); margin-top: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
    .article-layout { grid-template-columns: 1fr; }
    .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
}
@media (max-width: 768px) {
    .header-nav { display: none; }
    .header-nav.open { display: flex; flex-direction: column; position: absolute; top: var(--header-height); left: 0; right: 0; background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 16px; gap: 4px; box-shadow: var(--shadow-md); }
    .menu-toggle { display: block; }
    .hero h1 { font-size: 32px; }
    .hero p { font-size: 16px; }
    .section { padding: 48px 0; }
    .section-header h2 { font-size: 24px; }
    .observatory-grid { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
    /* List page */
    .article-list { grid-template-columns: 1fr; }
    .article-card.featured { grid-template-columns: 1fr; }
    .article-card.featured .card-thumb { height: 200px; }
    .page-banner h1 { font-size: 28px; }
    /* Single page */
    .article-header h1 { font-size: 26px; }
    .article-layout { grid-template-columns: 1fr; padding: 0 16px; }
    .sidebar { grid-template-columns: 1fr; }
    .article-nav { grid-template-columns: 1fr; }
    .author-card { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
    .hero h1 { font-size: 26px; }
    .stats-row { grid-template-columns: 1fr; }
    .hero-actions { flex-direction: column; align-items: center; }
    .btn { width: 100%; justify-content: center; }
    .category-filter { justify-content: center; }
    .pagination { flex-wrap: wrap; }
}

/* ---------- Animations ---------- */
.animate-in {
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.animate-in.visible { opacity: 1; transform: translateY(0); }
