/*
Theme Name: 风淘社办公资源主题
Theme URI: https://www.fengtaoshe.com/
Author: 风淘社
Author URI: https://www.fengtaoshe.com/
Description: 为办公模板、Excel表格与实用工具下载站设计的轻量 WordPress 主题，兼顾资源展示、搜索体验与 SEO 内容结构。
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: fengtao-office
*/

:root {
  --fts-primary: #246bfd;
  --fts-primary-dark: #174fc9;
  --fts-ink: #172033;
  --fts-muted: #667085;
  --fts-line: #e8edf4;
  --fts-soft: #f5f8fc;
  --fts-white: #fff;
  --fts-green: #12a36d;
  --fts-orange: #f79009;
  --fts-radius: 14px;
  --fts-shadow: 0 12px 32px rgba(23, 32, 51, .07);
  --fts-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--fts-ink);
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--fts-primary); text-decoration: none; }
a:hover { color: var(--fts-primary-dark); }
button, input, select, textarea { font: inherit; }
.container { width: min(calc(100% - 40px), var(--fts-width)); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { top: 8px; left: 8px; z-index: 9999; width: auto; height: auto; padding: 10px 14px; clip: auto; background: #fff; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--fts-line); backdrop-filter: blur(12px); }
.admin-bar .site-header { top: 32px; }
.header-inner { min-height: 70px; display: flex; align-items: center; gap: 28px; }
.site-branding { flex: 0 0 auto; }
.site-logo, .custom-logo-link { display: inline-flex; align-items: center; }
.custom-logo { max-height: 44px; width: auto; }
.site-title { margin: 0; font-size: 25px; font-weight: 800; letter-spacing: -.5px; color: var(--fts-ink); }
.site-title-mark { color: var(--fts-primary); }
.site-tagline { display: none; }
.main-navigation { margin-left: auto; }
.main-navigation ul { display: flex; align-items: center; gap: 6px; padding: 0; margin: 0; list-style: none; }
.main-navigation a { display: block; padding: 10px 13px; color: #344054; font-size: 15px; font-weight: 600; border-radius: 9px; }
.main-navigation a:hover, .main-navigation .current-menu-item > a, .main-navigation .current-menu-ancestor > a { color: var(--fts-primary); background: #eef4ff; }
.header-search-btn, .menu-toggle { border: 0; background: transparent; color: var(--fts-ink); cursor: pointer; border-radius: 9px; padding: 9px; display: inline-flex; }
.header-search-btn:hover, .menu-toggle:hover { background: var(--fts-soft); color: var(--fts-primary); }
.menu-toggle { display: none; }
.header-search { display: none; padding: 12px 0 18px; border-top: 1px solid var(--fts-line); }
.header-search.is-open { display: block; }

/* Forms */
.search-form { display: flex; width: 100%; gap: 10px; }
.search-field { min-width: 0; flex: 1; height: 48px; padding: 0 16px; color: var(--fts-ink); background: #fff; border: 1px solid #d7deea; border-radius: 10px; outline: 0; }
.search-field:focus { border-color: var(--fts-primary); box-shadow: 0 0 0 3px rgba(36,107,253,.12); }
.search-submit, .button, .wp-block-button__link { display: inline-flex; justify-content: center; align-items: center; min-height: 46px; padding: 0 22px; border: 0; border-radius: 10px; color: #fff; background: var(--fts-primary); font-weight: 700; cursor: pointer; transition: .2s ease; }
.search-submit:hover, .button:hover, .wp-block-button__link:hover { color: #fff; background: var(--fts-primary-dark); transform: translateY(-1px); }
.button-secondary { color: var(--fts-primary); background: #eef4ff; }
.button-secondary:hover { color: #fff; background: var(--fts-primary); }

/* Home */
.home-hero { padding: 76px 0 62px; text-align: center; background: linear-gradient(180deg, #f5f9ff 0%, #fff 100%); }
.home-hero h1 { max-width: 800px; margin: 0 auto 14px; font-size: clamp(32px, 5vw, 48px); line-height: 1.25; letter-spacing: -1.5px; }
.home-hero p { max-width: 680px; margin: 0 auto 30px; color: var(--fts-muted); font-size: 18px; }
.hero-search { max-width: 720px; margin: 0 auto; padding: 8px; background: #fff; border: 1px solid var(--fts-line); border-radius: 14px; box-shadow: var(--fts-shadow); }
.hero-search .search-field { height: 54px; border: 0; }
.hero-search .search-submit { min-width: 112px; min-height: 54px; }
.hot-searches { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 18px; color: #98a2b3; font-size: 14px; }
.hot-searches a { color: var(--fts-muted); }
.hot-searches a:hover { color: var(--fts-primary); }
.section { padding: 58px 0; }
.section-soft { background: var(--fts-soft); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-title { margin: 0; font-size: 28px; line-height: 1.3; letter-spacing: -.5px; }
.section-desc { margin: 7px 0 0; color: var(--fts-muted); }
.section-more { white-space: nowrap; font-weight: 600; }
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.category-tile { position: relative; min-height: 172px; padding: 28px; overflow: hidden; color: var(--fts-ink); background: #fff; border: 1px solid var(--fts-line); border-radius: var(--fts-radius); box-shadow: 0 5px 20px rgba(23,32,51,.04); transition: .25s ease; }
.category-tile:hover { color: var(--fts-ink); border-color: #bcd0ff; transform: translateY(-4px); box-shadow: var(--fts-shadow); }
.category-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 18px; color: var(--fts-primary); background: #eef4ff; border-radius: 12px; }
.category-tile:nth-child(2) .category-icon { color: var(--fts-green); background: #eafaf4; }
.category-tile:nth-child(3) .category-icon { color: var(--fts-orange); background: #fff6e8; }
.category-tile h2 { margin: 0 0 7px; font-size: 21px; }
.category-tile p { max-width: 290px; margin: 0; color: var(--fts-muted); font-size: 14px; line-height: 1.65; }
.category-arrow { position: absolute; right: 24px; top: 28px; color: #98a2b3; }

/* Cards */
.resource-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.resource-card { min-width: 0; overflow: hidden; background: #fff; border: 1px solid var(--fts-line); border-radius: var(--fts-radius); transition: .25s ease; }
.resource-card:hover { transform: translateY(-4px); border-color: #d1dcf1; box-shadow: var(--fts-shadow); }
.resource-cover { position: relative; display: block; aspect-ratio: 16/10; overflow: hidden; background: #edf2f8; }
.resource-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.resource-card:hover .resource-cover img { transform: scale(1.035); }
.resource-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: #9aa8ba; background: linear-gradient(135deg, #eef4ff, #f6f8fb); }
.resource-badge { position: absolute; left: 12px; top: 12px; z-index: 2; padding: 4px 9px; border-radius: 6px; color: #fff; background: var(--fts-green); font-size: 12px; font-weight: 700; line-height: 1.4; }
.resource-badge.vip { background: var(--fts-orange); }
.resource-badge.paid { background: #ec4899; }
.resource-body { padding: 17px 17px 18px; }
.resource-cat { display: inline-block; margin-bottom: 7px; color: var(--fts-primary); font-size: 13px; }
.resource-title { display: -webkit-box; min-height: 48px; margin: 0 0 13px; overflow: hidden; color: var(--fts-ink); font-size: 16px; line-height: 1.5; font-weight: 700; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.resource-title a { color: inherit; }
.resource-title a:hover { color: var(--fts-primary); }
.resource-meta { display: flex; justify-content: space-between; gap: 10px; color: #98a2b3; font-size: 12px; }
.empty-state { grid-column: 1/-1; padding: 54px 24px; text-align: center; background: var(--fts-soft); border-radius: var(--fts-radius); }

/* Archive */
.page-banner { padding: 46px 0 34px; background: var(--fts-soft); border-bottom: 1px solid var(--fts-line); }
.breadcrumbs { margin: 0 0 13px; color: #98a2b3; font-size: 13px; }
.breadcrumbs a { color: var(--fts-muted); }
.breadcrumbs .sep { padding: 0 7px; }
.archive-title, .page-title { margin: 0; font-size: clamp(28px, 4vw, 38px); line-height: 1.3; }
.archive-description { max-width: 850px; margin-top: 15px; color: var(--fts-muted); }
.archive-description p { margin: 0; }
.archive-tools { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.archive-count { color: var(--fts-muted); font-size: 14px; }
.archive-search { max-width: 340px; }

/* Single */
.single-main { padding: 36px 0 68px; }
.single-layout { display: grid; grid-template-columns: minmax(0, 800px) 300px; align-items: start; justify-content: space-between; gap: 42px; }
.article-header { margin-bottom: 25px; }
.entry-title { margin: 0 0 14px; font-size: clamp(28px, 4vw, 40px); line-height: 1.35; letter-spacing: -.6px; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: #98a2b3; font-size: 13px; }
.entry-summary { margin: 22px 0; padding: 18px 20px; color: #475467; background: #f7f9fc; border-left: 4px solid var(--fts-primary); border-radius: 0 10px 10px 0; }
.article-cover { margin: 0 0 28px; overflow: hidden; border-radius: 12px; }
.entry-content { color: #303b50; font-size: 17px; line-height: 1.9; overflow-wrap: anywhere; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2 { margin: 42px 0 16px; padding-bottom: 10px; color: var(--fts-ink); font-size: 26px; line-height: 1.4; border-bottom: 1px solid var(--fts-line); }
.entry-content h3 { margin: 30px 0 12px; color: var(--fts-ink); font-size: 21px; }
.entry-content p { margin: 0 0 20px; }
.entry-content ul, .entry-content ol { padding-left: 24px; }
.entry-content img { border-radius: 8px; }
.entry-content blockquote { margin: 26px 0; padding: 15px 20px; color: #475467; background: var(--fts-soft); border-left: 4px solid #a9c1f8; }
.entry-content table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { padding: 10px 12px; border: 1px solid var(--fts-line); }
.entry-content th { background: var(--fts-soft); }
.resource-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 22px 0 30px; overflow: hidden; border: 1px solid var(--fts-line); border-radius: 12px; }
.resource-fact { padding: 15px 17px; border-right: 1px solid var(--fts-line); }
.resource-fact:last-child { border-right: 0; }
.resource-fact span { display: block; color: #98a2b3; font-size: 12px; }
.resource-fact strong { display: block; margin-top: 3px; color: #344054; font-size: 14px; overflow-wrap: anywhere; }
.download-box { margin-top: 42px; padding: 26px; background: #f5f9ff; border: 1px solid #cddcff; border-radius: var(--fts-radius); }
.download-box h2 { margin: 0 0 6px; font-size: 24px; }
.download-box-note { margin: 0 0 20px; color: var(--fts-muted); }
.download-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; padding: 16px 0; margin-bottom: 18px; border-top: 1px solid #dbe6ff; border-bottom: 1px solid #dbe6ff; font-size: 14px; }
.download-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.extract-code { padding: 11px 14px; color: #344054; background: #fff; border: 1px dashed #b9c9eb; border-radius: 9px; font-size: 14px; }
.article-notice { margin-top: 30px; padding: 15px 17px; color: var(--fts-muted); background: #fafafa; border: 1px solid var(--fts-line); border-radius: 9px; font-size: 13px; }
.post-tags { margin-top: 24px; color: var(--fts-muted); font-size: 14px; }
.post-tags a { display: inline-block; margin: 4px 5px 4px 0; padding: 4px 10px; color: var(--fts-muted); background: var(--fts-soft); border-radius: 6px; }
.single-sidebar { position: sticky; top: 98px; }
.side-card { padding: 22px; background: #fff; border: 1px solid var(--fts-line); border-radius: var(--fts-radius); box-shadow: 0 6px 22px rgba(23,32,51,.04); }
.side-card h2 { margin: 0 0 16px; font-size: 18px; }
.side-facts { padding: 0; margin: 0 0 18px; list-style: none; }
.side-facts li { display: flex; justify-content: space-between; gap: 15px; padding: 9px 0; border-bottom: 1px dashed var(--fts-line); color: var(--fts-muted); font-size: 13px; }
.side-facts li strong { color: #344054; text-align: right; overflow-wrap: anywhere; }
.side-card .button { width: 100%; }
.side-card-help { margin: 12px 0 0; color: #98a2b3; text-align: center; font-size: 12px; }
.related-section { margin-top: 54px; padding-top: 34px; border-top: 1px solid var(--fts-line); }
.related-section .resource-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Pages and misc */
.content-page { padding: 48px 0 72px; }
.content-narrow { max-width: 820px; margin-inline: auto; }
.pagination { margin-top: 36px; }
.nav-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; }
.page-numbers { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 11px; color: #475467; background: #fff; border: 1px solid var(--fts-line); border-radius: 8px; }
.page-numbers.current, .page-numbers:hover { color: #fff; background: var(--fts-primary); border-color: var(--fts-primary); }
.comments-area { margin-top: 45px; padding-top: 30px; border-top: 1px solid var(--fts-line); }
.comment-list { padding: 0; list-style: none; }
.comment-body { padding: 18px 0; border-bottom: 1px solid var(--fts-line); }
.comment-form input:not([type=submit]), .comment-form textarea { width: 100%; padding: 11px 13px; border: 1px solid #d7deea; border-radius: 8px; }

/* Footer */
.site-footer { padding: 42px 0 26px; color: #98a2b3; background: #111827; }
.footer-top { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 50px; padding-bottom: 30px; }
.footer-title { margin: 0 0 10px; color: #fff; font-size: 21px; }
.footer-desc { max-width: 420px; margin: 0; font-size: 14px; }
.footer-heading { margin: 0 0 12px; color: #e5e7eb; font-size: 15px; }
.footer-links { padding: 0; margin: 0; list-style: none; }
.footer-links li { margin: 6px 0; }
.footer-links a { color: #98a2b3; font-size: 14px; }
.footer-links a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.09); font-size: 13px; }

@media (max-width: 1024px) {
  .resource-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .single-layout { grid-template-columns: minmax(0, 1fr); }
  .single-sidebar { position: static; }
  .side-card { display: none; }
}

@media (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
  .container { width: min(calc(100% - 28px), var(--fts-width)); }
  .header-inner { min-height: 62px; gap: 12px; }
  .site-title { font-size: 22px; }
  .menu-toggle { display: inline-flex; margin-left: auto; }
  .header-search-btn { display: none; }
  .main-navigation { display: none; position: absolute; left: 0; top: 100%; width: 100%; margin: 0; padding: 10px 14px 16px; background: #fff; border-bottom: 1px solid var(--fts-line); box-shadow: 0 12px 24px rgba(23,32,51,.08); }
  .main-navigation.is-open { display: block; }
  .main-navigation ul { display: block; }
  .main-navigation a { padding: 10px 12px; }
  .home-hero { padding: 52px 0 44px; }
  .home-hero p { font-size: 16px; }
  .hero-search .search-submit { min-width: 86px; padding-inline: 15px; }
  .section { padding: 42px 0; }
  .category-grid { grid-template-columns: 1fr; }
  .category-tile { min-height: 150px; }
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .resource-body { padding: 14px; }
  .resource-title { font-size: 15px; }
  .resource-meta span:last-child { display: none; }
  .page-banner { padding: 34px 0 26px; }
  .archive-tools { align-items: stretch; flex-direction: column; }
  .archive-search { max-width: none; }
  .single-main { padding-top: 24px; }
  .resource-facts { grid-template-columns: repeat(2, 1fr); }
  .resource-fact { border-bottom: 1px solid var(--fts-line); }
  .resource-fact:nth-child(2) { border-right: 0; }
  .resource-fact:nth-last-child(-n+2) { border-bottom: 0; }
  .related-section .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-top { grid-template-columns: 1fr; gap: 25px; }
  .footer-bottom { flex-direction: column; }
}

@media (max-width: 480px) {
  .home-hero h1 { font-size: 30px; }
  .hero-search { padding: 5px; }
  .hero-search .search-field { padding-inline: 12px; }
  .hot-searches { justify-content: flex-start; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .resource-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .resource-cover { aspect-ratio: 4/3; }
  .resource-body { padding: 11px; }
  .resource-cat { font-size: 11px; }
  .resource-title { min-height: 43px; margin-bottom: 8px; font-size: 14px; }
  .entry-title { font-size: 27px; }
  .entry-content { font-size: 16px; }
  .entry-content h2 { font-size: 23px; }
  .resource-facts { grid-template-columns: 1fr 1fr; }
  .download-box { padding: 20px; }
  .download-details { grid-template-columns: 1fr; }
  .download-actions { flex-direction: column; }
  .download-actions .button { width: 100%; }
  .related-section .resource-grid { grid-template-columns: 1fr 1fr; }
}

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