﻿/* ==========================================================================
   广告投放中心
   纸面风格：暖白底、细黑线、衬线标题、单一砖红色强调
   ========================================================================== */

:root {
  --paper: #f6f4ef;
  --surface: #fffdf8;
  --ink: #1b1a17;
  --ink-2: #46443f;
  --muted: #7c7970;
  --line: #ddd8cc;
  --line-2: #c6c0b1;
  --accent: #a12a20;
  --accent-soft: #f3e7e4;
  --ok: #3f6f3a;
  --ok-soft: #edf2e7;
  --radius: 3px;
  --wrap: 1080px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --serif: "Songti SC", "SimSun", "Source Han Serif SC", "Noto Serif CJK SC",
    "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono",
    "Courier New", monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1 0 auto; }

a { color: inherit; text-decoration: none; }

::selection { background: #f0d9d4; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 顶部 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 244, 239, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 58px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-mark {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1;
  border-radius: 2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 13.5px;
}

.nav a { color: var(--ink-2); }
.nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.nav a.btn-primary { color: var(--paper); text-decoration: none; }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.btn-primary:hover { background: #000; border-color: #000; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}

.btn-ghost:hover { border-color: var(--ink); }

.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ---------- 通用 ---------- */

.section { padding: 8px 0 44px; }

.mono {
  font-family: var(--mono);
  font-size: 0.92em;
  letter-spacing: 0.01em;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: #efece4;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1px 5px;
  color: var(--ink-2);
}

.section-head {
  max-width: 620px;
  margin-bottom: 26px;
}

.section-head h2 {
  position: relative;
  margin: 0 0 8px;
  padding-top: 14px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.section-head h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 26px;
  height: 2px;
  background: var(--accent);
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

/* ---------- 首屏广告位 ---------- */

.slots-top { padding: 36px 0 52px; }

.slots-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.slots-head h1 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.slots-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.slots-head .meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ---------- 广告卡片 ---------- */

.ad-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.ad-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.ad-card:hover { border-color: var(--line-2); }

.ad-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.ad-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-cover .mark {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(27, 26, 23, 0.32);
  font-variant-numeric: tabular-nums;
}

.cover-blue { background: #e3e8ee; }
.cover-violet { background: #ece3e1; }
.cover-green { background: #e4e9de; }

.ad-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 2px 7px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid var(--line);
  border-radius: 2px;
}

.ad-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 7px;
  padding: 15px 16px 14px;
}

.ad-body h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.ad-body p {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.65;
}

.ad-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.ad-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.ad-link:hover { color: var(--accent); }

.ad-link span { font-family: var(--mono); font-size: 12px; }

/* ---------- 底部提示条 ---------- */

.slots-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.slots-note .btn { flex: none; }

/* ---------- 常见问题 ---------- */

.faq-list {
  display: grid;
  gap: 22px;
  max-width: 720px;
  margin: 0;
}

.faq-list dt {
  font-weight: 600;
  font-size: 14px;
}

.faq-list dd {
  margin: 3px 0 0;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.8;
}

.tg-link {
  color: var(--accent);
  border-bottom: 1px solid rgba(161, 42, 32, 0.35);
}

.tg-link:hover { border-bottom-color: var(--accent); }

/* ---------- 投放页 ---------- */

.page-head { padding: 36px 0 22px; }

.page-head h1 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3vw, 2.1rem);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  max-width: 60ch;
}

.publish-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 20px;
  align-items: start;
}

.card-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.panel-title {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.02em;
}

.panel-title + .hint { margin-bottom: 14px; }

.actions-row + .panel-title { margin-top: 26px; }

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.hint.list {
  display: grid;
  gap: 3px;
  margin: 0 0 4px;
  padding-left: 18px;
}

.form-grid { display: grid; gap: 15px; }

.field label {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.field .hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

input[type="text"],
input[type="url"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 9px 11px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}

input::placeholder,
textarea::placeholder { color: #a29e94; }

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--ink);
}

textarea { min-height: 80px; resize: vertical; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.output {
  margin: 0;
  padding: 14px;
  min-height: 170px;
  background: #fbf9f3;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  max-height: 340px;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* 发布权限 */

.token-box {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-2);
  display: grid;
  gap: 7px;
}

.token-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.02em;
}

.token-row {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.token-row input { flex: 1; min-width: 0; }



.publish-status {
  display: none;
  margin: 16px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 12.5px;
  line-height: 1.7;
}

.publish-status.is-busy {
  display: block;
  background: #f5f2e9;
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.publish-status.is-ok {
  display: block;
  background: var(--ok-soft);
  border: 1px solid #c9d6bd;
  color: #33452b;
}

.publish-status.is-err {
  display: block;
  background: var(--accent-soft);
  border: 1px solid #e0b7b1;
  color: #7d1f18;
}

/* 在投列表 */

.ad-list {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  gap: 7px;
}

.ad-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbf9f3;
  font-size: 12.5px;
}

.ad-list li.empty {
  display: block;
  color: var(--muted);
  border-style: dashed;
  background: transparent;
}

.slot-no {
  flex: none;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 2px;
}

.ad-list .ad-id {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: 0;
}

.ad-list .ad-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-btn {
  flex: none;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn:hover { color: var(--accent); }

/* 密钥锁 */

.gate {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 26px 22px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
}

.gate h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.02em;
}

.gate p {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 13px;
}

.is-locked .publish-main { display: none; }
.is-unlocked .gate { display: none; }

.key-status {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 10px 14px;
  background: var(--ok-soft);
  border: 1px solid #c9d6bd;
  border-radius: var(--radius);
  font-size: 13px;
  color: #33452b;
}

.is-unlocked .key-status { display: flex; }

.key-status b { font-weight: 700; }
.key-status .meta { color: #5a6b50; }

/* ---------- 弹窗 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(27, 26, 23, 0.38);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.modal.is-open { opacity: 1; visibility: visible; }

.modal-card {
  width: 100%;
  max-width: 400px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  box-shadow: 0 18px 40px -24px rgba(27, 26, 23, 0.55);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 4px;
}

.modal-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.02em;
}

.modal-close {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
}

.modal-close:hover { color: var(--ink); border-color: var(--line-2); }

.modal-sub {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.modal .field { margin-bottom: 12px; }

.modal-msg {
  display: none;
  margin: 0 0 12px;
  padding: 9px 11px;
  border-radius: var(--radius);
  font-size: 12.5px;
  line-height: 1.6;
}

.modal-msg.is-error {
  display: block;
  color: #7d1f18;
  background: var(--accent-soft);
  border: 1px solid #e0b7b1;
}

.modal-msg.is-ok {
  display: block;
  color: #33452b;
  background: var(--ok-soft);
  border: 1px solid #c9d6bd;
}

.modal-foot {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

/* ---------- 指南 / 文章 ---------- */

.article {
  max-width: 680px;
  padding: 20px 0 28px;
}

.article h1 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.2vw, 2.2rem);
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.article .lede {
  margin: 0 0 18px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.85;
}

.article h2 {
  margin: 38px 0 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.02em;
}

.article p {
  margin: 0 0 13px;
  color: var(--ink-2);
  line-height: 1.9;
}

.article strong { color: var(--ink); font-weight: 600; }

.article .callout {
  margin: 18px 0;
  padding: 12px 14px;
  border-left: 2px solid var(--accent);
  background: #fbf6f4;
  color: var(--ink-2);
  font-size: 13.5px;
}

.article .callout p:last-child { margin-bottom: 0; }

.article ol {
  margin: 0 0 14px;
  padding-left: 20px;
  color: var(--ink-2);
}

.article ol li { margin-bottom: 7px; line-height: 1.85; }

.article .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

/* ---------- 404 ---------- */

.error-page {
  min-height: calc(100vh - 58px);
  display: grid;
  place-items: center;
  padding: 40px 20px;
  text-align: center;
}

.error-page .code {
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}

.error-page h1 {
  margin: 10px 0 6px;
  font-family: var(--serif);
  font-size: 22px;
}

.error-page p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13.5px;
}

/* ---------- 页脚 ---------- */

.site-footer {
  margin-top: 36px;
  padding: 20px 0 26px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  justify-content: space-between;
}

.footer-bottom a { color: var(--ink-2); }
.footer-bottom a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 跳转页 ---------- */

.redirect {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
}

.redirect-inner { display: grid; gap: 10px; justify-items: center; }

.redirect h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
}

.redirect p { margin: 0; color: var(--muted); font-size: 13px; }

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
  .publish-layout { grid-template-columns: 1fr; }
  .ad-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav { gap: 16px; }
  .nav a:not(.btn) { display: none; }
}

@media (max-width: 640px) {
  .ad-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .slots-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .slots-top { padding: 24px 0 36px; }
  .ad-body p { min-height: 0; }
  .wrap { padding: 0 18px; }
  .article h2 { font-size: 17.5px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* 表单补充 */

.field .req {
  margin-left: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
}

.field .opt {
  margin-left: 4px;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}

details.more {
  padding: 10px 12px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
}

details.more summary {
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
}

details.more summary::-webkit-details-marker { display: none; }

details.more summary::after {
  content: "＋";
  float: right;
  color: var(--muted);
}

details.more[open] summary::after { content: "－"; }
/* 图片上传 */

[hidden] { display: none !important; }

.upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.upload-preview {
  width: 180px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0 0 8px;
}
.upload-row.is-drag {
  border-color: var(--ink);
  background: #f5f1e7;
}
/* ---------- 更明显的广告卡片 ---------- */

.ad-card {
  border-color: var(--line-2);
  box-shadow: 0 1px 2px rgba(27, 26, 23, 0.05);
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.ad-card:hover {
  transform: translateY(-3px);
  border-color: var(--ink);
  box-shadow: 0 18px 32px -22px rgba(27, 26, 23, 0.6);
}

.ad-cover { aspect-ratio: 16 / 10; }

.ad-body h3 { font-size: 17px; }
.ad-body p { font-size: 13.5px; }

.ad-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 0;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-size: 13.5px;
  font-weight: 600;
}

.ad-link:hover { background: #000; color: var(--paper); }

.ad-link span { font-family: var(--mono); font-size: 12px; }

/* ---------- 折叠块 ---------- */

.fold {
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.02em;
  cursor: pointer;
  list-style: none;
}

.fold summary::-webkit-details-marker { display: none; }

.fold summary::after {
  content: "＋";
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}

.fold[open] summary::after { content: "－"; }

.fold .faq-list,
.fold .fold-body {
  padding: 0 16px 16px;
}

.fold .faq-list { margin: 0; }

.fold-body p {
  margin: 0 0 9px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.85;
}

.fold-body p:last-child { margin-bottom: 0; }
/* 顶部横幅 */

.top-banner {
  display: block;
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.top-banner img { display: block; width: 100%; height: auto; }
.top-banner:hover { border-color: var(--ink); }
/* ---------- 顶部滚动公告 ---------- */

.ticker {
  display: flex;
  align-items: center;
  gap: 0;
  height: 42px;
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.ticker-label {
  flex: none;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--paper);
  background: var(--ink);
}

.ticker-view {
  flex: 1;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-scroll 60s linear infinite;
}

.ticker-group {
  display: flex;
  gap: 56px;
  padding-right: 56px;
  white-space: nowrap;
  font-size: 13px;
  color: var(--ink-2);
}

.ticker:hover .ticker-track { animation-play-state: paused; }

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .ticker-view { overflow-x: auto; }
}
/* ---------- 整卡可点 + 键盘可达 ---------- */

.ad-card { cursor: pointer; }

.ad-card:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.ad-link span { display: inline-block; transition: transform 0.15s ease; }

.ad-card:hover .ad-link span { transform: translateX(4px); }

/* ---------- 指南页目录 ---------- */

.toc {
  display: grid;
  gap: 6px;
  margin: 0 0 26px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13.5px;
}

.toc .toc-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.toc a {
  color: var(--ink-2);
  width: fit-content;
}

.toc a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.article .totop {
  margin-top: 34px;
  font-size: 13px;
}

.article .totop a { color: var(--muted); border-bottom: 1px solid var(--line-2); }
.article .totop a:hover { color: var(--ink); }
/* 锚点跳转别被吸顶导航挡住 */
h1[id], h2[id], h3[id], section[id] { scroll-margin-top: 74px; }

/* 目录两列，更紧凑 */
.toc { grid-template-columns: 1fr 1fr; }
.toc .toc-title { grid-column: 1 / -1; }

@media (max-width: 640px) {
  .toc { grid-template-columns: 1fr; }
}
/* ---------- 进站弹窗广告 ---------- */

.pop-ad {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(27, 26, 23, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.pop-ad.is-open { opacity: 1; visibility: visible; }

.pop-ad-card {
  position: relative;
  width: min(420px, 92vw);
  max-height: 86vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  box-shadow: 0 30px 60px -30px rgba(27, 26, 23, 0.65);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.22s ease;
}

.pop-ad.is-open .pop-ad-card { transform: none; }

.pop-ad-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}

.pop-ad-close:hover { background: #fff; border-color: var(--line-2); }

.pop-ad-link { display: block; color: inherit; }

.pop-ad-link img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.pop-ad-body { padding: 16px; }

.pop-ad-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.pop-ad-title {
  display: block;
  margin-bottom: 4px;
  font-family: var(--serif);
  font-size: 19px;
}

.pop-ad-desc {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.pop-ad-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .pop-ad-card { width: 92vw; }
  .pop-ad-body { padding: 14px; }
  .pop-ad-title { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .pop-ad, .pop-ad-card { transition: none; }
  .pop-ad-card { transform: none; }
}
/* ---------- 弹窗卡片 2.0（覆盖旧样式） ---------- */

.pop-ad {
  background: rgba(20, 18, 16, 0.5);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.pop-ad-card {
  width: min(380px, 92vw);
  max-height: 88vh;
  background: #fff;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 24px 60px -24px rgba(20, 18, 16, 0.5);
}

.pop-ad-close {
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  font-size: 13px;
  color: #2b2823;
  background: rgba(255, 255, 255, 0.86);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.pop-ad-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f0ede6;
}

.pop-ad-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pop-ad-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(20, 18, 16, 0.45);
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.pop-ad-body { padding: 14px 16px 16px; }

.pop-ad-title {
  margin: 0 0 4px;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pop-ad-desc {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.pop-ad-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13.5px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .pop-ad-card { width: 90vw; }
  .pop-ad-body { padding: 12px 14px 14px; }
  .pop-ad-title { font-size: 16px; }
}


/* ---------- 首页背景图 ---------- */

body.home {
  background-color: #f6f4ef;
  background-image: url("bg-home.jpg");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

@media (max-width: 900px) {
  body.home { background-attachment: scroll; }
}
/* ---------- 右下角悬浮按钮 ---------- */

.floaters {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 95;
  display: grid;
  gap: 10px;
  justify-items: end;
}

.floaters:empty { display: none; }

.floater {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 26px -16px rgba(27, 26, 23, 0.8);
  animation: floater-bob 3s ease-in-out infinite;
  transition: background 0.15s ease;
}

.floater:hover { background: #000; color: var(--paper); }

.floater-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffb4a8;
  animation: floater-blink 1.8s ease-in-out infinite;
}

@keyframes floater-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes floater-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

@media (max-width: 640px) {
  .floaters { right: 12px; bottom: 14px; gap: 8px; }
  .floater { font-size: 12px; padding: 9px 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .floater, .floater-dot { animation: none; }
}

