/*
Theme Name: NebulaPress 科技资讯
Theme URI: https://example.com/nebulapress
Author: Codex
Description: 一款科技感、响应式的中文 WordPress 资讯主题，支持特色图、分类、作者、分页、相关文章及上下篇导航。
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: nebulapress
*/

:root {
  --bg: #050812;
  --panel: #0c1222;
  --panel-2: #10182c;
  --text: #edf4ff;
  --muted: #8795ad;
  --line: rgba(148, 177, 229, .14);
  --cyan: #35d9ff;
  --blue: #3977ff;
  --violet: #9c6cff;
  --green: #4cf3b0;
  --radius: 18px;
  --shadow: 0 20px 50px rgba(0, 0, 0, .28);
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(57, 119, 255, .13), transparent 28rem),
    radial-gradient(circle at 90% 15%, rgba(156, 108, 255, .1), transparent 24rem),
    var(--bg);
  font: 15px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button, input { font: inherit; }
.wrap { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(5, 8, 18, .78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.header-inner { min-height: 76px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; font-weight: 850; letter-spacing: -.5px; }
.brand-mark {
  width: 37px; aspect-ratio: 1; display: grid; place-items: center;
  border: 1px solid rgba(53, 217, 255, .45); border-radius: 11px;
  background: linear-gradient(145deg, rgba(53, 217, 255, .2), rgba(156, 108, 255, .18));
  box-shadow: inset 0 0 18px rgba(53, 217, 255, .12), 0 0 22px rgba(57, 119, 255, .15);
}
.brand-mark::before {
  content: ""; width: 13px; height: 13px; border-radius: 3px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  transform: rotate(45deg); box-shadow: 0 0 13px var(--cyan);
}
.brand-name { font-size: 20px; }
.brand-name em { color: var(--cyan); font-style: normal; }
.main-nav { margin-left: auto; }
.main-nav ul { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.main-nav a {
  display: block; padding: 9px 14px; color: #b9c5d8; border-radius: 9px;
  transition: .2s ease;
}
.main-nav a:hover, .main-nav .current-menu-item > a { color: #fff; background: rgba(53, 217, 255, .09); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.icon-button, .menu-toggle {
  width: 40px; height: 40px; display: grid; place-items: center;
  color: var(--text); background: rgba(255,255,255,.04); border: 1px solid var(--line);
  border-radius: 11px; cursor: pointer;
}
.menu-toggle { display: none; }
.search-panel {
  position: absolute; inset: 76px 0 auto; padding: 16px 0;
  border-bottom: 1px solid var(--line); background: rgba(5,8,18,.96);
}
.search-panel[hidden] { display: none; }
.search-form { display: flex; gap: 10px; }
.search-field {
  width: 100%; padding: 12px 16px; color: #fff; background: var(--panel);
  border: 1px solid var(--line); border-radius: 11px; outline: none;
}
.search-field:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(53,217,255,.1); }
.search-submit, .button {
  flex: 0 0 auto; padding: 11px 20px; color: #03101c; font-weight: 750;
  border: 0; border-radius: 11px; cursor: pointer;
  background: linear-gradient(135deg, var(--cyan), #70a2ff);
}

.hero { padding: 42px 0 26px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 15px;
  color: var(--cyan); font-size: 12px; font-weight: 800; letter-spacing: 1.7px; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; box-shadow: 0 0 8px currentColor; }
.hero-heading { max-width: 750px; margin: 0 0 28px; font-size: clamp(30px, 5vw, 58px); line-height: 1.08; letter-spacing: -2px; }
.hero-heading span {
  color: transparent; background: linear-gradient(90deg, var(--cyan), #79a4ff 52%, #b693ff);
  background-clip: text; -webkit-background-clip: text;
}
.featured-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 18px; }
.side-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.story-card {
  position: relative; min-width: 0; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .25s ease, border-color .25s ease;
}
.story-card:hover { transform: translateY(-4px); border-color: rgba(53, 217, 255, .35); }
.story-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #111a31; }
.story-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.story-card:hover .story-media img { transform: scale(1.04); }
.story-media::after {
  content: ""; position: absolute; inset: auto 0 0; height: 45%;
  background: linear-gradient(transparent, rgba(5,8,18,.55)); pointer-events: none;
}
.thumb-fallback {
  width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden;
  background:
    linear-gradient(135deg, transparent 45%, rgba(53,217,255,.08) 45% 46%, transparent 46%),
    radial-gradient(circle at 25% 30%, rgba(53,217,255,.26), transparent 25%),
    radial-gradient(circle at 75% 72%, rgba(156,108,255,.26), transparent 24%),
    #0b1429;
}
.thumb-fallback::before {
  content: attr(data-letter); font-size: clamp(42px, 7vw, 92px); font-weight: 900;
  color: rgba(255,255,255,.08); text-shadow: 0 0 35px rgba(53,217,255,.25);
}
.story-body { padding: 20px; }
.story-card h2, .story-card h3 { margin: 8px 0 9px; line-height: 1.35; letter-spacing: -.3px; }
.story-card h2 { font-size: clamp(22px, 2.3vw, 34px); }
.story-card h3 { font-size: 18px; }
.story-card--main .story-body { padding: 25px 27px 27px; }
.story-card--small .story-body { padding: 15px; }
.story-card--small .story-media { aspect-ratio: 16 / 9; }
.story-card--small h3 { margin-top: 6px; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.story-card--list { display: grid; grid-template-columns: 220px 1fr; }
.story-card--list .story-media { aspect-ratio: auto; min-height: 160px; }
.story-card--list .story-body { display: flex; flex-direction: column; justify-content: center; }
.story-card--compact { display: grid; grid-template-columns: 104px 1fr; border: 0; border-radius: 0; background: transparent; }
.story-card--compact + .story-card--compact { padding-top: 16px; border-top: 1px solid var(--line); }
.story-card--compact .story-media { aspect-ratio: 1; border-radius: 12px; }
.story-card--compact .story-body { padding: 5px 0 5px 15px; }
.story-card--compact h3 { margin: 4px 0; font-size: 15px; }
.category-label {
  display: inline-flex; align-items: center; width: fit-content; padding: 4px 9px;
  color: var(--cyan); background: rgba(53,217,255,.09); border: 1px solid rgba(53,217,255,.17);
  border-radius: 999px; font-size: 11px; font-weight: 750;
}
.story-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 12px; }
.story-meta span + span::before { content: "·"; margin-right: 7px; color: #45536a; }
.story-excerpt { margin: 0 0 13px; color: #99a7bb; }

.content-section { padding: 36px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-title { margin: 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -1px; }
.section-title small { display: block; margin-bottom: 3px; color: var(--cyan); font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; }
.more-link { color: #9cb0cc; font-size: 13px; }
.more-link:hover { color: var(--cyan); }
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; }
.posts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.posts-list { display: grid; gap: 15px; }
.sidebar-stack {
  padding: 22px; height: fit-content; background: rgba(12,18,34,.72);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.sidebar-title { margin: 0 0 18px; font-size: 17px; }
.category-cloud { display: flex; flex-wrap: wrap; gap: 9px; }
.category-cloud a {
  padding: 7px 11px; color: #aab8cc; background: rgba(255,255,255,.035);
  border: 1px solid var(--line); border-radius: 9px; font-size: 12px;
}
.category-cloud a:hover { color: var(--cyan); border-color: rgba(53,217,255,.3); }

.page-hero { padding: 55px 0 28px; border-bottom: 1px solid var(--line); }
.page-hero h1 { margin: 4px 0 8px; font-size: clamp(32px, 5vw, 52px); letter-spacing: -1.6px; }
.page-hero p { max-width: 720px; margin: 0; color: var(--muted); }
.archive-main { padding: 34px 0 60px; }
.pagination { margin-top: 32px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers {
  min-width: 40px; height: 40px; display: grid; place-items: center; padding: 0 10px;
  color: #a9b6ca; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.pagination .current, .pagination a:hover { color: #07101d; background: var(--cyan); border-color: var(--cyan); }

.article-shell { width: min(calc(100% - 40px), 900px); margin: 0 auto; }
.article-header { padding: 58px 0 30px; text-align: center; }
.article-header .category-label { margin: 0 auto 15px; }
.article-title { margin: 0 auto 18px; font-size: clamp(32px, 5vw, 58px); line-height: 1.15; letter-spacing: -1.7px; }
.article-header .story-meta { justify-content: center; }
.article-cover { overflow: hidden; margin-bottom: 36px; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.article-cover img { width: 100%; max-height: 560px; object-fit: cover; }
.article-cover .thumb-fallback { aspect-ratio: 16 / 8.5; }
.article-content { color: #c7d1e0; font-size: 17px; line-height: 1.95; }
.article-content > *:first-child { margin-top: 0; }
.article-content h2, .article-content h3 { margin-top: 2em; color: #fff; line-height: 1.35; }
.article-content a { color: var(--cyan); text-decoration: underline; }
.article-content blockquote {
  margin: 2em 0; padding: 18px 24px; color: #dceaff;
  background: rgba(53,217,255,.06); border-left: 3px solid var(--cyan);
}
.article-content pre { overflow: auto; padding: 20px; background: #02050c; border: 1px solid var(--line); border-radius: 12px; }
.article-content img { border-radius: 14px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 34px; }
.post-tags a { padding: 5px 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; font-size: 12px; }
.author-box { display: flex; gap: 17px; margin-top: 36px; padding: 23px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.author-box img { width: 56px; height: 56px; border-radius: 50%; }
.author-box h3 { margin: 0 0 3px; }
.author-box p { margin: 0; color: var(--muted); }
.post-navigation { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 26px 0 48px; }
.post-navigation a {
  display: block; min-height: 100%; padding: 18px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px;
}
.post-navigation a:hover { border-color: rgba(53,217,255,.38); }
.post-navigation .next-post { text-align: right; }
.nav-caption { display: block; margin-bottom: 4px; color: var(--cyan); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.nav-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 700; line-height: 1.45; }
.related-posts { padding: 43px 0 64px; border-top: 1px solid var(--line); }

.empty-state { padding: 70px 20px; text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.empty-state h2 { margin: 0 0 8px; }
.empty-state p { color: var(--muted); }
.site-footer { margin-top: 25px; padding: 42px 0 24px; background: #03060d; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 50px; }
.footer-intro { max-width: 430px; color: var(--muted); }
.footer-heading { margin: 0 0 12px; font-size: 14px; }
.footer-links { margin: 0; padding: 0; list-style: none; }
.footer-links li { margin: 7px 0; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--cyan); }
.copyright { margin-top: 34px; padding-top: 20px; color: #68768b; border-top: 1px solid var(--line); font-size: 12px; }

@media (max-width: 1040px) {
  .featured-grid { grid-template-columns: 1.25fr 1fr; }
  .side-grid { grid-template-columns: 1fr; }
  .side-grid .story-card:nth-child(n+3) { display: none; }
  .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-layout { grid-template-columns: minmax(0, 1fr) 290px; }
}

@media (max-width: 780px) {
  .wrap, .article-shell { width: min(calc(100% - 28px), var(--max)); }
  .header-inner { min-height: 66px; }
  .brand-name { font-size: 18px; }
  .menu-toggle { display: grid; }
  .main-nav {
    display: none; position: absolute; inset: 66px 0 auto; padding: 10px 14px 16px;
    background: rgba(5,8,18,.98); border-bottom: 1px solid var(--line);
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { display: block; }
  .main-nav a { padding: 11px 12px; }
  .search-panel { top: 66px; }
  .hero { padding-top: 30px; }
  .hero-heading { letter-spacing: -1px; }
  .featured-grid, .content-layout { grid-template-columns: 1fr; }
  .side-grid { grid-template-columns: 1fr 1fr; }
  .side-grid .story-card:nth-child(n+3) { display: block; }
  .story-card--main .story-media { aspect-ratio: 16 / 9; }
  .sidebar-stack { order: 2; }
  .article-header { padding-top: 40px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 540px) {
  .header-actions .icon-button { display: none; }
  .hero-heading { font-size: 34px; }
  .featured-grid { gap: 14px; }
  .side-grid { gap: 12px; }
  .story-card--small .story-body { padding: 12px; }
  .story-card--small h3 { font-size: 14px; }
  .posts-grid { grid-template-columns: 1fr; }
  .story-card--list { grid-template-columns: 125px 1fr; }
  .story-card--list .story-media { min-height: 135px; }
  .story-card--list .story-body { padding: 14px; }
  .story-card--list .story-excerpt { display: none; }
  .article-title { font-size: 33px; }
  .article-content { font-size: 16px; }
  .post-navigation { grid-template-columns: 1fr; }
  .post-navigation .next-post { text-align: left; }
  .footer-grid { grid-template-columns: 1fr; gap: 25px; }
  .footer-grid > :first-child { grid-column: auto; }
}
