/* ============================== *
 * 《可视化导论》课程门户 — 共享样式 *
 * ============================== */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: #1f2937;
  background: #f8fafc;
  line-height: 1.6;
}

/* ========== Hero 顶部 ========== */
.hero {
  background: linear-gradient(135deg, #4338ca 0%, #6366f1 50%, #818cf8 100%);
  color: white;
  padding: 80px 20px 60px;
  text-align: center;
}

.hero-inner {
  max-width: 900px;
  margin: 0 auto;
}

.hero-tag {
  font-size: 13px;
  letter-spacing: 3px;
  opacity: 0.85;
  margin: 0 0 12px;
  font-weight: 500;
}

.hero h1 {
  font-size: 56px;
  margin: 0 0 16px;
  font-weight: 700;
  letter-spacing: -1px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.hero-subtitle {
  font-size: 20px;
  margin: 0 0 8px;
  opacity: 0.95;
  font-weight: 400;
}

.hero-meta {
  font-size: 14px;
  margin: 0;
  opacity: 0.75;
}

/* 教师主页链接：保持低调，下划线提示可点击 */
.teacher-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
  transition: opacity 0.15s;
}
.teacher-link:hover {
  opacity: 0.65;
  border-bottom-style: solid;
}

/* ========== 顶部导航 ========== */
.nav {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 20px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.nav a {
  color: #4338ca;
  text-decoration: none;
  font-weight: 500;
  margin: 0 20px;
  font-size: 15px;
  transition: color 0.2s;
}

.nav a:hover {
  color: #1e1b4b;
  text-decoration: underline;
}

/* ========== 主体 ========== */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 20px;
}

.section {
  margin-bottom: 80px;
}

.section h2 {
  font-size: 32px;
  margin: 0 0 16px;
  color: #1e1b4b;
  font-weight: 700;
}

.section-lead {
  font-size: 16px;
  color: #6b7280;
  margin: 0 0 32px;
}

/* ========== 章节卡片 ========== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 28px;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

a.card.available {
  cursor: pointer;
}

a.card.available:hover {
  border-color: #6366f1;
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.15);
}

.card.pending {
  opacity: 0.65;
  background: #fafafa;
}

.card-status {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.card.available .card-status {
  background: #d1fae5;
  color: #065f46;
}

.card.pending .card-status {
  background: #fef3c7;
  color: #92400e;
}

.card-num {
  font-size: 14px;
  color: #6366f1;
  font-weight: 600;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}

.card h3 {
  font-size: 24px;
  margin: 0 0 12px;
  color: #1e1b4b;
  font-weight: 700;
}

.card-source {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 14px;
}

.card-desc {
  font-size: 14px;
  color: #374151;
  margin: 0 0 18px;
  line-height: 1.65;
}

.card-tags {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-tags li {
  font-size: 12px;
  padding: 3px 10px;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 10px;
  font-weight: 500;
}

.card-cta {
  font-size: 15px;
  font-weight: 600;
  color: #6366f1;
  padding-top: 14px;
  border-top: 1px solid #f3f4f6;
}

a.card.available:hover .card-cta {
  color: #4338ca;
}

/* ========== 使用方式 ========== */
.howto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.howto-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 24px;
}

.howto-card h3 {
  font-size: 18px;
  margin: 0 0 10px;
  color: #4338ca;
  font-weight: 600;
}

.howto-card p {
  font-size: 14px;
  color: #374151;
  margin: 0;
  line-height: 1.6;
}

.howto-card code {
  background: #f3f4f6;
  color: #6366f1;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: "Cascadia Code", "Fira Code", Menlo, Consolas, monospace;
}

/* ========== 关于 ========== */
.about {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.about-item {
  background: white;
  border-left: 4px solid #6366f1;
  padding: 20px 24px;
  border-radius: 6px;
}

.about-item h4 {
  margin: 0 0 10px;
  color: #1e1b4b;
  font-size: 16px;
  font-weight: 600;
}

.about-item p {
  margin: 0;
  font-size: 14px;
  color: #4b5563;
  line-height: 1.6;
}

.about-item code {
  background: #f3f4f6;
  color: #6366f1;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 13px;
  font-family: "Cascadia Code", "Fira Code", Menlo, Consolas, monospace;
}

/* ========== 底部 ========== */
footer {
  background: #1e1b4b;
  color: #c7d2fe;
  text-align: center;
  padding: 32px 20px;
  margin-top: 80px;
}

footer p {
  margin: 4px 0;
  font-size: 14px;
}

.footer-meta {
  font-size: 12px !important;
  opacity: 0.7;
}

/* ========== 响应式 ========== */
@media (max-width: 640px) {
  .hero h1 { font-size: 36px; }
  .hero-subtitle { font-size: 16px; }
  .section h2 { font-size: 24px; }
  .nav a { margin: 0 8px; font-size: 13px; }
  main { padding: 40px 16px; }
}
