/*
Theme Name: SiteGroundWorld 海外建站指南
Theme URI: https://sitegroundworld.com/
Author: 海外建站指南编辑团队
Description: 面向中文建站新手的海外主机评测、SiteGround 教程与 WordPress 建站主题。
Version: 0.1.3
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: sitegroundworld
*/

:root {
  --sgw-ink: #172033;
  --sgw-text: #526071;
  --sgw-muted: #758195;
  --sgw-line: #e5e9f0;
  --sgw-surface: #ffffff;
  --sgw-bg: #f8fafc;
  --sgw-soft: #f3f1ff;
  --sgw-brand: #6656d9;
  --sgw-brand-dark: #5041bf;
  --sgw-success: #178765;
  --sgw-warning: #c66b24;
  --sgw-radius: 18px;
  --sgw-shadow: 0 18px 50px rgba(23, 32, 51, 0.08);
  --sgw-container: 1180px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--sgw-surface);
  color: var(--sgw-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }
a { color: var(--sgw-brand-dark); text-decoration: none; }
a:hover { color: var(--sgw-brand); }
button, input, select, textarea { font: inherit; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.7em;
  color: var(--sgw-ink);
  font-weight: 750;
  line-height: 1.28;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.35rem, 5vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 3.3vw, 3rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); }
p { margin: 0 0 1.25em; }

.container { width: min(calc(100% - 40px), var(--sgw-container)); margin-inline: auto; }
.narrow { width: min(calc(100% - 40px), 780px); margin-inline: auto; }
.section { padding: 96px 0; }
.section--soft { background: var(--sgw-bg); }
.section--tint { background: var(--sgw-soft); }
#plans { scroll-margin-top: 76px; }
.section-heading { max-width: 760px; margin-bottom: 42px; }
.section-heading--center { margin-inline: auto; text-align: center; }
.section-heading p { color: var(--sgw-muted); font-size: 1.08rem; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--sgw-brand-dark);
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 24px; height: 2px; background: currentColor; }

.button,
.wp-block-button__link {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid var(--sgw-brand);
  border-radius: 11px;
  background: var(--sgw-brand);
  color: #fff;
  font-weight: 700;
  line-height: 1.2;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.button:hover,
.wp-block-button__link:hover { color: #fff; background: var(--sgw-brand-dark); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(102,86,217,.22); }
.button--ghost { background: transparent; color: var(--sgw-ink); border-color: var(--sgw-line); }
.button--ghost:hover { color: var(--sgw-brand-dark); background: #fff; border-color: #cfc9fb; box-shadow: none; }
.button--small { min-height: 42px; padding: 9px 16px; font-size: .92rem; }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }

.skip-link { position: fixed; z-index: 9999; top: 10px; left: 10px; transform: translateY(-160%); padding: 10px 14px; background: #fff; color: var(--sgw-ink); border-radius: 8px; box-shadow: var(--sgw-shadow); }
.skip-link:focus { transform: translateY(0); }

.site-header { position: sticky; z-index: 1000; top: 0; background: rgba(255,255,255,.94); border-bottom: 1px solid rgba(229,233,240,.9); backdrop-filter: blur(14px); }
.header-inner { display: flex; min-height: 76px; align-items: center; gap: 28px; }
.site-branding { margin-right: auto; }
.site-branding a { display: flex; align-items: center; gap: 10px; color: var(--sgw-ink); font-size: 1.17rem; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: var(--sgw-brand); color: #fff; font-size: .9rem; }
.custom-logo { display: block; max-height: 42px; width: auto; }
.main-navigation ul { display: flex; align-items: center; gap: 5px; margin: 0; padding: 0; list-style: none; }
.main-navigation a { display: block; padding: 10px 11px; border-radius: 8px; color: var(--sgw-ink); font-size: .94rem; font-weight: 650; }
.main-navigation a:hover,
.main-navigation .current-menu-item > a { background: var(--sgw-soft); color: var(--sgw-brand-dark); }
.menu-toggle { display: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--sgw-line); border-radius: 10px; background: #fff; color: var(--sgw-ink); }
.menu-toggle span { display: block; width: 20px; height: 2px; margin: 4px auto; background: currentColor; }

.hero { position: relative; overflow: hidden; padding: 92px 0 74px; background: linear-gradient(180deg, #fff 0%, #fbfaff 100%); }
.hero::after { content: ""; position: absolute; right: -140px; top: -180px; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(102,86,217,.13), transparent 68%); pointer-events: none; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(340px, .76fr); align-items: center; gap: 76px; }
.hero h1 {
  max-width: 680px;
  font-size: clamp(1.9rem, 3.6vw, 3.5rem);
}
.hero-copy { max-width: 690px; font-size: 1.16rem; color: var(--sgw-text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 20px; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 18px; color: var(--sgw-muted); font-size: .91rem; }
.hero-proof span::before { content: "✓"; margin-right: 6px; color: var(--sgw-success); font-weight: 800; }

.rating-card { padding: 32px; border: 1px solid var(--sgw-line); border-radius: 24px; background: rgba(255,255,255,.92); box-shadow: var(--sgw-shadow); }
.rating-card__top { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 22px; border-bottom: 1px solid var(--sgw-line); }
.rating-card__name { color: var(--sgw-ink); font-size: 1.25rem; font-weight: 800; }
.rating-card__score { color: var(--sgw-ink); font-size: 1.8rem; font-weight: 800; }
.stars { color: #efab32; letter-spacing: 2px; }
.rating-list { margin: 22px 0; padding: 0; list-style: none; }
.rating-list li { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 12px; margin: 12px 0; font-size: .92rem; }
.rating-bar { overflow: hidden; height: 7px; border-radius: 99px; background: #eceff4; }
.rating-bar span { display: block; height: 100%; border-radius: inherit; background: var(--sgw-brand); }
.rating-note { padding: 14px 16px; border-radius: 12px; background: var(--sgw-bg); color: var(--sgw-text); font-size: .91rem; }

.quick-paths { position: relative; z-index: 2; margin-top: -2px; }
.path-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--sgw-line); border-radius: var(--sgw-radius); background: #fff; box-shadow: 0 16px 42px rgba(23,32,51,.06); }
.path-card { position: relative; display: grid; grid-template-columns: 48px 1fr; gap: 14px; padding: 28px; color: var(--sgw-text); }
.path-card + .path-card { border-left: 1px solid var(--sgw-line); }
.path-card:hover { color: var(--sgw-text); background: var(--sgw-bg); }
.path-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 13px; background: var(--sgw-soft); color: var(--sgw-brand-dark); font-weight: 800; }
.path-card strong { display: block; margin-bottom: 3px; color: var(--sgw-ink); }
.path-card small { display: block; color: var(--sgw-muted); line-height: 1.5; }

.fit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.fit-card { padding: 34px; border: 1px solid var(--sgw-line); border-radius: var(--sgw-radius); background: #fff; }
.fit-card--positive { border-top: 4px solid var(--sgw-success); }
.fit-card--warning { border-top: 4px solid var(--sgw-warning); }
.check-list { margin: 20px 0 0; padding: 0; list-style: none; }
.check-list li { position: relative; margin: 13px 0; padding-left: 29px; }
.check-list li::before { position: absolute; left: 0; top: .14em; content: "✓"; color: var(--sgw-success); font-weight: 900; }
.fit-card--warning .check-list li::before { content: "!"; display: grid; top: .33em; width: 17px; height: 17px; place-items: center; border-radius: 50%; background: #fff2e7; color: var(--sgw-warning); font-size: .7rem; }

.pricing-wrap { overflow-x: auto; border: 1px solid var(--sgw-line); border-radius: 22px; background: #fff; box-shadow: 0 16px 44px rgba(23,32,51,.05); }
.pricing-table { width: 100%; min-width: 940px; border-collapse: collapse; }
.pricing-table th,
.pricing-table td { padding: 21px 18px; border-bottom: 1px solid var(--sgw-line); text-align: left; vertical-align: middle; }
.pricing-table thead th { background: var(--sgw-ink); color: #fff; font-size: .88rem; letter-spacing: .02em; }
.pricing-table tbody tr:last-child td { border-bottom: 0; }
.pricing-table tbody tr:hover { background: #fcfcfe; }
.pricing-table .recommended { background: var(--sgw-soft); }
.pricing-table .recommended:hover { background: #ece9ff; }
.plan-name { color: var(--sgw-ink); font-size: 1.1rem; font-weight: 800; }
.plan-badge { display: inline-block; margin-top: 6px; padding: 3px 8px; border-radius: 99px; background: var(--sgw-brand); color: #fff; font-size: .72rem; font-weight: 750; }
.price { color: var(--sgw-ink); font-size: 1.22rem; font-weight: 800; white-space: nowrap; }
.renewal-price { display: block; margin-top: 3px; color: var(--sgw-muted); font-size: .78rem; white-space: nowrap; }
.pricing-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 18px 2px 0; color: var(--sgw-muted); font-size: .84rem; }
.pricing-meta p { margin: 0; }
.mobile-plans { display: none; }
.plan-card { padding: 26px; border: 1px solid var(--sgw-line); border-radius: var(--sgw-radius); background: #fff; }
.plan-card--recommended { border: 2px solid var(--sgw-brand); box-shadow: 0 14px 36px rgba(102,86,217,.12); }
.plan-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.plan-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 20px 0; }
.plan-card dt { color: var(--sgw-muted); }
.plan-card dd { margin: 0; text-align: right; color: var(--sgw-ink); font-weight: 700; }
.plan-card .button { width: 100%; }

.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; counter-reset: steps; }
.step { position: relative; padding: 28px 22px; border: 1px solid var(--sgw-line); border-radius: var(--sgw-radius); background: #fff; counter-increment: steps; }
.step::before { content: counter(steps, decimal-leading-zero); display: block; margin-bottom: 28px; color: var(--sgw-brand); font-size: .83rem; font-weight: 800; letter-spacing: .08em; }
.step h3 { font-size: 1.03rem; }
.step p { margin: 0; color: var(--sgw-muted); font-size: .88rem; line-height: 1.6; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card { overflow: hidden; border: 1px solid var(--sgw-line); border-radius: var(--sgw-radius); background: #fff; transition: transform .2s ease, box-shadow .2s ease; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--sgw-shadow); }
.post-card__image { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, var(--sgw-soft), #edf4ff); }
.post-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.post-card:hover .post-card__image img { transform: scale(1.03); }
.post-card__placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: var(--sgw-brand); font-size: 2rem; font-weight: 800; }
.post-card__body { padding: 24px; }
.post-card__meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; color: var(--sgw-muted); font-size: .78rem; }
.post-card__meta span + span::before { content: "·"; margin-right: 10px; }
.post-card h3 { margin-bottom: 10px; font-size: 1.18rem; }
.post-card h3 a { color: var(--sgw-ink); }
.post-card p { margin: 0 0 16px; color: var(--sgw-muted); font-size: .92rem; line-height: 1.65; }
.section-footer { margin-top: 38px; text-align: center; }

.compare-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.compare-card { padding: 28px; border: 1px solid var(--sgw-line); border-radius: var(--sgw-radius); background: #fff; }
.compare-label { display: inline-block; margin-bottom: 18px; color: var(--sgw-brand-dark); font-size: .78rem; font-weight: 800; }
.compare-card p { color: var(--sgw-muted); font-size: .94rem; }

.faq-list { border-top: 1px solid var(--sgw-line); }
.faq-item { border-bottom: 1px solid var(--sgw-line); }
.faq-question { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 0; border: 0; background: transparent; color: var(--sgw-ink); text-align: left; font-weight: 750; cursor: pointer; }
.faq-question::after { content: "+"; color: var(--sgw-brand); font-size: 1.5rem; font-weight: 400; }
.faq-item.is-open .faq-question::after { content: "−"; }
.faq-answer { display: none; max-width: 820px; padding: 0 0 24px; }
.faq-item.is-open .faq-answer { display: block; }
.faq-answer p:last-child { margin-bottom: 0; }

.cta-panel { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 40px; padding: 54px 60px; border-radius: 28px; background: var(--sgw-ink); color: #dbe1eb; }
.cta-panel h2 { color: #fff; }
.cta-panel p { margin: 0; }

.page-hero { padding: 72px 0 54px; background: var(--sgw-bg); border-bottom: 1px solid var(--sgw-line); }
.page-hero h1 { max-width: 850px; font-size: clamp(2.2rem, 4vw, 3.5rem); }
.archive-description { max-width: 720px; color: var(--sgw-muted); }
.content-layout { display: grid; grid-template-columns: minmax(0, 760px) 280px; justify-content: space-between; gap: 70px; padding: 70px 0 100px; }
.entry-header { margin-bottom: 34px; }
.entry-title { font-size: clamp(2.15rem, 4.5vw, 3.7rem); }
.entry-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--sgw-muted); font-size: .86rem; }
.entry-meta span + span::before { content: "·"; margin-right: 12px; }
.featured-image { overflow: hidden; margin-bottom: 38px; border-radius: 22px; }
.entry-content { color: #3f4a5b; }
.entry-content h2 { margin-top: 2em; font-size: 1.9rem; }
.entry-content h3 { margin-top: 1.7em; }
.entry-content a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.entry-content blockquote { margin: 2em 0; padding: 22px 28px; border-left: 4px solid var(--sgw-brand); background: var(--sgw-soft); color: var(--sgw-ink); }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { padding: 13px; border: 1px solid var(--sgw-line); text-align: left; }
.entry-content th { background: var(--sgw-bg); color: var(--sgw-ink); }
.entry-content img { border-radius: 14px; }
.entry-footer { margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--sgw-line); }
.author-box { display: grid; grid-template-columns: 54px 1fr; gap: 18px; margin-top: 44px; padding: 26px; border-radius: var(--sgw-radius); background: var(--sgw-bg); }
.author-avatar { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 16px; background: var(--sgw-brand); color: #fff; font-weight: 800; }
.author-box p { margin: 5px 0 0; font-size: .9rem; }
.sidebar-card { position: sticky; top: 105px; padding: 24px; border: 1px solid var(--sgw-line); border-radius: var(--sgw-radius); }
.sidebar-card h2 { font-size: 1.08rem; }
.sidebar-card ul { margin: 0; padding: 0; list-style: none; }
.sidebar-card li { margin: 11px 0; }

.posts-wrap { padding: 64px 0 100px; }
.posts-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.pagination { margin-top: 46px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination a, .pagination span { display: grid; min-width: 42px; height: 42px; place-items: center; padding: 0 10px; border: 1px solid var(--sgw-line); border-radius: 9px; }
.pagination .current { border-color: var(--sgw-brand); background: var(--sgw-brand); color: #fff; }
.search-form { display: flex; gap: 8px; }
.search-field { width: 100%; min-height: 46px; padding: 9px 13px; border: 1px solid var(--sgw-line); border-radius: 9px; color: var(--sgw-ink); }
.search-submit { min-height: 46px; padding: 9px 16px; border: 0; border-radius: 9px; background: var(--sgw-brand); color: #fff; font-weight: 700; }
.empty-state { padding: 70px 30px; border: 1px solid var(--sgw-line); border-radius: var(--sgw-radius); background: var(--sgw-bg); text-align: center; }

.site-footer { padding: 72px 0 28px; background: #121a2a; color: #9faabc; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 55px; }
.footer-brand { color: #fff; font-size: 1.28rem; font-weight: 800; }
.footer-about { max-width: 390px; margin-top: 15px; font-size: .92rem; }
.footer-title { margin-bottom: 16px; color: #fff; font-size: .92rem; }
.footer-menu { margin: 0; padding: 0; list-style: none; }
.footer-menu li { margin: 9px 0; }
.site-footer a { color: #b9c2d1; }
.site-footer a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; gap: 30px; margin-top: 52px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.1); font-size: .8rem; }
.footer-bottom p { margin: 0; }

@media (max-width: 1020px) {
  .header-cta { display: none; }
  .menu-toggle { display: block; }
  .main-navigation { position: absolute; top: 76px; left: 0; right: 0; display: none; padding: 12px 20px 22px; border-bottom: 1px solid var(--sgw-line); background: #fff; }
  .main-navigation.is-open { display: block; }
  .main-navigation ul { display: block; }
  .main-navigation a { padding: 12px; }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-copy { max-width: 760px; }
  .rating-card { max-width: 640px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .compare-grid { grid-template-columns: 1fr; }
  .content-layout { grid-template-columns: 1fr; gap: 44px; }
  .sidebar-card { position: static; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
  .footer-grid > div:last-child { grid-column: 2; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .container, .narrow { width: min(calc(100% - 28px), var(--sgw-container)); }
  .section { padding: 70px 0; }
  .hero { padding: 66px 0 52px; }
  .hero-grid { gap: 36px; }
  .hero-actions .button { width: 100%; }
  .rating-card { padding: 24px; }
  .path-grid { grid-template-columns: 1fr; }
  .path-card + .path-card { border-left: 0; border-top: 1px solid var(--sgw-line); }
  .fit-grid { grid-template-columns: 1fr; }
  .pricing-wrap { display: none; }
  .mobile-plans { display: grid; gap: 16px; }
  .steps { grid-template-columns: 1fr; }
  .step { display: grid; grid-template-columns: 42px 1fr; column-gap: 8px; }
  .step::before { margin: 0; }
  .step p { grid-column: 2; }
  .card-grid { grid-template-columns: 1fr; }
  .cta-panel { grid-template-columns: 1fr; padding: 38px 28px; }
  .cta-panel .button { width: 100%; }
  .page-hero { padding: 54px 0 40px; }
  .content-layout { padding: 52px 0 76px; }
  .entry-content { overflow-wrap: anywhere; }
  .entry-content table { display: block; overflow-x: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .footer-grid > div:last-child { grid-column: auto; }
  .footer-bottom { display: block; }
  .footer-bottom p + p { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.screen-reader-text:focus { z-index: 100000; top: 5px; left: 5px; display: block; width: auto; height: auto; padding: 15px 23px 14px; clip: auto; background: #f1f1f1; color: #21759b; font-size: 14px; font-weight: 700; }
