/* ========== 基础样式 / 全局变量 ========== */
:root {
  /* 商会科技蓝主题 */
  --blue-900: #061a3a;
  --blue-800: #0a2a5e;
  --blue-700: #0d3b8c;
  --blue-600: #1366e0;
  --blue-500: #2b8cff;
  --blue-400: #5aa9ff;
  --blue-300: #9cc8ff;
  --cyan-400: #2ee6e6;
  --gold: #ffc24b;
  /* 党建红主题 */
  --red-700: #b3122b;
  --red-600: #d62839;
  --red-500: #e63946;
  --red-400: #ff5a67;
  /* 中性 */
  --ink: #0e1726;
  --ink-2: #3a4a63;
  --muted: #7a8aa3;
  --line: #e6ecf5;
  --bg: #f5f8fd;
  --white: #ffffff;
  --radius: 16px;
  --shadow-sm: 0 4px 16px rgba(13, 59, 140, .08);
  --shadow-md: 0 12px 40px rgba(13, 59, 140, .12);
  --shadow-lg: 0 24px 60px rgba(13, 59, 140, .18);
  --maxw: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 90px 0; }
.section-title { font-size: 34px; font-weight: 800; letter-spacing: 1px; text-align: center; }
.section-title .accent { color: var(--blue-600); }
.section-title .medal { display: inline-flex; align-items: center; vertical-align: -0.13em; margin-right: 8px; }
.section-title .medal svg { width: 1em; height: 1em; display: block; }
.section-title .gold-txt { color: #d4a017; }
.section-title .ink-txt { color: var(--ink); }
.section-sub { text-align: center; color: var(--muted); margin-top: 12px; font-size: 16px; }
.section-head { margin-bottom: 48px; }

/* 顶部加载条 */
#topbar-thin { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 9999;
  background: linear-gradient(90deg, var(--blue-500), var(--cyan-400)); transition: width .25s; }

/* ========== 导航 ========== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px max(24px, calc((100% - 1200px) / 2 + 24px)); background: rgba(255,255,255,.72);
  backdrop-filter: blur(14px); border-bottom: 1px solid rgba(255,255,255,.4);
  transition: all .35s;
}
.nav.scrolled { background: rgba(255,255,255,.92); box-shadow: var(--shadow-sm); padding: 5px max(24px, calc((100% - 1200px) / 2 + 24px)); }
.nav .brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 19px; }
.nav .brand .logo {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, var(--blue-600), var(--cyan-400));
  display: grid; place-items: center; color: #fff; font-size: 20px; font-weight: 800;
  box-shadow: 0 6px 18px rgba(19,102,224,.35);
}
.nav .brand .logo-img { width: 42px; height: 42px; border-radius: 50%; flex: none; background: transparent; padding: 0; object-fit: contain; box-shadow: 0 4px 14px rgba(0,0,0,.16); }
.nav .brand .brand-word { height: 32px; width: auto; display: block; flex: none; }
.nav .brand .logo-img.sm { width: 46px; height: 46px; border-radius: 50%; background: transparent; padding: 0; }
.nav .brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 2px; }
.nav .links { display: flex; align-items: center; gap: 10px; }
.nav .links a {
  padding: 9px 16px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--ink-2);
  transition: all .2s; position: relative;
}
.nav .links a:hover { color: var(--blue-600); background: rgba(19,102,224,.07); }
.nav .links a.active { color: var(--blue-600); }
.nav .links a.btn-apply {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-500)); color: #fff;
  box-shadow: 0 6px 18px rgba(19,102,224,.35);
}
.nav .links a.btn-apply:hover { transform: translateY(-2px); color: #fff; }
.nav .links a.btn-admin { color: var(--blue-700); }
.nav-toggle { display: none; background: none; border: none; font-size: 26px; cursor: pointer; color: var(--blue-700); }

/* ========== 按钮 ========== */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 13px 28px; border-radius: 999px; font-size: 15px; font-weight: 700; border: none;
  transition: all .25s; text-align: center;
}
.btn-primary { background: linear-gradient(135deg, var(--blue-600), var(--blue-500)); color: #fff; box-shadow: 0 10px 26px rgba(19,102,224,.35); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(19,102,224,.45); }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.35); backdrop-filter: blur(4px); }
.btn-ghost:hover { background: rgba(255,255,255,.22); transform: translateY(-3px); }
.btn-outline { background: #fff; color: var(--blue-700); border: 1.5px solid var(--blue-500); }
.btn-outline:hover { background: var(--blue-600); color: #fff; }

/* ========== 页脚 ========== */
.footer { background: var(--blue-900); color: #c7d6ee; padding: 60px 0 30px; }
.footer .grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; }
.footer h4 { color: #fff; font-size: 17px; margin-bottom: 16px; }
.footer a { color: #c7d6ee; font-size: 14px; display: block; margin-bottom: 9px; transition: color .2s; }
.footer a:hover { color: var(--cyan-400); }
.footer .brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.footer .brand-row .logo { width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(135deg, var(--blue-600), var(--cyan-400)); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 22px; }
.footer .brand-row .logo-img { width: 50px; height: 50px; border-radius: 50%; background: #fff; padding: 3px; flex: none; object-fit: contain; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.footer .contact-line { font-size: 14px; margin-bottom: 8px; }
.footer .bottom { text-align: center; margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; color: #8fa6c9; }

/* 滚动显示动画 */
.reveal { opacity: 0; transform: translateY(38px); transition: all .8s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }

/* toast 提示 */
.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 13px 24px; border-radius: 12px; font-size: 14px;
  box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transition: all .3s; z-index: 9999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: #16a34a; }
.toast.err { background: var(--red-600); }

/* ========== 移动端适配 ========== */
@media (max-width: 860px) {
  .nav { padding: 7px 16px; }
  .nav.scrolled { padding: 6px 16px; }
  .nav .brand { min-width: 0; }
  /* 抽屉式菜单：贴合导航下方，全宽留边 */
  .nav .links {
    position: absolute; top: calc(100% + 10px); left: 12px; right: 12px;
    width: auto; flex-direction: column; align-items: stretch;
    background: #fff; padding: 12px; border-radius: 18px;
    box-shadow: 0 26px 60px rgba(6,26,58,.28);
    gap: 4px; transform: translateY(-10px); opacity: 0; visibility: hidden;
    pointer-events: none; transition: transform .26s ease, opacity .26s, visibility .26s;
  }
  .nav .links.open { transform: none; opacity: 1; visibility: visible; pointer-events: auto; }
  .nav .links a { min-height: 48px; display: flex; align-items: center; font-size: 16px; border-radius: 12px; }
  .nav .links a.btn-apply { justify-content: center; margin-top: 4px; }
  .nav .links a.btn-admin { justify-content: center; }
  .nav-toggle { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; margin-left: 8px; flex: none; }
  /* 菜单打开时的遮罩，并锁定背景滚动 */
  body.menu-open { overflow: hidden; }
  body.menu-open::after {
    content: ''; position: fixed; inset: 0; z-index: 999;
    background: rgba(6,26,58,.42); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    animation: maskIn .2s ease;
  }
  @keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
  .footer .grid { grid-template-columns: 1fr 1fr; gap: 26px; }
  .section { padding: 62px 0; }
  .section-title { font-size: 26px; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .section { padding: 50px 0; }
  .section-title { font-size: 23px; }
  .section-sub { font-size: 14px; margin-top: 10px; }
  .section-head { margin-bottom: 30px; }
  .nav { padding: 6px 14px; }
  .nav.scrolled { padding: 5px 14px; }
  .nav .brand { font-size: 16px; gap: 9px; }
  .nav .brand .logo-img { width: 40px; height: 40px; }
  .nav .brand small { font-size: 9.5px; letter-spacing: 1px; }
  .footer { padding: 44px 0 26px; }
  .footer .grid { grid-template-columns: 1fr; gap: 22px; }
  .footer .bottom { margin-top: 28px; font-size: 12px; }
  .btn { padding: 12px 22px; font-size: 15px; }
  /* toast 小屏改为通栏 */
  .toast { left: 16px; right: 16px; bottom: 22px; transform: translateY(16px); text-align: center; }
  .toast.show { transform: translateY(0); }
  /* iOS 输入框字号 >=16px，避免聚焦自动放大 */
  .field input, .field textarea, .field select,
  .login-card input,
  .adm-field input, .adm-field textarea, .adm-field select { font-size: 16px; }
}
