/* ==========================================================================
   安摩汇｜首页专用样式
   --------------------------------------------------------------------------
   设计方向：行业档案馆 / 公报美学
   - 纸面质感底色 + 墨蓝主色 + 朱砂点缀，模拟档案卷宗的印刷感
   - 核心视觉元素：档案编号（Doc. No.）、索引标签、装订线装饰
   - 依赖 main.css 的设计令牌，此文件仅承载首页专属版式
   ========================================================================== */

/* ==========================================================================
   一、报头（Masthead）—— 仿行业公报刊头
   ========================================================================== */
.masthead {
  position: relative;
  background: var(--brand-dark);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.masthead::before {
  content: "";
  position: absolute; inset: 0; z-index: -2;
  background-image:
    repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 1px, transparent 1px 7px);
}
.masthead::after {
  content: "\u6A94";
  position: absolute; right: 2%; top: 50%; transform: translateY(-50%);
  font-family: var(--font-serif); font-size: clamp(160px, 26vw, 320px);
  line-height: .8; color: rgba(255, 255, 255, .045);
  pointer-events: none; user-select: none; z-index: -1;
}
.masthead-inner {
  display: grid; gap: 34px; align-items: center;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  padding: 52px 16px 46px;
}
.masthead-flag {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-bottom: 16px; margin-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .16);
}
.masthead-flag-name {
  font-family: var(--font-serif); font-size: 15px; letter-spacing: 7px;
  color: rgba(255, 255, 255, .92); font-weight: 700;
}
.masthead-flag-rule { flex: 1 1 40px; height: 1px; background: rgba(255, 255, 255, .2); }
.masthead-flag-meta {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 1.5px;
  color: rgba(255, 255, 255, .55);
}
.masthead-title {
  font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(30px, 4.4vw, 50px); line-height: 1.18;
  color: #fff; margin: 0 0 18px; letter-spacing: 3px;
}
.masthead-title em { font-style: normal; color: var(--risk); }
.masthead-rule {
  width: 68px; height: 3px; background: var(--seal);
  margin: 0 0 20px; border-radius: 2px;
}
.masthead-lead {
  font-size: 15.5px; line-height: 1.95; color: rgba(255, 255, 255, .84);
  max-width: 620px; margin: 0 0 26px;
}
.masthead-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.masthead-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius);
  font-size: 14.5px; text-decoration: none; border: 1px solid transparent;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.masthead-btn:hover { text-decoration: none; transform: translateY(-1px); }
.masthead-btn-primary { background: var(--risk); color: #3B2400; font-weight: 600; }
.masthead-btn-primary:hover { background: #FBBF24; color: #3B2400; }
.masthead-btn-ghost {
  border-color: rgba(255, 255, 255, .32); color: rgba(255, 255, 255, .92);
}
.masthead-btn-ghost:hover { border-color: rgba(255, 255, 255, .7); background: rgba(255,255,255,.07); color: #fff; }

.masthead-ledger {
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.masthead-ledger-title {
  font-size: 11.5px; letter-spacing: 3px; color: rgba(255, 255, 255, .5);
  text-transform: uppercase; margin: 0 0 16px;
  display: flex; align-items: center; gap: 10px;
}
.masthead-ledger-title::after {
  content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .18);
}
.ledger-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 11px 0; border-bottom: 1px dashed rgba(255, 255, 255, .15);
}
.ledger-row:last-child { border-bottom: 0; }
.ledger-label { font-size: 13.5px; color: rgba(255, 255, 255, .72); }
.ledger-value {
  font-family: var(--font-mono); font-size: 22px; font-weight: 600;
  color: #fff; line-height: 1; letter-spacing: -.5px;
}
.ledger-value small { font-size: 12px; color: rgba(255,255,255,.55); margin-left: 3px; font-weight: 400; }

.masthead-notice {
  background: rgba(0, 0, 0, .26);
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding: 11px 16px;
}
.masthead-notice-inner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12.5px; color: rgba(255, 255, 255, .68);
}
.masthead-notice-inner strong { color: var(--risk); font-weight: 600; }
.masthead-notice-seal {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border: 1px solid rgba(245, 158, 11, .5);
  border-radius: 3px; color: var(--risk); font-size: 11.5px; letter-spacing: 1px;
  white-space: nowrap;
}

/* ==========================================================================
   二、索引条（Index Bar）—— 档案检索索引
   ========================================================================== */
.indexbar {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 4px 22px;
  box-shadow: var(--shadow-sm);
  margin: 26px 0 0;
}
.indexbar-row {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 15px 0; border-bottom: 1px solid var(--line-soft);
}
.indexbar-row:last-child { border-bottom: 0; }
.indexbar-label {
  flex: 0 0 92px; padding-top: 3px;
  font-size: 12px; letter-spacing: 2px; color: var(--muted);
  display: flex; align-items: center; gap: 7px;
}
.indexbar-label::before {
  content: ""; width: 3px; height: 13px; background: var(--seal); border-radius: 2px;
}
.indexbar-links { display: flex; flex-wrap: wrap; gap: 7px; flex: 1 1 auto; }
.indexbar-links a {
  display: inline-block; padding: 3px 12px;
  border: 1px solid var(--line); background: var(--bg);
  border-radius: var(--radius); font-size: 13px; color: var(--ink-soft);
  text-decoration: none; transition: all .16s ease;
}
.indexbar-links a:hover {
  border-color: var(--brand-light); color: var(--brand);
  background: var(--brand-soft); text-decoration: none;
}
.indexbar-count {
  font-family: var(--font-mono); font-size: 11px; color: var(--muted-light); margin-left: 5px;
}
.indexbar-links a:hover .indexbar-count { color: var(--brand-light); }

/* ==========================================================================
   三、档案大卡片（Archive Card）—— 首页主视觉
   ========================================================================== */
.archive-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.archive-card {
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.archive-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #BFCDE5;
}
/* 卡片左侧装订边：墨蓝渐变到朱砂 */
.archive-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; z-index: 3;
  background: linear-gradient(180deg, var(--brand-dark), var(--brand-light) 55%, var(--seal));
  opacity: .85;
}
.archive-card-head {
  padding: 18px 20px 14px 22px;
  border-bottom: 1px solid var(--line-soft);
}
/* 档案编号行 */
.archive-no {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.2px;
  color: var(--muted-light); margin-bottom: 9px;
}
.archive-no-doc { color: var(--brand); }
.archive-no-views { display: inline-flex; align-items: center; gap: 4px; }
.archive-name {
  font-family: var(--font-serif); font-size: 19px; font-weight: 700;
  color: var(--brand-dark); margin: 0 0 6px; letter-spacing: .5px; line-height: 1.3;
  position: relative; z-index: 1;
}
.archive-name a { color: inherit; text-decoration: none; }
.archive-name a:hover { color: var(--brand); text-decoration: none; }
/* 标题链接铺满整张卡片，底部链接用更高层级覆盖 */
.archive-name a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.archive-entity {
  display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-soft); margin: 0; position: relative; z-index: 1;
}
.archive-entity-key {
  font-size: 11px; letter-spacing: 1.5px; color: var(--muted-light);
  text-transform: uppercase; white-space: nowrap;
}

/* 标签行 */
.archive-tags {
  display: flex; flex-wrap: wrap; gap: 5px;
  padding: 12px 20px 0 22px; position: relative; z-index: 1;
}
/* 元信息栅格 */
.archive-meta {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px; background: var(--line-soft);
  margin: 14px 0 0; border-top: 1px solid var(--line-soft);
  position: relative; z-index: 1;
}
.archive-meta-item { background: var(--paper); padding: 10px 12px 10px 22px; }
.archive-meta-item.full { grid-column: 1 / -1; }
.archive-meta-key {
  font-size: 10.5px; letter-spacing: 1.6px; color: var(--muted-light);
  text-transform: uppercase; margin: 0 0 3px;
}
.archive-meta-val { font-size: 13px; color: var(--ink-soft); margin: 0; line-height: 1.6; }
.archive-meta-val.is-muted { color: var(--muted-light); }

/* 风险提示条 */
.archive-risk {
  margin: 0 20px 0 22px; padding: 9px 12px;
  background: var(--seal-soft); border-left: 2px solid var(--seal);
  border-radius: 0 4px 4px 0; font-size: 12.5px; color: #9A3412; line-height: 1.65;
  position: relative; z-index: 1;
}
.archive-risk strong { color: var(--seal); font-weight: 700; }

/* 卡片底部 */
.archive-foot {
  margin-top: auto; padding: 13px 20px 14px 22px;
  border-top: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--muted);
  position: relative; z-index: 2;
}
.archive-foot-link {
  font-size: 13px; color: var(--brand); text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.archive-foot-link:hover { gap: 8px; }

/* ==========================================================================
   四、双栏区（卷宗列表 + 侧栏）
   ========================================================================== */
.home-split {
  display: grid; gap: 24px;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
}
.dossier-list {
  display: flex; flex-direction: column; gap: 0;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
}
.dossier-item {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 17px 20px; border-bottom: 1px solid var(--line-soft);
  transition: background .16s ease;
}
.dossier-item:last-child { border-bottom: 0; }
.dossier-item:hover { background: var(--brand-mist); }
.dossier-index {
  flex: 0 0 34px; height: 34px; border-radius: var(--radius);
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 600;
}
.dossier-body { flex: 1 1 auto; min-width: 0; }
.dossier-title { font-size: 15.5px; margin: 0 0 5px; line-height: 1.5; }
.dossier-title a { color: var(--brand-dark); text-decoration: none; }
.dossier-title a:hover { color: var(--brand); text-decoration: underline; }
.dossier-desc {
  font-size: 13.5px; color: var(--ink-soft); margin: 0 0 7px; line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dossier-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.dossier-meta span { display: inline-flex; align-items: center; gap: 4px; }

/* 侧栏卡片 */
.side-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden;
}
.side-card + .side-card { margin-top: 18px; }
.side-card-head {
  padding: 13px 18px; border-bottom: 1px solid var(--line-soft);
  background: var(--soft);
  display: flex; align-items: center; gap: 9px;
}
.side-card-head h3 {
  margin: 0; font-size: 13.5px; letter-spacing: 1.5px;
  color: var(--brand-dark); font-weight: 600;
}
.side-card-head::before {
  content: ""; width: 3px; height: 13px; background: var(--seal); border-radius: 2px;
}
.side-card-body { padding: 16px 18px; }

/* 侧栏：收录流程 */
.flow-list { counter-reset: flow; }
.flow-item {
  display: flex; gap: 12px; padding: 9px 0; align-items: flex-start;
  border-bottom: 1px dashed var(--line-soft);
}
.flow-item:last-child { border-bottom: 0; }
.flow-item::before {
  counter-increment: flow; content: counter(flow, decimal-leading-zero);
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--brand-light); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 10.5px; margin-top: 1px;
}
.flow-text { font-size: 13.5px; color: var(--ink-soft); line-height: 1.65; }
.flow-text strong { color: var(--brand-dark); font-weight: 600; }

/* 侧栏：收录原则 */
.principle-item {
  display: flex; gap: 9px; padding: 8px 0; align-items: flex-start;
  font-size: 13px; color: var(--ink-soft); line-height: 1.65;
}
.principle-mark {
  flex: 0 0 auto; width: 16px; height: 16px; margin-top: 4px;
  border-radius: 3px; background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 10px;
}
.principle-item.is-risk .principle-mark { background: var(--seal-soft); color: var(--seal); }

/* 侧栏：CTA */
.side-cta {
  background: var(--brand-dark); color: #fff;
  padding: 20px 18px; border-radius: var(--radius-lg);
  position: relative; overflow: hidden;
}
.side-cta::after {
  content: "\u6A94"; position: absolute; right: -6px; bottom: -22px;
  font-family: var(--font-serif); font-size: 92px; color: rgba(255,255,255,.05);
  pointer-events: none;
}
.side-cta h3 {
  margin: 0 0 8px; color: #fff; font-size: 15.5px;
  font-family: var(--font-serif); letter-spacing: 1px; position: relative;
}
.side-cta p {
  margin: 0 0 15px; font-size: 13px; color: rgba(255,255,255,.76); line-height: 1.7;
  position: relative;
}
.side-cta-btn {
  display: inline-block; padding: 9px 18px; border-radius: var(--radius);
  background: var(--risk); color: #3B2400; font-size: 13.5px; font-weight: 600;
  text-decoration: none; position: relative;
}
.side-cta-btn:hover { background: #FBBF24; color: #3B2400; text-decoration: none; }

/* ==========================================================================
   五、专题格子
   ========================================================================== */
.dossier-topic-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dossier-topic {
  display: block; position: relative;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px 22px;
  text-decoration: none; color: inherit; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.dossier-topic:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-md);
  border-color: #BFCDE5; text-decoration: none;
}
.dossier-topic::after {
  content: ""; position: absolute; right: -34px; top: -34px;
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--brand-soft); opacity: .6; transition: transform .35s ease;
}
.dossier-topic:hover::after { transform: scale(1.3); }
.dossier-topic-no {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.5px;
  color: var(--muted-light); margin-bottom: 9px; position: relative;
}
.dossier-topic h3 {
  margin: 0 0 8px; font-size: 17px; position: relative; z-index: 1;
  font-family: var(--font-serif); letter-spacing: .5px;
}
.dossier-topic p {
  margin: 0 0 12px; font-size: 13.5px; color: var(--ink-soft);
  line-height: 1.7; position: relative; z-index: 1;
}
.dossier-topic-foot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted); position: relative; z-index: 1;
}
.dossier-topic-count {
  font-family: var(--font-mono); color: var(--brand);
  background: var(--brand-soft); padding: 2px 9px; border-radius: 3px;
}

/* ==========================================================================
   六、馆藏说明（底部合规区）
   ========================================================================== */
.charter {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden;
}
.charter-head {
  padding: 18px 24px; background: var(--soft);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.charter-head h2 {
  margin: 0; font-family: var(--font-serif); font-size: 17px;
  letter-spacing: 2px; color: var(--brand-dark);
  display: flex; align-items: center; gap: 10px;
}
.charter-head h2::before {
  content: ""; width: 4px; height: 18px; background: var(--seal); border-radius: 2px;
}
.charter-head-note { font-size: 12.5px; color: var(--muted); }
.charter-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.charter-item {
  padding: 16px 24px; border-bottom: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  display: flex; gap: 12px; align-items: flex-start;
}
.charter-item:nth-child(2n) { border-right: 0; }
.charter-item:nth-last-child(-n+2) { border-bottom: 0; }
.charter-mark {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 4px; margin-top: 1px;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 11px;
}
.charter-item.is-risk .charter-mark { background: var(--seal-soft); color: var(--seal); }
.charter-text { font-size: 13.5px; color: var(--ink-soft); line-height: 1.75; }
.charter-text strong { color: var(--brand-dark); font-weight: 600; }

/* ==========================================================================
   七、加载动效
   ========================================================================== */
@keyframes home-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.home-reveal { opacity: 0; animation: home-rise .62s cubic-bezier(.22, .68, .35, 1) forwards; }
.home-reveal:nth-child(1) { animation-delay: .04s; }
.home-reveal:nth-child(2) { animation-delay: .11s; }
.home-reveal:nth-child(3) { animation-delay: .18s; }
.home-reveal:nth-child(4) { animation-delay: .25s; }
.home-reveal:nth-child(5) { animation-delay: .32s; }
.home-reveal:nth-child(6) { animation-delay: .39s; }

/* 尊重用户的减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  .home-reveal { opacity: 1; animation: none; }
  .archive-card, .dossier-topic, .entry, .platform-card, .masthead-btn { transition: none; }
  .archive-card:hover, .dossier-topic:hover, .entry:hover, .platform-card:hover { transform: none; }
}

/* ==========================================================================
   八、首页响应式
   ========================================================================== */
@media (max-width: 1024px) {
  .masthead-inner { grid-template-columns: minmax(0, 1fr); gap: 30px; padding: 42px 16px 38px; }
  .masthead-ledger { max-width: 560px; }
  .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-split { grid-template-columns: minmax(0, 1fr); }
  .charter-body { grid-template-columns: minmax(0, 1fr); }
  .charter-item { border-right: 0; }
  .charter-item:nth-last-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .charter-item:last-child { border-bottom: 0; }
}

@media (max-width: 760px) {
  .masthead-inner { padding: 32px 13px 30px; gap: 24px; }
  .masthead::after { font-size: 150px; right: -6%; }
  .masthead-title { letter-spacing: 2px; }
  .masthead-rule { width: 52px; }
  .masthead-lead { font-size: 14.5px; line-height: 1.85; }
  .masthead-actions { gap: 9px; }
  .masthead-btn { padding: 10px 17px; font-size: 13.5px; }
  .masthead-ledger { padding: 18px 16px; }
  .ledger-value { font-size: 19px; }
  .indexbar { padding: 2px 15px; margin-top: 18px; }
  .indexbar-row { flex-direction: column; gap: 9px; padding: 13px 0; }
  .indexbar-label { flex: none; }
  .archive-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .archive-meta { grid-template-columns: minmax(0, 1fr); }
  .archive-meta-item { padding: 9px 16px 9px 20px; }
  .dossier-topic-grid { grid-template-columns: minmax(0, 1fr); }
  .dossier-item { padding: 15px 16px; gap: 12px; }
  .dossier-index { flex: 0 0 28px; height: 28px; font-size: 11.5px; }
  .charter-head { padding: 15px 16px; }
  .charter-item { padding: 14px 16px; }
  .charter-head h2 { font-size: 15.5px; letter-spacing: 1.5px; }
}
