/* ==========================================================
   知书堂教育 K&B Education — 全站样式
   主色：墨蓝 / 竹青 / 书卷金，纸张底色
   ========================================================== */
:root {
  --ink: #13263b;
  --ink-2: #1e3a56;
  --teal: #2f7d74;
  --teal-soft: #e3f0ed;
  --gold: #c8a15a;
  --gold-dark: #a9843f;
  --paper: #faf7f2;
  --paper-2: #f2ede4;
  --text: #24313d;
  --muted: #6b7682;
  --line: #e4ddd1;
  --white: #fff;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(19, 38, 59, 0.08);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", "Noto Serif JP", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Hiragino Kaku Gothic ProN", "Meiryo", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--paper);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); line-height: 1.35; margin: 0 0 0.6em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.3rem); letter-spacing: 0.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.container { width: min(1180px, 92%); margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.eyebrow { font-size: 0.9rem; font-weight: 600; letter-spacing: 0.08em; color: var(--teal); margin-bottom: 0.6rem; text-transform: uppercase; }
.subtitle { color: var(--gold-dark); font-weight: 600; margin-top: -0.4em; }
.note { font-size: 0.85rem; margin-top: 1.2rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  padding: 0.8em 1.5em; border-radius: 999px; font-weight: 600; font-size: 0.98rem;
  border: 1.5px solid transparent; cursor: pointer; transition: all 0.2s ease; white-space: nowrap;
}
.btn-sm { padding: 0.5em 1.1em; font-size: 0.9rem; }
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { background: var(--ink-2); transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-dark); color: var(--white); }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--white); }
.link-arrow { font-weight: 600; color: var(--gold); margin-top: auto; }
.link-arrow::after { content: " →"; transition: margin 0.2s; }
.link-arrow:hover::after { margin-left: 4px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 247, 242, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--serif); font-size: 1.2rem; color: var(--ink); letter-spacing: 0.06em; }
.brand-text small { font-size: 0.72rem; color: var(--gold-dark); letter-spacing: 0.12em; font-weight: 600; }
.brand-light .brand-text strong { color: var(--white); }
.main-nav { display: flex; gap: 1.4rem; font-size: 0.95rem; }
.main-nav a { color: var(--text); position: relative; padding: 0.3em 0; white-space: nowrap; }
.main-nav a:hover, .main-nav a.active { color: var(--teal); }
.main-nav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--gold); }
.nav-tools { display: flex; align-items: center; gap: 0.7rem; }
.lang-select select {
  appearance: none; border: 1px solid var(--line); background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7682'/%3E%3C/svg%3E") no-repeat right 0.7em center;
  padding: 0.45em 2em 0.45em 0.9em; border-radius: 999px; font-size: 0.88rem; color: var(--text); cursor: pointer;
}
.nav-toggle { display: none; background: none; border: 0; width: 36px; height: 36px; cursor: pointer; padding: 6px; }
.nav-toggle span { display: block; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: 0.2s; }

/* ---------- Hero ---------- */
.hero {
  padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(3rem, 6vw, 5rem);
  background:
    radial-gradient(circle at 85% 20%, rgba(200, 161, 90, 0.18), transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(47, 125, 116, 0.12), transparent 40%);
}
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 3rem; align-items: center; }
.hero-tags { font-weight: 600; color: var(--ink-2); letter-spacing: 0.03em; }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 40em; }
.hero-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.6rem; }
.hero-card {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.stat { background: var(--white); padding: 1.6rem 1.3rem; display: flex; flex-direction: column; gap: 0.3rem; }
.stat b { font-family: var(--serif); font-size: 2.2rem; color: var(--ink); line-height: 1.1; }
.stat sup { color: var(--gold); font-size: 0.6em; }
.stat span { font-size: 0.9rem; color: var(--muted); line-height: 1.5; }

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section-alt { background: var(--paper-2); }
.section-dark { background: var(--ink); color: #d7dee6; }
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-dark .eyebrow { color: var(--gold); }
.section-head { margin-bottom: 2.5rem; max-width: 760px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.row-between { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; max-width: none; flex-wrap: wrap; }
.row-between > div { max-width: 640px; }

.grid { display: grid; gap: 1.4rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

/* About */
.about-grid { display: grid; grid-template-columns: 320px 1fr; gap: 3.5rem; align-items: center; }
.about-photo img { border-radius: 24px; box-shadow: var(--shadow); aspect-ratio: 4 / 5; object-fit: cover; width: 100%; background: var(--paper-2); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 1.4rem 0 0; }
.chips li { background: var(--teal-soft); color: var(--teal); padding: 0.35em 0.9em; border-radius: 999px; font-size: 0.88rem; font-weight: 600; }

/* Directions */
.dir-card .icon { font-size: 2rem; margin-bottom: 0.6rem; }
.dir-card h3 { font-size: 1.08rem; }
.dir-card p { font-size: 0.92rem; color: var(--muted); margin: 0; }

/* Inside */
.inside-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3rem; align-items: center; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.9rem; }
.checklist li {
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem 1.2rem 1rem 3.2rem; position: relative;
}
.checklist li::before {
  content: "✓"; position: absolute; left: 1.1rem; top: 1rem; width: 1.4rem; height: 1.4rem;
  border-radius: 50%; background: var(--teal); color: #fff; font-size: 0.8rem; display: grid; place-items: center; font-weight: 700;
}

/* Services */
.svc-card {
  background: var(--ink-2); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: var(--radius);
  padding: 1.8rem; display: flex; flex-direction: column; transition: 0.2s;
}
.svc-card:hover { border-color: var(--gold); transform: translateY(-3px); }
.svc-card .num { font-family: var(--serif); color: var(--gold); font-size: 1.05rem; letter-spacing: 0.1em; margin-bottom: 0.4rem; }
.svc-card p { color: #b9c4d0; font-size: 0.95rem; }
.svc-card ul { padding-left: 1.1em; margin: 0 0 1.3rem; color: #d7dee6; font-size: 0.92rem; }
.svc-card ul li::marker { color: var(--gold); }
.svc-card-cta { background: linear-gradient(135deg, var(--gold), #d9b979); color: var(--ink); justify-content: center; }
.svc-card-cta h3 { color: var(--ink) !important; }
.svc-card-cta p { color: var(--ink-2); }
.svc-card-cta .btn { background: var(--ink); color: #fff; align-self: flex-start; }

/* Videos */
.video-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: 0.2s; }
.video-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.video-thumb {
  position: relative; aspect-ratio: 16 / 9; background: var(--ink) center / cover no-repeat; cursor: pointer;
  border: 0; width: 100%; padding: 0; display: block;
}
.video-thumb::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 64px; height: 44px; border-radius: 12px;
  background: rgba(200, 30, 30, 0.9) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='20'%3E%3Cpath d='M0 0l18 10L0 20z' fill='white'/%3E%3C/svg%3E") no-repeat 55% center;
  transition: transform 0.2s;
}
.video-thumb:hover::after { transform: scale(1.1); }
.video-thumb iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-thumb.playing::after { display: none; }
.video-body { padding: 1rem 1.2rem 1.2rem; }
.video-body h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; margin: 0 0 0.3rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-body time { font-size: 0.82rem; color: var(--muted); }
.video-placeholder { aspect-ratio: 16 / 9; display: grid; place-items: center; background: linear-gradient(135deg, var(--ink), var(--ink-2)); color: var(--gold); font-family: var(--serif); font-size: 1.1rem; }

/* Jobs */
.job-list { display: grid; gap: 0.8rem; }
.job-item {
  display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.4rem; transition: 0.2s;
}
.job-item:hover { border-color: var(--teal); }
.job-item h3 { font-family: var(--sans); font-size: 1.05rem; font-weight: 700; margin: 0 0 0.25rem; }
.job-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.88rem; color: var(--muted); }
.job-side { display: flex; align-items: center; gap: 0.8rem; }
.tag { display: inline-block; padding: 0.2em 0.75em; border-radius: 999px; font-size: 0.8rem; font-weight: 700; background: var(--teal-soft); color: var(--teal); }
.tag-intern { background: #fdf1dc; color: #a86d10; }
.tag-fulltime { background: var(--teal-soft); color: var(--teal); }
.tag-postdoc { background: #e7ecf7; color: #3a56a0; }
.tag-faculty { background: #f5e6ea; color: #a03a5a; }
.empty { padding: 2rem; text-align: center; color: var(--muted); background: var(--white); border-radius: 12px; border: 1px dashed var(--line); }

.job-toolbar { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1.5rem; align-items: center; }
.job-toolbar input[type="search"] {
  flex: 1 1 260px; padding: 0.75em 1.1em; border-radius: 999px; border: 1px solid var(--line); font-size: 0.95rem; background: #fff;
}
.filter-btns { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.filter-btns button {
  border: 1px solid var(--line); background: #fff; padding: 0.55em 1.1em; border-radius: 999px; cursor: pointer; font-size: 0.9rem; color: var(--text);
}
.filter-btns button.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Study tracks */
.track h3 { font-size: 1.15rem; }
.track ol { padding-left: 0; margin: 0; list-style: none; counter-reset: s; }
.track li { counter-increment: s; position: relative; padding: 0.55rem 0 0.55rem 2.4rem; border-bottom: 1px dashed var(--line); font-size: 0.95rem; }
.track li:last-child { border-bottom: 0; }
.track li::before {
  content: counter(s); position: absolute; left: 0; top: 0.6rem; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  border: 1.5px solid var(--gold); color: var(--gold-dark); font-size: 0.8rem; font-weight: 700; display: grid; place-items: center;
}
.disclaimer { font-size: 0.82rem; color: var(--muted); margin-top: 1.5rem; }

/* Social */
.social-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; }
.social-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1rem;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; transition: 0.2s;
}
.social-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.social-card.featured { border: 2px solid var(--gold); }
.social-card .qr { width: 132px; height: 132px; border-radius: 10px; background: var(--paper-2); object-fit: contain; }
.social-card .pname { font-weight: 700; color: var(--ink); }
.social-card .pid { font-size: 0.82rem; color: var(--muted); word-break: break-all; }
.social-card .badge { font-size: 0.72rem; background: var(--gold); color: var(--ink); padding: 0.1em 0.7em; border-radius: 999px; font-weight: 700; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.contact-card { background: var(--ink-2); border-radius: var(--radius); padding: 2rem; display: grid; gap: 1.2rem; border: 1px solid rgba(255,255,255,0.08); }
.contact-row { display: flex; gap: 1rem; align-items: center; }
.contact-row .ci { width: 44px; height: 44px; border-radius: 12px; background: rgba(200,161,90,0.15); display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.contact-row small { display: block; color: #9fb0c1; font-size: 0.8rem; }
.contact-row a, .contact-row span.v { color: #fff; font-weight: 600; word-break: break-all; }
.contact-row a:hover { color: var(--gold); }
.contact-qr { display: flex; gap: 1rem; align-items: center; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.1); }
.contact-qr img { width: 110px; height: 110px; border-radius: 10px; background: #fff; }

/* Footer */
.site-footer { background: #0d1c2c; color: #9fb0c1; padding: 3rem 0 1.5rem; font-size: 0.92rem; }
.footer-grid { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; align-items: flex-start; }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); margin-top: 2rem; padding-top: 1.2rem; font-size: 0.82rem; }

/* Page hero (sub pages) */
.page-hero { padding: 3.5rem 0 2rem; background: radial-gradient(circle at 85% 20%, rgba(200,161,90,0.18), transparent 45%); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .social-grid { grid-template-columns: repeat(3, 1fr); }
  .main-nav { gap: 1rem; font-size: 0.9rem; }
}
@media (max-width: 1100px) {
  .nav-toggle { display: block; }
  .hide-mobile { display: none; }
  .main-nav {
    position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 0.5rem 4%;
    display: none; box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
  .main-nav a:last-child { border-bottom: 0; }
  .main-nav a.active::after { display: none; }
}
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .hide-mobile { display: none; }
  .main-nav {
    position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 0.5rem 4%;
    display: none; box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
  .main-nav a:last-child { border-bottom: 0; }
  .main-nav a.active::after { display: none; }
  .hero-grid, .about-grid, .inside-grid, .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-photo { max-width: 260px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-3, .grid-5 { grid-template-columns: 1fr; }
  .social-grid { grid-template-columns: repeat(2, 1fr); }
  .social-card .qr { width: 110px; height: 110px; }
  .job-item { grid-template-columns: 1fr; }
  .brand-text strong { font-size: 1.05rem; }
}

/* ICP / 公安备案 */
.footer-bottom { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; align-items: center; }
.beian { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.beian a { display: inline-flex; align-items: center; gap: 0.3em; }
.beian a:hover { color: var(--gold); }
/* 大陆网络无法访问 YouTube 时的视频卡片 */
.video-card.blocked .video-placeholder { cursor: pointer; text-align: center; padding: 1rem; font-size: 0.95rem; line-height: 1.6; }
.video-card.blocked .video-placeholder small { display: block; color: #b9c4d0; font-family: var(--sans); font-size: 0.8rem; margin-top: 0.4rem; }
.yt-notice { display: none; background: var(--teal-soft); color: var(--teal); border-radius: 12px; padding: 0.8rem 1.1rem; margin-bottom: 1.2rem; font-size: 0.92rem; }
.yt-notice.show { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.yt-notice a { font-weight: 700; text-decoration: underline; }
