:root {
  --brand: #2f6df6;
  --brand-dark: #1d4fd0;
  --accent: #ff8a3d;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2733;
  --muted: #6b7785;
  --line: #e6eaf0;
  --ok: #2bb673;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(31, 39, 51, .08);
  --shadow-sm: 0 2px 10px rgba(31, 39, 51, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.65; font-size: 15px;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
/* 容器：只负责「水平居中 + 横向安全边距」，不碰纵向 */
.container { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 20px; }
.container.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---------- 顶部导航 ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow-sm); }
.topbar .inner { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.logo { font-weight: 800; font-size: 18px; color: var(--brand); display: flex; align-items: center; gap: 8px; }
.logo .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--text); font-size: 14px; }
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.active { background: var(--brand); color: #fff; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 18px; cursor: pointer; }

/* ---------- Hero / 名片墙 ---------- */
.hero { position: relative; color: #fff; overflow: hidden; min-height: 360px; display: flex; align-items: center; }
.hero .slides { position: absolute; inset: 0; }
.hero .slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1s ease; }
.hero .slide.active { opacity: 1; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(20,30,60,.72), rgba(20,30,60,.45)); }
/* padding-block 只改纵向，保留 .container 的横向留白与居中 */
.hero .container { position: relative; z-index: 2; display: flex; gap: 28px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-block: 48px; }
.hero-card { background: rgba(255,255,255,.12); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.25); border-radius: 18px; padding: 22px; display: flex; gap: 18px; align-items: center; min-width: 320px; flex: 1 1 380px; }
.hero-avatar { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; background: #fff; }
.hero-name { font-size: 26px; font-weight: 800; margin: 0; }
.hero-title { opacity: .92; margin: 2px 0 6px; }
.hero-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.hero-tags span { background: rgba(255,255,255,.2); padding: 3px 10px; border-radius: 999px; font-size: 12px; }
.hero-contact { font-size: 13px; opacity: .95; margin-top: 8px; line-height: 1.9; }
.qr-box { background: #fff; border-radius: 14px; padding: 12px; text-align: center; color: var(--text); box-shadow: var(--shadow); }
.qr-box img { width: 130px; height: 130px; display: block; margin: 0 auto; }
.qr-box .cap { font-size: 12px; color: var(--muted); margin-top: 4px; }
.carousel-dots { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; z-index: 3; }
.carousel-dots span { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.5); margin: 0 4px; cursor: pointer; }
.carousel-dots span.active { background: #fff; width: 22px; border-radius: 6px; }
/* 名片座右铭 */
.hero-motto { margin-top: 10px; font-size: 13.5px; background: rgba(255,255,255,.16); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 5px 12px; display: inline-block; }
.hero-motto b { font-weight: 800; }

/* ---------- 教育理念折叠面板 ---------- */
.philo { max-width: 860px; margin: 0 auto; }
.philo-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 14px; overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.philo-item:hover { box-shadow: var(--shadow); border-color: #cfdcfb; }
.philo-item summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 16px 20px; cursor: pointer; user-select: none; }
.philo-item summary::-webkit-details-marker { display: none; }
.philo-item summary .ico { font-size: 24px; line-height: 1; }
.philo-item summary .ttl { font-size: 17px; font-weight: 800; white-space: nowrap; }
.philo-item summary:hover .ttl { color: var(--brand); }
.philo-item summary .hint { flex: 1; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.philo-item summary .arrow { color: var(--muted); font-size: 13px; transition: transform .25s; }
.philo-item[open] summary .arrow { transform: rotate(180deg); }
.philo-body { padding: 0 20px 18px; border-top: 1px dashed var(--line); }
.philo-lead { margin: 14px 0 12px; font-size: 16px; font-weight: 700; color: var(--brand); text-align: center; }
.philo-lead::before { content: "「"; color: var(--accent); }
.philo-lead::after { content: "」"; color: var(--accent); }
.philo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.philo-list li { display: flex; align-items: baseline; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: 14px; }

/* ---------- 区块 ---------- */
/* 区块：只负责「纵向节奏」，用 padding-block 避免覆盖 .container 的横向留白 */
.block { padding-block: 40px; }
.block.tight { padding-block: 24px; }

/* 白色面板：需要卡片底色的区块用它包裹内容，保证内边距充足 */
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-sm); padding: 30px 28px;
}

/* 区块标题：默认居中，带渐变装饰线（伪元素用 absolute，不参与 flex 排布） */
.section-title {
  font-size: 24px; font-weight: 800; margin: 0 0 14px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  position: relative; padding-bottom: 14px; text-align: center;
}
.section-title::after {
  content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 46px; height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}
/* 需要左对齐标题时加 .left */
.section-title.left { justify-content: flex-start; text-align: left; }
.section-title.left::after { left: 0; transform: none; }
.section-sub { color: var(--muted); margin: 0 0 22px; text-align: center; }
.section-sub.left { text-align: left; }

/* 区块底部动作区：按钮居中 */
.block-actions { margin-top: 22px; text-align: center; }

.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #cfdcfb; }
.card h3 { margin: 0 0 6px; font-size: 17px; }
.card .ico { font-size: 26px; }
.card .desc { color: var(--muted); font-size: 14px; }
/* 磁贴式卡片：图标+标题+说明整体居中（用于模块入口） */
.card.tile { text-align: center; }
.card.tile .ico { font-size: 34px; display: block; margin-bottom: 10px; line-height: 1; }
.card.tile .desc { font-size: 13px; }

/* 班级照片墙 */
.photo-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo-wall img { width: 100%; height: 120px; object-fit: cover; border-radius: 10px; }

/* 资源/列表 */
.list-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.list-item h4 { margin: 0 0 4px; }
.badge { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: #eef3ff; color: var(--brand); margin-right: 6px; }
.badge.lock { background: #fff4e6; color: #d97706; }
.badge.web { background: #e8f7ee; color: var(--ok); }

/* 按钮 */
.btn { display: inline-block; background: var(--brand); color: #fff; border: none; border-radius: 9px; padding: 9px 16px; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.danger { background: #e5484d; }
.input, .select, textarea, input[type=text], input[type=password], input[type=search] { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; font-family: inherit; background: #fff; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

/* 时间轴 */
.timeline { border-left: 3px solid var(--brand); margin-left: 8px; padding-left: 20px; }
.timeline .item { position: relative; margin-bottom: 22px; }
.timeline .item::before { content: ""; position: absolute; left: -29px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--brand); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--brand); }
.timeline .date { font-size: 13px; color: var(--accent); font-weight: 700; }

/* 留言板 */
.message { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.message .who { font-weight: 700; }
.message .meta { font-size: 12px; color: var(--muted); }

/* 页脚 */
footer.site { background: #1f2733; color: #cdd5e0; padding: 26px 0; margin-top: 30px; font-size: 13px; }
footer.site a { color: #9fb4d8; }

/* 工具页 */
.tool-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.seat-grid { display: grid; gap: 8px; }
.seat { aspect-ratio: 1.4; border: 1px dashed var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #fafbfe; font-size: 13px; cursor: pointer; position: relative; }
.seat.filled { background: #eef3ff; border-style: solid; border-color: var(--brand); }
.seat .rm { position: absolute; top: 2px; right: 4px; color: #e5484d; font-size: 12px; cursor: pointer; }
.geo-canvas, .formula-canvas { border: 1px solid var(--line); border-radius: 10px; background: #fff; width: 100%; touch-action: none; }
.like-btn { cursor: pointer; user-select: none; }

/* 响应式 */
@media (max-width: 860px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .nav { display: none; position: absolute; top: 58px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 8px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .menu-btn { display: block; }
  .hero .container { flex-direction: column; align-items: center; text-align: center; }
  .hero-card { width: 100%; flex-direction: column; text-align: center; }
  .hero-title, .hero-name { text-align: center; }
  .hero-tags { justify-content: center; }
  .block { padding-block: 30px; }
  .panel { padding: 24px 20px; }
  .section-title { font-size: 21px; }
}
@media (max-width: 560px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .hero-name { font-size: 22px; }
  .container { padding-inline: 14px; }
  .panel { padding: 20px 16px; border-radius: 14px; }
  .block { padding-block: 24px; }
  .philo-list { grid-template-columns: 1fr; }
  .philo-item summary .hint { display: none; }
}
