/* ==================================================================
 * base.css —— 设计令牌 / 重置 / 排版 / 通用工具类
 * 风格定位：庄重简约 · 学术科技感 · 蓝白主色调
 * ================================================================== */

/* ---------- 设计令牌 ---------- */
:root {
  /* 品牌蓝 */
  --c-primary: #0a3d91;
  --c-primary-700: #083071;
  --c-primary-900: #05214f;
  --c-primary-500: #1c5fc4;
  --c-primary-300: #6f9fe8;
  --c-primary-100: #dbe7fb;
  --c-primary-50: #eff5fd;

  /* 辅助色 */
  --c-accent: #0f7ae5;
  --c-gold: #b99245;
  --c-success: #1f9d6b;
  --c-warning: #d98613;
  --c-danger: #c0392b;

  /* 中性色 */
  --c-bg: #ffffff;
  --c-bg-soft: #f5f8fd;
  --c-bg-mute: #eef2f9;
  --c-border: #e1e8f2;
  --c-border-strong: #c9d6e8;
  --c-text: #1b2735;
  --c-text-sub: #55677d;
  --c-text-mute: #8b9bad;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong",
    "SimSun", Georgia, "Times New Roman", serif;

  /* 尺寸 */
  --container: 1200px;
  --header-h: 132px;
  --nav-h: 52px;
  --radius-sm: 3px;
  --radius: 6px;
  --radius-lg: 12px;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(10, 61, 145, 0.06);
  --shadow: 0 4px 16px rgba(10, 61, 145, 0.08);
  --shadow-lg: 0 12px 36px rgba(10, 61, 145, 0.14);

  /* 动效 */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 0.24s;
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  color: var(--c-text);
  background: var(--c-bg-soft);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.6em;
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.35;
  color: var(--c-primary-900);
}

p { margin: 0 0 1em; }

a {
  color: var(--c-primary-500);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
a:hover { color: var(--c-accent); }

img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 0;
}

ul, ol { margin: 0; padding: 0; list-style: none; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; }

table { border-collapse: collapse; width: 100%; }

::selection { background: var(--c-primary-100); color: var(--c-primary-900); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--c-bg-mute); }
::-webkit-scrollbar-thumb {
  background: var(--c-border-strong);
  border-radius: 6px;
  border: 2px solid var(--c-bg-mute);
}
::-webkit-scrollbar-thumb:hover { background: var(--c-primary-300); }

/* ---------- 排版工具 ---------- */
.u-serif { font-family: var(--font-serif); }
.u-mono { font-family: "SF Mono", Menlo, Consolas, monospace; }
.u-bold { font-weight: 700; }
.u-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.u-clamp-2, .u-clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.u-clamp-2 { -webkit-line-clamp: 2; }
.u-clamp-3 { -webkit-line-clamp: 3; }

/* ---------- 布局工具 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

.row { display: flex; flex-wrap: wrap; }
.row-gap-24 { gap: 24px; }
.row-gap-16 { gap: 16px; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-1 { flex: 1; min-width: 0; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }

.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.u-hidden { display: none !important; }

/* ---------- 文本色 ---------- */
.t-primary { color: var(--c-primary); }
.t-sub { color: var(--c-text-sub); }
.t-mute { color: var(--c-text-mute); }
.t-gold { color: var(--c-gold); }
.t-sm { font-size: 13px; }
.t-xs { font-size: 12px; }
.t-lg { font-size: 17px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--c-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: all var(--dur) var(--ease);
}
.btn:hover {
  background: var(--c-primary-500);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
  background: transparent;
  border-color: var(--c-border-strong);
  color: var(--c-text-sub);
}
.btn-ghost:hover {
  background: var(--c-primary-50);
  border-color: var(--c-primary-300);
  color: var(--c-primary);
}
.btn-outline {
  background: transparent;
  border-color: currentColor;
}
.btn-sm { height: 30px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 46px; padding: 0 28px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-white { background: #fff; color: var(--c-primary); }
.btn-white:hover { background: var(--c-primary-50); color: var(--c-primary-700); }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 2px;
  background: var(--c-primary-50);
  color: var(--c-primary);
  font-size: 12px;
  line-height: 1;
  border: 1px solid var(--c-primary-100);
}
.tag-gold { background: #fbf6ec; color: var(--c-gold); border-color: #f0e4cc; }
.tag-green { background: #eaf7f1; color: var(--c-success); border-color: #d3ece0; }
.tag-grey { background: var(--c-bg-mute); color: var(--c-text-sub); border-color: var(--c-border); }

/* ---------- 通用区块标题 ---------- */
.section { padding: 44px 0; }
.section-tight { padding: 28px 0; }
.section-alt { background: var(--c-bg); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--c-border);
  position: relative;
}
.section-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 72px;
  height: 2px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-primary-300));
}
.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0;
  font-size: 24px;
  letter-spacing: 1px;
}
.section-title .en {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--c-text-mute);
  text-transform: uppercase;
}
.section-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--c-text-mute);
  flex-shrink: 0;
}
.section-more:hover { color: var(--c-primary); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card-hover:hover {
  border-color: var(--c-primary-100);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--c-text-mute);
  padding: 16px 0;
}
.breadcrumb a { color: var(--c-text-sub); }
.breadcrumb a:hover { color: var(--c-primary); }
.breadcrumb .sep { color: var(--c-border-strong); }
.breadcrumb .current { color: var(--c-primary); font-weight: 500; }

/* ---------- 加载 / 空状态 / 骨架 ---------- */
.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 64px 20px;
  color: var(--c-text-mute);
  font-size: 14px;
  text-align: center;
}
.state svg { opacity: 0.45; }

.spinner {
  width: 26px;
  height: 26px;
  border: 2px solid var(--c-primary-100);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--c-bg-mute) 25%, #f8fafd 37%, var(--c-bg-mute) 63%);
  background-size: 400% 100%;
  animation: skeleton 1.3s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 28px 0 8px;
}
.pagination button {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-bg);
  color: var(--c-text-sub);
  font-size: 14px;
  transition: all var(--dur) var(--ease);
}
.pagination button:hover:not(:disabled):not(.is-active) {
  border-color: var(--c-primary-300);
  color: var(--c-primary);
}
.pagination button.is-active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
  font-weight: 600;
}
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .total { font-size: 13px; color: var(--c-text-mute); margin-right: 10px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 18px; }
.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text-sub);
}
.field-label .req { color: var(--c-danger); margin-left: 3px; }

.input, .select, .textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  background: var(--c-bg);
  font-size: 14px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.textarea { height: auto; min-height: 96px; padding: 9px 12px; line-height: 1.7; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--c-primary-500);
  box-shadow: 0 0 0 3px rgba(28, 95, 196, 0.12);
}
.input::placeholder, .textarea::placeholder { color: var(--c-text-mute); }
.input:disabled, .textarea:disabled { background: var(--c-bg-mute); cursor: not-allowed; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  :root { --container: 100%; }
  .section { padding: 34px 0; }
  .section-title { font-size: 21px; }
}

@media (max-width: 768px) {
  body { font-size: 14px; }
  .section { padding: 26px 0; }
  .section-title { font-size: 19px; }
  .section-title .en { display: none; }
  .container { padding: 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 打印 ---------- */
@media print {
  .site-header, .site-footer, .page-banner, .breadcrumb, .pagination, .back-to-top { display: none !important; }
  body { background: #fff; }
}
