/* ============================================================
   styles.css — 个人网站（浅色简约 · 类 Notion/Linear）
   保留所有 class 绑定（脚本依赖），仅重做视觉与布局。
   品牌点缀：安全橙 #F97316（克制使用），主体中性灰阶为主。
   ============================================================ */
:root {
  --bg: #f7f8fa;          /* 画布背景 */
  --surface: #ffffff;     /* 卡片/面板 */
  --ink: #1f2328;         /* 主文字 */
  --ink-soft: #57606a;    /* 次级文字 */
  --muted: #8c959f;       /* 弱化文字 */
  --line: #e8eaed;        /* 分隔线/边框 */
  --line-strong: #d8dce2;
  --accent: #f97316;      /* 品牌橙（主操作/链接），克制使用 */
  --accent-strong: #ea580c;
  --accent-soft: rgba(249, 115, 22, .08);
  --blue: #2563eb;        /* 次级强调（聚焦/引用） */
  --blue-soft: rgba(37, 99, 235, .08);
  --teal: #0f766e;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .05);
  --content: 720px;       /* 居中单栏宽度 */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--content); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0; z-index: 200;
}
.skip-link:focus { left: 0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 20px; border-radius: 10px; font-weight: 600; font-size: 14.5px;
  border: 1px solid transparent; transition: background .2s ease, border-color .2s ease, transform .15s ease, color .2s ease;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-primary:active { transform: translateY(1px); }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 248, 250, .82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
}
.brand-mark img { width: 26px; height: 26px; }
.brand-name { font-size: 17px; letter-spacing: .3px; }
.brand-sub { font-size: 12px; color: var(--muted); padding: 2px 8px; border-left: 1px solid var(--line-strong); }

.nav-links { display: flex; gap: 26px; }
.nav-links a { font-size: 15px; color: var(--ink-soft); font-weight: 500; position: relative; padding: 4px 0; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px;
  background: var(--accent); border-radius: 2px;
}
.nav-actions { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; width: 40px; height: 38px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- App 布局（左侧导航 + 右侧内容） ---------- */
.app-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  min-height: calc(100vh - 60px - 140px);
}

/* 左侧导航 */
.app-sidebar {
  padding-right: 16px;
}
.side-nav {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.side-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background .15s, color .15s;
  text-align: left;
  font-family: inherit;
}
.side-nav-item:hover { background: #f1f3f5; color: var(--ink); }
.side-nav-item.active { background: var(--accent-soft); color: var(--accent-strong); }
.side-icon { font-size: 16px; line-height: 1; }

/* 右侧内容区 */
.app-content { min-width: 0; }
.view-header { margin-bottom: 20px; }
.view-title { margin: 0; font-size: 22px; font-weight: 700; }
.view-desc { margin: 6px 0 0; font-size: 14px; color: var(--ink-soft); }

/* ---------- 笔记应用 ---------- */
.notes-app { max-width: var(--content); padding-bottom: 72px; }

/* 添加笔记 */
.composer {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px; box-shadow: var(--shadow); margin-bottom: 40px;
}
.composer-row { display: flex; gap: 12px; }
.link-input {
  flex: 1; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px;
  font-size: 15px; color: var(--ink); background: #fbfbfc; transition: border-color .2s, box-shadow .2s;
}
.link-input:focus, .note-input:focus, .summary-manual textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft);
}
.note-input {
  width: 100%; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line-strong);
  border-radius: 10px; font-size: 15px; color: var(--ink); background: #fbfbfc; resize: vertical;
  font-family: inherit; line-height: 1.7;
}

.summary-box {
  margin-top: 14px; padding: 16px; border: 1px solid var(--blue);
  border-radius: 10px; background: var(--blue-soft);
}
.summary-status { font-size: 14px; color: var(--ink-soft); margin-bottom: 8px; }
.summary-status.loading { color: var(--blue); }
.summary-status.err { color: #dc2626; }
.summary-text {
  font-size: 15px; color: var(--ink); line-height: 1.8; white-space: pre-wrap;
}
.summary-manual { margin-top: 12px; }
.summary-actions { margin-top: 10px; }
.summary-manual label { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 6px; }
.summary-manual textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px;
  font-size: 14px; line-height: 1.7; font-family: inherit; resize: vertical; background: #fbfbfc;
}
.summary-manual .btn { margin-top: 10px; }

.composer-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.composer-msg { font-size: 14px; }
.composer-msg.ok { color: var(--teal); }
.composer-msg.err { color: #dc2626; }

/* 笔记列表 */
.notes-list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.notes-list-title { margin: 0; font-size: 20px; font-weight: 700; }
.notes-list-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.notes-count { font-size: 13.5px; color: var(--muted); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.search-input {
  padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 10px;
  font-size: 13.5px; color: var(--ink); background: #fbfbfc; width: 180px;
  font-family: inherit; transition: border-color .2s, box-shadow .2s;
}
.search-input:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft);
}
.search-input::-webkit-search-cancel-button { cursor: pointer; }

.notes-list { display: flex; flex-direction: column; gap: 14px; }

.note-card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
  transition: border-color .2s ease, transform .2s ease;
}
.note-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.note-date {
  position: absolute; top: 16px; right: 18px; font-size: 12px; color: var(--muted);
  background: #f1f3f5; padding: 3px 10px; border-radius: 999px;
}
.note-title { margin: 0 0 2px; padding-right: 96px; font-size: 16.5px; font-weight: 700; color: var(--ink); line-height: 1.45; word-break: break-word; }
.note-link { display: inline-block; max-width: calc(100% - 110px); color: var(--accent); font-weight: 600; font-size: 14px; word-break: break-all; }
.note-link:hover { color: var(--accent-strong); text-decoration: underline; }
.note-summary {
  margin: 12px 0 0; padding: 12px 14px; background: #f6f7f9; border-left: 3px solid var(--blue);
  border-radius: 8px; font-size: 14px; color: var(--ink-soft); line-height: 1.8; white-space: pre-wrap;
}
.note-content { margin: 12px 0 0; font-size: 15px; color: var(--ink); line-height: 1.85; white-space: pre-wrap; word-break: break-word; }
.note-delete {
  margin-top: 14px; background: none; border: 1px solid var(--line); color: var(--muted);
  font-size: 13px; padding: 6px 12px; border-radius: 8px; cursor: pointer; transition: all .2s;
}
.note-delete:hover { border-color: #dc2626; color: #dc2626; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.empty-state strong { display: block; font-size: 16px; color: var(--ink-soft); margin-bottom: 6px; }

/* ---------- 页脚 ---------- */
.site-footer { background: var(--surface); color: var(--ink-soft); padding: 40px 0; text-align: center; border-top: 1px solid var(--line); margin-top: 20px; }
.footer-brand { font-size: 18px; font-weight: 700; color: var(--ink); }
.footer-brand span { font-size: 13px; color: var(--muted); margin-left: 8px; font-weight: 400; }
.footer-tag { margin: 10px 0 6px; font-size: 13.5px; color: var(--muted); }
.footer-copy { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ---------- 回到顶部 ---------- */
.to-top {
  position: fixed; left: 22px; bottom: 22px; width: 44px; height: 44px;
  border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 18px; box-shadow: 0 6px 18px rgba(16, 24, 40, .25); opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: all .3s ease; z-index: 90;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.to-top:hover { background: var(--accent); }

/* ---------- 滚动渐显 ---------- */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.visible { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .app-layout { grid-template-columns: 1fr; padding: 16px 16px 32px; }
  .app-sidebar { padding-right: 0; margin-bottom: 12px; }
  .side-nav { position: static; flex-direction: row; gap: 8px; }
  .side-nav-item { flex: 1; justify-content: center; padding: 10px; font-size: 13.5px; }
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 8px 20px 16px; box-shadow: 0 12px 24px rgba(16, 24, 40, .08);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav-links.open { max-height: 320px; }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-actions .btn-ghost { display: none; }
  .to-top { left: 16px; bottom: 16px; }
  .composer-row { flex-direction: column; }
  .composer-row .btn { width: 100%; }
  .note-date { position: static; display: inline-block; margin-bottom: 8px; }
  .note-title { padding-right: 0; }
  .note-link { max-width: 100%; }
  .search-input { width: 100%; order: 5; }
  .contact-body { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- 通用 eyebrow ---------- */
.eyebrow { margin: 0 0 14px; font-size: 12.5px; letter-spacing: 3px; text-transform: uppercase; color: var(--accent); font-weight: 600; }

/* ============================================================
   简历页样式（内嵌到 index.html 的单页切换）
   ============================================================ */
#pageResume { padding: 32px 0 48px; }

.resume {
  display: grid; grid-template-columns: 280px 1fr; gap: 32px;
  max-width: 960px; margin: 0 auto; padding: 0 20px;
}

/* 左侧栏 */
.r-side {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow); height: fit-content;
}
.r-id { text-align: center; margin-bottom: 20px; }
.r-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
}
.r-name { margin: 0; font-size: 22px; font-weight: 700; }
.r-title { margin: 7px 0 0; font-size: 14px; color: var(--accent); font-weight: 600; }

.r-block { margin-top: 22px; }
.r-h { margin: 0 0 12px; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.r-contact { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.r-contact li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.r-contact li:last-child { border-bottom: 0; }
.r-contact span { color: var(--muted); font-size: 12.5px; }

.r-tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.r-tags li { background: #f1f3f5; color: var(--ink-soft); font-size: 12.5px; padding: 5px 11px; border-radius: 999px; }

.r-edu-name { margin: 0; font-weight: 600; font-size: 15px; }
.r-edu-sub { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.r-edu-year { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }

/* 右侧主体 */
.r-main { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px 32px; box-shadow: var(--shadow); }
.r-sec { margin-bottom: 28px; }
.r-sec:last-child { margin-bottom: 0; }
.r-sec-h { margin: 0 0 14px; font-size: 18px; font-weight: 700; padding-bottom: 8px; border-bottom: 2px solid var(--accent); display: inline-block; }
.r-summary { margin: 0; font-size: 15px; color: var(--ink-soft); line-height: 1.85; }
.r-summary strong { color: var(--ink); }

.r-exp { margin-bottom: 22px; }
.r-exp:last-child { margin-bottom: 0; }
.r-exp-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.r-exp-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.r-exp-date { font-size: 13px; color: var(--muted); }
.r-exp-org { margin: 0 0 8px; font-size: 13.5px; color: var(--ink-soft); }
.r-exp-list { margin: 0; padding-left: 18px; font-size: 14px; color: var(--ink-soft); line-height: 1.85; }
.r-exp-list li { margin-bottom: 4px; }

.r-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.r-kpi { text-align: center; padding: 14px; background: #f6f7f9; border-radius: 10px; }
.r-kpi b { display: block; font-size: 22px; color: var(--accent); margin-bottom: 4px; }
.r-kpi span { font-size: 12.5px; color: var(--ink-soft); }

/* 联系我弹窗 */
.contact-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(16, 24, 40, .45); display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.contact-overlay[hidden] { display: none; }
.contact-overlay.show { opacity: 1; pointer-events: auto; }
.contact-modal {
  position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; max-width: 480px; width: 90%; box-shadow: 0 24px 48px rgba(16, 24, 40, .18);
  transform: translateY(12px) scale(.98); transition: transform .25s ease;
}
.contact-overlay.show .contact-modal { transform: translateY(0) scale(1); }
.contact-close {
  position: absolute; top: 14px; right: 16px; background: none; border: none;
  font-size: 24px; color: var(--muted); cursor: pointer; line-height: 1;
}
.contact-close:hover { color: var(--ink); }
.contact-modal h2 { margin: 0 0 20px; font-size: 20px; text-align: center; }
.contact-body { display: flex; gap: 24px; align-items: center; }
.contact-qr { text-align: center; flex-shrink: 0; }
.contact-qr img { width: 140px; height: 140px; border-radius: 10px; border: 1px solid var(--line); }
.contact-qr p { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.contact-info { flex: 1; min-width: 0; }
.contact-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.contact-row:last-child { margin-bottom: 0; }
.contact-label { font-size: 12.5px; color: var(--muted); width: 50px; flex-shrink: 0; }
.contact-value { font-size: 14.5px; color: var(--ink); font-weight: 500; word-break: break-all; }
.contact-value:hover { color: var(--accent); }

/* 简历页打印样式 */
@media print {
  .site-header, .site-footer, .to-top, .contact-overlay, .nav-actions { display: none !important; }
  #pageResume { padding: 0; }
  .resume { grid-template-columns: 220px 1fr; gap: 20px; max-width: 100%; }
  .r-side, .r-main { box-shadow: none; border: 1px solid #ddd; }
}

/* 简历页响应式 */
@media (max-width: 760px) {
  .resume { grid-template-columns: 1fr; }
  .r-main { padding: 20px; }
  .r-kpis { grid-template-columns: repeat(2, 1fr); }
  .contact-body { flex-direction: column; }
}
