/* ==========================================================================
   CG1120 · 个人主页
   设计基调：沉静编辑感 —— 大字号 / 充足留白 / 细线分隔 / 暖金点缀
   浅色 + 深色双主题（跟随系统 prefers-color-scheme）
   ========================================================================== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ---------- 设计令牌 ---------- */
:root {
  color-scheme: light dark;

  /* 面层：纸底 → 卡片 → 次级面，三级递进 */
  --paper:       #f5f4f1;
  --paper-warm:  #faf7f1;
  --paper-glass: rgba(245, 244, 241, .82);
  --card:        #ffffff;
  --card-2:      #faf9f6;

  /* 文字：四级灰阶，均满足 WCAG AA（正文 ≥4.5:1） */
  --ink:   #14171b;
  --ink-2: #434a52;
  --ink-3: #656d76;
  --ink-4: #9aa2ab;

  /* 分隔线 */
  --line:   #e5e2dc;
  --line-2: #efece7;

  /* 强调色 */
  --accent:      #1c5fa8;
  --accent-soft: #e9eff8;
  --gold:        #8f6326;   /* 用于文字，对比度 ≥4.4:1 */
  --gold-bright: #c08b3f;   /* 仅装饰：线、圆点、图标 */
  --gold-line:   #e8d9bd;
  --gold-soft:   #f9f2e6;

  /* 阴影：三级 */
  --sh-1: 0 1px 2px rgba(20, 23, 27, .04), 0 1px 1px rgba(20, 23, 27, .03);
  --sh-2: 0 1px 2px rgba(20, 23, 27, .04), 0 10px 24px -12px rgba(20, 23, 27, .18);
  --sh-3: 0 2px 6px rgba(20, 23, 27, .05), 0 22px 48px -20px rgba(20, 23, 27, .24);

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;

  --ease: cubic-bezier(.2, .7, .3, 1);
  --wrap: 960px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:       #121417;
    --paper-warm:  #16181c;
    --paper-glass: rgba(18, 20, 23, .82);
    --card:        #1a1d21;
    --card-2:      #202429;

    --ink:   #f0f2f4;
    --ink-2: #c1c7ce;
    --ink-3: #939ba4;
    --ink-4: #6b737c;

    --line:   #2b3037;
    --line-2: #23272c;

    --accent:      #7cb0f0;
    --accent-soft: #1a2634;
    --gold:        #d8ab6e;
    --gold-bright: #e3bd85;
    --gold-line:   #3a3222;
    --gold-soft:   #26211a;

    --sh-1: 0 1px 2px rgba(0, 0, 0, .5);
    --sh-2: 0 1px 2px rgba(0, 0, 0, .45), 0 12px 28px -14px rgba(0, 0, 0, .7);
    --sh-3: 0 2px 8px rgba(0, 0, 0, .5), 0 24px 52px -22px rgba(0, 0, 0, .85);
  }
}

/* ---------- 基础 ---------- */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--gold-soft); color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  padding: 84px 0 54px;
  border-bottom: 1px solid var(--line);
}

.hero-bg {
  position: absolute; top: -1px; left: 0; right: 0; bottom: 0;
  z-index: 0; pointer-events: none; overflow: hidden;
}
.hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(80% 130% at 4% -20%, var(--gold-soft) 0%, transparent 62%);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: .55;
  -webkit-mask-image: radial-gradient(110% 100% at 15% 0%, #000 0%, transparent 68%);
          mask-image: radial-gradient(110% 100% at 15% 0%, #000 0%, transparent 68%);
}

.hero-top, .hero .meta { position: relative; z-index: 1; }

.hero-top { display: flex; align-items: center; gap: 20px; }

.hero-mark {
  flex: 0 0 auto;
  width: 64px; height: 64px;
  display: grid; place-items: center;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 22px; font-weight: 600; letter-spacing: -.5px;
  color: var(--gold);
  background: linear-gradient(155deg, var(--card) 0%, var(--gold-soft) 100%);
  border: 1px solid var(--gold-line);
  border-radius: 20px;
  box-shadow: var(--sh-1);
}

.hero-id { min-width: 0; }

.hero-kicker {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 11.5px; font-weight: 500;
  letter-spacing: .3em;
  color: var(--gold);
  margin-bottom: 7px;
}

h1 {
  font-size: 46px; font-weight: 700;
  letter-spacing: -1px; line-height: 1.08;
  color: var(--ink);
  text-wrap: balance;
}

.tagline {
  margin-top: 11px;
  font-size: 16.5px; line-height: 1.6;
  color: var(--ink-2);
}

.hero .meta {
  margin-top: 32px;
  display: flex; flex-wrap: wrap;
  gap: 9px 20px;
  font-size: 13.5px; color: var(--ink-3);
}
.hero .meta span::before {
  content: ""; display: inline-block;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold-bright); opacity: .5;
  margin-right: 10px; position: relative; top: -2px;
}
.hero .meta span:first-child::before { display: none; }

/* ---------- 标签页 ---------- */
.tabs {
  display: flex; gap: 30px;
  position: sticky; top: 0; z-index: 20;
  background: var(--paper-glass);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
          backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.tab {
  appearance: none; -webkit-appearance: none;
  font-family: inherit;
  font-size: 15.5px; font-weight: 600; letter-spacing: .3px;
  color: var(--ink-3); background: none; border: none;
  border-bottom: 2px solid transparent;
  padding: 15px 1px; margin-bottom: -1px;
  cursor: pointer;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--gold-bright); }

.panel { display: none; }
.panel.is-active { display: block; animation: panelIn .32s var(--ease) both; }

@keyframes panelIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 区块 ---------- */
section {
  padding: 60px 0;
  border-bottom: 1px solid var(--line-2);
}
section:last-of-type { border-bottom: none; }

h2 {
  display: flex; align-items: center; gap: 14px;
  font-size: 19px; font-weight: 600; letter-spacing: .3px;
  color: var(--ink);
  margin-bottom: 26px;
}

h2::after {
  content: ""; flex: 1 1 auto; height: 1px;
  background: var(--line);
}

p { color: var(--ink-2); font-size: 15.5px; line-height: 1.85; }
p + p { margin-top: 14px; }
.stats + p { margin-top: 24px; }

/* ---------- 数据条 ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-1);
}
.stat {
  position: relative;
  background: var(--card);
  padding: 26px 22px;
}
.stat::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, var(--gold-bright), transparent);
  opacity: 0;
  transition: opacity .22s var(--ease);
}
.stat:hover::before { opacity: 1; }
.stat b {
  display: block;
  font-size: 30px; font-weight: 600; line-height: 1.15;
  letter-spacing: -1px; color: var(--ink);
}
.stat b span {
  font-size: .5em; font-weight: 500;
  letter-spacing: 0; color: var(--ink-3);
  margin-left: 2px;
}
.stat small {
  display: block; margin-top: 7px;
  font-size: 12.5px; line-height: 1.55; color: var(--ink-3);
}

/* ---------- 能力卡 ---------- */
.skills {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.skill {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px 24px;
  box-shadow: var(--sh-1);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.skill:hover {
  transform: translateY(-2px);
  border-color: var(--gold-line);
  box-shadow: var(--sh-2);
}
.skill h3 {
  display: flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 600; letter-spacing: .2px;
  color: var(--ink);
  margin-bottom: 9px;
}
.skill h3::before {
  content: ""; flex: 0 0 auto;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold-bright);
}
.skill p { font-size: 14.5px; line-height: 1.8; }

/* ---------- 标签 ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  font-size: 13.5px; color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  transition: color .18s var(--ease), background .18s var(--ease),
              border-color .18s var(--ease), transform .18s var(--ease);
}
.tag:hover {
  color: var(--gold);
  background: var(--gold-soft);
  border-color: var(--gold-line);
  transform: translateY(-1px);
}

/* ---------- 链接卡 ---------- */
.link-card {
  position: relative;
  display: block;
  text-decoration: none; color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px 60px 22px 24px;
  box-shadow: var(--sh-1);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.link-card::after {
  content: "\2192";
  position: absolute; right: 24px; top: 50%;
  transform: translateY(-50%);
  font-size: 18px; color: var(--gold-bright);
  transition: transform .22s var(--ease);
}
.link-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-line);
  box-shadow: var(--sh-2);
}
.link-card:hover::after { transform: translateY(-50%) translateX(4px); }
.link-card b { display: block; font-size: 16px; color: var(--ink); letter-spacing: -.1px; }
.link-card span { display: block; margin-top: 4px; font-size: 13.5px; color: var(--ink-3); }

/* ---------- 个人感悟 ---------- */
#life { background: linear-gradient(180deg, var(--paper-warm) 0%, var(--paper) 260px); }

.life-lead {
  font-size: 16.5px; line-height: 1.85; color: var(--ink-2);
  margin-bottom: 40px;
  padding: 3px 0 3px 18px;
  border-left: 3px solid var(--gold-bright);
}

.thought {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 22px;
  box-shadow: var(--sh-1);
  transition: transform .24s var(--ease), box-shadow .24s var(--ease), border-color .24s var(--ease);
}
.thought::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  opacity: 0;
  transition: opacity .24s var(--ease);
}
.thought:hover {
  transform: translateY(-2px);
  border-color: var(--gold-line);
  box-shadow: var(--sh-3);
}
.thought:hover::before { opacity: 1; }
.thought:last-child { margin-bottom: 0; }

.thought-body { padding: 28px 32px 30px; }

.thought-head { display: flex; align-items: center; gap: 15px; margin-bottom: 18px; }

.thought-icon {
  flex: 0 0 48px; width: 48px; height: 48px; min-width: 48px; max-width: 48px;
  border-radius: 14px;
  background: linear-gradient(155deg, var(--gold-soft), var(--card-2));
  border: 1px solid var(--gold-line);
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.thought-icon svg { width: 26px; height: 26px; flex: 0 0 26px; display: block; }

.thought-title { flex: 1 1 auto; min-width: 0; }

.thought-num {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 11.5px; font-weight: 500; letter-spacing: .18em;
  color: var(--gold);
  margin-bottom: 4px;
}
.thought-src {
  display: inline-block; margin-left: 8px;
  padding: 1px 8px 2px;
  font-size: 10.5px; font-weight: 500; letter-spacing: .12em;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  vertical-align: 1px;
}

.thought-body h3 {
  font-size: 18.5px; font-weight: 600; letter-spacing: -.2px; line-height: 1.4;
  color: var(--ink);
  text-wrap: balance;
}

.thought-body .text { font-size: 15.5px; line-height: 1.92; color: var(--ink-2); }
.thought-body .text + .text { margin-top: 14px; }
.thought-body .text strong { color: var(--ink); font-weight: 600; }

.thought-body .punch {
  margin-top: 20px;
  padding: 15px 18px 15px 20px;
  background: var(--gold-soft);
  border-left: 3px solid var(--gold-bright);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 15.5px; font-weight: 600; line-height: 1.85;
  color: var(--ink);
}

.thought-body .punch + .text {
  margin-top: 12px;
  font-size: 13px; letter-spacing: .4px;
  color: var(--ink-3);
  text-align: right;
}

.thought-body .steps { display: grid; gap: 8px; margin-top: 16px; }
.thought-body .steps div {
  position: relative; padding-left: 22px;
  font-size: 15px; line-height: 1.8; color: var(--ink-2);
}
.thought-body .steps div::before {
  content: ""; position: absolute; left: 6px; top: 11px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold-bright); opacity: .7;
}

/* ---------- 页脚 ---------- */
footer {
  padding: 44px 0 56px;
  border-top: 1px solid var(--line-2);
  font-size: 13px; color: var(--ink-3); text-align: center;
}
footer .icp { margin-top: 10px; font-size: 12.5px; }
footer .gov a {
  display: inline-flex; align-items: center; gap: 5px;
}
footer .gov img {
  width: 14px; height: 16px; display: block;
}
footer .contact { margin-top: 10px; font-size: 12.5px; }
footer .contact a {
  color: var(--ink-3); text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
footer .contact a:hover { color: var(--accent); border-bottom-color: var(--accent); }
footer .icp a {
  color: var(--ink-3); text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
footer .icp a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.admin-entry {
  display: inline-block; margin-top: 10px; font-size: 12.5px;
  color: var(--ink-3); text-decoration: none; opacity: .55;
}
.admin-entry:hover { opacity: 1; color: var(--accent); }

/* ---------- 时间轴（当前未使用，保留供后续复用） ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 10px; bottom: 10px;
  width: 1px; background: var(--line);
}
.item { position: relative; padding-bottom: 32px; }
.item:last-child { padding-bottom: 0; }
.item::before {
  content: ""; position: absolute; left: -25px; top: 9px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--gold-bright);
}
.item h3 { font-size: 16.5px; font-weight: 600; color: var(--ink); }
.item .role { font-size: 14px; color: var(--gold); margin-top: 2px; }
.item p { margin-top: 8px; font-size: 14.5px; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .wrap { padding: 0 24px; }
  .hero { padding: 64px 0 42px; }
  h1 { font-size: 36px; letter-spacing: -.7px; }
  .hero-mark { width: 56px; height: 56px; border-radius: 17px; font-size: 19px; }
  section { padding: 48px 0; }
  .skills { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .thought-body { padding: 24px 24px 26px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .hero { padding: 52px 0 34px; }
  .hero-top { gap: 15px; }
  .hero-mark { width: 50px; height: 50px; border-radius: 15px; font-size: 17px; }
  .hero-kicker { letter-spacing: .24em; }
  h1 { font-size: 30px; letter-spacing: -.5px; }
  .tagline { font-size: 15px; }
  .hero .meta { margin-top: 24px; gap: 8px 16px; font-size: 13px; }
  .tabs { gap: 24px; }
  .tab { font-size: 15px; padding: 13px 1px; }
  h2 { font-size: 17.5px; gap: 11px; }
  .stats { grid-template-columns: 1fr; }
  .stat { padding: 22px 20px; }
  .thought-body { padding: 22px 20px 24px; }
  .thought-head { gap: 12px; }
  .thought-icon {
    flex: 0 0 42px; width: 42px; height: 42px; min-width: 42px; max-width: 42px;
    border-radius: 12px;
  }
  .thought-icon svg { width: 23px; height: 23px; flex: 0 0 23px; }
  .thought-body h3 { font-size: 17px; }
}

/* ---------- 无障碍：尊重「减少动态效果」 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- 个人感悟：区块头精修 ---------- */
.life-head { margin-bottom: 40px; }

.life-eyebrow {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 15px;
}
.life-eyebrow-t {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 11px; font-weight: 500;
  letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold);
}
.life-eyebrow-t::before {
  content: ""; width: 20px; height: 1px;
  background: var(--gold-bright); opacity: .6;
}
.life-count {
  margin-left: auto;
  font-size: 11.5px; letter-spacing: .08em;
  color: var(--ink-4);
}
.life-count b {
  font-weight: 600; color: var(--gold);
  font-variant-numeric: tabular-nums;
}

#life h2 {
  font-size: 26px; font-weight: 600; letter-spacing: -.4px;
  margin-bottom: 18px;
}
#life .life-lead {
  margin-bottom: 0;
  font-size: 16px;
}

/* ---------- 个人感悟：卡片精修 ---------- */
.thought { border-radius: 20px; }
.thought-body { padding: 32px 36px 34px; }
.thought-head {
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-2);
}
.thought-icon { border-radius: 15px; }
.thought-num::before {
  content: ""; display: inline-block;
  width: 14px; height: 1px; margin-right: 8px;
  background: var(--gold-bright); opacity: .55;
  vertical-align: middle; position: relative; top: -2px;
  transition: width .24s var(--ease), opacity .24s var(--ease);
}
.thought:hover .thought-num::before { width: 20px; opacity: 1; }
.thought-body h3 { font-size: 20px; letter-spacing: -.3px; }
.thought-body .text { font-size: 15.8px; line-height: 1.95; }

.thought-body .punch {
  position: relative;
  margin-top: 22px;
  padding: 17px 20px 17px 46px;
  border-radius: 0 var(--r) var(--r) 0;
  font-size: 16px;
}
.thought-body .punch::before {
  content: "\201C";
  position: absolute; left: 16px; top: 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px; line-height: 1;
  color: var(--gold-bright); opacity: .5;
}

/* ---------- 个人感悟：响应式微调 ---------- */
@media (max-width: 860px) {
  #life h2 { font-size: 23px; }
  .thought-body { padding: 26px 24px 28px; }
}
@media (max-width: 560px) {
  .life-eyebrow-t { letter-spacing: .2em; }
  #life h2 { font-size: 21px; }
  .thought { border-radius: 16px; }
  .thought-body { padding: 22px 20px 24px; }
  .thought-body h3 { font-size: 17.5px; }
  .thought-body .punch { padding: 15px 16px 15px 40px; font-size: 15.5px; }
}
