/* ============================================================
   英语进阶站 EnglishThink — 共享样式
   3 套主题: data-theme="scholar" | "paper" | "edtech"
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@500;600;700;900&family=Noto+Sans+SC:wght@400;500;700;900&family=Source+Serif+4:opsz,wght@8..60,500;8..60,600;8..60,700&display=swap');

:root {
  --max-w: 1180px;
  --content-w: 720px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 2px 10px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 10px 36px rgba(15, 23, 42, 0.12);
  --font-scale: 1;
  --sans: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Source Serif 4", "Songti SC", serif;
  --en-serif: "Source Serif 4", Georgia, serif;
}

/* —— 主题 1:青墨学术 (默认) —— */
:root, [data-theme="scholar"] {
  --primary: #1E3A8A;
  --primary-strong: #16306E;
  --primary-soft: #EEF2FB;
  --accent: #B45309;
  --accent-soft: #FDF3E3;
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --surface-alt: #F3F4F0;
  --ink: #1A2233;
  --ink-2: #4B5563;
  --ink-3: #8A93A3;
  --line: #E4E6E0;
  --line-soft: #EFF0EA;
  --display-font: var(--serif);
  --header-bg: rgba(250, 250, 248, 0.92);
  --hero-bg: linear-gradient(170deg, #FFFFFF 0%, #EEF2FB 100%);
  --footer-bg: #16213C;
  --footer-ink: #B6C2DE;
}

/* —— 主题 2:纸墨阅读 —— */
[data-theme="paper"] {
  --primary: #9A3412;
  --primary-strong: #7C2A0E;
  --primary-soft: #F8EADF;
  --accent: #1C5E54;
  --accent-soft: #E4EFEC;
  --bg: #F7F2E9;
  --surface: #FDFBF5;
  --surface-alt: #F1EADD;
  --ink: #2B2620;
  --ink-2: #5C544A;
  --ink-3: #98907F;
  --line: #E5DCC9;
  --line-soft: #EEE7D7;
  --display-font: var(--serif);
  --header-bg: rgba(247, 242, 233, 0.93);
  --hero-bg: linear-gradient(170deg, #FDFBF5 0%, #F3E9D8 100%);
  --footer-bg: #2B2620;
  --footer-ink: #C9BFA9;
}

/* —— 主题 3:现代教育 —— */
[data-theme="edtech"] {
  --primary: #0E7490;
  --primary-strong: #0B5C73;
  --primary-soft: #E3F3F7;
  --accent: #C2410C;
  --accent-soft: #FCEEE4;
  --bg: #F5F8F9;
  --surface: #FFFFFF;
  --surface-alt: #ECF2F4;
  --ink: #0F2530;
  --ink-2: #46606C;
  --ink-3: #87A0AB;
  --line: #DFE8EB;
  --line-soft: #EAF1F3;
  --display-font: var(--sans);
  --header-bg: rgba(245, 248, 249, 0.92);
  --hero-bg: linear-gradient(170deg, #FFFFFF 0%, #DDF0F5 100%);
  --footer-bg: #0F2530;
  --footer-ink: #9FBCC8;
}

/* ============ Reset / Base ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-padding-top: 90px; }
body {
  font-family: var(--sans);
  font-size: calc(16px * var(--font-scale));
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 28px; }

/* ============ 顶部导航 ============ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 36px; height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  font-family: var(--en-serif); font-weight: 700; font-size: 19px;
}
.brand-name { font-family: var(--display-font); font-weight: 700; font-size: 18px; letter-spacing: 0.01em; }
.brand-name small { display: block; font-family: var(--sans); font-weight: 400; font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.12em; line-height: 1.2; }

.main-nav { display: flex; gap: 4px; flex: 1; }
.main-nav a {
  padding: 8px 14px; border-radius: 8px;
  font-size: 14.5px; font-weight: 500; color: var(--ink-2);
  transition: background 0.15s, color 0.15s;
}
.main-nav a:hover { background: var(--surface-alt); color: var(--ink); }
.main-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }

.header-cta {
  flex-shrink: 0;
  padding: 9px 18px; border-radius: 999px; border: none;
  background: var(--primary); color: #fff;
  font-size: 14px; font-weight: 700;
  transition: background 0.15s;
}
.header-cta:hover { background: var(--primary-strong); }

.mobile-menu-btn { display: none; }

/* ============ 广告位 ============ */
.ad-slot {
  display: grid; place-items: center;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, var(--surface-alt) 0 12px, transparent 12px 24px);
  color: var(--ink-3); position: relative;
  min-height: 90px;
}
.ad-slot::before {
  content: "AD"; position: absolute; top: 8px; right: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--ink-3); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 4px; background: var(--surface);
}
.ad-slot .ad-hint { font-size: 12.5px; text-align: center; line-height: 1.5; padding: 14px; }
.ad-slot .ad-hint strong { display: block; font-size: 13px; color: var(--ink-2); }
.ad-banner { min-height: 100px; }
.ad-in-article { min-height: 120px; margin: 36px 0; }
.ad-sidebar { min-height: 250px; }
.ad-slot.live { display: block; border: none; background: transparent; min-height: 0; }
.ad-slot.live::before { display: none; }
.ad-slot.live ins.adsbygoogle { display: block; width: 100%; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border-radius: 999px; border: none;
  font-size: 15px; font-weight: 700;
  background: var(--primary); color: #fff;
  transition: background 0.15s, transform 0.15s;
}
.btn:hover { background: var(--primary-strong); transform: translateY(-1px); }
.btn.ghost {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn.ghost:hover { background: var(--primary-soft); transform: none; }
.btn.sm { padding: 8px 16px; font-size: 13.5px; }

/* ============ 标签 / 徽章 ============ */
.kicker {
  display: inline-block; font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.14em; color: var(--accent); text-transform: uppercase;
  margin-bottom: 14px;
}
.tag {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: var(--primary-soft); color: var(--primary);
}
.tag.warm { background: var(--accent-soft); color: var(--accent); }
.tag.neutral { background: var(--surface-alt); color: var(--ink-2); }

/* ============ 卡片 ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
a.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: var(--line); }

/* ============ 章节标题 ============ */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.section-title {
  font-family: var(--display-font); font-size: clamp(24px, 3vw, 32px);
  font-weight: 700; line-height: 1.25; letter-spacing: 0.01em;
}
.section-sub { font-size: 14.5px; color: var(--ink-2); margin-top: 8px; max-width: 560px; }
.section-more { font-size: 14px; font-weight: 700; color: var(--primary); white-space: nowrap; padding-bottom: 4px; }
.section-more:hover { text-decoration: underline; }

/* ============ 页脚 ============ */
.site-footer { background: var(--footer-bg); color: var(--footer-ink); margin-top: 90px; }
.site-footer .wrap { padding-top: 56px; padding-bottom: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand-name { font-family: var(--display-font); font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 12px; }
.footer-desc { font-size: 13.5px; line-height: 1.8; opacity: 0.85; max-width: 300px; }
.footer-col h4 { font-size: 13px; font-weight: 700; color: #fff; letter-spacing: 0.08em; margin-bottom: 16px; }
.footer-col a { display: block; font-size: 13.5px; padding: 5px 0; opacity: 0.85; }
.footer-col a:hover { opacity: 1; color: #fff; }
.footer-bottom {
  margin-top: 44px; padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12.5px; opacity: 0.7;
}

/* ============ 问题反馈 ============ */
.feedback-widget {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 220;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.feedback-toggle,
.feedback-submit {
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  transition: background 0.15s, transform 0.15s;
}
.feedback-toggle {
  min-width: 92px;
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
}
.feedback-toggle:hover,
.feedback-submit:hover { background: var(--primary-strong); transform: translateY(-1px); }
.feedback-panel {
  display: none;
  width: min(360px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.feedback-widget.open .feedback-panel { display: block; }
.feedback-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.feedback-head strong { font-size: 16px; color: var(--ink); }
.feedback-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1;
}
.feedback-close:hover { color: var(--primary); border-color: var(--primary); }
.feedback-panel label {
  display: block;
  margin: 10px 0 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
}
.feedback-panel textarea,
.feedback-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  outline: none;
}
.feedback-panel textarea {
  min-height: 112px;
  padding: 10px 11px;
  resize: vertical;
}
.feedback-panel input {
  height: 40px;
  padding: 0 11px;
}
.feedback-panel textarea:focus,
.feedback-panel input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.feedback-submit {
  width: 100%;
  height: 42px;
  margin-top: 12px;
  border-radius: 8px;
}
.feedback-submit:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
}
.feedback-status {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #15803D;
  text-align: center;
}
.feedback-status.err { color: #DC2626; }

/* ============ 面包屑 ============ */
.breadcrumb {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-3);
  padding: 18px 0 0;
}
.breadcrumb a { color: var(--ink-2); }
.breadcrumb a:hover { color: var(--primary); text-decoration: underline; }
.breadcrumb .sep { opacity: 0.5; }
.breadcrumb .current { color: var(--ink-3); }

/* ============ 文章排版 ============ */
.prose { font-size: calc(16.5px * var(--font-scale)); line-height: 1.95; color: var(--ink); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 {
  font-family: var(--display-font); font-size: 1.6em; font-weight: 700;
  line-height: 1.35; margin-top: 2.2em; padding-top: 0.4em;
}
.prose h3 { font-family: var(--display-font); font-size: 1.25em; font-weight: 700; margin-top: 1.8em; }
.prose h4 { font-size: 1.05em; font-weight: 700; margin-top: 1.5em; }
.prose strong { font-weight: 700; }
.prose em { font-style: normal; background: linear-gradient(transparent 62%, var(--accent-soft) 62%); padding: 0 2px; }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose li { margin-top: 0.45em; }
.prose .en {
  font-family: var(--en-serif); font-size: 1.02em;
}
.prose blockquote {
  border-left: 3px solid var(--primary);
  background: var(--primary-soft);
  padding: 18px 22px; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95em;
}
.prose table { width: 100%; border-collapse: collapse; font-size: 0.88em; line-height: 1.6; }
.prose table th {
  text-align: left; font-weight: 700; background: var(--surface-alt);
  padding: 10px 14px; border: 1px solid var(--line);
}
.prose table td { padding: 10px 14px; border: 1px solid var(--line); vertical-align: top; }

/* 例句卡 */
.example-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 22px;
  box-shadow: var(--shadow-sm);
}
.example-card .en-line { font-family: var(--en-serif); font-size: 1.06em; line-height: 1.65; }
.example-card .en-line mark { background: var(--accent-soft); color: var(--accent); font-weight: 600; padding: 0 3px; border-radius: 3px; }
.example-card .src { font-size: 0.78em; color: var(--ink-3); margin-top: 8px; }

/* 知识点强调框 */
.insight-box {
  background: var(--accent-soft); border-radius: var(--radius);
  padding: 20px 24px; font-size: 0.94em;
}
.insight-box .insight-label {
  font-weight: 900; color: var(--accent); font-size: 0.82em;
  letter-spacing: 0.1em; display: block; margin-bottom: 6px;
}

/* ============ 响应式 ============ */
@media (max-width: 920px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .wrap { padding: 0 18px; }
  .main-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; background: var(--surface);
    border-bottom: 1px solid var(--line); padding: 10px 16px 16px;
    box-shadow: var(--shadow-lg);
  }
  .main-nav.open { display: flex; }
  .mobile-menu-btn {
    display: grid; place-items: center; margin-left: auto;
    width: 40px; height: 40px; border: 1px solid var(--line);
    border-radius: 8px; background: var(--surface); font-size: 17px;
  }
  .site-header .wrap { gap: 12px; }
  .header-cta { display: none; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
}
