/* ============================================================
   寰城科技 · 全站样式表
   纯静态、零依赖；配色沿用原站青绿色系，做现代化重构
   ============================================================ */

:root {
  --teal-950: #083f46;
  --teal-900: #0b4f57;
  --teal-800: #0f6f78;
  --teal-700: #12848e;
  --teal-600: #1a9aa3;
  --teal-100: #e3f2f2;
  --teal-50:  #f1f8f8;

  --bg: #f5f8f8;
  --surface: #ffffff;
  --ink: #17373a;
  --ink-soft: #5b777a;
  --line: #e2ecec;
  --accent: #d98336;

  --shadow-sm: 0 1px 2px rgba(11, 79, 87, .04), 0 6px 18px rgba(11, 79, 87, .06);
  --shadow-md: 0 14px 34px rgba(11, 79, 87, .13);

  --radius: 16px;
  --radius-sm: 10px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans CJK SC",
          -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; border: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--teal-600);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection { background: var(--teal-100); color: var(--teal-900); }

.container {
  width: min(1160px, calc(100% - 48px));
  margin-inline: auto;
}

/* ---------- 顶部日期条 ---------- */
.topbar {
  background: #eaf3f3;
  border-bottom: 1px solid rgba(15, 111, 120, .07);
  color: var(--ink-soft);
  font-size: 13px;
}
.topbar-inner {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  letter-spacing: .02em;
}
#date { font-variant-numeric: tabular-nums; }

/* ---------- 主导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--teal-700), var(--teal-900));
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(15, 111, 120, .22);
}
.brand-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--teal-900);
  white-space: nowrap;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.main-nav a {
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease, transform .2s var(--ease);
}
.main-nav a:hover { background: var(--teal-50); color: var(--teal-800); }
.main-nav a[aria-current="page"] {
  background: var(--teal-100);
  color: var(--teal-900);
  font-weight: 600;
}
.main-nav a.nav-cta {
  margin-left: 8px;
  border: 1px solid rgba(15, 111, 120, .28);
  color: var(--teal-800);
}
.main-nav a.nav-cta:hover { background: var(--teal-800); color: #fff; border-color: var(--teal-800); }
.main-nav a.nav-cta[aria-current="page"] { background: var(--teal-800); color: #fff; border-color: var(--teal-800); }

/* ---------- 页面主体 ---------- */
.site-header, .site-footer { flex: 0 0 auto; }
.main { flex: 1 0 auto; padding: 32px 0 72px; }

/* ---------- 首页横幅 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid #dceaea;
  border-radius: 22px;
  background:
    linear-gradient(90deg, rgba(244, 250, 250, .97) 0%, rgba(244, 250, 250, .84) 42%, rgba(244, 250, 250, .08) 100%),
    url("images/banner.jpg") center center / cover no-repeat;
  box-shadow: var(--shadow-sm);
}
.hero-inner {
  position: relative;
  padding: 52px 56px 56px;
  max-width: 640px;
}
.hero-eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(15, 111, 120, .09);
  color: var(--teal-800);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
}
.hero h1 {
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.28;
  letter-spacing: -.02em;
  font-weight: 700;
  color: var(--teal-900);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s ease, background-color .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(.98); }
.btn-primary {
  background: var(--teal-800);
  color: #fff;
  box-shadow: 0 6px 16px rgba(15, 111, 120, .22);
}
.btn-primary:hover { background: var(--teal-700); box-shadow: 0 10px 22px rgba(15, 111, 120, .28); }
.btn-ghost {
  background: rgba(255, 255, 255, .86);
  border-color: rgba(15, 111, 120, .24);
  color: var(--teal-800);
}
.btn-ghost:hover { background: #fff; border-color: var(--teal-700); }
.btn-quiet {
  background: var(--teal-50);
  border-color: var(--line);
  color: var(--ink-soft);
}
.btn-quiet:hover { background: var(--teal-100); color: var(--teal-900); }

/* ---------- 区块标题 ---------- */
.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 44px 0 22px;
}
.section-head h2 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--teal-900);
  white-space: nowrap;
}
.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* ---------- 信息卡片网格 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}
.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  animation: rise .5s var(--ease) both;
  transition: transform .25s var(--ease), box-shadow .25s ease, border-color .25s ease;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: rgba(15, 111, 120, .22);
}
.card-media {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #f0f5f5;
  border-bottom: 1px solid var(--line);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform .35s var(--ease);
}
.card:hover .card-media img { transform: scale(1.045); }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 47px;
}
.card-title a { transition: color .2s ease; }
.card:hover .card-title a { color: var(--teal-700); }
.card-date {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.card-date::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 详情页 ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--ink-soft);
}
.breadcrumb a { color: var(--teal-700); transition: color .2s ease; }
.breadcrumb a:hover { color: var(--teal-900); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb .sep { color: #b9cccd; }
.breadcrumb .current { color: var(--ink); }

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.detail-media {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.detail-panel {
  padding: 30px 32px 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.detail-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--teal-100);
  color: var(--teal-800);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}
.detail-title {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--teal-900);
}
.detail-actions {
  margin: 24px 0 26px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
.detail-body {
  color: #39585b;
  font-size: 15.5px;
  line-height: 1.95;
  white-space: normal;
}
.detail-body br { display: block; content: ""; margin-top: .35em; }

/* 无图详情页：文章式单栏 */
.detail-grid--text { grid-template-columns: minmax(0, 1fr); }
.detail-grid--text .detail-panel { padding: 36px 42px 42px; }
.detail-grid--text .detail-body { max-width: 74ch; }

/* ---------- 登录 / 注册 ---------- */
.auth-wrap {
  flex: 1 0 auto;
  display: grid;
  place-items: center;
  padding: 56px 24px 72px;
  background:
    radial-gradient(1100px 420px at 50% -10%, rgba(26, 154, 163, .13), transparent 70%),
    var(--bg);
}
.auth-card {
  width: min(440px, 100%);
  padding: 38px 38px 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  animation: rise .5s var(--ease) both;
}
.auth-head { margin-bottom: 28px; text-align: center; }
.auth-head .auth-kicker {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--teal-700);
}
.auth-head h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--teal-900);
  letter-spacing: -.01em;
}
.auth-head::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  margin: 16px auto 0;
  border-radius: 999px;
  background: var(--accent);
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.field input {
  width: 100%;
  height: 48px;
  padding: 0 15px;
  border: 1px solid #d3e2e2;
  border-radius: var(--radius-sm);
  background: #fbfdfd;
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.field input::placeholder { color: #9bb2b4; }
.field input:hover { border-color: #b8d2d3; }
.field input:focus {
  outline: none;
  border-color: var(--teal-600);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 154, 163, .15);
}
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 26px;
}
.form-actions .btn { flex: 1; }

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--teal-950);
  color: #cfe3e3;
  padding: 34px 0 30px;
  font-size: 14px;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.footer-brand {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .04em;
}
.footer-lines { line-height: 1.9; }
.footer-lines p { margin: 0; }
.footer-lines a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 255, 255, .4);
  transition: text-decoration-color .2s ease, color .2s ease;
}
.footer-lines a:hover { color: #9fe0e0; text-decoration-color: currentColor; }
.footer-divider { margin: 0 10px; color: rgba(255, 255, 255, .35); }

/* 独立 footer.html 使用 */
body.footer-only { display: block; background: var(--teal-950); min-height: 100vh; }
body.footer-only .site-footer { padding: 40px 0; }

/* ---------- 404 ---------- */
.error-wrap {
  flex: 1 0 auto;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 24px;
  background: radial-gradient(900px 400px at 50% 30%, rgba(26, 154, 163, .12), transparent 70%), var(--bg);
}
.error-card { text-align: center; }
.error-code {
  font-size: clamp(80px, 14vw, 140px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.06em;
  color: var(--teal-800);
  opacity: .9;
}
.error-card h1 {
  margin-top: 12px;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}
.error-card .btn { margin-top: 30px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-inner { padding: 44px 42px 48px; }
}

@media (max-width: 860px) {
  .nav-inner { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 0 14px; }
  .brand { justify-content: center; }
  .main-nav { justify-content: center; }
  .main-nav a { padding: 7px 12px; font-size: 14px; }
  .main-nav a.nav-cta { margin-left: 0; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-media { max-height: 420px; }
  .auth-wrap { min-height: auto; }
}

@media (max-width: 700px) {
  .container { width: min(1160px, calc(100% - 32px)); }
  .topbar-inner { font-size: 12px; }
  .nav-inner { gap: 6px; padding: 10px 0 12px; }
  .main-nav { width: 100%; gap: 5px; }
  .main-nav a { padding: 6px 9px; font-size: 13px; }
  .main-nav a.nav-cta { margin-left: 0; }
  .main { padding: 22px 0 52px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .card-body { padding: 13px 13px 15px; gap: 8px; }
  .card-title { font-size: 14px; min-height: 44px; }
  .hero-inner { padding: 34px 26px 36px; }
  .hero-actions { margin-top: 20px; }
  .section-head { margin: 32px 0 18px; }
  .detail-panel, .detail-grid--text .detail-panel { padding: 24px 22px 28px; }
  .detail-title { font-size: 22px; }
  .auth-card { padding: 30px 24px 32px; }
  .footer-divider { margin: 0 6px; }
}

@media (max-width: 420px) {
  .main-nav a { padding: 6px 8px; font-size: 12.5px; }
  .hero h1 { font-size: 26px; }
  .btn { padding: 10px 18px; }
  .form-actions { flex-direction: column; }
}

@media (max-width: 360px) {
  .card-grid { grid-template-columns: minmax(0, 1fr); }
  .card-media { aspect-ratio: 4 / 3; }
}

/* ---------- 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
