/* 华讯新闻网 - 样式表 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #c41e3a;
    --primary-dark: #9a1830;
    --text: #222;
    --text-light: #666;
    --text-muted: #999;
    --bg: #f5f5f5;
    --white: #fff;
    --border: #e8e8e8;
    --shadow: 0 2px 8px rgba(0,0,0,.08);
    --radius: 4px;
    --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; font-size: 15px; }
a { color: inherit; text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* Top Bar */
.top-bar { background: #1a1a2e; color: #ccc; font-size: 13px; padding: 6px 0; }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; }
.top-links a { color: #ccc; margin-left: 16px; }
.top-links a:hover { color: var(--white); }

/* Header */
.site-header { background: var(--white); padding: 16px 0; border-bottom: 3px solid var(--primary); box-shadow: var(--shadow); }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { width: 48px; height: 48px; background: var(--primary); color: var(--white); font-size: 24px; font-weight: bold; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); }
.logo-text strong { display: block; font-size: 26px; color: var(--primary); letter-spacing: 2px; }
.logo-text small { font-size: 12px; color: var(--text-muted); }
.search-form { display: flex; }
.search-form input { border: 1px solid var(--border); padding: 8px 14px; width: 260px; border-radius: var(--radius) 0 0 var(--radius); font-size: 14px; outline: none; }
.search-form input:focus { border-color: var(--primary); }
.search-form button { background: var(--primary); color: var(--white); border: none; padding: 8px 20px; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; font-size: 14px; }
.search-form button:hover { background: var(--primary-dark); }

/* Navigation */
.main-nav { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.main-nav ul { display: flex; list-style: none; overflow-x: auto; }
.main-nav a { display: block; padding: 14px 22px; font-size: 15px; font-weight: 500; white-space: nowrap; border-bottom: 3px solid transparent; }
.main-nav a:hover, .main-nav a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Main Content */
.main-content { padding: 24px 0 40px; min-height: 60vh; }

/* Hero Section */
.hero-section { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 32px; }
.hero-main { position: relative; border-radius: var(--radius); overflow: hidden; display: block; height: 400px; }
.hero-main img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.hero-main:hover img { transform: scale(1.03); }
.hero-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 24px; background: linear-gradient(transparent, rgba(0,0,0,.85)); color: var(--white); }
.hero-overlay h2 { font-size: 24px; margin: 8px 0; line-height: 1.4; }
.hero-overlay p { font-size: 14px; opacity: .9; margin-bottom: 8px; }
.hero-overlay time { font-size: 13px; opacity: .7; }
.hero-side { display: flex; flex-direction: column; gap: 16px; }
.hero-side-item { display: flex; gap: 12px; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); flex: 1; }
.hero-side-item img { width: 140px; height: 100%; object-fit: cover; flex-shrink: 0; }
.hero-side-item div { padding: 12px; display: flex; flex-direction: column; justify-content: center; }
.hero-side-item h3 { font-size: 15px; line-height: 1.4; }

/* Tags */
.tag { display: inline-block; background: var(--primary); color: var(--white); font-size: 12px; padding: 2px 8px; border-radius: 2px; }
.tag.small { font-size: 11px; padding: 1px 6px; }

/* Content Layout */
.content-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }

/* Section Header */
.section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.section-header h2 { font-size: 20px; color: var(--primary); white-space: nowrap; }
.section-line { flex: 1; height: 2px; background: linear-gradient(to right, var(--primary), transparent); }

/* News Cards */
.news-list { display: flex; flex-direction: column; gap: 16px; }
.news-card { display: flex; gap: 16px; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: box-shadow .2s; }
.news-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.news-card-image { width: 220px; flex-shrink: 0; overflow: hidden; }
.news-card-image img { width: 100%; height: 150px; object-fit: cover; transition: transform .3s; }
.news-card:hover .news-card-image img { transform: scale(1.05); }
.news-card-body { padding: 16px 16px 16px 0; flex: 1; }
.news-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.news-card-body h3 { font-size: 18px; margin-bottom: 8px; line-height: 1.4; }
.news-card-body p { font-size: 14px; color: var(--text-light); line-height: 1.6; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.widget { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.widget h3 { font-size: 16px; color: var(--primary); margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--primary); }
.hot-list { list-style: none; counter-reset: hot; }
.hot-list li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.hot-list li:last-child { border-bottom: none; }
.hot-list .rank { width: 22px; height: 22px; background: #eee; color: var(--text-muted); font-size: 12px; font-weight: bold; display: flex; align-items: center; justify-content: center; border-radius: 2px; flex-shrink: 0; }
.hot-list li:nth-child(-n+3) .rank { background: var(--primary); color: var(--white); }
.hot-list a { font-size: 14px; line-height: 1.4; }
.category-list { list-style: none; }
.category-list li { border-bottom: 1px dashed var(--border); }
.category-list a { display: block; padding: 10px 0; font-size: 14px; }
.category-list a.active { color: var(--primary); font-weight: bold; }

/* Article Page */
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.breadcrumb a:hover { color: var(--primary); }
.article-page { background: var(--white); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.article-header h1 { font-size: 28px; line-height: 1.4; margin-bottom: 16px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; color: var(--text-muted); padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.article-image { margin: 24px 0; border-radius: var(--radius); overflow: hidden; }
.article-image img { width: 100%; max-height: 450px; object-fit: cover; }
.article-summary { background: #f9f9f9; border-left: 4px solid var(--primary); padding: 16px 20px; margin: 20px 0; font-size: 16px; color: var(--text-light); line-height: 1.8; }
.article-content { font-size: 16px; line-height: 2; color: #333; }
.article-content p { margin-bottom: 20px; text-indent: 2em; }
.article-content h2 { font-size: 20px; margin: 28px 0 16px; color: var(--text); text-indent: 0; }
.article-content ul { margin: 16px 0 16px 2em; }
.article-content li { margin-bottom: 8px; }
.article-footer { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }

/* Related */
.related-articles { margin-top: 32px; }
.related-articles h3 { font-size: 18px; margin-bottom: 16px; color: var(--primary); }
.related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.related-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.related-card img { width: 100%; height: 120px; object-fit: cover; }
.related-card h4 { padding: 12px; font-size: 14px; line-height: 1.4; }

/* Category / Search */
.category-header, .search-header { margin-bottom: 24px; }
.category-header h1, .search-header h1 { font-size: 24px; color: var(--primary); }
.category-header p, .search-header p { color: var(--text-muted); margin-top: 4px; }
.empty-msg { text-align: center; padding: 60px 20px; color: var(--text-muted); font-size: 16px; }

/* Error Page */
.error-page { text-align: center; padding: 80px 20px; background: var(--white); border-radius: var(--radius); }
.error-page h1 { font-size: 72px; color: var(--primary); }
.error-page p { font-size: 18px; color: var(--text-muted); margin: 16px 0 32px; }

/* Buttons */
.btn { display: inline-block; padding: 10px 24px; border-radius: var(--radius); font-size: 14px; cursor: pointer; border: none; transition: background .2s; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); color: var(--white); }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-block { display: block; width: 100%; text-align: center; }

/* Footer */
.site-footer { background: #1a1a2e; color: #aaa; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding: 40px 16px; }
.footer-col h4 { color: var(--white); margin-bottom: 16px; font-size: 16px; }
.footer-col p { font-size: 14px; line-height: 1.8; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; font-size: 14px; }
.footer-col a { color: #aaa; }
.footer-col a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid #333; padding: 16px 0; text-align: center; font-size: 13px; }

/* ========== Login Page ========== */
.login-page { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-container { width: 100%; max-width: 480px; padding: 20px; }
.login-box { background: var(--white); border-radius: 8px; padding: 36px; box-shadow: 0 8px 32px rgba(0,0,0,.3); }
.login-header { text-align: center; margin-bottom: 28px; }
.logo-mini { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 18px; font-weight: bold; color: var(--primary); }
.logo-mini .logo-icon { width: 36px; height: 36px; font-size: 18px; }
.login-header h1 { font-size: 22px; margin-bottom: 4px; }
.login-header p { font-size: 13px; color: var(--text-muted); }

.login-form .form-group { margin-bottom: 18px; }
.login-form label { display: block; font-size: 14px; margin-bottom: 6px; color: var(--text-light); }
.login-form input[type="text"],
.login-form input[type="password"] { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; outline: none; transition: border-color .2s; }
.login-form input:focus { border-color: var(--primary); }
.form-options { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.forgot-link { color: var(--text-muted); font-size: 13px; }
.login-hint { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 16px; }
.login-footer { text-align: center; margin-top: 20px; font-size: 13px; }
.login-footer a { color: var(--text-muted); }

.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* Admin Panel */
.admin-panel { margin-top: 8px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.admin-nav-item { padding: 8px 16px; background: #f5f5f5; border-radius: var(--radius); font-size: 13px; color: var(--text-light); }
.admin-nav-item.active { background: var(--primary); color: var(--white); }

.network-tools { background: #f9f9f9; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-top: 16px; }
.network-tools h3 { font-size: 16px; margin-bottom: 8px; }
.tool-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.ping-form .form-group { margin-bottom: 14px; }
.ping-form label { display: block; font-size: 13px; margin-bottom: 4px; color: var(--text-light); }
.ping-form input[type="text"] { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; font-family: monospace; }
.ping-result { margin-top: 16px; }
.ping-result h4 { font-size: 14px; margin-bottom: 8px; color: var(--text-light); }
.ping-result pre { background: #1a1a2e; color: #0f0; padding: 16px; border-radius: var(--radius); font-size: 13px; line-height: 1.5; overflow-x: auto; white-space: pre-wrap; word-break: break-all; max-height: 400px; overflow-y: auto; }

/* Responsive */
@media (max-width: 900px) {
    .hero-section { grid-template-columns: 1fr; }
    .hero-main { height: 280px; }
    .content-layout { grid-template-columns: 1fr; }
    .news-card-image { width: 160px; }
    .related-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr; }
    .header-inner { flex-direction: column; }
    .search-form input { width: 200px; }
}
@media (max-width: 600px) {
    .news-card { flex-direction: column; }
    .news-card-image { width: 100%; }
    .news-card-body { padding: 16px; }
    .article-page { padding: 20px; }
    .article-header h1 { font-size: 22px; }
    .related-grid { grid-template-columns: 1fr; }
}
