/* ============================================================
   深度学园 — 主样式表
   风格：简洁技术风（浅色 + 蓝色主色）
   说明：备案信息区的颜色对比度按可读性要求处理，字号不小于 12px
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  --brand: #1d4ed8;
  --brand-strong: #1e40af;
  --brand-light: #3b82f6;
  --brand-soft: #eff4ff;

  --text: #1f2933;
  --text-sub: #52606d;
  /* 页脚/备案信息文字色：与浅色背景对比度 > 4.5:1 */
  --text-foot: #3e4c59;
  --text-foot-strong: #1f2933;

  --bg: #ffffff;
  --bg-alt: #f6f8fc;
  --bg-foot: #eef2f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 20px;

  --shadow-s: 0 1px 2px rgba(15, 23, 42, .06), 0 2px 8px rgba(15, 23, 42, .05);
  --shadow-m: 0 6px 24px rgba(15, 23, 42, .08);

  --container: 1140px;
  --header-h: 72px;

  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
          "Source Han Sans SC", "Noto Sans CJK SC", system-ui, -apple-system,
          "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 700; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; height: auto; border: 0; }

a {
  color: var(--brand);
  text-decoration: none;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}
a:hover { color: var(--brand-strong); text-decoration: underline; }

:focus-visible {
  outline: 3px solid rgba(59, 130, 246, .55);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 10px 16px;
  background: var(--brand);
  color: #fff;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  border-radius: var(--radius-s);
  text-decoration: none;
  color: #fff;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .2s ease;
}
.site-header.is-scrolled { box-shadow: var(--shadow-s); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.brand:hover { text-decoration: none; color: var(--brand); }
.brand-logo { display: inline-flex; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: 19px; letter-spacing: .5px; }
.brand-slogan { font-size: 12px; color: var(--text-sub); font-weight: 400; }

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 15px;
  color: var(--text-sub);
  white-space: nowrap;
}
.nav-link:hover {
  background: var(--brand-soft);
  color: var(--brand-strong);
  text-decoration: none;
}
.nav-link.is-active {
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  padding: 72px 0 64px;
  background:
    radial-gradient(1000px 380px at 82% -12%, rgba(59, 130, 246, .16), transparent 62%),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border);
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}
.hero-tag {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .4px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  border: 1px solid #d7e3ff;
  border-radius: 999px;
}
.hero-title {
  font-size: clamp(30px, 4.6vw, 46px);
  letter-spacing: 1px;
}
.hero-subtitle {
  margin-top: 6px;
  font-size: 17px;
  font-weight: 600;
  color: var(--brand);
}
.hero-desc {
  margin-top: 18px;
  max-width: 62ch;
  font-size: 16px;
  color: var(--text-sub);
  text-align: justify;
}
.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 22px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-light), var(--brand));
  color: #fff;
  box-shadow: 0 6px 18px rgba(29, 78, 216, .25);
}
.btn-primary:hover { color: #fff; filter: brightness(1.06); }
.btn-ghost {
  background: #fff;
  color: var(--brand-strong);
  border-color: #c9d8f7;
}
.btn-ghost:hover { background: var(--brand-soft); color: var(--brand-strong); }

.hero-card {
  padding: 24px 24px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-m);
}
.hero-card-title {
  margin-bottom: 14px;
  font-size: 15px;
  color: var(--brand);
  letter-spacing: .5px;
}
.hero-facts .fact {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px dashed var(--border);
  font-size: 14px;
}
.hero-facts .fact:first-child { border-top: 0; }
.hero-facts dt {
  flex: 0 0 78px;
  color: var(--text-sub);
}
.hero-facts dd {
  flex: 1;
  color: var(--text);
  font-weight: 500;
}

/* ---------- 通用区块 ---------- */
.section { padding: 68px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head { max-width: 760px; margin-bottom: 34px; }
.section-title {
  position: relative;
  padding-left: 14px;
  font-size: clamp(22px, 2.6vw, 28px);
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-light), var(--brand));
}
.section-desc { margin-top: 10px; color: var(--text-sub); }

/* ---------- 内容方向 ---------- */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}
.topic-card {
  display: flex;
  flex-direction: column;
  padding: 26px 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.topic-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-m);
  border-color: #c9d8f7;
}
.topic-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 14px;
}
.topic-title { font-size: 19px; margin-bottom: 10px; }
.topic-text { color: var(--text-sub); font-size: 15px; }
.topic-list {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.topic-list li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  color: var(--text-sub);
  line-height: 2;
}
.topic-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .85em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-light);
}

/* ---------- 文章列表 ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.filter-btn {
  padding: 7px 16px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-sub);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: all .18s ease;
}
.filter-btn:hover { color: var(--brand-strong); border-color: #c9d8f7; }
.filter-btn.is-active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  font-weight: 600;
}

.article-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.article-item { display: flex; }
.article-item[hidden] { display: none; }
.article-link {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 20px 22px;
  color: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.article-link:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: #c9d8f7;
  box-shadow: var(--shadow-m);
}
.article-main { min-width: 0; }
.article-tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-radius: 999px;
}
.article-title {
  font-size: 16.5px;
  line-height: 1.5;
  color: var(--text);
}
.article-link:hover .article-title { color: var(--brand-strong); }
.article-summary {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-sub);
}
.article-date {
  flex: 0 0 auto;
  padding-top: 4px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: #7b8794;
  white-space: nowrap;
}
.article-empty {
  margin-top: 18px;
  padding: 22px;
  text-align: center;
  color: var(--text-sub);
  background: #fff;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-m);
}

/* ---------- 关于本站 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.about-text p + p { margin-top: 14px; }
.about-text { color: var(--text-sub); text-align: justify; }
.about-points { margin-top: 18px; }
.about-points li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--text);
}
.about-points li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .72em;
  width: 12px;
  height: 6px;
  border-left: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(-45deg);
}

.about-panel {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
}
.about-panel-title {
  margin-bottom: 14px;
  font-size: 16px;
  color: var(--brand-strong);
}
.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.info-table th,
.info-table td {
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.info-table tr:last-child th,
.info-table tr:last-child td { border-bottom: 0; }
.info-table th {
  width: 38%;
  font-weight: 500;
  color: var(--text-sub);
  background: #fafbfe;
  white-space: nowrap;
}
.info-table td { color: var(--text); word-break: break-all; }
.panel-note {
  margin-top: 12px;
  padding-top: 12px;
  font-size: 13px;
  color: var(--text-sub);
  border-top: 1px dashed var(--border);
}

/* ---------- 联系方式 ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.contact-card {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
}
.contact-title {
  margin-bottom: 10px;
  font-size: 16px;
  color: var(--brand-strong);
}
.contact-value {
  font-size: 15px;
  color: var(--text);
  word-break: break-all;
}
.contact-note {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--text-sub);
}

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--bg-foot);
  border-top: 1px solid var(--border-strong);
  color: var(--text-foot);
}
.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  padding-top: 46px;
  padding-bottom: 32px;
}
.footer-site-name {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-foot-strong);
  letter-spacing: .5px;
}
.footer-desc {
  margin-top: 10px;
  max-width: 46ch;
  font-size: 14px;
  color: var(--text-foot);
}
.footer-col-title {
  margin-bottom: 12px;
  font-size: 15px;
  color: var(--text-foot-strong);
}
.footer-links li { margin-bottom: 8px; font-size: 14px; }
.footer-links a { color: var(--text-foot); }
.footer-links a:hover { color: var(--brand-strong); }
.footer-links-plain li { color: var(--text-foot); }

/* 备案信息条：静态可见、可读性优先 */
.footer-beian {
  border-top: 1px solid var(--border-strong);
  background: #e7ecf5;
  padding: 18px 0 20px;
}
.beian-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  font-size: 13.5px;
  color: var(--text-foot-strong);
}
.beian-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.9;
}
.beian-icon { display: inline-block; width: 16px; height: 16px; }
.beian-link {
  color: var(--text-foot-strong);
  text-decoration: none;
  border-bottom: 1px solid rgba(31, 41, 51, .35);
  padding-bottom: 1px;
}
.beian-link:hover {
  color: var(--brand-strong);
  border-bottom-color: var(--brand-strong);
}
.copyright {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-foot);
}
.copyright .sep { margin: 0 6px; color: var(--border-strong); }

/* ---------- 回到顶部 ---------- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(29, 78, 216, .3);
  transition: opacity .2s ease, transform .2s ease;
}
.back-to-top[hidden] { display: none; }
.back-to-top:hover { background: var(--brand-strong); transform: translateY(-2px); }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .hero-inner,
  .about-grid { grid-template-columns: 1fr; }
  .hero { padding: 52px 0 46px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-m);
  }
  .site-nav.is-open { display: block; }
  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 16px 16px;
  }
  .nav-link {
    padding: 12px 14px;
    border-radius: var(--radius-s);
    font-size: 16px;
  }
  .section { padding: 48px 0; }
  .footer-top { grid-template-columns: 1fr; gap: 24px; padding-top: 34px; }
  /* 给「回到顶部」按钮留出空间，避免遮挡版权行 */
  .footer-beian { padding-bottom: 72px; }
  .beian-list { flex-direction: column; align-items: flex-start; gap: 4px; }
  .article-date { display: none; }
  .back-to-top { right: 16px; bottom: 16px; }
}

/* ---------- 打印 ---------- */
@media print {
  .site-header, .back-to-top, .filter-bar, .hero-actions { display: none !important; }
  .site-footer, .footer-beian { background: #fff; }
  a { text-decoration: none; color: #000; }
}
