
/* =========================================================
   Language Lab
   全局页面样式与主题配置
   ========================================================= */

/* =========================================================
   一、全局变量：浅色主题
   ========================================================= */

:root {
  color-scheme: light;

  --bg-color: #f7f8fa;
  --surface-color: #ffffff;
  --surface-hover: #f2f3f5;

  --text-primary: #202124;
  --text-secondary: #777d87;
  --text-muted: #a0a5ae;

  --border-color: #e9ebef;
  --shadow-color: rgba(0, 0, 0, 0.04);

  --accent-color: #3978c6;

  --english-bg: #edf4ff;
  --english-color: #3474c5;

  --french-bg: #f1efff;
  --french-color: #7765c4;

  --russian-bg: #fff2e9;
  --russian-color: #c47a48;

  --radius-large: 20px;
  --radius-medium: 14px;

  --transition: 0.25s ease;
}

/* =========================================================
   二、深色主题变量
   ========================================================= */

body.dark-theme {
  color-scheme: dark;

  --bg-color: #151619;
  --surface-color: #202226;
  --surface-hover: #292c31;

  --text-primary: #f0f1f3;
  --text-secondary: #a0a5ae;
  --text-muted: #737983;

  --border-color: #30343a;
  --shadow-color: rgba(0, 0, 0, 0.16);

  --accent-color: #83b5f4;

  --english-bg: #26364b;
  --english-color: #a5c9fa;

  --french-bg: #342e4b;
  --french-color: #c0b5fa;

  --russian-bg: #49362b;
  --russian-color: #f0b58b;
}

/* =========================================================
   三、基础样式
   ========================================================= */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;

  background: var(--bg-color);
  color: var(--text-primary);

  font-family:
    "Nunito",
    "Noto Sans SC",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;

  transition:
    background var(--transition),
    color var(--transition);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

/* =========================================================
   四、顶部导航与品牌标识
   ========================================================= */

.site-header {
  width: min(1120px, calc(100% - 48px));
  height: 76px;

  margin: 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Language Lab 品牌名称 */
.brand {
  position: relative;

  display: inline-flex;
  align-items: center;

  font-family: "Nunito", "Noto Sans SC", sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;

  text-decoration: none;
}

/* 确保品牌文字显示在图标上方 */
.brand span {
  position: relative;
  z-index: 1;
}

/* =========================================================
   五、主题切换：滑动开关
   左侧浅色，右侧深色
   ========================================================= */

/* 开关轨道 */
.theme-toggle {
  position: relative;

  width: 54px;
  height: 30px;
  padding: 0;

  display: inline-flex;
  align-items: center;

  flex-shrink: 0;

  border: 1px solid var(--border-color);
  border-radius: 999px;

  background: #e2e5e9;

  cursor: pointer;

  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

/* 圆形滑块 */
.theme-toggle #themeIcon {
  position: absolute;
  left: 3px;
  top: 3px;

  width: 22px;
  height: 22px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;
  background: #ffffff;

  /* 隐藏原来的月亮或太阳字符 */
  font-size: 0;
  color: transparent;

  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);

  transition:
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    background 0.3s ease;
}

/* 深色模式：荧光绿轨道 */
body.dark-theme .theme-toggle {
  background: #b6ff00;
  border-color: #b6ff00;
}

/* 深色模式：滑块移动到右侧 */
body.dark-theme .theme-toggle #themeIcon {
  transform: translateX(24px);
  background: #202124;
}

/* 鼠标悬停 */
.theme-toggle:hover {
  box-shadow: 0 0 0 4px rgba(182, 255, 0, 0.15);
}

/* 键盘焦点 */
.theme-toggle:focus-visible {
  outline: 2px solid #b6ff00;
  outline-offset: 4px;
}

/* =========================================================
   六、首页主体
   ========================================================= */

.main-content {
  width: min(1000px, calc(100% - 48px));
  margin: 0 auto;
}

/* =========================================================
   七、欢迎区域 Hero
   ========================================================= */

.hero {
  padding: 92px 0 75px;
}

.eyebrow {
  margin: 0 0 20px;

  color: var(--text-muted);

  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
}

/* Hero 普通标题基础样式 */
.hero h1 {
  margin: 0;

  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.12;
  letter-spacing: -2.8px;
  font-weight: 700;
}

.hero-description {
  margin-top: 22px;

  color: var(--text-secondary);

  font-size: 15px;
  line-height: 1.9;
}

/* ---------- 三语彩色欢迎标题 ---------- */

.hero .hero-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 12px;

  font-family: "Nunito", "Noto Sans SC", sans-serif;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.3;
}

/* 英语：蓝色 */
.hello-en {
  color: #3978c6;
}

/* 法语：紫色 */
.hello-fr {
  color: #8b65bd;
}

/* 俄语：橙色 */
.hello-ru {
  color: #d58a3c;
}

/* 个人英文署名 */
.hero-name {
  display: inline-block;
  margin-top: 5px;

  font-family: "Nunito", "Noto Sans SC", sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;

  color: var(--text-primary);
}

/* Sean 使用荧光绿 */
.hero-name span {
  color: #8dbb00;
  font-weight: 800;
}

/* 深色主题下的欢迎标题 */
body.dark-theme .hello-en {
  color: #76aaf0;
}

body.dark-theme .hello-fr {
  color: #b99be8;
}

body.dark-theme .hello-ru {
  color: #e9ad70;
}

body.dark-theme .hero-name span {
  color: #b6ff00;
}

/* =========================================================
   八、通用区块标题
   ========================================================= */

.language-section,
.overview-section,
.activity-section {
  margin-bottom: 65px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;

  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0;

  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.5px;
}

.section-heading span {
  color: var(--text-muted);
  font-size: 12px;
}

/* =========================================================
   九、三语言卡片
   ========================================================= */

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

.language-card {
  position: relative;

  min-height: 185px;
  padding: 25px;

  display: flex;
  flex-direction: column;
  align-items: flex-start;

  border-radius: var(--radius-large);

  transition:
    transform var(--transition),
    box-shadow var(--transition);
}

.language-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px var(--shadow-color);
}

/* 英语 */
.english {
  background: var(--english-bg);
  color: var(--english-color);
}

/* 法语 */
.french {
  background: var(--french-bg);
  color: var(--french-color);
}

/* 俄语 */
.russian {
  background: var(--russian-bg);
  color: var(--russian-color);
}

.language-code {
  font-size: 35px;
  font-weight: 750;
  letter-spacing: -1.5px;
}

.language-name {
  margin-top: 12px;

  font-size: 17px;
  font-weight: 650;
}

.language-description {
  margin-top: 6px;

  font-size: 11px;
  opacity: 0.75;
}

.card-arrow {
  position: absolute;
  right: 22px;
  top: 22px;

  font-size: 17px;
  opacity: 0.65;
}

/* =========================================================
   十、学习数据卡片
   ========================================================= */

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.overview-card {
  min-height: 125px;
  padding: 23px;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-medium);

  box-shadow: 0 4px 15px var(--shadow-color);
}

.overview-label {
  color: var(--text-secondary);
  font-size: 12px;
}

.overview-card strong {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -1px;
}

.overview-card small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
}

/* =========================================================
   十一、最近学习记录
   ========================================================= */

.empty-state {
  min-height: 170px;
  padding: 30px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-large);
}

.empty-icon {
  color: var(--text-muted);
  font-size: 25px;
}

.empty-state p {
  margin: 15px 0 5px;

  font-size: 14px;
  font-weight: 550;
}

.empty-state span:last-child {
  color: var(--text-muted);
  font-size: 12px;
}

/* =========================================================
   十二、Today's Reading · 每日文章推荐
   ========================================================= */

/* 推荐区域整体 */
.daily-section {
  margin-bottom: 75px;
}

/* 推荐区域标题 */
.daily-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;

  margin-bottom: 28px;
}

.daily-heading .eyebrow {
  margin-bottom: 13px;
}

.daily-heading h2 {
  margin: 0;

  font-size: 30px;
  font-weight: 680;
  letter-spacing: -1.2px;
}

.daily-subtitle {
  margin: 12px 0 0;

  color: var(--text-secondary);
  font-size: 13px;
}

/* CAIBUDIAN 标识 */
.daily-brand {
  display: flex;
  align-items: center;
  gap: 8px;

  padding-bottom: 5px;

  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.3px;
  white-space: nowrap;
}

.daily-brand-dot {
  width: 7px;
  height: 7px;

  border-radius: 50%;
  background: #7da98a;
}

/* 新闻列表外框 */
.article-list {
  overflow: hidden;

  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-large);

  box-shadow: 0 5px 22px var(--shadow-color);
}

/* 新闻卡片 */
.article-item {
  position: relative;

  display: flex;
  align-items: flex-start;
  gap: 20px;

  padding: 26px;

  border-bottom: 1px solid var(--border-color);

  cursor: pointer;

  transition:
    background var(--transition),
    border-color var(--transition);
}

.article-item:last-child {
  border-bottom: none;
}

/* 键盘访问焦点 */
.article-item:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: -3px;
}

/* 新闻标题 */
.article-content {
  flex: 1;
  min-width: 0;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;

  color: var(--text-muted);

  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
}

.article-content h3 {
  margin: 12px 0 7px;

  color: var(--text-primary);

  font-size: 16px;
  font-weight: 620;
  letter-spacing: -0.3px;

  overflow-wrap: anywhere;
}

.article-content > p {
  margin: 0;

  color: var(--text-secondary);

  font-size: 12px;
  line-height: 1.8;
}

/* 新闻底部信息 */
.article-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;

  margin-top: 16px;

  color: var(--text-muted);
  font-size: 10px;
}

.article-level {
  color: var(--accent-color);
  font-weight: 650;
}

/* 媒体来源徽标 */
.article-source {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 34px;
  padding: 3px 7px;

  border: 1px solid var(--border-color);
  border-radius: 5px;

  background: var(--surface-hover);
  color: var(--text-secondary);

  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.8px;
  line-height: 1.3;

  white-space: nowrap;

  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition);
}

/* 新闻缩略图 */
.article-image {
  flex-shrink: 0;

  width: 128px;
  height: 88px;

  display: block;

  object-fit: cover;
  object-position: center;

  border-radius: 10px;

  background: var(--surface-hover);

  transition:
    transform var(--transition),
    opacity var(--transition);
}

/* 右侧外链指示图标 */
.article-arrow {
  flex-shrink: 0;

  width: 32px;
  height: 32px;

  display: grid;
  place-items: center;

  margin-left: auto;
  padding: 0;

  border: 1px solid var(--border-color);
  border-radius: 50%;

  background: var(--surface-hover);
  color: var(--text-secondary);

  font-size: 15px;

  transition:
    transform var(--transition),
    background var(--transition),
    color var(--transition),
    border-color var(--transition);
}

/* ---------- 新闻卡片：英语蓝色 ---------- */

.article-en {
  background: #edf4fc;
  border-color: #dce9f8;
}

.article-en:hover {
  background: #e3eefb;
}

/* ---------- 新闻卡片：法语紫色 ---------- */

.article-fr {
  background: #f3effb;
  border-color: #e6dcf7;
}

.article-fr:hover {
  background: #ece5f8;
}

/* ---------- 新闻卡片：俄语橙色 ---------- */

.article-ru {
  background: #fbf2e8;
  border-color: #f3e2ce;
}

.article-ru:hover {
  background: #f7e9d9;
}

/* ---------- 深色主题新闻卡片 ---------- */

body.dark-theme .article-en {
  background: #202e40;
  border-color: #30445e;
}

body.dark-theme .article-en:hover {
  background: #263950;
}

body.dark-theme .article-fr {
  background: #30283e;
  border-color: #46385e;
}

body.dark-theme .article-fr:hover {
  background: #392f4b;
}

body.dark-theme .article-ru {
  background: #3a2d22;
  border-color: #57402e;
}

body.dark-theme .article-ru:hover {
  background: #453526;
}

/* 新闻卡片悬停反馈 */
.article-item:hover .article-image {
  transform: scale(1.02);
}

.article-item:hover .article-source {
  border-color: var(--accent-color);
  color: var(--text-primary);
}

.article-item:hover .article-arrow {
  transform: translate(2px, -2px);

  border-color: var(--accent-color);
  background: var(--surface-color);
  color: var(--text-primary);
}

/* 新闻加载提示 */
.daily-loading {
  padding: 38px 20px;

  color: var(--text-muted);
  text-align: center;

  font-size: 12px;
}

/* 新闻加载失败提示 */
.daily-error {
  padding: 38px 20px;

  color: var(--text-secondary);
  text-align: center;

  font-size: 12px;
  line-height: 1.8;
}

/* 新闻推荐区域底部 */
.daily-footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;

  margin-top: 17px;

  color: var(--text-muted);

  font-size: 9px;
  letter-spacing: 1px;
}

/* =========================================================
   十三、My Vocabulary · 首页词汇本入口
   独立黑色 × 荧光绿配色
   ========================================================= */

.vocabulary-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;

  padding: 28px 32px;
  margin-top: 24px;

  background: #101310;
  border: 1px solid #283b2a;
  border-radius: 16px;

  color: #f2f5f0;
  text-decoration: none;

  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

/* 鼠标悬停 */
.vocabulary-entry:hover {
  transform: translateY(-3px);

  border-color: #a6ff4d;

  box-shadow: 0 8px 28px rgba(166, 255, 77, 0.10);
}

/* 英文小标题 */
.vocabulary-entry .eyebrow {
  margin: 0 0 10px;

  color: #a6ff4d;

  letter-spacing: 2px;
  font-size: 10px;
}

/* 词汇本标题 */
.vocabulary-entry h2 {
  margin: 0 0 9px;

  color: #a6ff4d;

  font-size: 25px;
  font-weight: 600;
}

/* 中文与语言说明 */
.vocabulary-entry p:last-child {
  margin: 0;

  color: #a8b2a5;

  font-size: 13px;
  line-height: 1.7;
}

/* 右侧箭头 */
.vocabulary-entry-arrow {
  flex-shrink: 0;

  color: #a6ff4d;
  font-size: 27px;

  transition: transform 0.25s ease;
}

.vocabulary-entry:hover .vocabulary-entry-arrow {
  transform: translate(4px, -4px);
}

/* =========================================================
   十四、个人署名 · 彭星源 Ben Sean
   左下角固定显示，黑色 × 荧光绿
   ========================================================= */

.personal-signature {
  position: fixed;
  left: 24px;
  bottom: 20px;
  z-index: 100;

  display: inline-flex;
  align-items: center;
  gap: 7px;

  font-family: "Nunito", "Noto Sans SC", sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.4px;

  color: #202124;
  text-decoration: none;

  background: #b6ff00;

  padding: 7px 14px;
  border-radius: 999px;

  box-shadow: 0 4px 14px rgba(182, 255, 0, 0.18);

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

/* 鼠标悬停 */
.personal-signature:hover {
  transform: translateY(-3px);

  box-shadow: 0 7px 20px rgba(182, 255, 0, 0.28);
}

/* 键盘焦点 */
.personal-signature:focus-visible {
  outline: 2px solid #202124;
  outline-offset: 4px;
}

/* =========================================================
   十五、页面底部
   ========================================================= */

.site-footer {
  width: min(1000px, calc(100% - 48px));

  margin: 0 auto;
  padding: 25px 0 35px;

  display: flex;
  justify-content: space-between;

  border-top: 1px solid var(--border-color);

  color: var(--text-muted);

  font-size: 10px;
  letter-spacing: 1px;
}

/* =========================================================
   十六、移动端适配
   ========================================================= */

@media (max-width: 650px) {

  /* 顶部导航 */
  .site-header {
    width: calc(100% - 36px);
    height: 65px;
  }

  /* 页面主体 */
  .main-content {
    width: calc(100% - 36px);
  }

  /* 欢迎区域 */
  .hero {
    padding: 65px 0 55px;
  }

  .hero h1 {
    letter-spacing: -1.8px;
  }

  .hero .hero-title {
    gap: 4px 9px;

    font-size: clamp(29px, 8vw, 40px);
    letter-spacing: -1px;
  }

  .hero-name {
    font-size: 16px;
  }

  /* 三语言卡片 */
  .language-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .language-card {
    min-height: 145px;
  }

  /* 学习数据卡片 */
  .overview-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .overview-card {
    min-height: 105px;
  }

  /* 通用区块间距 */
  .language-section,
  .overview-section,
  .activity-section {
    margin-bottom: 48px;
  }

  /* 每日阅读标题 */
  .daily-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .daily-heading h2 {
    font-size: 27px;
  }

  /* 新闻卡片 */
  .article-item {
    gap: 13px;
    padding: 21px 16px;
  }

  /* 新闻图片 */
  .article-image {
    width: 82px;
    height: 72px;

    border-radius: 8px;
  }

  /* 新闻标题 */
  .article-content h3 {
    font-size: 14px;
  }

  /* 新闻加载状态 */
  .daily-loading,
  .daily-error {
    padding: 30px 16px;
  }

  /* 新闻底部 */
  .daily-footer {
    font-size: 8px;
  }

  /* 词汇本入口 */
  .vocabulary-entry {
    padding: 23px 20px;
  }

  .vocabulary-entry h2 {
    font-size: 22px;
  }

  /* 个人署名 */
  .personal-signature {
    left: 14px;
    bottom: 14px;

    font-size: 12px;
    padding: 6px 11px;
  }

  /* 页面底部 */
  .site-footer {
    width: calc(100% - 36px);

    gap: 15px;
    flex-wrap: wrap;
  }
}

/* =========================================================
   十七、动效辅助：尊重系统减少动态效果设置
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

}

/* =========================================================
   页面背景图案 · CAIBUDIAN.jpeg
   整页铺设，低透明度，不影响内容阅读
   ========================================================= */

body {
  position: relative;
  isolation: isolate;
}

/* 页面背景图层 */
body::before {
  content: "";

  position: fixed;
  inset: 0;
  z-index: -1;

  background-image: url("CAIBUDIAN.jpeg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: min(65vw, 760px);

  opacity: 0.145;

  pointer-events: none;
}

/* 深色主题下适当提高背景图的可见度 */
body.dark-theme::before {
  opacity: 0.07;
}

/* 手机端背景图适当缩小 */
@media (max-width: 650px) {
  body::before {
    background-size: 90vw;
    background-position: center 100%;
  }
}

