/* BPEI - Style System */
:root {
  --primary: #1a3a5c;
  --primary-light: #2563eb;
  --accent: #0ea5e9;
  --accent-2: #10b981;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-dark: #0f172a;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.12);
  --radius: 8px;
  --radius-lg: 16px;
  --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-w: 1280px;
  --header-h: 64px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-sans); background: var(--bg); color: var(--text); line-height: 1.7; font-size: 16px; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-light); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent); }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
ul { list-style: none; }

/* Accessibility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }
.skip-link { position: absolute; top: -40px; left: 8px; background: var(--primary); color: #fff; padding: 8px 12px; border-radius: 4px; z-index: 1000; transition: top .2s; }
.skip-link:focus { top: 8px; }

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

/* ===== HEADER ===== */
.site-header { background: var(--primary); position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow); }
.header-inner { display: flex; align-items: center; height: var(--header-h); gap: 24px; }
.site-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.site-logo img { filter: brightness(0) invert(1); }
.logo-text { display: flex; flex-direction: column; }
.logo-abbr { color: #fff; font-size: 22px; font-weight: 800; letter-spacing: .05em; line-height: 1; }
.logo-sub { color: rgba(255,255,255,.55); font-size: 10px; letter-spacing: .04em; line-height: 1.4; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Main nav */
.main-nav { flex: 1; }
.main-nav > ul { display: flex; align-items: center; gap: 4px; }
.main-nav a { color: rgba(255,255,255,.85); font-size: 14px; font-weight: 500; padding: 8px 14px; border-radius: 6px; transition: background .2s, color .2s; }
.main-nav a:hover, .main-nav a.active { background: rgba(255,255,255,.12); color: #fff; }
.has-dropdown { position: relative; }
.dropdown { display: none; position: absolute; top: calc(100% + 8px); left: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 180px; padding: 8px 0; z-index: 200; }
.dropdown li a { color: var(--text); display: block; padding: 10px 16px; font-size: 13px; border-radius: 0; }
.dropdown li a:hover { background: var(--bg); color: var(--primary-light); }
.has-dropdown:hover .dropdown { display: block; }

/* Header search */
.header-search { display: flex; flex-shrink: 0; }
.header-search form { display: flex; align-items: center; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 24px; overflow: hidden; transition: background .2s; }
.header-search form:focus-within { background: rgba(255,255,255,.18); }
.header-search input { background: transparent; border: none; color: #fff; padding: 8px 14px; width: 200px; outline: none; }
.header-search input::placeholder { color: rgba(255,255,255,.5); }
.header-search button { background: transparent; border: none; color: rgba(255,255,255,.7); padding: 8px 12px; cursor: pointer; transition: color .2s; }
.header-search button:hover { color: #fff; }

/* Ticker */
.header-ticker { background: rgba(0,0,0,.2); border-top: 1px solid rgba(255,255,255,.1); padding: 6px 0; overflow: hidden; }
.header-ticker .container { display: flex; align-items: center; gap: 12px; }
.ticker-label { background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 3px; white-space: nowrap; flex-shrink: 0; }
.ticker-track { flex: 1; overflow: hidden; white-space: nowrap; }
.ticker-track a { color: rgba(255,255,255,.8); font-size: 13px; margin-right: 40px; }
.ticker-track a:hover { color: #fff; }

/* Menu toggle (mobile) */
.menu-toggle { display: none; flex-direction: column; gap: 5px; background: transparent; border: none; cursor: pointer; padding: 8px; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: transform .3s, opacity .3s; }

/* ===== HERO ===== */
.hero { background: linear-gradient(135deg, var(--primary) 0%, #0c2340 60%, #0a192f 100%); padding: 40px 0; overflow: hidden; position: relative; }
.hero::before { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }
.hero-inner { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.hero-text h1 { color: #fff; font-size: clamp(28px, 4vw, 44px); font-weight: 800; line-height: 1.2; margin-bottom: 12px; }
.hero-text h1 em { color: var(--accent); font-style: normal; }
.hero-text p { color: rgba(255,255,255,.75); font-size: 17px; line-height: 1.8; margin-bottom: 20px; }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-weight: 600; font-size: 15px; cursor: pointer; transition: all .2s; border: 2px solid transparent; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: #0284c7; border-color: #0284c7; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(14,165,233,.4); }
.btn-outline { background: transparent; color: rgba(255,255,255,.9); border-color: rgba(255,255,255,.3); }
.btn-outline:hover { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.6); }
.hero-stats { display: flex; gap: 32px; margin-top: 28px; }
.hero-stat { text-align: center; }
.hero-stat .num { font-size: 32px; font-weight: 800; color: var(--accent); line-height: 1; }
.hero-stat .lbl { font-size: 13px; color: rgba(255,255,255,.6); margin-top: 4px; }
.hero-featured { display: flex; flex-direction: column; gap: 10px; }
.featured-card { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius); padding: 14px; cursor: pointer; transition: background .2s, transform .2s; }
.featured-card:hover { background: rgba(255,255,255,.1); transform: translateX(4px); }
.featured-card .cat-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 3px; margin-bottom: 6px; display: inline-block; }
.featured-card h3 { color: rgba(255,255,255,.9); font-size: 14px; font-weight: 600; line-height: 1.5; margin-bottom: 4px; }
.featured-card .meta { color: rgba(255,255,255,.5); font-size: 12px; }

/* ===== SECTIONS ===== */
.section { padding: 16px 0; }
.section-alt { background: #fff; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.section-header h2 { font-size: 22px; font-weight: 800; color: var(--text); position: relative; padding-left: 14px; }
.section-header h2::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; background: var(--primary-light); border-radius: 2px; }
.section-header a { font-size: 14px; color: var(--primary-light); font-weight: 500; }
.section-header a:hover { color: var(--accent); }

/* About banner - compact */
.section-about-banner { padding: 4px 0; }
.about-card { padding: 14px 20px; }

/* ===== GRID CARDS ===== */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.news-grid-4 { grid-template-columns: repeat(4, 1fr); gap: 16px; }

.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: box-shadow .2s, transform .2s; display: flex; flex-direction: column; }
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.card-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: linear-gradient(135deg, #1a3a5c 0%, #2563eb 100%); }
.card-img-placeholder { width: 100%; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; font-size: 48px; }
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-cat { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 4px; margin-bottom: 8px; }
.card-title { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.5; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a { color: inherit; }
.card-title a:hover { color: var(--primary-light); }
.card-excerpt { font-size: 13px; color: var(--text-muted); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; margin-bottom: 12px; }
.card-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-light); margin-top: auto; }
.card-source { font-weight: 600; }

/* ===== LAYOUT: content + sidebar ===== */
.content-layout { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }
.sidebar { position: sticky; top: calc(var(--header-h) + 16px); }
.widget { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 10px; }
.widget-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.widget-news { display: flex; flex-direction: column; gap: 10px; }
.widget-news-item { display: flex; gap: 10px; }
.widget-news-item .num { width: 22px; height: 22px; background: var(--bg); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }
.widget-news-item:nth-child(-n+3) .num { background: var(--primary-light); color: #fff; }
.widget-news-item p { font-size: 13px; color: var(--text); line-height: 1.5; }
.widget-news-item p a { color: var(--text); }
.widget-news-item p a:hover { color: var(--primary-light); }
.widget-news-item .meta { font-size: 11px; color: var(--text-light); margin-top: 3px; }

/* Categories widget */
.cat-list { display: flex; flex-direction: column; gap: 6px; }
.cat-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--border); transition: all .2s; text-decoration: none; }
.cat-item:hover { border-color: var(--primary-light); background: #eff6ff; }
.cat-item-left { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.cat-item .count { font-size: 12px; color: var(--text-muted); background: var(--bg); padding: 2px 8px; border-radius: 10px; }

/* Tags cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); transition: all .2s; cursor: pointer; text-decoration: none; }
.tag:hover { background: var(--primary-light); color: #fff; border-color: var(--primary-light); }

/* ===== ARTICLE ===== */
.article-header { margin-bottom: 24px; }
.article-header h1 { font-size: clamp(22px, 3vw, 34px); font-weight: 800; color: var(--text); line-height: 1.35; margin-bottom: 12px; }
.article-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--text-muted); }
.article-meta .source { font-weight: 600; color: var(--primary-light); }
.article-body { font-size: 16px; line-height: 1.9; color: var(--text); }
.article-body h2 { font-size: 22px; font-weight: 700; margin: 32px 0 14px; color: var(--text); }
.article-body h3 { font-size: 18px; font-weight: 700; margin: 24px 0 10px; }
.article-body p { margin-bottom: 10px; }
.article-body ul, .article-body ol { margin: 14px 0 18px 24px; }
.article-body li { margin-bottom: 6px; }
.article-body blockquote { border-left: 4px solid var(--primary-light); padding: 14px 18px; background: #eff6ff; border-radius: 0 var(--radius) var(--radius) 0; margin: 20px 0; color: var(--text-muted); }
.article-body a { color: var(--primary-light); text-decoration: underline; text-underline-offset: 3px; }
.article-body strong { font-weight: 700; color: var(--text); }

/* ===== SEARCH PAGE ===== */
.search-bar { display: flex; max-width: 600px; margin: 0 auto 32px; border: 2px solid var(--border-strong); border-radius: 40px; overflow: hidden; background: #fff; transition: border-color .2s, box-shadow .2s; }
.search-bar:focus-within { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.search-bar input { flex: 1; border: none; padding: 12px 18px; font-size: 16px; outline: none; background: transparent; }
.search-bar button { background: var(--primary-light); color: #fff; border: none; padding: 12px 20px; cursor: pointer; font-weight: 600; font-size: 15px; transition: background .2s; }
.search-bar button:hover { background: var(--primary); }

/* ===== PAGINATION ===== */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 36px; }
.page-link { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius); border: 1px solid var(--border); color: var(--text-muted); font-size: 14px; font-weight: 600; transition: all .2s; }
.page-link:hover { border-color: var(--primary-light); color: var(--primary-light); background: #eff6ff; }
.page-link.active { background: var(--primary-light); border-color: var(--primary-light); color: #fff; }
.page-link.disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* ===== BREADCRUMB ===== */
.breadcrumb { padding: 12px 0; }
.breadcrumb-list { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.breadcrumb-list li { display: flex; align-items: center; gap: 4px; }
.breadcrumb-list a { font-size: 13px; color: var(--text-muted); }
.breadcrumb-list .sep { color: var(--text-light); font-size: 12px; }
.breadcrumb-list .current { font-size: 13px; color: var(--text); font-weight: 600; }

/* ===== CATEGORY HEADER ===== */
.cat-hero { padding: 36px 0; background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%); }
.cat-hero-inner { display: flex; align-items: center; gap: 16px; }
.cat-icon { font-size: 48px; }
.cat-hero h1 { color: #fff; font-size: 28px; font-weight: 800; }
.cat-hero p { color: rgba(255,255,255,.75); margin-top: 4px; font-size: 14px; }

/* ===== ALERT / EMPTY ===== */
.empty-state { text-align: center; padding: 60px 24px; color: var(--text-muted); }
.empty-state .icon { font-size: 56px; margin-bottom: 12px; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 6px; }

/* ===== ABOUT PAGE ===== */
.about-hero { background: linear-gradient(135deg, var(--primary) 0%, #0c2340 100%); padding: 56px 0; text-align: center; }
.about-hero h1 { color: #fff; font-size: 38px; font-weight: 800; margin-bottom: 12px; }
.about-hero p { color: rgba(255,255,255,.8); font-size: 17px; max-width: 600px; margin: 0 auto; }
.mission-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 36px; }
.mission-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px 20px; text-align: center; }
.mission-card .icon { font-size: 36px; margin-bottom: 12px; }
.mission-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.mission-card p { font-size: 13px; color: var(--text-muted); line-height: 1.7; }

/* ===== NOTICE BAR ===== */
.notice-bar { background: #fefce8; border-bottom: 1px solid #fde68a; padding: 8px 0; text-align: center; font-size: 13px; color: #92400e; }

/* ===== FOOTER ===== */
.site-footer { background: var(--bg-dark); color: rgba(255,255,255,.75); padding: 28px 0 0; margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 28px; }
.footer-brand img { filter: brightness(0) invert(1); margin-bottom: 12px; }
.footer-desc { font-size: 13px; line-height: 1.8; color: rgba(255,255,255,.5); margin-bottom: 12px; }
.footer-contact a { color: var(--accent); font-size: 13px; }
.footer-links h4 { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 12px; letter-spacing: .05em; text-transform: uppercase; }
.footer-links li + li { margin-top: 6px; }
.footer-links a { font-size: 13px; color: rgba(255,255,255,.55); transition: color .2s; }
.footer-links a:hover { color: rgba(255,255,255,.9); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 16px 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-icp p { font-size: 12px; color: rgba(255,255,255,.35); line-height: 1.8; }
.footer-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.footer-tags span { font-size: 11px; color: rgba(255,255,255,.3); border: 1px solid rgba(255,255,255,.1); padding: 2px 8px; border-radius: 20px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-featured { display: none; }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .content-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .mission-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --header-h: 56px; }
  .logo-sub { display: none; }
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--primary); padding: 16px 24px; border-top: 1px solid rgba(255,255,255,.1); }
  .main-nav.open { display: block; }
  .main-nav > ul { flex-direction: column; gap: 4px; }
  .main-nav a { display: block; }
  .dropdown { display: none !important; }
  .menu-toggle { display: flex; margin-left: auto; }
  .header-search { display: none; }
  .news-grid, .news-grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .hero { padding: 32px 0; }
  .section { padding: 14px 0; }
}

/* ===== LOADING ===== */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ===== TICKER ANIMATION ===== */
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-inner { display: inline-flex; animation: ticker 30s linear infinite; }
.ticker-inner:hover { animation-play-state: paused; }

/* ===== PRINT ===== */
@media print {
  .site-header, .site-footer, .sidebar, .header-ticker { display: none; }
  .content-layout { grid-template-columns: 1fr; }
}
