/* ============================================
   果核剥壳风格 - 全站样式框架
   GHXi Framework - Global Stylesheet
   ============================================ */

/* --- CSS Variables --- */
:root {
  --primary: #3fb950;
  --primary-dark: #2ea043;
  --accent: #0969da;
  --accent-hover: #0550ae;
  --header-bg: #24292f;
  --header-text: #e6edf3;
  --body-bg: #f6f8fa;
  --card-bg: #ffffff;
  --text-primary: #1f2328;
  --text-secondary: #656d76;
  --text-muted: #8b949e;
  --border: #d0d7de;
  --border-light: #eaeef2;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --radius: 8px;
  --radius-sm: 4px;
  --nav-height: 56px;
  --max-width: 1200px;
  --sidebar-width: 320px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

/* --- Utility --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 16px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }

/* ============================================
   TOP BAR (公告条)
   ============================================ */
.top-bar {
  background: #fffbea;
  border-bottom: 1px solid #e0c870;
  font-size: .8rem;
  padding: 4px 0;
  overflow: hidden;
  white-space: nowrap;
}
.top-bar .container { display: flex; align-items: center; gap: 12px; }
.top-bar-label { color: #9a6700; font-weight: 600; white-space: nowrap; }
.top-bar-list { display: flex; gap: 16px; overflow: hidden; }
.top-bar-list a { color: #9a6700; font-size: .78rem; opacity: .85; }
.top-bar-list a:hover { opacity: 1; }

/* ============================================
   HEADER / NAVIGATION
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  height: var(--nav-height);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--header-text);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -.02em;
}
.logo:hover { color: var(--header-text); }
.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), #1a7f37);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 18px;
}
.nav { display: flex; align-items: center; gap: 2px; }
.nav-item {
  position: relative;
  color: #c9d1d9;
  padding: 8px 14px;
  font-size: .9rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all .15s;
  text-decoration: none;
  cursor: pointer;
}
.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: rgba(255,255,255,.1);
}
.nav-item.has-sub::after {
  content: '';
  display: inline-block;
  width: 0; height: 0;
  margin-left: 5px;
  vertical-align: middle;
  border-top: 4px solid currentColor;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}

/* Dropdown Sub-menu */
.sub-nav {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: all .15s;
  z-index: 100;
}
.nav-item:hover > .sub-nav {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.sub-nav a {
  display: block;
  padding: 8px 16px;
  color: var(--text-primary);
  font-size: .85rem;
  transition: background .1s;
}
.sub-nav a:hover {
  background: var(--body-bg);
  color: var(--accent);
}

/* Header Right */
.header-right { display: flex; align-items: center; gap: 10px; }
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box input {
  width: 200px;
  height: 34px;
  padding: 0 12px 0 34px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px;
  background: rgba(255,255,255,.08);
  color: #e6edf3;
  font-size: .85rem;
  outline: none;
  transition: all .2s;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box input:focus {
  width: 260px;
  border-color: var(--primary);
  background: rgba(255,255,255,.12);
}
.search-box svg {
  position: absolute;
  left: 11px;
  width: 15px; height: 15px;
  fill: var(--text-muted);
  pointer-events: none;
}
.btn-header {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  transition: all .15s;
}
.btn-login {
  color: #e6edf3;
  border: 1px solid rgba(255,255,255,.2);
}
.btn-login:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.35); }

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  border-radius: 6px;
  color: #e6edf3;
}
.menu-toggle:hover { background: rgba(255,255,255,.1); }

/* ============================================
   HERO BANNER
   ============================================ */
.hero {
  background: linear-gradient(135deg, #1a1f36 0%, #0d1117 50%, #161b22 100%);
  padding: 28px 0 32px;
  overflow: hidden;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(63,185,80,.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  position: relative;
  z-index: 1;
}
.hero-main {
  background: linear-gradient(135deg, #21262d, #161b22);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 32px;
  color: #e6edf3;
  position: relative;
  overflow: hidden;
  min-height: 280px;
}
.hero-main::after {
  content: '';
  position: absolute;
  bottom: -40px; right: -40px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(63,185,80,.15), transparent 70%);
}
.hero-tag {
  display: inline-block;
  background: rgba(63,185,80,.15);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .03em;
  margin-bottom: 14px;
}
.hero-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 10px;
}
.hero-desc {
  color: #8b949e;
  font-size: .95rem;
  max-width: 480px;
  margin-bottom: 20px;
  line-height: 1.6;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: .82rem;
  color: #8b949e;
}
.hero-meta span { display: flex; align-items: center; gap: 4px; }
.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .9rem;
  margin-top: 16px;
  transition: background .15s;
}
.hero-btn:hover { background: var(--primary-dark); color: #fff; }

/* Hero Sidebar Cards */
.hero-side { display: flex; flex-direction: column; gap: 12px; }
.hero-card-sm {
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.hero-card-sm:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.hero-card-sm img {
  width: 52px; height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.hero-card-sm-info h4 {
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 2px;
}
.hero-card-sm-info p {
  font-size: .78rem;
  color: var(--text-muted);
}

/* ============================================
   SECTION COMMON
   ============================================ */
.section {
  padding: 28px 0;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  width: 4px; height: 18px;
  background: var(--primary);
  border-radius: 2px;
}
.section-more {
  font-size: .84rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.section-more:hover { color: var(--accent); }

/* ============================================
   MAIN LAYOUT (Two Column)
   ============================================ */
.main-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 24px;
  padding: 24px 0;
}
.main-content { min-width: 0; }
.sidebar { min-width: 0; }

/* ============================================
   DEAL CARDS (正版特惠)
   ============================================ */
.deal-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.deal-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.deal-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.deal-cover {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #667eea, #764ba2);
  position: relative;
  overflow: hidden;
}
.deal-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.deal-badge {
  position: absolute;
  top: 8px; left: 8px;
  background: #cf222e;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 600;
}
.deal-body { padding: 10px 12px; }
.deal-body h3 {
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.deal-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.deal-price .now {
  color: #cf222e;
  font-size: 1.1rem;
  font-weight: 800;
}
.deal-price .old {
  color: var(--text-muted);
  font-size: .8rem;
  text-decoration: line-through;
}
.deal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .74rem;
  color: var(--text-muted);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-light);
}

/* ============================================
   POST/TOOL CARDS (内容卡片)
   ============================================ */
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.post-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
  display: flex;
  text-decoration: none;
  color: inherit;
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.post-card:hover h3 { color: var(--accent); }
.post-thumb {
  width: 220px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea, #764ba2);
}
.post-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.post-card:hover .post-thumb img { transform: scale(1.05); }
.post-cat {
  position: absolute;
  top: 10px; left: 10px;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
}
.post-cat.cat-pc { background: #0969da; }
.post-cat.cat-android { background: #bf8700; }
.post-cat.cat-deal { background: #cf222e; }
.post-cat.cat-news { background: #8957e5; }
.post-cat.cat-video { background: #1f6feb; }
.post-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }
.post-body h3 {
  font-size: .98rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .15s;
}
.post-excerpt {
  font-size: .83rem;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: .76rem;
  color: var(--text-muted);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}
.post-meta span { display: flex; align-items: center; gap: 3px; }
.post-meta svg { width: 14px; height: 14px; fill: currentColor; opacity: .7; }

/* Post Card List Style (for listing page) */
.post-list { display: flex; flex-direction: column; gap: 12px; }
.post-list-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s;
  text-decoration: none;
  color: inherit;
}
.post-list-item:hover { box-shadow: var(--shadow-md); }
.post-list-item:hover h3 { color: var(--accent); }
.post-list-item .post-thumb { width: 180px; height: 120px; border-radius: 6px; }
.post-list-item .post-body { padding: 0; }

/* Pinned post */
.post-pinned {
  border-left: 3px solid var(--primary);
  background: linear-gradient(90deg, rgba(63,185,80,.04), transparent);
}

/* ============================================
   NEWS CARDS (圈内热点 - 横向卡片)
   ============================================ */
.news-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.news-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s;
  text-decoration: none;
  color: inherit;
}
.news-card:hover { transform: translateY(-2px); }
.news-card .news-cover {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #1f6feb, #58a6ff);
  overflow: hidden;
}
.news-card .news-cover img { width: 100%; height: 100%; object-fit: cover; }
.news-card .news-body { padding: 10px 12px; }
.news-card .news-body h4 {
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   TEXT LIST (微信推文/圈内新闻)
   ============================================ */
.text-list { display: flex; flex-direction: column; }
.text-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: inherit;
  transition: background .1s;
}
.text-list-item:last-child { border-bottom: none; }
.text-list-item:hover { background: var(--body-bg); }
.text-list-item .tl-title {
  font-size: .88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.text-list-item .tl-title::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}
.text-list-item .tl-date {
  font-size: .78rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ============================================
   SIDEBAR MODULES
   ============================================ */
.sidebar-module {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}
.sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: .92rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-header::before {
  content: '';
  width: 3px; height: 14px;
  background: var(--primary);
  border-radius: 2px;
}
.sidebar-body { padding: 12px 16px; }

/* Hot ranking */
.hot-list { counter-reset: hot; }
.hot-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: inherit;
}
.hot-item:last-child { border-bottom: none; }
.hot-rank {
  counter-increment: hot;
  width: 20px; height: 20px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--body-bg);
  color: var(--text-muted);
}
.hot-item:nth-child(-n+3) .hot-rank {
  background: #cf222e;
  color: #fff;
}
.hot-item:nth-child(2) .hot-rank { background: #d29922; }
.hot-item:nth-child(3) .hot-rank { background: #bf8700; }
.hot-title {
  font-size: .84rem;
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hot-item:hover .hot-title { color: var(--accent); }

/* Tag cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-item {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .78rem;
  background: var(--body-bg);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all .15s;
  border: 1px solid transparent;
}
.tag-item:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Comment sidebar items */
.comment-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: .82rem;
}
.comment-item:last-child { border-bottom: none; }
.comment-user {
  font-weight: 600;
  color: var(--accent);
  font-size: .8rem;
  margin-bottom: 3px;
}
.comment-text {
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.comment-post-link {
  font-size: .76rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================
   SPECIAL ENTRY (专题入口)
   ============================================ */
.special-entry {
  background: linear-gradient(135deg, #ff7e21, #ff5722);
  border-radius: var(--radius);
  padding: 20px 24px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.special-entry:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255,87,34,.3);
  color: #fff;
}
.special-entry h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.special-entry p { font-size: .84rem; opacity: .9; }
.special-entry .arrow {
  font-size: 1.5rem;
  opacity: .7;
}

/* ============================================
   VIDEO CARDS
   ============================================ */
.video-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.video-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s;
  text-decoration: none;
  color: inherit;
}
.video-card:hover { transform: translateY(-2px); }
.video-cover {
  aspect-ratio: 16/10;
  background: #000;
  position: relative;
  overflow: hidden;
}
.video-cover img { width: 100%; height: 100%; object-fit: cover; }
.video-play {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.25);
  transition: background .15s;
}
.video-card:hover .video-play { background: rgba(0,0,0,.4); }
.video-play-icon {
  width: 40px; height: 40px;
  background: rgba(255,255,255,.9);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.video-play-icon::after {
  content: '';
  width: 0; height: 0;
  border-left: 14px solid #333;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  margin-left: 3px;
}
.video-body { padding: 10px 12px; }
.video-body h4 {
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .74rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ============================================
   DETAIL PAGE
   ============================================ */
.detail-page { padding: 24px 0 48px; }
.detail-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 24px;
}
.detail-main {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.detail-head { padding: 28px 32px 20px; border-bottom: 1px solid var(--border-light); }
.detail-category {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 4px;
  font-size: .78rem;
  font-weight: 600;
  background: rgba(63,185,80,.1);
  color: var(--primary-dark);
  margin-bottom: 12px;
}
.detail-title {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 12px;
}
.detail-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: .84rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.detail-meta span { display: flex; align-items: center; gap: 5px; }
.detail-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 12px;
}
.detail-tag {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .76rem;
  background: var(--body-bg);
  color: var(--text-secondary);
}
.detail-body { padding: 28px 32px; }
.detail-body h2 { font-size: 1.3rem; margin: 28px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--border-light); }
.detail-body h3 { font-size: 1.1rem; margin: 20px 0 10px; }
.detail-body p { margin-bottom: 14px; line-height: 1.8; color: var(--text-primary); }
.detail-body img { border-radius: var(--radius-sm); margin: 16px 0; box-shadow: var(--shadow); }
.detail-body pre {
  background: #161b22;
  color: #e6edf3;
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: .85rem;
  line-height: 1.6;
  margin: 16px 0;
}
.detail-body code {
  background: rgba(175,184,193,.2);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: .88em;
}
.detail-body blockquote {
  border-left: 4px solid var(--primary);
  padding: 12px 18px;
  margin: 16px 0;
  background: rgba(63,185,80,.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}
.download-section {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1px solid rgba(63,185,80,.2);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
}
.download-section h3 {
  font-size: 1.05rem;
  color: var(--primary-dark);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  padding: 10px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .95rem;
  transition: background .15s;
}
.download-btn:hover { background: var(--primary-dark); color: #fff; }

/* Related posts */
.related-section { margin-top: 32px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}
.related-card {
  background: var(--body-bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}
.related-card:hover { background: #eaeef2; }
.related-card h4 {
  font-size: .86rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Comments section */
.comments-section { margin-top: 36px; padding-top: 24px; border-top: 2px solid var(--border-light); }
.comment-form { margin-bottom: 24px; }
.comment-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
  outline: none;
  font-size: .9rem;
  transition: border-color .15s;
}
.comment-form textarea:focus { border-color: var(--primary); }
.comment-form-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.btn-comment {
  padding: 8px 24px;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
  font-size: .86rem;
  transition: background .15s;
}
.btn-comment:hover { background: var(--primary-dark); }

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 28px 0;
}
.page-btn {
  min-width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .85rem;
  color: var(--text-primary);
  background: var(--card-bg);
  transition: all .15s;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.page-btn.disabled { opacity: .4; cursor: not-allowed; }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: #161b22;
  color: #8b949e;
  padding: 36px 0 24px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 28px;
}
.footer-brand h3 {
  color: #e6edf3;
  font-size: 1.15rem;
  margin-bottom: 8px;
}
.footer-brand p { font-size: .84rem; line-height: 1.6; }
.footer-col h4 {
  color: #e6edf3;
  font-size: .9rem;
  margin-bottom: 12px;
}
.footer-col ul li { margin-bottom: 6px; }
.footer-col ul a {
  color: #8b949e;
  font-size: .84rem;
  transition: color .15s;
}
.footer-col ul a:hover { color: #e6edf3; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 18px;
  text-align: center;
  font-size: .8rem;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .84rem;
  color: var(--text-muted);
  padding: 14px 0;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: .4; }

/* ============================================
   FILTER BAR (列表页筛选)
   ============================================ */
.filter-bar {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.filter-label { font-size: .85rem; font-weight: 600; color: var(--text-secondary); }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: .82rem;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.filter-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.filter-search {
  margin-left: auto;
  flex: 1;
  max-width: 240px;
}
.filter-search input {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: .84rem;
  outline: none;
  transition: border-color .15s;
}
.filter-search input:focus { border-color: var(--accent); }

/* ============================================
   LOADING / EMPTY STATES
   ============================================ */
.loading {
  text-align: center;
  padding: 48px 0;
  color: var(--text-muted);
}
.loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state svg { width: 64px; height: 64px; fill: var(--border); margin-bottom: 14px; }
.empty-state p { font-size: .95rem; }

/* ============================================
   ADMIN STYLES
   ============================================ */
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px;
  background: #161b22;
  color: #e6edf3;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.admin-logo {
  padding: 18px 20px;
  font-size: 1.1rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 8px;
}
.admin-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.admin-nav-group { margin-bottom: 8px; }
.admin-nav-label {
  padding: 8px 20px;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #8b949e;
  font-weight: 600;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: #c9d1d9;
  font-size: .88rem;
  text-decoration: none;
  transition: background .1s, color .1s;
  border-left: 3px solid transparent;
}
.admin-nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav-item.active {
  background: rgba(63,185,80,.12);
  color: var(--primary);
  border-left-color: var(--primary);
}
.admin-main { flex: 1; background: var(--body-bg); overflow-y: auto; }
.admin-topbar {
  height: 56px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.admin-topbar h2 { font-size: 1.05rem; font-weight: 600; }
.admin-user { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--text-secondary); }
.admin-content { padding: 24px; }

/* Admin Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.stat-card .stat-label {
  font-size: .84rem;
  color: var(--text-muted);
}
.stat-card.stat-green .stat-value { color: var(--primary-dark); }
.stat-card.stat-blue .stat-value { color: var(--accent); }
.stat-card.stat-red .stat-value { color: #cf222e; }
.stat-card.stat-orange .stat-value { color: #d29922; }

/* Admin Table */
.admin-panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-header h3 { font-size: .98rem; font-weight: 600; }
.panel-actions { display: flex; gap: 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: .84rem;
  font-weight: 500;
  transition: all .15s;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-success { background: var(--primary); color: #fff; }
.btn-success:hover { background: var(--primary-dark); color: #fff; }
.btn-danger { background: #cf222e; color: #fff; }
.btn-danger:hover { background: #a40e26; color: #fff; }
.btn-outline {
  background: #fff;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 5px 12px; font-size: .8rem; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  background: var(--body-bg);
  padding: 10px 14px;
  text-align: left;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table td {
  padding: 12px 14px;
  font-size: .85rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.admin-table tr:hover td { background: rgba(63,185,80,.03); }
.admin-table .thumb-cell img {
  width: 44px; height: 44px;
  border-radius: 6px;
  object-fit: cover;
}
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 5px;
}
.status-dot.published { background: var(--primary); }
.status-dot.draft { background: #d29922; }

/* Admin Form */
.form-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all .2s;
}
.form-modal-overlay.show { opacity: 1; visibility: visible; }
.form-modal {
  background: #fff;
  border-radius: 12px;
  width: 640px;
  max-width: 94vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  transform: scale(.96);
  transition: transform .2s;
}
.form-modal-overlay.show .form-modal { transform: scale(1); }
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 1.05rem; font-weight: 600; }
.modal-close {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: background .1s;
}
.modal-close:hover { background: var(--body-bg); }
.modal-body { padding: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .88rem;
  outline: none;
  transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { min-height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Login Page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #161b22, #24292f);
}
.login-box {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  width: 400px;
  max-width: 94vw;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-box h2 {
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: 24px;
}
.login-box .form-group { margin-bottom: 18px; }
.login-box .btn { width: 100%; justify-content: center; padding: 11px; font-size: .95rem; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  :root { --sidebar-width: 280px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-side { display: none; }
  .deal-grid { grid-template-columns: repeat(3, 1fr); }
  .news-row { grid-template-columns: repeat(3, 1fr); }
  .video-grid { grid-template-columns: repeat(3, 1fr); }
  .main-layout { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
  .detail-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-sidebar { width: 200px; }
}
@media (max-width: 768px) {
  .nav { display: none; }
  .menu-toggle { display: flex; }
  .search-box input { width: 140px; }
  .search-box input:focus { width: 180px; }
  .deal-grid { grid-template-columns: repeat(2, 1fr); }
  .post-grid { grid-template-columns: 1fr; }
  .post-card { flex-direction: column; }
  .post-thumb { width: 100%; height: 180px; }
  .news-row { grid-template-columns: repeat(2, 1fr); }
  .video-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .admin-sidebar { 
    position: fixed; left: -100%; top: 0; bottom: 0; z-index: 1001;
    transition: left .25s;
  }
  .admin-sidebar.open { left: 0; }
}
@media (max-width: 480px) {
  .hero-title { font-size: 1.5rem; }
  .detail-head { padding: 20px 18px 16px; }
  .detail-body { padding: 20px 18px; }
  .detail-title { font-size: 1.3rem; }
}
