/* 万红日 · 科技成果展示 —— 全站样式（无外部依赖，可离线部署） */

:root {
  --brand: #14507d;
  --brand-2: #0f8f8f;
  --brand-soft: #eef4fa;
  --accent: #c9761f;
  --text: #1f2a35;
  --text-soft: #55616e;
  --line: #dde5ee;
  --bg: #ffffff;
  --bg-alt: #f6f9fc;
  --card: #ffffff;
  --shadow: 0 10px 30px rgba(20, 80, 125, .08);
  --radius: 14px;
  --max: 1140px;
}

html[data-theme="dark"] {
  --brand: #6fb1e6;
  --brand-2: #4fd1c5;
  --brand-soft: #16222e;
  --accent: #e0a458;
  --text: #e8eef4;
  --text-soft: #a8b6c4;
  --line: #26333f;
  --bg: #0f1720;
  --bg-alt: #131e28;
  --card: #16222e;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; }

/* ---------- 顶部提示条 ---------- */
.template-notice {
  display: flex; align-items: center; gap: 12px;
  background: #fff7e6; color: #8a5300;
  border-bottom: 1px solid #f0dcb4;
  padding: 10px 20px; font-size: 14px;
}
.template-notice[hidden] { display: none; }
.template-notice p { margin: 0; flex: 1; }
.template-notice__icon {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  background: #e6a23c; color: #fff; font-weight: 700; font-size: 13px;
  display: grid; place-items: center;
}
.template-notice__close {
  border: 0; background: transparent; color: inherit;
  font-size: 20px; line-height: 1; cursor: pointer; padding: 0 6px;
}

/* ---------- 头部 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 66px; }

.brand { display: flex; align-items: center; gap: 10px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand__logo { width: 34px; height: 34px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__text strong { font-size: 16px; letter-spacing: .3px; }
.brand__text small { color: var(--text-soft); font-size: 12px; }

.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 8px 12px; border-radius: 8px;
  color: var(--text-soft); font-size: 15px;
}
.site-nav a:hover, .site-nav a.is-active { background: var(--brand-soft); color: var(--brand); text-decoration: none; }

.theme-toggle {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--text-soft);
  cursor: pointer; font-size: 15px;
}
.theme-toggle:hover { border-color: var(--brand); color: var(--brand); }

.nav-toggle {
  display: none; width: 40px; height: 34px; border: 1px solid var(--line);
  border-radius: 8px; background: transparent; cursor: pointer; padding: 8px;
}
.nav-toggle span { display: block; height: 2px; background: var(--text); margin: 4px 0; border-radius: 2px; }

/* ---------- 首屏 ---------- */
.hero {
  background:
    radial-gradient(1100px 420px at 12% -10%, color-mix(in srgb, var(--brand-2) 18%, transparent), transparent),
    radial-gradient(900px 380px at 88% 0%, color-mix(in srgb, var(--brand) 16%, transparent), transparent),
    var(--bg-alt);
  padding: 68px 0 60px;
  border-bottom: 1px solid var(--line);
}
.hero__inner { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: center; }
.hero__eyebrow { margin: 0 0 8px; color: var(--brand-2); font-weight: 600; letter-spacing: .5px; font-size: 14px; }
.hero__title { margin: 0 0 6px; font-size: 44px; line-height: 1.2; letter-spacing: 1px; }
.hero__subtitle { margin: 0 0 14px; font-size: 19px; color: var(--brand); font-weight: 600; }
.hero__desc { margin: 0 0 18px; color: var(--text-soft); font-size: 16px; max-width: 42em; }
.hero__tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 22px; padding: 0; }
.hero__tags li {
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 14px; font-size: 13px; color: var(--text-soft);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-block; padding: 11px 22px; border-radius: 10px;
  font-size: 15px; font-weight: 600; border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: var(--shadow); }
.btn--primary:hover { filter: brightness(1.06); }
.btn--ghost { border-color: var(--line); color: var(--text); background: var(--card); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }

.hero__card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 24px; text-align: center;
}
.hero__card img { width: 150px; height: 150px; margin: 0 auto 16px; }
.hero__card dl { margin: 0; text-align: left; }
.hero__card dl > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--line); }
.hero__card dl > div:first-child { border-top: 0; }
.hero__card dt { color: var(--text-soft); font-size: 14px; }
.hero__card dd { margin: 0; font-weight: 600; font-size: 14px; }

/* ---------- 数据条 ---------- */
.stats { background: var(--brand); color: #fff; }
html[data-theme="dark"] .stats { background: #10202d; }
.stats__inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 26px 20px; }
.stat { text-align: center; }
.stat__value { font-size: 30px; font-weight: 700; letter-spacing: .5px; }
.stat__value em { font-size: 14px; font-style: normal; margin-left: 4px; opacity: .8; }
.stat__label { font-size: 14px; opacity: .9; }

/* ---------- 通用区块 ---------- */
.section { padding: 64px 0; }
.section--alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section__head { margin-bottom: 30px; }
.section__head h2 {
  margin: 0 0 6px; font-size: 28px; letter-spacing: .5px;
  position: relative; padding-left: 14px;
}
.section__head h2::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 5px;
  border-radius: 3px; background: linear-gradient(var(--brand), var(--brand-2));
}
.section__sub { margin: 0 0 0 14px; color: var(--text-soft); font-size: 15px; }

.grid { display: grid; gap: 20px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); }
.card__icon {
  width: 38px; height: 38px; border-radius: 10px; margin-bottom: 12px;
  display: grid; place-items: center; color: #fff; font-size: 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--text-soft); font-size: 15px; }

.badge-sample {
  display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 6px;
  background: #fff2d8; color: #9a6200; font-size: 12px; font-weight: 600;
  vertical-align: middle;
}
html[data-theme="dark"] .badge-sample { background: #3a2c12; color: #e8c07d; }

/* ---------- 个人简介 ---------- */
.about { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; align-items: start; }
.about__text p { margin: 0 0 14px; color: var(--text-soft); }
.about__facts {
  margin: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px 20px; box-shadow: var(--shadow);
}
.about__facts .fact { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.about__facts .fact:last-child { border-bottom: 0; }
.about__facts dt { color: var(--text-soft); font-size: 14px; }
.about__facts dd { margin: 0; font-weight: 600; text-align: right; }

/* ---------- 成果分类 ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tab {
  border: 1px solid var(--line); background: var(--card); color: var(--text-soft);
  padding: 8px 16px; border-radius: 999px; cursor: pointer; font-size: 15px;
}
.tab:hover { border-color: var(--brand); color: var(--brand); }
.tab.is-active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; }

.panel { display: none; }
.panel.is-active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.item-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.item {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand-2);
  border-radius: 10px; padding: 18px 20px; box-shadow: var(--shadow);
}
.item__title { margin: 0 0 6px; font-size: 17px; }
.item__meta { margin: 0 0 6px; color: var(--brand); font-size: 14px; }
.item__desc { margin: 0; color: var(--text-soft); font-size: 15px; }

/* ---------- 成果图 ---------- */
.shot { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.shot__btn { display: block; width: 100%; padding: 0; border: 0; background: var(--bg-alt); cursor: zoom-in; }
.shot__btn img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.shot figcaption { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.shot figcaption strong { font-size: 16px; }
.shot figcaption span { color: var(--text-soft); font-size: 14px; }

/* ---------- 联系 ---------- */
.contact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.contact__row {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.contact__row span { display: block; color: var(--text-soft); font-size: 14px; margin-bottom: 4px; }
.contact__row strong { font-size: 16px; word-break: break-all; }

/* ---------- 页脚（含备案信息） ---------- */
.site-footer { background: #10202d; color: #cfd9e3; padding: 34px 0 40px; position: relative; }
.site-footer__inner { display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; align-items: start; }
.footer__brand { display: flex; flex-direction: column; gap: 6px; }
.footer__brand strong { color: #fff; font-size: 17px; }
.footer__brand span { color: #9fb0bf; font-size: 14px; }
.footer__meta p { margin: 0 0 8px; font-size: 14px; }
.footer__filings { display: flex; flex-wrap: wrap; gap: 14px; }
.footer__link { color: #cfd9e3; }
.footer__link--icp { color: #fff; font-weight: 600; text-decoration: underline; }
.footer__tip { color: #8ea0b0; font-size: 13px; }

.to-top {
  position: fixed; right: 22px; bottom: 24px; width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: var(--brand); color: #fff; font-size: 18px; cursor: pointer;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; }

/* ---------- 图片放大 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 90; background: rgba(9, 16, 22, .9);
  display: grid; place-items: center; padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1100px, 94vw); max-height: 84vh; border-radius: 10px; }
.lightbox figcaption { color: #fff; text-align: center; margin-top: 12px; font-size: 15px; }
.lightbox__close {
  position: absolute; top: 18px; right: 22px; width: 42px; height: 42px;
  border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff;
  font-size: 22px; cursor: pointer;
}

/* ---------- 404 ---------- */
.error-page { text-align: center; padding: 60px 20px; }
.error-page h1 { font-size: 72px; margin: 0 0 8px; color: var(--brand); }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__card { max-width: 420px; }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .about { grid-template-columns: 1fr; }
  .contact { grid-template-columns: repeat(2, 1fr); }
  .site-footer__inner { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .hero { padding: 46px 0 40px; }
  .hero__title { font-size: 32px; }
  .section { padding: 46px 0; }
  .stats__inner { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .grid--3, .contact { grid-template-columns: 1fr; }

  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 10px 16px 16px;
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: 12px; }
  .theme-toggle { align-self: flex-start; margin-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
