/* style.css - 全局样式，优化电脑端与手机端体验 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
}

body {
  background: #f5f7fa;
  color: #1e2b3c;
  line-height: 1.6;
  padding: 16px 12px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.container {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  background: white;
  border-radius: 24px;
  box-shadow: 0 8px 30px rgba(0, 20, 50, 0.08);
  padding: 24px 18px;
  transition: all 0.2s ease;
}

/* 电脑端优化 */
@media (min-width: 640px) {
  body {
    padding: 24px 20px;
  }
  .container {
    max-width: 800px;
    padding: 32px 28px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1000px;
    padding: 40px 36px;
  }
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #0b4e70, #1b7e9f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h2 {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 1.5rem 0 0.8rem;
  padding-bottom: 8px;
  border-bottom: 3px solid #b3e0f0;
  color: #0a4b6e;
}

h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 1.2rem 0 0.6rem;
  color: #1a5d7a;
}

h4 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0.9rem 0 0.3rem;
  color: #2c3e50;
}

.subhead {
  color: #2c5f8a;
  font-weight: 400;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

p, li, .text-block {
  margin-bottom: 0.7rem;
  color: #253544;
  font-size: 1rem;
}

ul, ol {
  padding-left: 1.8rem;
  margin: 0.6rem 0 1.2rem;
}

li {
  margin-bottom: 0.4rem;
}

.note-box {
  background: #f0f9ff;
  border-left: 5px solid #0088cc;
  padding: 16px 20px;
  border-radius: 16px;
  margin: 1.5rem 0;
  box-shadow: 0 2px 8px rgba(0,80,120,0.08);
  font-size: 1rem;
}

.note-box strong {
  color: #005a8c;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

th {
  background: #d9eaf5;
  color: #03314b;
  font-weight: 600;
  padding: 12px 8px;
  border-bottom: 2px solid #7fb4cf;
  text-align: left;
}

td {
  padding: 10px 8px;
  border-bottom: 1px solid #dde7f0;
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

.badge {
  background: #e0f0fa;
  color: #105a7a;
  padding: 4px 14px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-block;
  margin-right: 8px;
  margin-bottom: 4px;
}

.btn-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px 0 10px;
}

.btn-nav a {
  background: #e6f0f9;
  text-decoration: none;
  color: #11537a;
  padding: 10px 18px;
  border-radius: 40px;
  font-weight: 500;
  font-size: 0.95rem;
  flex: 1 1 auto;
  text-align: center;
  border: 1px solid #bdd8ec;
  transition: all 0.2s;
}

.btn-nav a:hover {
  background: #c9e2f5;
  border-color: #7fa9c9;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,60,100,0.1);
}

.btn-home {
  display: inline-block;
  background: #11537a;
  color: white !important;
  padding: 8px 22px;
  border-radius: 40px;
  text-decoration: none;
  font-weight: 500;
  margin: 10px 0 5px;
  border: none;
  transition: background 0.2s;
}

.btn-home:hover {
  background: #0a3e5c;
}

hr {
  border: none;
  border-top: 1px solid #cde0ec;
  margin: 24px 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-top: 28px;
}

.footer-links a {
  color: #2a6792;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #0b4e70;
  text-decoration: underline;
}

.katex-math {
  background: #f8fafc;
  padding: 2px 6px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
}

.emph {
  background: #fef9e7;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 500;
}

/* 目录列表样式 */
.chapter-list {
  list-style: none;
  padding-left: 0;
}

.chapter-list li {
  margin: 14px 0;
}

.chapter-list a {
  text-decoration: none;
  font-size: 1.2rem;
  background: #eef4f9;
  display: block;
  padding: 14px 18px;
  border-radius: 30px;
  color: #11537a;
  font-weight: 500;
  transition: background 0.2s, transform 0.1s;
  border: 1px solid transparent;
}

.chapter-list a:hover {
  background: #d9e6f2;
  border-color: #b0c8dd;
}

/* 手机微调 */
@media (max-width: 480px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }
  .container { padding: 20px 14px; }
  .btn-nav a { padding: 8px 12px; font-size: 0.9rem; }
  .chapter-list a { padding: 12px 16px; font-size: 1.1rem; }
}