/* === 时间线风 Main Styles === */

/* --- Header --- */
.site-header {
  background: #27ae60;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  
}
.header-top {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.site-branding .site-title {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
}
.site-branding .site-title:hover {
  opacity: .9;
}
.header-search {
  max-width: 400px;
  flex: 1;
}
.search-form {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,.15);
}
.search-field {
  flex: 1;
  border: none;
  padding: 8px 14px;
  background: transparent;
  color: #fff;
  font-size: .9rem;
}
.search-field::placeholder { color: rgba(255,255,255,.6); }
.search-submit {
  border: none;
  padding: 8px 14px;
  background: #f39c12;
  color: #fff;
  cursor: pointer;
  transition: background .2s;
}
.search-submit:hover { background: #219a52; }

/* --- Navigation --- */
.main-nav {
  background: #219a52;
  
}
.nav-list {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 0;
}
.nav-list > li > a {
  display: block;
  padding: 10px 18px;
  color: #fff;
  font-size: .9rem;
  text-decoration: none;
  transition: background .2s;
  
}
.nav-list > li > a:hover,
.nav-list > li.current-menu-item > a {
  background: rgba(255,255,255,.15);
}

/* --- Side Navigation (dl-split) --- */
.side-navigation {
  position: fixed;
  left: 0;
  top: 56px;
  width: 0;
  height: calc(100vh - 56px);
  background: #ffffff;
  border-right: 1px solid #d5f5e3;
  overflow-y: auto;
  padding: 20px 0;
}
.side-nav-list a {
  display: block;
  padding: 10px 24px;
  color: #2c3e50;
  font-size: .9rem;
  transition: background .2s;
}
.side-nav-list a:hover,
.side-nav-list .current-menu-item > a {
  background: #27ae60;
  color: #fff;
}
.split-layout {
  display: flex;
  margin-top: 56px;
}
.split-content {
  margin-left: 0;
  flex: 1;
  padding: 24px;
}

/* --- Pill nav variant --- */
.pill-list {
  display: flex;
  gap: 8px;
  padding: 10px 0;
  flex-wrap: wrap;
}
.pill-list > li > a {
  display: block;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: .85rem;
}
.pill-list > li > a:hover,
.pill-list > li.current-menu-item > a {
  background: #f39c12;
}

/* --- Layout --- */
.content-with-sidebar {
  display: flex;
  gap: 30px;
  padding: 30px 20px;
  max-width: 900px;
  margin: 0 auto;
}
.content-area {
  flex: 1;
  min-width: 0;
}
.sidebar {
  width: 0;
  flex-shrink: 0;
}
.content-full {
  padding: 30px 20px;
  max-width: 900px;
  margin: 0 auto;
}

/* --- Sections --- */
.section {
  padding: 40px 0;
}
.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 3px solid #27ae60;
  color: #2c3e50;
}

/* --- Post Grid --- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 0;
}

/* --- Post Card --- */
.post-card {
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: transform .2s, box-shadow .2s;
  background: #ffffff; color: #2c3e50;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.card-thumb {
  display: block;
  overflow: hidden;
  aspect-ratio: 4/3;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.post-card:hover .card-thumb img {
  transform: scale(1.05);
}
.card-body {
  padding: 16px;
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}
.card-title a {
  color: #2c3e50;
  text-decoration: none;
}
.card-title a:hover {
  color: #27ae60;
}
.card-excerpt {
  font-size: .85rem;
  color: #7f8c8d;
  line-height: 1.5;
}
.card-meta {
  font-size: .8rem;
  color: #7f8c8d;
  margin-bottom: 8px;
}
.card-date {
  font-size: .8rem;
  color: #7f8c8d;
}

/* --- Category Grid --- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 0;
}
.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  text-decoration: none;
  transition: transform .2s;
  background: #ffffff; color: #2c3e50;
}
.category-item:hover {
  transform: translateY(-2px);
}
.cat-name {
  font-weight: 600;
  color: #2c3e50;
  font-size: .95rem;
}
.cat-count {
  font-size: .8rem;
  color: #7f8c8d;
  margin-top: 4px;
}

/* --- Top List --- */
.top-list {
  list-style: none;
  counter-reset: rank;
}
.top-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #d5f5e3;
  gap: 12px;
}
.top-rank {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #27ae60;
  color: #fff;
  border-radius: 50%;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* --- Hero Slider --- */
.hero-slider {
  position: relative;
  background: #219a52;
  overflow: hidden;
}
.swiper-wrapper {
  display: flex;
  transition: transform .5s ease;
}
.swiper-slide {
  min-width: 100%;
}
.slide-content {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 40px 20px;
  color: #fff;
}
.slide-image {
  flex-shrink: 0;
  width: 320px;
  border-radius: 8px;
  overflow: hidden;
}
.slide-text {
  flex: 1;
}
.slide-title {
  font-size: 1.8rem;
  margin-bottom: 12px;
}
.slide-title a { color: #fff; }
.slide-excerpt {
  opacity: .8;
  margin-bottom: 20px;
  line-height: 1.6;
}
.swiper-pagination {
  text-align: center;
  padding: 16px;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  border: none;
}
.btn-primary {
  background: #27ae60;
  color: #fff;
}
.btn-primary:hover {
  background: #219a52;
  color: #fff;
}
.btn-sm {
  padding: 6px 16px;
  font-size: .85rem;
}

/* --- Sidebar Widgets --- */
.widget {
  background: #ffffff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  background: #ffffff; color: #2c3e50;
}
.widget-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #27ae60;
}

/* --- Footer --- */
.site-footer {
  background: #219a52;
  color: rgba(255,255,255,.8);
  margin-top: 40px;
  
}
.footer-widgets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  padding: 40px 20px;
}
.footer-widget-title {
  color: #fff;
  margin-bottom: 12px;
  font-size: 1rem;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 20px;
  text-align: center;
  font-size: .85rem;
}
.copyright { margin-bottom: 8px; }
.copyright a { color: #fff; }
.footer-nav ul {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-nav a { color: rgba(255,255,255,.7); font-size: .85rem; }
.footer-nav a:hover { color: #fff; }

/* --- Single Post --- */
/* .single-post 在 WordPress 中会被 body_class() 添加到 <body>，
   导致 body 自身带 padding/radius/shadow，阻斷全宽铺满。
   改为 body:not(.dl-master-theme) 限制，仅非 master 主题生效 */
body:not(.dl-master-theme).single-post {
  background: #ffffff;
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  color: #2c3e50;
}
.entry-title {
  font-size: 1.8rem;
  margin-bottom: 12px;
}
.entry-meta {
  color: #7f8c8d;
  font-size: .85rem;
  margin-bottom: 20px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.post-thumbnail {
  margin-bottom: 20px;
  border-radius: 8px;
  overflow: hidden;
}
.entry-content {
  line-height: 1.8;
  font-size: 1rem;
}
.entry-content h2,
.entry-content h3 {
  margin: 24px 0 12px;
}
.entry-content p {
  margin-bottom: 16px;
}
.entry-content img {
  border-radius: 8px;
}
.tag-links {
  margin-top: 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tag-links a {
  padding: 4px 12px;
  background: #f7fdf9;
  border-radius: 8px;
  font-size: .8rem;
  color: #7f8c8d;
}

/* --- 404 --- */
.error-title {
  font-size: 6rem;
  color: #27ae60;
  font-weight: 900;
}
.error-message {
  font-size: 1.2rem;
  margin: 16px 0 30px;
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #27ae60;
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all .3s;
  z-index: 999;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover {
  background: #219a52;
}

/* --- Archive --- */
.archive-header {
  margin-bottom: 30px;
}
.archive-title {
  font-size: 1.6rem;
}

/* --- Glass Theme Overrides --- */

.timeline { position: relative; padding-left: 40px; }
.timeline::before { content: ''; position: absolute; left: 18px; top: 0; bottom: 0; width: 2px; background: var(--color-primary); }
.timeline-entry { position: relative; margin-bottom: 30px; }
.timeline-entry::before { content: ''; position: absolute; left: -30px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--color-primary); border: 2px solid #fff; }

/* === Responsive === */

/* Tablet */
@media (max-width: 1024px) {
  .content-with-sidebar {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
  }
  .post-grid,
  .category-grid {
    grid-template-columns: repeat(1, 1fr);
  }
  .footer-widgets {
    grid-template-columns: repeat(2, 1fr);
  }
  .side-navigation {
    display: none;
  }
  .split-content {
    margin-left: 0;
  }
  .slide-image {
    width: 200px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    gap: 12px;
  }
  .header-search {
    max-width: 100%;
    width: 100%;
  }
  .nav-list {
    flex-wrap: wrap;
    justify-content: center;
  }
  .nav-list > li > a {
    padding: 8px 12px;
    font-size: .85rem;
  }
  .post-grid,
  .category-grid {
    grid-template-columns: repeat(1, 1fr);
  }
  .slide-content {
    flex-direction: column;
    text-align: center;
  }
  .slide-image {
    width: 100%;
    max-width: 280px;
  }
  .slide-title {
    font-size: 1.3rem;
  }
  .section {
    padding: 24px 0;
  }
  .section-title {
    font-size: 1.2rem;
  }
  .footer-widgets {
    grid-template-columns: 1fr;
  }
  .entry-title {
    font-size: 1.4rem;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .post-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }
  .pill-list {
    gap: 4px;
  }
  .pill-list > li > a {
    padding: 4px 10px;
    font-size: .8rem;
  }
  body:not(.dl-master-theme).single-post {
    padding: 16px;
  }
  .top-item {
    padding: 8px 0;
  }
}

/* === SEO: Breadcrumb === */
.breadcrumb {
  padding: 12px 0;
  font-size: .85rem;
  color: var(--color-text-secondary);
}
.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.breadcrumb-list li {
  display: inline;
}
.breadcrumb-list a {
  color: var(--color-primary);
  text-decoration: none;
}
.breadcrumb-list a:hover {
  text-decoration: underline;
}
.breadcrumb-list .sep {
  color: var(--color-text-secondary);
  margin: 0 2px;
}

/* === SEO: Related Posts === */
.related-posts {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid var(--color-border);
}
.related-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.related-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.related-thumb {
  flex-shrink: 0;
  width: 60px;
  height: 45px;
  border-radius: var(--radius);
  overflow: hidden;
}
.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.related-name {
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.3;
}
.related-name a {
  color: var(--color-text);
  text-decoration: none;
}
.related-name a:hover {
  color: var(--color-primary);
}
.related-body time {
  font-size: .75rem;
  color: var(--color-text-secondary);
}

/* === SEO: sr-only H1 on front page === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === SEO: dateModified hidden === */
.date-modified {
  display: none;
}

/* === Performance: focus styles for accessibility === */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* === Mobile: font readability SEO === */
@media (max-width: 768px) {
  .entry-content {
    font-size: 1rem;
    line-height: 1.8;
  }
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .breadcrumb-list {
    font-size: .8rem;
  }
}

@media (max-width: 480px) {
  .related-grid {
    grid-template-columns: 1fr;
  }
  .entry-content {
    line-height: 1.9;
  }
}

/* ========== 下载站专用样式（由 upgrade_dl_themes.py 注入） ========== */

/* App 详情页整体 */
.dl-single-wrap { display: grid; grid-template-columns: 1fr 280px; gap: 24px; padding: 24px 0; }
@media (max-width: 900px) { .dl-single-wrap { grid-template-columns: 1fr; } }

/* App 头部 */
.dl-app-header {
  display: flex; gap: 20px; align-items: flex-start;
  background: #fff; border-radius: 12px;
  padding: 24px; margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.dl-app-icon { flex-shrink: 0; }
.app-icon-img { width: 80px; height: 80px; border-radius: 16px; object-fit: cover; }
.dl-icon-placeholder {
  width: 80px; height: 80px; border-radius: 16px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  display: flex; align-items: center; justify-content: center;
}
.dl-icon-placeholder span { color: #fff; font-size: 2rem; font-weight: 700; }
.dl-app-info { flex: 1; min-width: 0; }
.dl-app-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; line-height: 1.3; }

/* Badges */
.dl-app-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.dl-badge { font-size: .75rem; padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.dl-badge-noad     { background: #e8f5e9; color: #2e7d32; }
.dl-badge-safe     { background: #e3f2fd; color: #1565c0; }
.dl-badge-official { background: #fff3e0; color: #e65100; }

/* Meta row */
.dl-app-meta-row { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 16px; font-size: .875rem; color: #5f6368; }
.dl-meta-item strong { color: #202124; }

/* 下载按钮 */
.dl-btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.dl-download-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 28px; border-radius: 8px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  text-decoration: none; border: none;
}
.dl-download-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.dl-btn-primary  { background: #00b341; color: #fff; }
.dl-btn-primary:hover  { background: #009d39; color: #fff; }
.dl-btn-secondary { background: #1a73e8; color: #fff; }
.dl-btn-secondary:hover { background: #1557b0; color: #fff; }

/* iOS 提示（默认隐藏，JS 控制） */
.dl-ios-tip { display: none; color: #e53935; font-size: .8rem; margin-top: 4px; }

/* 正文区 */
.dl-app-body { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.dl-entry-content h2 { font-size: 1.15rem; color: var(--color-primary); margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--color-primary); }
.dl-entry-content h3 { font-size: 1rem; color: #202124; margin: 16px 0 8px; }
.dl-entry-content p  { line-height: 1.8; margin-bottom: 12px; color: #3c4043; }
.dl-entry-content ol, .dl-entry-content ul { padding-left: 1.4em; margin-bottom: 12px; }
.dl-entry-content li { line-height: 1.8; margin-bottom: 4px; }

/* 列表页卡片下载按钮 */
.card-dl-btn {
  display: block; width: 100%; text-align: center;
  padding: 7px 0; border-radius: 6px;
  background: #00b341; color: #fff; font-size: .85rem; font-weight: 600;
  margin-top: 8px; transition: background .2s; text-decoration: none;
}
.card-dl-btn:hover { background: #009d39; color: #fff; }

@media (max-width: 600px) {
  .dl-app-header { flex-direction: column; }
  .dl-app-title { font-size: 1.2rem; }
  .dl-download-btn { padding: 11px 20px; font-size: .9rem; }
}
/* ========== 侧边栏统一模块 ========== */
.dl-sidebar { }
.front-sidebar { }
.dl-sidebar-section {
  background: var(--color-surface, #fff);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.dl-sidebar-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-primary, #27ae60);
  color: var(--color-text, #2c3e50);
}
.dl-sidebar-list { list-style: none; padding: 0; margin: 0; }
.dl-sidebar-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border, #eee);
  font-size: .92rem;
}
.dl-sidebar-list li:last-child { border-bottom: 0; }
.dl-sidebar-list a { color: var(--color-text, #2c3e50); }
.dl-sidebar-list a:hover { color: var(--color-primary, #27ae60); }
.dl-tag-cloud { line-height: 1.8; }
.dl-tag-cloud a {
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 4px 10px;
  background: var(--color-bg, #f7fdf9);
  border-radius: 20px;
  font-size: .85rem !important;
  color: var(--color-text-secondary, #7f8c8d);
}
.dl-tag-cloud a:hover { background: var(--color-primary, #27ae60); color: #fff; }

/* ========== END 下载站专用样式 ========== */
