/* ========================================
   太阳系联合通讯社 (SSUP) - 全局样式
   双主题：地球总社(暖色) / 星舰分社(深色)
   ======================================== */

/* === CSS 变量：地球主题（默认） === */
:root {
  --bg-primary: #fdf6e8;
  --bg-secondary: #f5eed8;
  --bg-card: #fffef7;
  --bg-header: #1a1a2e;
  --bg-footer: #1a1a2e;
  --bg-nav: #2c2c3e;
  --bg-sidebar: #f0ead5;
  --bg-input: #fff;
  --text-primary: #2c2416;
  --text-secondary: #5c5240;
  --text-muted: #8a7e6a;
  --text-header: #f0e6d2;
  --text-nav: #ddd;
  --text-nav-hover: #fff;
  --accent: #8b0000;
  --accent-light: #c0392b;
  --accent-glow: rgba(139, 0, 0, 0.3);
  --border: #d5c9a8;
  --border-light: #e8ddc5;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --font-heading: 'STSong', 'SimSun', 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', serif;
  --font-body: 'STSong', 'SimSun', 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', serif;
  --font-mono: 'Courier New', 'Source Code Pro', monospace;
  --star-color: rgba(0, 0, 0, 0.3);
  --divider: repeating-linear-gradient(to right, #8b0000 0px, #8b0000 2px, transparent 2px, transparent 8px);
  --radius: 4px;
  --transition: 0.3s ease;
  --max-width: 1280px;
}

/* === 舰队主题 === */
[data-theme="fleet"] {
  --bg-primary: #0a0a14;
  --bg-secondary: #0f0f20;
  --bg-card: #141428;
  --bg-header: #060610;
  --bg-footer: #060610;
  --bg-nav: #0c0c1a;
  --bg-sidebar: #101022;
  --bg-input: #1a1a30;
  --text-primary: #c8d0e0;
  --text-secondary: #8899b0;
  --text-muted: #556680;
  --text-header: #dde4f0;
  --text-nav: #aabbcc;
  --text-nav-hover: #ff6633;
  --accent: #c0392b;
  --accent-light: #e74c3c;
  --accent-glow: rgba(192, 57, 43, 0.4);
  --border: #1a2a3a;
  --border-light: #1e2e40;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --star-color: rgba(200, 210, 240, 0.6);
  --divider: repeating-linear-gradient(to right, #c0392b 0px, #c0392b 2px, transparent 2px, transparent 8px);
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* === 星空背景 === */
#star-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

[data-theme="fleet"] #star-canvas {
  opacity: 1;
}

/* === 容器 === */
.main-wrapper {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* === 顶部信息栏 === */
.top-bar {
  background: var(--bg-header);
  color: var(--text-header);
  font-size: 0.8rem;
  padding: 6px 0;
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--accent);
}

.top-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.crisis-clock {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
}

.crisis-clock .label {
  color: var(--accent-light);
  font-weight: bold;
  letter-spacing: 1px;
}

.fleet-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 300px;
  min-width: 150px;
}

.progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  background: var(--accent-light);
  border-radius: 2px;
  transition: width 1s ease;
  animation: progressPulse 3s infinite;
}

@keyframes progressPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--text-header);
  padding: 4px 12px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.75rem;
  border-radius: var(--radius);
  transition: all var(--transition);
  white-space: nowrap;
}

.theme-toggle-btn:hover {
  border-color: var(--accent-light);
  color: var(--accent-light);
}

/* === 报头 === */
.header {
  background: var(--bg-header);
  color: var(--text-header);
  padding: 30px 0 20px;
  text-align: center;
  border-bottom: 3px solid var(--accent);
  position: relative;
  z-index: 5;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.newspaper-name {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: bold;
  letter-spacing: 4px;
  margin-bottom: 4px;
  color: #fff;
  text-shadow: 0 0 20px var(--accent-glow);
}

.newspaper-name .accent {
  color: var(--accent-light);
}

.newspaper-subtitle {
  font-size: 0.9rem;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.6);
  font-family: var(--font-body);
}

.header-meta {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 12px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  flex-wrap: wrap;
}

/* === 分隔线 === */
.decorative-divider {
  height: 4px;
  background: var(--divider);
  margin: 0;
  opacity: 0.5;
}

/* === 导航 === */
nav {
  background: var(--bg-nav);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 10px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
}

.nav-inner a {
  color: var(--text-nav);
  text-decoration: none;
  padding: 12px 18px;
  font-size: 0.9rem;
  letter-spacing: 1px;
  transition: all var(--transition);
  position: relative;
  white-space: nowrap;
}

.nav-inner a:hover,
.nav-inner a.active {
  color: var(--text-nav-hover);
  background: rgba(255,255,255,0.05);
}

.nav-inner a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  width: 60%;
  height: 2px;
  background: var(--accent-light);
}

.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-nav);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 10px;
}

/* === 主内容区 === */
.content-area {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
  padding: 30px 0;
}

.main-content {
  min-width: 0;
}

/* === 侧边栏 === */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sidebar-card h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
  color: var(--accent);
  letter-spacing: 1px;
}

.sidebar-card .data-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 0.85rem;
  border-bottom: 1px dotted var(--border-light);
}

.sidebar-card .data-row .val {
  font-weight: bold;
  font-family: var(--font-mono);
  color: var(--accent-light);
}

.sidebar-card .hot-item {
  display: block;
  padding: 6px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px dotted var(--border-light);
  transition: color var(--transition);
}

.sidebar-card .hot-item:hover {
  color: var(--accent-light);
}

.daily-quote {
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.85rem;
}

.daily-quote .attr {
  display: block;
  text-align: right;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-style: normal;
}

/* === 头条 Hero === */
.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
  transition: background var(--transition), border var(--transition);
}

.hero-card .hero-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 4px 14px;
  font-size: 0.75rem;
  letter-spacing: 1px;
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
}

.hero-card .hero-image {
  width: 100%;
  height: 320px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
}

.hero-card .hero-image svg {
  width: 100%;
  height: 100%;
}

.hero-card .hero-body {
  padding: 24px;
}

.hero-card .hero-category {
  font-size: 0.75rem;
  color: var(--accent-light);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.hero-card .hero-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  line-height: 1.4;
  margin-bottom: 10px;
}

.hero-card .hero-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition);
}

.hero-card .hero-title a:hover {
  color: var(--accent-light);
}

.hero-card .hero-summary {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

.hero-card .hero-meta {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 12px;
}

/* === 新闻网格 === */
.news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s, background var(--transition);
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.news-card .card-image {
  height: 160px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.news-card .card-body {
  padding: 16px;
}

.news-card .card-category {
  font-size: 0.7rem;
  color: var(--accent-light);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.news-card .card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  line-height: 1.5;
  margin-bottom: 8px;
}

.news-card .card-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition);
}

.news-card .card-title a:hover {
  color: var(--accent-light);
}

.news-card .card-summary {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.news-card .card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 10px;
}

/* === 版块标题 === */
.section-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '◆';
  font-size: 0.6rem;
}

/* === 文章列表（二级页面） === */
.article-list {
  list-style: none;
  padding: 0;
}

.article-list-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--border-light);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}

.article-list-item:last-child {
  border-bottom: none;
}

.article-list-item .list-category {
  font-size: 0.7rem;
  color: var(--accent-light);
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.article-list-item .list-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.article-list-item .list-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition);
}

.article-list-item .list-title a:hover {
  color: var(--accent-light);
}

.article-list-item .list-summary {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.article-list-item .list-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.article-list-item .list-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: 4px;
}

/* === 文章详情（三级页面） === */
.article-full {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  max-width: 860px;
  margin: 0 auto;
}

.article-full .article-header {
  border-bottom: 2px solid var(--accent);
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.article-full .article-category {
  font-size: 0.8rem;
  color: var(--accent-light);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.article-full h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  line-height: 1.4;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.article-full .article-byline {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-full .article-tags {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-full .tag {
  display: inline-block;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 2px 10px;
  font-size: 0.75rem;
  border-radius: 2px;
  border: 1px solid var(--border-light);
}

.article-full .article-body {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text-primary);
}

.article-full .article-body h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin: 28px 0 14px;
  color: var(--accent);
}

.article-full .article-body h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin: 22px 0 10px;
}

.article-full .article-body p {
  margin-bottom: 14px;
}

.article-full .article-body blockquote {
  border-left: 3px solid var(--accent-light);
  margin: 16px 0;
  padding: 12px 20px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-style: italic;
}

.article-full .article-body ul, 
.article-full .article-body ol {
  margin: 12px 0 12px 24px;
}

.article-full .article-body li {
  margin-bottom: 6px;
}

.article-full .article-body strong {
  color: var(--accent);
}

.article-full .article-body hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 24px 0;
}

.article-full .article-body em {
  color: var(--text-muted);
}

.article-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-footer a {
  color: var(--accent-light);
  text-decoration: none;
}

.article-footer a:hover {
  text-decoration: underline;
}

/* === 页脚 === */
.footer {
  background: var(--bg-footer);
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 30px 20px;
  font-size: 0.85rem;
  margin-top: 40px;
  border-top: 2px solid var(--accent);
}

.footer .motto {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 8px;
}

/* === 面包屑导航 === */
.breadcrumb {
  padding: 16px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--accent-light);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  margin: 0 8px;
}

/* === 响应式 === */
@media (max-width: 1024px) {
  .content-area {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .newspaper-name {
    font-size: 1.8rem;
    letter-spacing: 2px;
  }
  .news-grid {
    grid-template-columns: 1fr;
  }
  .sidebar {
    grid-template-columns: 1fr;
  }
  .content-area {
    padding: 16px 0;
  }
  .header-meta {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
  .top-bar-inner {
    flex-direction: column;
    text-align: center;
    font-size: 0.7rem;
  }
  .fleet-progress {
    max-width: 100%;
  }
  .nav-inner {
    flex-direction: column;
    align-items: center;
  }
  .nav-inner a {
    width: 100%;
    text-align: center;
    padding: 10px;
  }
  .mobile-nav-toggle {
    display: block;
  }
  .nav-inner.collapsed {
    display: none;
  }
  .article-full {
    padding: 20px;
  }
  .article-full h1 {
    font-size: 1.4rem;
  }
  .hero-card .hero-image {
    height: 180px;
  }
  .hero-card .hero-title {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .newspaper-name {
    font-size: 1.4rem;
  }
  .hero-card .hero-image {
    height: 140px;
  }
  .hero-card .hero-body {
    padding: 14px;
  }
  .hero-card .hero-title {
    font-size: 1.1rem;
  }
}

/* === 打印样式 === */
@media print {
  #star-canvas, .top-bar, nav, .sidebar, .footer, .theme-toggle-btn {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
  .content-area {
    grid-template-columns: 1fr;
  }
}
