/* ============================================================
   办公魔方 OfficeCube 官网样式
   Fluent 风格设计系统 · 无第三方依赖 · 支持深色模式
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  --accent: #0f6cbd;
  --accent-hover: #1b75d0;
  --accent-pressed: #0c5aa0;
  --accent-soft: #e3f0fc;
  --accent-contrast: #ffffff;

  --bg: #f7f9fb;
  --bg-elevated: #ffffff;
  --bg-subtle: #f0f3f7;
  --border: #e1e6ec;
  --border-strong: #c9d1da;

  --text: #1b1f24;
  --text-secondary: #4d5661;
  --text-muted: #7a8490;

  --pro: #8a5a00;
  --pro-bg: #fff4d6;
  --pro-border: #f0c96b;
  --free: #0d7a43;
  --free-bg: #e4f6ec;
  --warn-bg: #fff8e1;
  --warn-border: #e6c75e;
  --info-bg: #e8f3ff;
  --info-border: #9cc8f5;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .10), 0 2px 4px rgba(16, 24, 40, .06);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, .16);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --max-width: 1180px;
  --header-h: 64px;
  --font: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB",
    "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #4ea0ec;
    --accent-hover: #6bb3f2;
    --accent-pressed: #3a8fd9;
    --accent-soft: #163049;
    --accent-contrast: #0b1724;

    --bg: #0f1318;
    --bg-elevated: #171d24;
    --bg-subtle: #1e262f;
    --border: #2a333d;
    --border-strong: #3b4652;

    --text: #e8edf2;
    --text-secondary: #b6c0cb;
    --text-muted: #85929e;

    --pro: #f0c96b;
    --pro-bg: #2e2408;
    --pro-border: #7a5c14;
    --free-bg: #0e2b1c;
    --free: #54c98a;
    --warn-bg: #2e2810;
    --warn-border: #7a6420;
    --info-bg: #12283f;
    --info-border: #2c4d72;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
  }
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.3; color: var(--text); margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.01em; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.4em; }
li { margin-bottom: .35em; }
code {
  font-family: Consolas, "Cascadia Code", monospace;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .1em .45em;
  font-size: .9em;
}
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section-alt { background: var(--bg-subtle); }
.section-head { max-width: 720px; margin: 0 auto 44px; text-align: center; }
.section-head p { color: var(--text-secondary); font-size: 1.08rem; margin: 0; }
.eyebrow {
  display: inline-block; font-size: .82rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: 20px; height: 100%; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.12rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand small { font-weight: 500; color: var(--text-muted); font-size: .78rem; }
.site-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.site-nav a {
  color: var(--text-secondary); font-weight: 600; font-size: .95rem;
  padding: 8px 12px; border-radius: var(--radius-sm); white-space: nowrap;
}
.site-nav a:hover { color: var(--text); background: var(--bg-subtle); text-decoration: none; }
.site-nav a.active { color: var(--accent); background: var(--accent-soft); }
/* 导航栏中的主按钮：提升优先级，保证文字与图标为白色 */
.site-nav a.btn-primary,
.site-nav a.btn-primary:hover,
.site-nav a.btn-primary:active { color: #fff; }
.site-nav a.btn-primary .icon { fill: currentColor; }
.nav-toggle {
  display: none; margin-left: auto; background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); width: 40px; height: 40px; cursor: pointer;
  color: var(--text); font-size: 1.2rem;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm); font-weight: 700; font-size: 1rem;
  border: 1px solid transparent; cursor: pointer; transition: all .15s ease;
  text-decoration: none !important; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-contrast); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:active { background: var(--accent-pressed); transform: none; }
.btn-secondary { background: var(--bg-elevated); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg-subtle); transform: translateY(-1px); }
.btn-lg { padding: 15px 32px; font-size: 1.08rem; border-radius: var(--radius); }
.btn .icon { width: 20px; height: 20px; fill: currentColor; }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* 商店徽章按钮 */
.store-badge {
  display: inline-flex; align-items: center; gap: 12px; padding: 10px 22px;
  background: #111; color: #fff; border-radius: var(--radius-sm); text-decoration: none !important;
  transition: transform .15s ease, box-shadow .15s ease; box-shadow: var(--shadow-sm);
}
.store-badge:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.store-badge .icon { width: 28px; height: 28px; flex: none; }
.store-badge small { display: block; font-size: .72rem; line-height: 1.2; opacity: .82; }
.store-badge strong { display: block; font-size: 1.05rem; line-height: 1.3; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 88px 0 72px; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(680px 380px at 85% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    radial-gradient(520px 320px at 5% 10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%);
}
.hero .container { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600;
  color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 20px;
}
.hero p.lead { font-size: 1.16rem; color: var(--text-secondary); max-width: 34em; }
.hero .btn-row { margin-top: 28px; }
.hero-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 22px; color: var(--text-muted); font-size: .9rem; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-shot {
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); background: var(--bg-elevated);
}

/* ---------- 信任徽章条 ---------- */
.trust-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.trust-item {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; text-align: center;
}
.trust-item .icon { width: 34px; height: 34px; fill: var(--accent); margin-bottom: 10px; }
.trust-item strong { display: block; font-size: 1.02rem; margin-bottom: 4px; }
.trust-item span { color: var(--text-muted); font-size: .88rem; }

/* ---------- 工具卡片 ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tool-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; color: var(--text);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.tool-card:hover {
  text-decoration: none; transform: translateY(-4px);
  box-shadow: var(--shadow-md); border-color: var(--accent);
}
.tool-card .tool-icon {
  width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.tool-card .tool-icon .icon { width: 24px; height: 24px; fill: var(--accent); }
.tool-card h3 { margin: 0; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.tool-card p { color: var(--text-secondary); font-size: .93rem; margin: 0; flex: 1; }
.tool-card .card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.tool-card .more { font-weight: 700; font-size: .9rem; }
/* “使用教程”后的箭头：与文字同尺寸（em 跟随字号），不再使用默认大图标 */
.tool-card .more .icon { width: 1.05em; height: 1.05em; vertical-align: -0.16em; }
.cat-title { display: flex; align-items: center; gap: 12px; margin: 40px 0 18px; }
.cat-title:first-child { margin-top: 0; }
.cat-title h2 { font-size: 1.35rem; margin: 0; }
.cat-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* 版本标签 */
.tag { display: inline-block; font-size: .74rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.tag-free { color: var(--free); background: var(--free-bg); }
.tag-pro { color: var(--pro); background: var(--pro-bg); border: 1px solid var(--pro-border); }

/* 筛选工具栏 */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 34px; }
.filter-bar input, .filter-bar button {
  font: inherit; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--bg-elevated); color: var(--text);
}
.filter-bar input { min-width: 240px; border-radius: var(--radius-sm); }
.filter-bar button { cursor: pointer; font-weight: 600; }
.filter-bar button.active { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }

/* ---------- 特性区 ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.feature {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
}
.feature .icon { width: 30px; height: 30px; fill: var(--accent); margin-bottom: 12px; }
.feature h3 { font-size: 1.08rem; }
.feature p { color: var(--text-secondary); font-size: .94rem; margin: 0; }

/* 截图画廊 */
.shot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.shot-grid figure { margin: 0; }
.shot-grid img { border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.shot-grid figcaption { text-align: center; color: var(--text-muted); font-size: .86rem; margin-top: 8px; }
.shot-single { max-width: 980px; margin: 0 auto; }
.shot-single img { border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-md); width: 100%; }
.shot-single figcaption { text-align: center; color: var(--text-muted); font-size: .9rem; margin-top: 12px; }

/* ---------- 定价 ---------- */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; }
.price-card {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px 28px; display: flex; flex-direction: column;
  position: relative;
}
.price-card.featured { border-color: var(--accent); box-shadow: var(--shadow-md); }
.price-card .ribbon {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: var(--accent-contrast); font-size: .8rem; font-weight: 700;
  padding: 4px 16px; border-radius: 999px; white-space: nowrap;
}
.price-card h3 { font-size: 1.15rem; text-align: center; }
.price { text-align: center; margin: 10px 0 4px; }
.price strong { font-size: 2.4rem; letter-spacing: -.02em; }
.price span { color: var(--text-muted); font-size: .95rem; }
.price-card ul { flex: 1; }
.price-card .btn { width: 100%; margin-top: 16px; }
.compare-table { width: 100%; border-collapse: collapse; background: var(--bg-elevated); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.compare-table th, .compare-table td { padding: 13px 18px; border-bottom: 1px solid var(--border); text-align: left; font-size: .94rem; }
.compare-table th { background: var(--bg-subtle); font-weight: 700; }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table td.yes { color: var(--free); font-weight: 700; }
.compare-table td.pro { color: var(--pro); font-weight: 700; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

/* ---------- 提示框 ---------- */
.callout { border-radius: var(--radius); padding: 16px 20px; margin: 0 0 1.4em; border: 1px solid; font-size: .95rem; }
.callout p:last-child { margin: 0; }
.callout-info { background: var(--info-bg); border-color: var(--info-border); }
.callout-warn { background: var(--warn-bg); border-color: var(--warn-border); }
.callout-pro { background: var(--pro-bg); border-color: var(--pro-border); }
.callout strong { display: block; margin-bottom: 4px; }

/* ---------- 教程页 ---------- */
.tutorial-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 44px; padding: 48px 0 72px; }
.toc { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; max-height: calc(100vh - var(--header-h) - 48px); overflow: auto; }
.toc h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: 10px; }
.toc a { display: block; padding: 7px 12px; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: .92rem; border-left: 3px solid transparent; }
.toc a:hover { background: var(--bg-subtle); text-decoration: none; }
.toc a.active { color: var(--accent); background: var(--accent-soft); border-left-color: var(--accent); font-weight: 600; }
.article { min-width: 0; }
.article .crumb { color: var(--text-muted); font-size: .88rem; margin-bottom: 18px; }
.article-header { display: flex; gap: 18px; align-items: center; margin-bottom: 12px; }
.article-header .tool-icon { width: 56px; height: 56px; border-radius: 14px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; flex: none; }
.article-header .tool-icon .icon { width: 30px; height: 30px; fill: var(--accent); }
.article h2 { margin-top: 2em; padding-top: .4em; border-top: 1px solid var(--border); scroll-margin-top: 90px; }
.article h2:first-of-type { border-top: none; }

/* 步骤 */
.steps { list-style: none; padding: 0; margin: 0 0 1.5em; counter-reset: step; }
.steps li {
  counter-increment: step; position: relative; padding: 0 0 22px 52px;
  border-left: 2px solid var(--border); margin-left: 19px;
}
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before {
  content: counter(step); position: absolute; left: -19px; top: -2px;
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent);
  color: var(--accent-contrast); font-weight: 800; display: flex;
  align-items: center; justify-content: center; font-size: .95rem;
}
.steps li strong { display: block; font-size: 1.03rem; margin-bottom: 2px; }
.steps li p { color: var(--text-secondary); font-size: .94rem; margin: 0; }

/* FAQ */
details.faq {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px 20px; margin-bottom: 12px;
}
details.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
details.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
details.faq[open] summary::after { content: "–"; }
details.faq .faq-body { padding: 0 0 16px; color: var(--text-secondary); font-size: .95rem; }
details.faq .faq-body p:last-child { margin-bottom: 0; }

/* 上一篇/下一篇 */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; }
.pager a {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; color: var(--text);
}
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager .dir { font-size: .8rem; color: var(--text-muted); }
.pager .next { text-align: right; }
.pager .placeholder { visibility: hidden; }

/* ---------- 下载页 ---------- */
.download-hero { text-align: center; max-width: 760px; margin: 0 auto; }
.download-hero .store-badge { margin: 14px 0; }
.req-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.req-list li { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.req-list strong { display: block; margin-bottom: 4px; }
.req-list span { color: var(--text-secondary); font-size: .93rem; }

/* ---------- CTA 横幅 ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #6b3fd4));
  border-radius: var(--radius-lg); padding: 52px 40px; text-align: center; color: #fff;
}
.cta-banner h2 { color: #fff; }
.cta-banner p { color: rgba(255, 255, 255, .88); max-width: 40em; margin: 0 auto 26px; }
.cta-banner .btn-secondary { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .45); }
.cta-banner .btn-secondary:hover { background: rgba(255, 255, 255, .24); }
.cta-banner .btn-primary { background: #fff; color: var(--accent-pressed); }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-elevated); padding: 48px 0 32px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { font-size: .9rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.footer-grid a { display: block; color: var(--text-secondary); font-size: .93rem; padding: 4px 0; }
.footer-brand p { color: var(--text-muted); font-size: .9rem; max-width: 26em; }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 36px; padding-top: 22px; color: var(--text-muted); font-size: .86rem; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .hero .container { grid-template-columns: 1fr; gap: 40px; }
  .tool-grid, .price-grid, .shot-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-bar { grid-template-columns: repeat(2, 1fr); }
  .tutorial-layout { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; max-height: none; display: none; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .section { padding: 52px 0; }
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--bg-elevated); border-bottom: 1px solid var(--border);
    padding: 12px 20px 18px; display: none; box-shadow: var(--shadow-md);
  }
  .site-nav.open { display: flex; }
  .tool-grid, .price-grid, .shot-grid, .feature-grid, .trust-bar, .req-list { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
  .btn-row .btn, .btn-row .store-badge { width: 100%; }
}
