/* ============================================================
 * 上海诚盈财税官网 · 共享设计系统
 * 被 home.blade.php 与 wiki/layout.blade.php 共用
 * 维护人：官网维护组
 * ============================================================
 *
 * 设计原则（遵循 ui-ux-pro-max 技能规则）：
 *  - Accessibility CRITICAL：可见焦点环 / skip-link / reduced-motion / 对比度达标
 *  - Touch CRITICAL：移动端交互元素 ≥44pt
 *  - Style HIGH：tokens 走语义化 CSS 变量，深色蓝金配色贯穿
 *
 * 页面独有的 hero / services / wiki article / chat 组件 等
 * 样式仍保留在各自 Blade 内联 <style> 中。
 * ============================================================ */

:root {
  --navy:  #0f2d4f;
  --blue:  #1e6bb8;
  --gold:  #c99a3a;
  --ink:   #1f2937;
  --muted: #667085;
  --line:  #e5eaf0;
  --soft:  #f5f8fb;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(15, 45, 79, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.7;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

.container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

/* ============ Header / 主导航 ============ */
header.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid rgba(229, 234, 240, .9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  color: var(--navy);
}
.brand .logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff;
  font-size: 20px;
  box-shadow: 0 10px 22px rgba(30, 107, 184, .22);
  flex: 0 0 auto;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin-top: -2px;
}

.links {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: #344054;
}
.links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 18px;
  border-radius: 999px;
  color: var(--navy);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease,
              transform .2s ease, border-color .2s ease;
}
.links a:hover {
  color: var(--blue);
  border-color: rgba(30, 107, 184, .18);
  background: rgba(30, 107, 184, .06);
}
.links a.active {
  color: #fff !important;
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold), #d9ad54);
  box-shadow: 0 10px 24px rgba(201, 154, 58, .24);
}
.links a.active:hover {
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(201, 154, 58, .34);
}

/* 移动端 hamburger 切换按钮（仅 ≤900px 显示） */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--navy);
  cursor: pointer;
  flex: 0 0 auto;
}
.menu-toggle:hover { background: var(--soft); }
.menu-toggle svg { width: 22px; height: 22px; }
.menu-toggle .ic-close { display: none; }
.menu-toggle[aria-expanded="true"] .ic-menu { display: none; }
.menu-toggle[aria-expanded="true"] .ic-close { display: inline-block; }

/* ============ Skip-link & Focus 焦点环 ============ */
.skip-link {
  position: absolute;
  left: 8px;
  top: -50px;
  z-index: 100;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; }

.links a:focus-visible,
.btn:focus-visible,
.submit:focus-visible,
.svc:focus-visible,
.feature:focus-visible,
.step:focus-visible,
.brand:focus-visible,
.card:focus-visible,
.menu-toggle:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible,
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}
/* 不再用 outline:none 隐藏键盘焦点，但保留鼠标 focus 静默 */
input:focus, textarea:focus, select:focus { outline: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============ 移动端响应（≤900px）：导航 hamburger ============ */
@media (max-width: 900px) {
  .nav {
    height: auto;
    min-height: 64px;
    padding: 12px 0;
    flex-wrap: wrap;
    align-items: center;
  }
  .menu-toggle { display: inline-flex; }

  .links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 6px 0 4px;
    order: 3;
  }
  .links.open { display: flex; }
  .links a {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 12px 16px;
    font-size: 15px;
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .container { width: min(100% - 28px, 1180px); }
  .nav { min-height: 60px; gap: 10px; }
  .brand { max-width: calc(100% - 56px); }
  .brand span:last-child { font-size: 14px; }
  .brand small { display: none; }
  .links a { padding: 11px 14px; font-size: 14px; min-height: 44px; }
}

/* ============ Footer ============ */
footer.site-foot {
  padding: 28px 0;
  background: #0b213b;
  color: rgba(255, 255, 255, .7);
  font-size: 14px;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ============ prefers-reduced-motion ============ */
@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;
    scroll-behavior: auto !important;
  }
}
