/* 《振动测试与信号分析》课程网站 — 全局样式
 * 配色参考 Duke University System ID 课程页：https://people.duke.edu/~hpgavin/SystemID/
 */
:root {
  --bg: #ffffff;
  --surface: #f8f9fa;
  --border: #dee2e6;
  --text: #212529;
  --text-muted: #6c757d;
  --accent: #003366;
  --accent-soft: rgba(0, 51, 102, 0.08);
  --highlight: #003366;
  --font-sans: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Consolas", "Monaco", monospace;
  --radius: 4px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 顶部导航 */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .wrap {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.site-title a {
  color: var(--text);
  text-decoration: none;
}

.site-title a:hover {
  color: var(--accent);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
}

/* 主内容区 */
.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 2rem;
}

/* 区块 */
.section {
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--highlight);
  margin: 0 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

/* 卡片 / 列表 */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.card p,
.card ul {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.card ul {
  padding-left: 1.25rem;
}

.card a {
  color: var(--accent);
  text-decoration: none;
}

.card a:hover {
  text-decoration: underline;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: #e9ecef;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  color: #495057;
}

/* 通知条 */
.notice {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.notice strong {
  color: var(--accent);
}

/* 表格 */
.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border: 1px solid var(--border);
}

th {
  background: var(--surface);
  color: var(--highlight);
  font-weight: 600;
}

tr:nth-child(even) {
  background: rgba(0, 51, 102, 0.04);
}

/* 链接列表 */
.link-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.link-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.link-list li:last-child {
  border-bottom: none;
}

.link-list a {
  color: var(--accent);
  text-decoration: none;
}

.link-list a:hover {
  text-decoration: underline;
}

/* 教材/参考书列表：作者·书名·出版信息同一行自然排版 */
.ref-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ref-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: block;
}
.ref-list li:last-child {
  border-bottom: none;
}
.ref-list a {
  color: var(--accent);
  text-decoration: none;
}
.ref-list a:hover {
  text-decoration: underline;
}

/* 页脚 */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

#site-stats {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

#site-stats strong {
  color: var(--accent);
}

/* ========== 响应式：自适应电脑与手机 ========== */

/* 平板及以下 */
@media (max-width: 768px) {
  .main {
    padding: 1.5rem 1.25rem 3rem;
  }
  .page-title {
    font-size: 1.5rem;
  }
  .section-title {
    font-size: 1.05rem;
  }
  .card {
    padding: 1rem;
  }
}

/* 手机 */
@media (max-width: 640px) {
  .site-header {
    padding: 0.6rem 1rem;
  }
  .site-header .wrap {
    gap: 0.5rem;
  }
  .site-title {
    font-size: 1rem;
  }
  .site-nav {
    gap: 0.2rem;
  }
  .site-nav a {
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
    min-height: 2.5rem;
    display: inline-flex;
    align-items: center;
  }
  .main {
    padding: 1.25rem 1rem 2.5rem;
  }
  .page-title {
    font-size: 1.35rem;
  }
  .page-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }
  .section {
    margin-bottom: 1.75rem;
  }
  .section-title {
    font-size: 1rem;
  }
  .card {
    padding: 0.9rem 1rem;
    margin-bottom: 0.75rem;
  }
  .card h3 {
    font-size: 0.95rem;
  }
  .card p,
  .card ul {
    font-size: 0.85rem;
  }
  .notice {
    padding: 0.85rem 1rem;
  }
  .table-wrap {
    margin: 0.75rem 0;
    -webkit-overflow-scrolling: touch;
  }
  table {
    font-size: 0.8rem;
    min-width: 280px;
  }
  th, td {
    padding: 0.5rem 0.4rem;
    font-size: 0.8rem;
  }
  .link-list li {
    padding: 0.6rem 0;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .ref-list li {
    padding: 0.5rem 0;
    font-size: 0.9rem;
  }
  .site-footer {
    padding: 1rem;
    font-size: 0.8rem;
  }
  #site-stats {
    font-size: 0.8rem;
  }
}

/* 小屏手机 */
@media (max-width: 380px) {
  .site-title {
    font-size: 0.95rem;
  }
  .site-nav a {
    padding: 0.45rem 0.5rem;
    font-size: 0.8rem;
  }
  .page-title {
    font-size: 1.2rem;
  }
  th, td {
    padding: 0.4rem;
    font-size: 0.75rem;
  }
}
