/*
Theme Name: WPS全攻略 Pro
Theme URI: https://wpszh.top/
Author: WPS全攻略
Author URI: https://wpszh.top/
Description: WPS全攻略专业主题：绿色办公风格、内置SEO优化、响应式布局。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: wpszh
*/

/* ============ 基础 ============ */
:root {
  --c-bg: #0a1628;
  --c-bg-2: #0e1d35;
  --c-card: #11223f;
  --c-card-2: #16294b;
  --c-border: rgba(255, 255, 255, 0.08);
  --c-text: #e8eef7;
  --c-muted: #9fb0c8;
  --c-accent: #00b45a;
  --c-accent-2: #2fd47f;
  --c-gold: #f5b942;
  --c-green: #2fd47b;
  --c-red: #ff5c7a;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a {
  color: var(--c-accent-2);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover { color: #7de8b5; }

h1, h2, h3, h4, h5, h6 {
  color: #fff;
  line-height: 1.35;
  margin: 0 0 0.6em;
  font-weight: 700;
}

p { margin: 0 0 1em; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ============ 头部 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 22, 40, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 16px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.site-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.site-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.site-title small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--c-muted);
  letter-spacing: 1px;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.main-nav a {
  display: block;
  padding: 8px 13px;
  border-radius: 8px;
  color: var(--c-text);
  font-size: 14.5px;
  font-weight: 500;
}

.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current-cat > a {
  color: #fff;
  background: rgba(46, 124, 246, 0.18);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--c-border);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 16px;
  cursor: pointer;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search form {
  display: flex;
  align-items: center;
}

.header-search input[type="search"] {
  width: 0;
  padding: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 14px;
  transition: width 0.3s ease, padding 0.3s ease;
}

.header-search.open input[type="search"] {
  width: 180px;
  padding: 7px 10px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.header-search button {
  background: none;
  border: none;
  color: var(--c-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
}

/* ============ 首页 Hero ============ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 84px 0 72px;
  background:
    linear-gradient(rgba(10, 22, 40, 0.86), rgba(10, 22, 40, 0.94)),
    url("https://wpszh.top/wp-content/uploads/2026/08/wpszh-hero.webp") center / cover no-repeat,
  radial-gradient(900px 420px at 78% -10%, rgba(0, 180, 90, 0.32), transparent 60%),
  radial-gradient(700px 380px at 12% 110%, rgba(47, 212, 127, 0.16), transparent 60%),
    linear-gradient(180deg, #0b1830 0%, #0a1628 100%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 40%, #000 30%, transparent 75%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(46, 124, 246, 0.15);
  border: 1px solid rgba(46, 124, 246, 0.35);
  color: #9cc6ff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(30px, 5vw, 50px);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 18px;
}

.hero h1 .grad {
  background: linear-gradient(90deg, var(--c-accent-2), var(--c-accent), #00c8a0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  color: var(--c-muted);
  font-size: 17px;
  max-width: 680px;
  margin: 0 auto 30px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
  color: #fff;
  box-shadow: 0 8px 24px rgba(46, 124, 246, 0.35);
}

.btn-primary:hover { color: #fff; box-shadow: 0 10px 30px rgba(46, 124, 246, 0.5); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
}

.btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 42px;
  margin-top: 46px;
  flex-wrap: wrap;
}

.hero-stat { text-align: center; }

.hero-stat strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.hero-stat span {
  font-size: 13px;
  color: var(--c-muted);
}

/* ============ 通用区块 ============ */
.section {
  padding: 64px 0;
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 40px;
}

.section-head h2 {
  font-size: clamp(24px, 3.4vw, 34px);
  margin-bottom: 10px;
}

.section-head p {
  color: var(--c-muted);
  font-size: 15px;
}

.section-kicker {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--c-accent-2);
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* ============ 栏目卡片 ============ */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.cat-card {
  position: relative;
  display: block;
  background: linear-gradient(160deg, var(--c-card-2), var(--c-card));
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.cat-card::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--card-glow, rgba(46, 124, 246, 0.25)), transparent 70%);
  pointer-events: none;
}

.cat-card:hover {
  transform: translateY(-5px);
  border-color: rgba(46, 124, 246, 0.5);
  box-shadow: var(--shadow);
}

.cat-card .cat-icon {
  width: 54px;
  height: 54px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  margin-bottom: 16px;
  background: rgba(46, 124, 246, 0.16);
}

.cat-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.cat-card p {
  color: var(--c-muted);
  font-size: 13.5px;
  line-height: 1.65;
  margin-bottom: 14px;
}

.cat-card .cat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--c-accent-2);
  font-size: 13px;
  font-weight: 600;
}

.cat-card .cat-count {
  color: var(--c-muted);
  font-weight: 400;
  font-size: 12px;
}

/* ============ 文章卡片 ============ */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-color: rgba(46, 124, 246, 0.45);
}

.post-card .thumb {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--c-card-2);
}

.post-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.post-card:hover .thumb img { transform: scale(1.05); }

.post-card .card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px 20px 18px;
}

.post-card .cat-label {
  display: inline-block;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-accent-2);
  background: rgba(55, 200, 245, 0.1);
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 12px;
}

.post-card h3 {
  font-size: 16.5px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.post-card h3 a { color: #fff; }
.post-card h3 a:hover { color: var(--c-accent-2); }

.post-card .excerpt {
  color: var(--c-muted);
  font-size: 13.5px;
  line-height: 1.65;
  flex: 1;
}

.post-card .card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--c-border);
  color: var(--c-muted);
  font-size: 12.5px;
}

.section-more {
  text-align: center;
  margin-top: 36px;
}

/* ============ 特色区块 ============ */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.feature-item {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 26px 22px;
  text-align: center;
}

.feature-item .feat-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: rgba(46, 124, 246, 0.14);
}

.feature-item h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.feature-item p {
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.65;
  margin: 0;
}

/* ============ CTA ============ */
.cta-banner {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  padding: 56px 40px;
  text-align: center;
  background:
    radial-gradient(600px 300px at 15% 0%, rgba(46, 124, 246, 0.4), transparent 60%),
    linear-gradient(135deg, #123a75 0%, #0e2350 55%, #0c1a36 100%);
  border: 1px solid rgba(46, 124, 246, 0.3);
}

.cta-banner h2 {
  font-size: clamp(22px, 3vw, 32px);
  margin-bottom: 12px;
}

.cta-banner p {
  color: #b9c8dd;
  max-width: 620px;
  margin: 0 auto 26px;
}

/* ============ 面包屑 ============ */
.breadcrumbs {
  font-size: 13px;
  color: var(--c-muted);
  margin-bottom: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumbs a { color: var(--c-muted); }
.breadcrumbs a:hover { color: var(--c-accent-2); }
.breadcrumbs .sep { margin: 0 8px; color: #44566f; }
.breadcrumbs .current { color: var(--c-accent-2); }

/* ============ 文章列表页 / 栏目页 ============ */
.archive-hero {
  background:
    radial-gradient(700px 300px at 85% 0%, rgba(46, 124, 246, 0.28), transparent 60%),
    linear-gradient(180deg, #0d1c37, var(--c-bg));
  border-bottom: 1px solid var(--c-border);
  padding: 44px 0 36px;
}

.archive-hero h1 {
  font-size: clamp(26px, 4vw, 36px);
  margin-bottom: 10px;
}

.archive-hero .archive-desc {
  color: var(--c-muted);
  max-width: 760px;
  font-size: 15px;
}

.archive-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.archive-keywords span {
  font-size: 12px;
  color: var(--c-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: 3px 12px;
}

/* ============ 单篇文章 ============ */
.single-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 36px 20px 64px;
}

.single-head h1 {
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.35;
  margin-bottom: 16px;
}

.single-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--c-muted);
  font-size: 13.5px;
  padding-bottom: 20px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--c-border);
}

.single-meta a { color: var(--c-accent-2); }

.featured-image {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
  border: 1px solid var(--c-border);
}

.entry-content {
  font-size: 16.5px;
  line-height: 1.9;
  color: #d7e1ef;
}

.entry-content h2 {
  font-size: 24px;
  margin-top: 42px;
  padding-left: 14px;
  border-left: 4px solid var(--c-accent);
}

.entry-content h3 {
  font-size: 19px;
  margin-top: 30px;
  color: #cfe3ff;
}

.entry-content p { margin-bottom: 1.1em; }

.entry-content ul,
.entry-content ol {
  padding-left: 1.4em;
  margin-bottom: 1.2em;
}

.entry-content li { margin-bottom: 0.5em; }

.entry-content img {
  border-radius: 10px;
  border: 1px solid var(--c-border);
  margin: 10px 0;
}

.entry-content blockquote {
  margin: 1.4em 0;
  padding: 14px 20px;
  border-left: 4px solid var(--c-gold);
  background: rgba(245, 185, 66, 0.08);
  border-radius: 0 10px 10px 0;
  color: #e8d9b4;
}

.entry-content code {
  background: rgba(46, 124, 246, 0.12);
  color: #9cc6ff;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.92em;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 14.5px;
}

.entry-content th,
.entry-content td {
  border: 1px solid var(--c-border);
  padding: 10px 12px;
  text-align: left;
}

.entry-content th {
  background: var(--c-card-2);
  color: #fff;
}

.tag-list {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list a {
  font-size: 12.5px;
  color: var(--c-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: 4px 13px;
}

.tag-list a:hover { color: #fff; border-color: var(--c-accent); }

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 40px;
}

.post-nav a {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--c-muted);
}

.post-nav a:hover { border-color: var(--c-accent); color: #fff; }
.post-nav .next { text-align: right; }

.related-posts {
  margin-top: 46px;
  padding-top: 34px;
  border-top: 1px solid var(--c-border);
}

.related-posts h2 {
  font-size: 20px;
  margin-bottom: 20px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.related-item {
  display: block;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  overflow: hidden;
}

.related-item img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
}

.related-item .rel-title {
  display: block;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #d7e1ef;
}

.related-item:hover .rel-title { color: var(--c-accent-2); }

/* ============ 分页 ============ */
.pagination {
  margin: 44px 0 10px;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  color: var(--c-muted);
  font-size: 14px;
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
}

/* ============ 页脚 ============ */
.site-footer {
  background: #070f1d;
  border-top: 1px solid var(--c-border);
  margin-top: 40px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 36px;
  padding: 52px 0 36px;
}

.footer-col h3 {
  font-size: 15px;
  margin-bottom: 16px;
  color: #fff;
}

.footer-col p {
  color: var(--c-muted);
  font-size: 13.5px;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li { margin-bottom: 9px; }

.footer-col a {
  color: var(--c-muted);
  font-size: 13.5px;
}

.footer-col a:hover { color: var(--c-accent-2); }

.footer-bottom {
  border-top: 1px solid var(--c-border);
  padding: 20px 0;
  text-align: center;
  color: #55688a;
  font-size: 13px;
}

.footer-bottom a { color: #7789a8; }

/* ============ 搜索/404 ============ */
.page-box {
  max-width: 720px;
  margin: 40px auto 80px;
  text-align: center;
  padding: 60px 24px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}

.page-box h1 { font-size: 30px; }

.page-box form {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.page-box input[type="search"] {
  width: 300px;
  max-width: 80%;
  padding: 11px 16px;
  border-radius: 8px;
  border: 1px solid var(--c-border);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 14px;
}

.page-box button {
  padding: 11px 22px;
  border: none;
  border-radius: 8px;
  background: var(--c-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.empty-state {
  text-align: center;
  color: var(--c-muted);
  padding: 60px 20px;
}

/* ============ 响应式 ============ */
@media (max-width: 1024px) {
  .cat-grid,
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .main-nav {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    background: #0b1830;
    border-bottom: 1px solid var(--c-border);
    padding: 12px 20px 18px;
    transform: translateY(-120%);
    transition: transform 0.25s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  }

  .main-nav.open { transform: translateY(0); }

  .main-nav ul {
    flex-direction: column;
    gap: 2px;
  }

  .main-nav a { padding: 10px 12px; }

  .nav-toggle { display: block; }

  .hero { padding: 58px 0 48px; }
  .hero-stats { gap: 24px; }
  .cat-grid,
  .post-grid,
  .feature-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 26px; }
  .post-nav { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .cta-banner { padding: 40px 22px; }
  .section { padding: 44px 0; }
}
