/* ============================================================
   mjapk.com · base.css
   共用：重置 / 变量 / 导航 / 按钮 / 折叠 / 标签页 / 页脚
   ============================================================ */

:root {
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --ink: #101828;
  --ink-soft: #475467;
  --ink-faint: #98a2b3;
  --paper: #ffffff;
  --line: rgba(16, 24, 40, 0.1);

  --accent: #2f5bff;
  --accent-ink: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --max: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --header-bg: rgba(255, 255, 255, 0.86);
  --header-fg: #101828;
  --header-line: rgba(16, 24, 40, 0.08);
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p, figure, blockquote, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

::selection { background: var(--accent); color: var(--accent-ink); }

.container {
  width: min(100% - 48px, var(--max));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 8px;
  background: #101828;
  color: #fff;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: none; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-line);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: box-shadow 0.3s var(--ease);
}
.site-header.is-scrolled { box-shadow: 0 10px 30px rgba(16, 24, 40, 0.08); }

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--header-fg);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.brand-text {
  display: flex;
  flex-direction: column;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: 0.01em;
}
.brand-text em {
  font-style: normal;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  opacity: 0.55;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.site-nav a {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--header-fg);
  opacity: 0.72;
  white-space: nowrap;
  transition: opacity 0.2s, background 0.2s;
}
.site-nav a:hover { opacity: 1; background: rgba(127, 127, 127, 0.1); }
.site-nav a.is-active {
  opacity: 1;
  font-weight: 600;
  background: rgba(127, 127, 127, 0.13);
}

.btn-login {
  flex: 0 0 auto;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid currentColor;
  color: var(--header-fg);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.btn-login:hover { background: var(--header-fg); color: var(--header-bg); }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  padding: 11px;
  border: 1px solid var(--header-line);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  margin: 4px 0;
  border-radius: 2px;
  background: var(--header-fg);
  transition: transform 0.25s var(--ease), opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px color-mix(in srgb, var(--accent) 78%, transparent); }
.btn-room {
  border: 1.5px dashed color-mix(in srgb, currentColor 45%, transparent);
  color: inherit;
  cursor: default;
  background: transparent;
}
.btn-room b { font-family: var(--font-mono); letter-spacing: 0.06em; }

.tg-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
}
.tg-link svg { width: 20px; height: 20px; flex: 0 0 auto; }
.tg-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  opacity: 0.66;
}
.crumb a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- accordion ---------- */
.acc-item {
  border-bottom: 1px solid var(--line);
}
.acc-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 18px 2px;
  border: 0;
  background: transparent;
  text-align: left;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
}
.acc-trigger::after {
  content: "+";
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-weight: 400;
  font-size: 17px;
  line-height: 1;
  opacity: 0.6;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}
.acc-trigger[aria-expanded="true"]::after { transform: rotate(45deg); opacity: 1; }
.acc-panel { padding: 0 40px 20px 2px; font-size: 15px; opacity: 0.82; }
.acc-panel[hidden] { display: none; }

/* ---------- tabs ---------- */
.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.12);
}
.tab {
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.7;
  transition: background 0.2s, opacity 0.2s, color 0.2s;
}
.tab[aria-selected="true"] {
  background: var(--tab-on, #101828);
  color: var(--tab-on-fg, #fff);
  opacity: 1;
}
.tab-panel[hidden] { display: none; }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 0;
  padding: 64px 0 28px;
  background: #0d1320;
  color: #c8d0de;
  font-size: 14px;
}
.site-footer .brand { color: #fff; }
.site-footer .brand-text em { opacity: 0.5; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.7fr repeat(3, 1fr) 1.2fr;
  gap: 36px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-brand p { margin-top: 16px; max-width: 34em; opacity: 0.62; line-height: 1.8; }
.footer-col { display: flex; flex-direction: column; gap: 9px; }
.footer-col h3 {
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.45;
}
.footer-col a { opacity: 0.78; transition: opacity 0.2s; }
.footer-col a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.footer-contact a { color: #8fb0ff; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-top: 22px;
  font-size: 12.5px;
  opacity: 0.55;
}
.footer-bottom a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .header-inner { gap: 14px; }
  .site-nav { gap: 0; }
  .site-nav a { padding: 7px 8px; font-size: 13.5px; }
  .footer-grid { grid-template-columns: 1.6fr repeat(2, 1fr); }
  .footer-contact { grid-column: span 2; }
}

@media (max-width: 1000px) {
  .site-nav {
    position: fixed;
    inset: 68px 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    max-height: calc(100vh - 68px);
    padding: 16px 24px 26px;
    overflow: auto;
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-line);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s;
  }
  .site-nav.is-open { opacity: 1; transform: none; visibility: visible; }
  .site-nav a { padding: 12px 10px; font-size: 15px; }
  .nav-toggle { display: block; }
  .btn-login { display: none; }
}

@media (max-width: 700px) {
  .container { width: min(100% - 36px, var(--max)); }
  .header-inner { min-height: 62px; }
  .site-nav { inset: 62px 0 auto; }
  .brand-text { font-size: 14px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .footer-brand { grid-column: span 2; }
  .footer-contact { grid-column: span 2; }
  .btn { padding: 12px 18px; font-size: 14.5px; }
}

@media (max-width: 420px) {
  .brand-mark { width: 34px; height: 34px; border-radius: 9px; font-size: 12.5px; }
  .brand-text em { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
