/* =========================================================
 * style.css — 宝塔SSL证书自动化插件介绍页
 *
 * 设计约定：
 *   - 零外部依赖：不引任何 CDN 字体 / 图标库 / Tailwind 运行时，
 *     保证国内服务器直连加载稳定，可完全离线部署。
 *   - 颜色跟随插件图标（蓝色盾牌），主色 #2563eb。
 *   - 移动端被 mobile-guard.js 拦截，此处仅保留拦截页样式
 *     与一套兜底媒体查询（UA 被改写时仍能拦截）。
 * ========================================================= */

/* ---------- 设计变量 ---------- */
:root {
  --bg:          #ffffff;
  --bg-soft:     #f6f8fb;
  --bg-hero:     #f2f6ff;
  --border:      #e4e9f2;
  --border-strong: #d3dbe8;

  --text:        #17203a;
  --text-2:      #5b6579;
  --text-3:      #8a94a8;

  --brand:       #2563eb;
  --brand-dark:  #1d4ed8;
  --brand-soft:  #eaf1ff;
  --brand-ring:  rgba(37, 99, 235, .28);

  --ok:          #15803d;
  --ok-bg:       #e8f7ee;
  --warn:        #b45309;
  --warn-bg:     #fdf3e3;
  --danger:      #b91c1c;
  --danger-bg:   #fdeaea;

  --code-bg:     #0f1729;
  --code-text:   #e6edf7;

  --radius:      14px;
  --radius-sm:   9px;
  --shadow-sm:   0 1px 2px rgba(23, 32, 58, .06), 0 1px 3px rgba(23, 32, 58, .04);
  --shadow-md:   0 4px 16px rgba(23, 32, 58, .08);
  --shadow-lg:   0 18px 48px rgba(23, 32, 58, .12);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }

code {
  font-family: var(--mono);
  font-size: .9em;
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: .12em .4em;
  border-radius: 5px;
  word-break: break-all;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--brand-ring); }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}
.container-narrow { max-width: 820px; }

/* =========================================================
   移动端拦截页
   ========================================================= */
.mobile-gate { display: none; }

html.is-mobile .pc-only { display: none !important; }
html.is-mobile .mobile-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(1000px 520px at 50% -10%, #e6efff 0%, rgba(230, 239, 255, 0) 60%),
    var(--bg);
}

.gate-card {
  max-width: 460px;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  text-align: center;
}
.gate-icon { margin: 0 auto 20px; border-radius: 16px; }
.gate-card h1 { font-size: 22px; margin-bottom: 10px; }
.gate-lead { color: var(--text-2); font-size: 15px; margin: 0 0 22px; }
.gate-steps {
  text-align: left;
  margin: 0 0 24px;
  padding-left: 20px;
  color: var(--text-2);
  font-size: 14.5px;
}
.gate-steps li { margin-bottom: 8px; }
.gate-note {
  font-size: 13px;
  color: var(--text-3);
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* 兜底媒体查询：UA 被改写为桌面版但设备仍是窄屏触摸设备时，
   依然拦截（pointer:coarse 排除了以鼠标为主的触屏笔记本） */
@media (max-width: 768px) and (pointer: coarse) {
  html:not(.force-pc) .pc-only { display: none !important; }
  html:not(.force-pc) .mobile-gate {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: var(--bg);
  }
}

/* force_pc 逃生口：即使命中拦截条件也强制展示 PC 内容 */
html.force-pc .mobile-gate { display: none !important; }
html.force-pc .pc-only { display: block !important; }

/* =========================================================
   顶栏
   ========================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.topbar.scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 16.5px;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; }

.nav {
  display: flex;
  gap: 26px;
  margin-left: auto;
}
.nav a {
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 500;
  padding: 6px 0;
  transition: color .15s ease;
}
.nav a:hover { color: var(--brand); text-decoration: none; }

/* =========================================================
   按钮
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease,
              box-shadow .15s ease, transform .1s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-sm   { height: 38px; padding: 0 18px; font-size: 14px; }
.btn-lg   { height: 48px; padding: 0 26px; font-size: 16px; }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px var(--brand-ring);
}
.btn-primary:hover { background: var(--brand-dark); box-shadow: 0 4px 14px var(--brand-ring); }

.btn-ghost {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.btn-light {
  background: #fff;
  color: var(--brand-dark);
}
.btn-light:hover { background: #f2f6ff; }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  padding: 84px 0 72px;
  background:
    radial-gradient(1100px 560px at 78% -12%, #dbe8ff 0%, rgba(219, 232, 255, 0) 62%),
    radial-gradient(900px 480px at 8% 8%, #eef3ff 0%, rgba(238, 243, 255, 0) 58%),
    linear-gradient(180deg, var(--bg-hero) 0%, var(--bg) 100%);
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 56px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 6px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--brand-dark);
  background: #fff;
  border: 1px solid #cdddff;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.hero-badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, .15);
}
.hero-badge b { font-weight: 700; }

.hero h1 {
  font-size: clamp(34px, 4.4vw, 52px);
  font-weight: 800;
  letter-spacing: -.025em;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 17.5px;
  color: var(--text-2);
  max-width: 34em;
  margin: 0 0 30px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-note {
  margin: 18px 0 0;
  font-size: 13.5px;
  color: var(--text-3);
}

/* Hero 右侧模拟面板 */
.hero-panel { display: flex; justify-content: center; }
.panel-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  transform: rotate(1.2deg);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.panel-title { font-weight: 700; font-size: 15px; }
.panel-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-dark);
  background: var(--brand-soft);
  padding: 3px 10px;
  border-radius: 999px;
}
.panel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 4px;
  border-top: 1px solid var(--bg-soft);
  font-size: 14px;
}
.site-name {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pill {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill-ok     { color: var(--ok);     background: var(--ok-bg); }
.pill-warn   { color: var(--warn);   background: var(--warn-bg); }
.pill-danger { color: var(--danger); background: var(--danger-bg); }
.days { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.panel-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.mini-btn {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  padding: 7px 14px;
  border-radius: 7px;
}

/* 数据条 */
.stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 64px 0 0;
  padding: 28px 0 0;
  border-top: 1px solid rgba(37, 99, 235, .14);
}
.stats li { text-align: center; }
.stats b {
  display: block;
  font-size: 30px;
  font-weight: 800;
  color: var(--brand-dark);
  letter-spacing: -.02em;
  line-height: 1.2;
}
.stats span { font-size: 13.5px; color: var(--text-2); }

/* =========================================================
   通用 Section
   ========================================================= */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-soft); }

.kicker {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand);
}

.section h2 {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -.02em;
}

.section-sub {
  color: var(--text-2);
  font-size: 16.5px;
  max-width: 42em;
  margin: 0 0 44px;
}

/* =========================================================
   功能特性卡片
   ========================================================= */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: #cdddff;
}
.card-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  margin-bottom: 16px;
}
.card h3 { font-size: 17px; margin-bottom: 8px; }
.card p { margin: 0; color: var(--text-2); font-size: 14.5px; }

/* =========================================================
   工作流程
   ========================================================= */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  counter-reset: step;
}
.step {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  box-shadow: var(--shadow-sm);
}
.step-num {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 7px;
  padding: 3px 9px;
  margin-bottom: 14px;
}
.step h3 { font-size: 16.5px; margin-bottom: 8px; }
.step p { margin: 0; color: var(--text-2); font-size: 14px; }

/* 步骤间连接箭头（仅宽屏） */
@media (min-width: 1000px) {
  .step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 34px;
    right: -14px;
    width: 8px;
    height: 8px;
    border-top: 2px solid var(--border-strong);
    border-right: 2px solid var(--border-strong);
    transform: rotate(45deg);
  }
}

/* =========================================================
   安装方式
   ========================================================= */
.install-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}

.install-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: var(--shadow-sm);
}
.install-card h3 { font-size: 18px; margin-bottom: 16px; }

.install-tag {
  position: absolute;
  top: -11px;
  right: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--ok);
  padding: 3px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.install-list {
  margin: 0 0 18px;
  padding-left: 20px;
  color: var(--text-2);
  font-size: 14.5px;
}
.install-list li { margin-bottom: 10px; }
.install-list b { color: var(--text); }

.install-desc { color: var(--text-2); font-size: 14.5px; margin: 0 0 14px; }
.install-tip {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  color: var(--text-3);
  font-size: 13.5px;
}

/* 代码块 */
.code-block {
  background: var(--code-bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: rgba(255, 255, 255, .05);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  font-family: var(--mono);
  font-size: 12px;
  color: #8fa3c4;
}
.copy-btn {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: #c8d6ee;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 6px;
  padding: 4px 12px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.copy-btn:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.copy-btn.copied {
  color: #6ee7a0;
  border-color: rgba(110, 231, 160, .4);
  background: rgba(110, 231, 160, .1);
}
.code-block pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
}
.code-block code {
  display: block;
  background: none;
  color: var(--code-text);
  padding: 0;
  font-size: 13px;
  line-height: 1.85;
  white-space: pre;
  word-break: normal;
}

/* 环境要求 */
.env-box { margin-top: 44px; }
.env-box h3 { font-size: 18px; margin-bottom: 16px; }
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  background: var(--bg);
}
th, td { text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--border); }
thead th {
  background: var(--bg-soft);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody td:nth-child(2) { color: var(--brand-dark); font-weight: 600; white-space: nowrap; }
tbody td:last-child { color: var(--text-2); }

/* =========================================================
   安全说明
   ========================================================= */
.sec-grid { display: grid; grid-template-columns: 1fr; }
.sec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 32px;
}
.sec-list li {
  position: relative;
  padding-left: 26px;
  color: var(--text-2);
  font-size: 14.5px;
}
.sec-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .5em;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ok-bg);
  /* 对勾 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.6 2.6L12 5.5' fill='none' stroke='%2315803d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 16px 16px;
}
.sec-list b { color: var(--text); }

/* =========================================================
   FAQ
   ========================================================= */
.faq-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color .15s ease;
}
.faq-item[open] { border-color: #cdddff; }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  font-weight: 600;
  font-size: 15.5px;
  position: relative;
  padding-right: 52px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -7px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg);
  transition: transform .18s ease;
}
.faq-item[open] summary::after {
  transform: rotate(-135deg);
  margin-top: -3px;
}
.faq-body {
  padding: 0 22px 20px;
  color: var(--text-2);
  font-size: 14.5px;
}
.faq-body p { margin: 0 0 10px; }
.faq-body ol { margin: 0; padding-left: 20px; }
.faq-body li { margin-bottom: 6px; }

/* =========================================================
   底部 CTA
   ========================================================= */
.cta {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
  padding: 64px 0;
}
.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}
.cta h2 {
  color: #fff;
  font-size: clamp(22px, 2.6vw, 30px);
  margin-bottom: 6px;
}
.cta p { color: rgba(255, 255, 255, .82); margin: 0; font-size: 15px; }

/* =========================================================
   页脚
   ========================================================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  background: var(--bg);
}
.footer-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 14.5px;
}
.footer-brand img { border-radius: 7px; }
.footer-nav { display: flex; gap: 20px; margin-left: auto; }
.footer-nav a { color: var(--text-2); font-size: 14px; }
.footer-nav a:hover { color: var(--brand); }
.copyright {
  width: 100%;
  margin: 6px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--bg-soft);
  color: var(--text-3);
  font-size: 13.5px;
}

/* =========================================================
   响应式（PC 档位收缩；移动端已被拦截，仅保证不破版）
   ========================================================= */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 44px; }
  .hero-panel { justify-content: flex-start; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .nav { display: none; }
  .install-grid { grid-template-columns: 1fr; }
  .sec-list { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 24px 12px; }
}

@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .section { padding: 60px 0; }
  .hero { padding: 56px 0 48px; }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
  .panel-card { transform: none; }
}

/* 尊重系统减弱动效设置 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
