/*!
 * 二维码内容站 · 全局样式
 * 设计原则：移动优先（扫码访问以手机为主）、卡片式、清晰排版
 */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.07);
  --shadow-hover: 0 16px 36px rgba(37, 99, 235, 0.14);

  /* 四类内容的主题色，由 [data-type] 覆盖 */
  --type-color: var(--primary);
  --type-soft: var(--primary-soft);
}

[data-type="manual"] { --type-color: #2563eb; --type-soft: #eff6ff; }
[data-type="ad"]     { --type-color: #7c3aed; --type-soft: #f5f3ff; }
[data-type="promo"]  { --type-color: #ea580c; --type-soft: #fff7ed; }
[data-type="notice"] { --type-color: #059669; --type-soft: #ecfdf5; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; }

.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ============ 顶部导航 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.2px;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 17px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.header-spacer { flex: 1; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: var(--ink-2);
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--bg);
  transition: background 0.2s, color 0.2s;
}
.back-link:hover { background: var(--primary-soft); color: var(--primary); }

/* ============ 首页 Hero ============ */
.hero {
  background: linear-gradient(160deg, #1e40af 0%, #2563eb 55%, #0ea5e9 100%);
  color: #fff;
  padding: 44px 0 84px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -70px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
}
.hero::before {
  content: "";
  position: absolute;
  left: -90px;
  bottom: -130px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.hero-inner { position: relative; z-index: 1; }
.hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  margin-bottom: 16px;
}
.hero h1 {
  font-size: 30px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
.hero p {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.86);
  max-width: 560px;
}

/* ============ 分类筛选 ============ */
.section {
  margin-top: -44px;
  position: relative;
  z-index: 2;
  padding-bottom: 48px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 2px;
}
.section-head h2 { font-size: 19px; font-weight: 700; }
.section-head span { font-size: 13px; color: var(--ink-3); }

.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px;
  margin-bottom: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  padding: 7px 15px;
  border-radius: 999px;
  transition: all 0.2s;
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* ============ 内容卡片 ============ */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 14px;
}

.content-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.content-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--type-color);
}

.card-icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--type-soft);
  color: var(--type-color);
  display: grid;
  place-items: center;
  font-size: 22px;
}

.card-body { flex: 1; min-width: 0; }

.card-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--type-color);
  background: var(--type-soft);
  padding: 2px 9px;
  border-radius: 999px;
  margin-bottom: 7px;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 5px;
}

.card-desc {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-3);
}

.card-arrow {
  flex: 0 0 auto;
  align-self: center;
  color: var(--ink-3);
  font-size: 18px;
  transition: transform 0.2s, color 0.2s;
}
.content-card:hover .card-arrow { color: var(--type-color); transform: translateX(3px); }

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--ink-3);
  font-size: 14px;
}

/* ============ 内容页 ============ */
.article-wrap { padding: 22px 0 56px; }

.article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.article-banner {
  height: 8px;
  background: linear-gradient(90deg, var(--type-color), var(--type-soft));
}

.article-inner { padding: 26px 22px 34px; }

.article-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--type-color);
  background: var(--type-soft);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.article-title {
  font-size: 25px;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 12px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--ink-3);
  padding-bottom: 20px;
  border-bottom: 1px dashed var(--border);
}

.article-body { padding-top: 22px; font-size: 15px; color: var(--ink-2); }
.article-body > * + * { margin-top: 16px; }
.article-body h2 {
  font-size: 19px;
  color: var(--ink);
  font-weight: 700;
  padding-left: 12px;
  border-left: 4px solid var(--type-color);
  margin-top: 30px;
  line-height: 1.5;
}
.article-body h3 { font-size: 16px; color: var(--ink); font-weight: 700; margin-top: 24px; }
.article-body p { line-height: 1.85; }
.article-body strong { color: var(--ink); font-weight: 700; }
.article-body ul, .article-body ol { padding-left: 22px; }
.article-body li { margin-top: 7px; line-height: 1.8; }
.article-body a { color: var(--primary); text-decoration: underline; }

.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 16px;
}
.article-body th, .article-body td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.article-body th { background: var(--bg); color: var(--ink); font-weight: 700; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.tip-box {
  background: var(--type-soft);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.75;
}
.tip-box strong { color: var(--type-color); }

/* 目录（说明书用） */
.toc {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 14px;
}
.toc-title { font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.toc ol { padding-left: 20px; }
.toc li { margin-top: 4px; }
.toc a { color: var(--primary); }

/* 价格/优惠高亮块 */
.highlight-card {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
}
.highlight-price { font-size: 38px; font-weight: 800; color: #ea580c; line-height: 1.2; }
.highlight-price small { font-size: 18px; }
.highlight-label { font-size: 13px; color: #9a3412; margin-top: 4px; }

/* ============ 底部工具条 ============ */
.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.action-btn {
  flex: 1 1 auto;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}
.action-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.action-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.action-btn.primary:hover { background: var(--primary-dark); }

/* ============ 页脚 ============ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 22px 16px 30px;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.8;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
}

/* ============ 返回顶部 ============ */
.to-top {
  position: fixed;
  right: 16px;
  bottom: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--ink-2);
  font-size: 18px;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  z-index: 40;
}
.to-top.show { opacity: 1; visibility: visible; }

/* ============ 提示气泡 ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translate(-50%, 10px);
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s;
  z-index: 100;
  white-space: nowrap;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ============ 二维码弹窗 ============ */
.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.qr-modal.show { opacity: 1; visibility: visible; }

.qr-panel {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: 22px;
  padding: 28px 22px 24px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  transform: translateY(14px);
  transition: transform 0.25s;
}
.qr-modal.show .qr-panel { transform: translateY(0); }

.qr-close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  color: var(--ink-2);
  font-size: 20px;
  line-height: 1;
}

.qr-panel h3 { font-size: 20px; font-weight: 800; color: var(--ink); }
.qr-sub { font-size: 13px; color: var(--ink-3); margin-top: 4px; }

.qr-image-wrap {
  margin: 18px auto 14px;
  padding: 14px;
  width: -moz-max-content;
  width: max-content;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.qr-image-wrap img {
  width: 220px;
  height: 220px;
  max-width: 100%;
  image-rendering: pixelated;
}

.qr-url {
  font-size: 12px;
  color: var(--ink-2);
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 10px;
  word-break: break-all;
  line-height: 1.5;
}

.qr-warning {
  display: none;
  margin-top: 12px;
  font-size: 12px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 8px 10px;
  line-height: 1.6;
}

.qr-actions { display: flex; gap: 10px; margin-top: 16px; }
.qr-actions .action-btn { flex: 1 1 0; min-width: 0; }

/* ============ 首页 Hero 操作按钮 ============ */
.hero-actions {
  margin-top: 26px;
  max-width: 320px;
}
.hero-actions .action-btn {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}
.hero-actions .action-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}

/* ============ 平板/桌面增强 ============ */
@media (min-width: 640px) {
  .hero h1 { font-size: 38px; }
  .hero { padding: 56px 0 90px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .article-inner { padding: 34px 40px 44px; }
  .article-title { font-size: 30px; }
  .article-body { font-size: 16px; }
}

@media (min-width: 900px) {
  .hero h1 { font-size: 44px; }
}
