/* =========================================================
   澳门服务在线 · 共享样式表 /assets/site.css
   母题：数字口岸 + 信息灯塔
   ========================================================= */

/* ---------- 1. 变量 ---------- */
:root {
  --ink: #06121F;
  --ink-2: #0C2036;
  --cy: #35E6D0;
  --cy-soft: #9BF6EA;
  --paper: #F4F7F8;
  --mute: #94A6B3;
  --gold: #E8B75A;
  --coral: #FF6B5A;
  --glass: rgba(244, 247, 248, 0.08);
  --mono-bg: #0A2C3A;
  --hair: rgba(148, 166, 179, 0.24);
  --hair-cy: rgba(53, 230, 208, 0.22);
  --shell-w: 1200px;
  --gutter: clamp(18px, 4vw, 40px);
  --font-sans: "HarmonyOS Sans SC", "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "HarmonyOS Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-serif: "Songti SC", "Source Han Serif SC", "Noto Serif SC", "SimSun", Georgia, serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", "SFMono-Regular", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- 2. Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--ink);
  background-image:
    radial-gradient(72vw 56vh at 84% -10%, rgba(53, 230, 208, 0.10), transparent 68%),
    radial-gradient(52vw 48vh at 2% 14%, rgba(232, 183, 90, 0.055), transparent 70%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
ul, ol { margin: 0; padding-left: 0; list-style: none; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: inherit; }
[hidden] { display: none !important; }

::selection { background: var(--cy); color: #04211E; }

/* ---------- 3. 中文排版 ---------- */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--paper);
}
h1 { font-size: clamp(34px, 5.4vw, 56px); }
h2 { font-size: clamp(24px, 3vw, 32px); }
h3 { font-size: 22px; }
h4 { font-size: 18px; letter-spacing: 0; }

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.ver {
  display: inline-block;
  margin-inline: 0.4em;
  padding: 0.05em 0.45em;
  font-family: var(--font-mono);
  font-size: 0.86em;
  letter-spacing: 0.02em;
  color: var(--cy);
  background: var(--mono-bg);
  border-radius: 2px;
  font-variant-numeric: tabular-nums;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- 4. 焦点与可达性 ---------- */
:focus-visible {
  outline: 2px solid var(--cy);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- 5. 布局容器 ---------- */
.shell {
  width: 100%;
  max-width: var(--shell-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 28px);
}
.col-meta { grid-column: span 3; }
.col-main { grid-column: span 9; }

@media (max-width: 900px) {
  .col-meta,
  .col-main { grid-column: 1 / -1; }
}

.prose { max-width: 68ch; }
.prose p { color: var(--mute); margin-bottom: 1.1em; }
.prose h2, .prose h3 { margin: 1.6em 0 0.6em; }
.prose ul, .prose ol { padding-left: 1.25em; list-style: disc; color: var(--mute); }
.prose ol { list-style: decimal; }
.prose a { color: var(--cy); text-underline-offset: 3px; }

/* ---------- 6. 跳转链接 ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--cy);
  color: #04211E;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 2px;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- 7. 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  color: var(--paper);
  background: rgba(6, 18, 31, 0.86);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--hair);
  box-shadow: 0 1px 0 rgba(53, 230, 208, 0.10);
}

.header-top {
  max-height: 64px;
  overflow: hidden;
  border-bottom: 1px solid rgba(148, 166, 179, 0.14);
  transition: max-height 0.32s var(--ease), opacity 0.24s var(--ease),
              border-color 0.24s var(--ease);
}
.site-header[data-scrolled="true"] .header-top {
  max-height: 0;
  opacity: 0;
  border-bottom-color: transparent;
}

.header-top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  font-size: 12.5px;
  color: var(--mute);
}

.header-sign {
  margin: 0;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--paper);
}
.header-sign__meta {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--mute);
}

.header-meta {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}
.header-meta__text { letter-spacing: 0.06em; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 2px 10px;
  border: 1px solid rgba(232, 183, 90, 0.35);
  border-radius: 999px;
  background: rgba(232, 183, 90, 0.08);
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.08em;
  line-height: 1.7;
}
.chip .mono { color: var(--gold); }

.header-bar__inner {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.6vw, 34px);
  min-height: 72px;
  transition: min-height 0.28s var(--ease);
}
.site-header[data-scrolled="true"] .header-bar__inner { min-height: 56px; }

/* 品牌签名 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--paper);
}
.brand__mark {
  position: relative;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1px solid var(--cy);
  transform: rotate(45deg);
  transition: transform 0.32s var(--ease);
}
.brand__mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  background: var(--cy);
  opacity: 0.85;
}
.brand:hover .brand__mark { transform: rotate(135deg); }
.brand__text { display: block; }
.brand__name {
  display: block;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.25;
  color: var(--paper);
}
.brand__sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--mute);
}

/* 主导航 */
.site-nav { margin-left: auto; }
.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 26px);
}
.site-nav__link {
  position: relative;
  display: inline-block;
  padding: 6px 2px;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--mute);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--cy);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.24s var(--ease);
}
.site-nav__link:hover,
.site-nav__link:focus-visible { color: var(--paper); }
.site-nav__link:hover::after,
.site-nav__link:focus-visible::after { transform: scaleX(1); }
.site-nav__link[aria-current="page"] { color: var(--paper); font-weight: 600; }
.site-nav__link[aria-current="page"]::after { transform: scaleX(1); }

/* 移动开关 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  padding: 8px 13px;
  background: transparent;
  border: 1px solid var(--hair-cy);
  border-radius: 2px;
  color: var(--paper);
  font-size: 13px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.nav-toggle:hover { border-color: var(--cy); color: var(--cy); }
.nav-toggle__bars {
  position: relative;
  display: block;
  width: 16px;
  height: 1px;
  background: var(--cy);
}
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 1px;
  background: var(--cy);
  transition: transform 0.24s var(--ease);
}
.nav-toggle__bars::before { top: -5px; }
.nav-toggle__bars::after { top: 5px; }
.site-header[data-open="true"] .nav-toggle__bars { background: transparent; }
.site-header[data-open="true"] .nav-toggle__bars::before { transform: translateY(5px) rotate(45deg); }
.site-header[data-open="true"] .nav-toggle__bars::after { transform: translateY(-5px) rotate(-45deg); }

/* ---------- 8. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
              border-color 0.2s var(--ease), transform 0.1s var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--cy);
  border-color: var(--cy);
  color: #04211E;
}
.btn--primary:hover { background: var(--cy-soft); border-color: var(--cy-soft); }

.btn--ghost {
  background: transparent;
  border-color: var(--hair-cy);
  color: var(--paper);
}
.btn--ghost:hover {
  border-color: var(--cy);
  color: var(--cy);
  background: rgba(53, 230, 208, 0.08);
}

.header-cta { flex: 0 0 auto; white-space: nowrap; font-size: 13.5px; padding: 9px 16px; }

/* ---------- 9. 徽标 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 2px 9px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 1.7;
}
.badge--gold { color: var(--gold); background: rgba(232, 183, 90, 0.10); }
.badge--coral { color: var(--coral); background: rgba(255, 107, 90, 0.10); }
.badge--cy { color: var(--cy); background: rgba(53, 230, 208, 0.10); }

/* ---------- 10. 面包屑 ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--mute);
}
.crumbs a {
  color: var(--mute);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.crumbs a:hover { color: var(--cy); }
.crumbs__sep { color: var(--mute); opacity: 0.5; }
.crumbs [aria-current="page"] { color: var(--paper); }

/* ---------- 11. 章节刊头 ---------- */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
  margin-bottom: clamp(20px, 3vw, 34px);
}
.section-head__index {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.16em;
  color: var(--gold);
}
.section-head__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.section-head__note {
  margin: 0;
  font-size: 14px;
  color: var(--mute);
}

/* ---------- 12. 框景与四角刻度 ---------- */
.frame {
  position: relative;
  border: 1px solid var(--hair);
}
.frame::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  z-index: 2;
  background-image:
    linear-gradient(var(--cy), var(--cy)), linear-gradient(var(--cy), var(--cy)),
    linear-gradient(var(--cy), var(--cy)), linear-gradient(var(--cy), var(--cy)),
    linear-gradient(var(--cy), var(--cy)), linear-gradient(var(--cy), var(--cy)),
    linear-gradient(var(--cy), var(--cy)), linear-gradient(var(--cy), var(--cy));
  background-position:
    left top, left top,
    right top, right top,
    left bottom, left bottom,
    right bottom, right bottom;
  background-size:
    20px 1px, 1px 20px,
    20px 1px, 1px 20px,
    20px 1px, 1px 20px,
    20px 1px, 1px 20px;
  background-repeat: no-repeat;
}

/* ---------- 13. 通栏主题带 ---------- */
.band {
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  background:
    linear-gradient(90deg, rgba(12, 32, 54, 0.75), rgba(10, 44, 58, 0.42) 55%, rgba(6, 18, 31, 0) 100%);
}

/* ---------- 14. 图片容器 ---------- */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(160deg, #0C2036 0%, #06121F 72%);
  border: 1px solid var(--hair);
}
.media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(53, 230, 208, 0.07) 0 1px,
    transparent 1px 14px
  );
}
.media img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media--4x3 { aspect-ratio: 4 / 3; }
.media--16x9 { aspect-ratio: 16 / 9; }
.media--1x1 { aspect-ratio: 1 / 1; }
.media--tall { aspect-ratio: 3 / 4; }

.media__tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  padding: 3px 10px;
  background: rgba(6, 18, 31, 0.74);
  border: 1px solid var(--hair-cy);
  color: var(--cy);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  line-height: 1.7;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.media__cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  padding: 10px 14px;
  background: var(--glass);
  border-top: 1px solid var(--hair);
  color: var(--cy-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* ---------- 15. 标签流与页面内筛选 ---------- */
.tagflow {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(53, 230, 208, 0.35) transparent;
}
.tagflow > * {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 7px 15px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: transparent;
  color: var(--mute);
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.02em;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
              background-color 0.2s var(--ease);
}
.tag:hover { color: var(--cy); border-color: var(--hair-cy); }
.tag[aria-pressed="true"] {
  background: var(--cy);
  border-color: var(--cy);
  color: #04211E;
  font-weight: 600;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 14px;
  background: var(--glass);
  border: 1px solid var(--hair);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.filter-bar--stick {
  position: sticky;
  top: 76px;
  z-index: 40;
}
.filter-bar__count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--cy-soft);
  white-space: nowrap;
}

/* ---------- 16. 进场动效 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 0.42s var(--ease), transform 0.42s var(--ease);
  will-change: opacity, transform;
}
[data-reveal="in"] {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* ---------- 17. 页脚 ---------- */
.site-footer {
  margin-top: clamp(64px, 10vw, 120px);
  border-top: 1px solid var(--hair);
  background: linear-gradient(180deg, rgba(12, 32, 54, 0.62) 0%, rgba(6, 18, 31, 0.96) 100%);
  color: var(--mute);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr));
  gap: clamp(26px, 4vw, 44px);
  padding-block: clamp(40px, 6vw, 68px) clamp(28px, 4vw, 44px);
}

.footer-brand .brand { margin-bottom: 18px; }
.footer-tagline {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--paper);
}
.footer-note {
  margin: 0;
  max-width: 30ch;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--mute);
}

.footer-col__title {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--gold);
}
.footer-col__list {
  display: grid;
  gap: 9px;
}
.footer-col__list a {
  position: relative;
  display: inline-block;
  font-size: 14.5px;
  color: var(--mute);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.footer-col__list a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--cy);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.24s var(--ease);
}
.footer-col__list a:hover { color: var(--paper); }
.footer-col__list a:hover::after { transform: scaleX(1); }

.footer-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  padding-block: 22px;
  border-top: 1px solid var(--hair);
  font-size: 13.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.footer-contact__row { margin: 0; display: flex; align-items: baseline; gap: 0.5em; }
.footer-contact__key {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--mute);
  opacity: 0.75;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  padding-block: 18px 34px;
  border-top: 1px solid var(--hair);
  font-size: 12.5px;
  color: var(--mute);
}
.footer-legal__copy { margin: 0; }
.footer-legal__meta {
  margin: 0;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

/* ---------- 18. 响应式 ---------- */
@media (max-width: 980px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    margin-left: 0;
    padding: 4px var(--gutter) 14px;
    background: rgba(6, 18, 31, 0.97);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--hair-cy);
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.5);
  }
  .site-header[data-open="true"] .site-nav { display: block; }

  .site-nav__list {
    display: flex;
    align-items: center;
    gap: 20px;
    overflow-x: auto;
    padding: 12px 0 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .site-nav__list::-webkit-scrollbar { display: none; }
  .site-nav__link { white-space: nowrap; font-size: 14px; }

  .header-bar__inner { min-height: 60px; }
  .header-cta { display: none; }

  .filter-bar--stick { top: 60px; }
  .footer-contact { font-size: 13px; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .header-meta__text { display: none; }
  .header-sign { font-size: 12px; letter-spacing: 0.12em; }
  .brand__name { font-size: 16px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-legal { flex-direction: column; align-items: flex-start; }
}

/* ---------- 19. 动效尊重 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .brand:hover .brand__mark { transform: rotate(45deg); }
}
