/* ============================================
   HYA的赛博小??新拟态风格（Neumorphism?
   明暗模式：跟随系?/ 浅色 / 深色（三态循环）
   保留原站点全部类名，仅替换视觉风?
   ============================================ */

/* ---------- 主题变量 ---------- */
:root {
  /* 浅色（默认） */
  --bg: #e6e9f0;
  --bg-deep: #dfe3ec;
  --text: #4b4f5c;
  --text2: #8a8fa3;
  --accent: #6c7cff;
  --neu-dark: #c8cdd9;
  --neu-light: #ffffff;
  --radius: 18px;
  --radius-lg: 24px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  --shadow-dark: 8px 8px 20px var(--neu-dark), -8px -8px 20px var(--neu-light);
  --shadow-inset: inset 4px 4px 8px var(--neu-dark), inset -4px -4px 8px var(--neu-light);
  --shadow-sm: 4px 4px 10px var(--neu-dark), -4px -4px 10px var(--neu-light);
}

/* 跟随系统：系统为深色?*/
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #22252e;
    --bg-deep: #1b1e26;
    --text: #d4d8e2;
    --text2: #8b91a3;
    --accent: #8f9dff;
    --neu-dark: #14161c;
    --neu-light: #343949;
  }
}

/* 强制深色 */
:root[data-theme="dark"] {
  --bg: #22252e;
  --bg-deep: #1b1e26;
  --text: #d4d8e2;
  --text2: #8b91a3;
  --accent: #8f9dff;
  --neu-dark: #14161c;
  --neu-light: #343949;
}

/* 强制浅色 */
:root[data-theme="light"] {
  --bg: #e6e9f0;
  --bg-deep: #dfe3ec;
  --text: #4b4f5c;
  --text2: #8a8fa3;
  --accent: #6c7cff;
  --neu-dark: #c8cdd9;
  --neu-light: #ffffff;
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  transition: background-color .3s ease, color .3s ease;
}

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent); text-decoration: underline; }

/* 极简线性图?*/
.ic { width: 1em; height: 1em; display: block; }

/* ---------- 顶部 Header（胶囊导航） ---------- */
.site-header { position: sticky; top: 0; z-index: 100; padding: calc(14px + env(safe-area-inset-top)) 0 14px; transition: background-color .3s ease; }
.site-header-inner {
  max-width: 880px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: background-color .3s ease;
}
.site-logo {
  font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none;
  white-space: nowrap; display: flex; align-items: center; gap: 8px;
}
.site-logo .ic { font-size: 20px; color: var(--accent); }
.site-logo:hover { color: var(--accent); text-decoration: none; }

.site-nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a {
  font-size: 13px; color: var(--text2); text-decoration: none;
  padding: 6px 13px; border-radius: 999px; transition: box-shadow .15s, color .15s;
}
.site-nav a:hover { color: var(--accent); box-shadow: var(--shadow-inset); text-decoration: none; }
.site-nav a.active { color: var(--accent); font-weight: 600; box-shadow: var(--shadow-inset); }

/* 主题切换按钮（三态：自动/?深） */
.theme-toggle {
  width: 38px; height: 38px; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: var(--text2);
  background: var(--bg); border-radius: 50%; box-shadow: var(--shadow-sm);
  transition: color .15s, box-shadow .15s; flex-shrink: 0; margin-left: 4px;
}
.theme-toggle:hover { color: var(--accent); }
.theme-toggle:active { box-shadow: var(--shadow-inset); }
.theme-toggle .ic { font-size: 17px; }

/* 移动端导航折叠按钮(汉堡菜单, PC 隐藏) */
.nav-toggle {
  display: none; width: 38px; height: 38px; border: none; cursor: pointer;
  align-items: center; justify-content: center;
  color: var(--text2); background: var(--bg); border-radius: 50%;
  box-shadow: var(--shadow-sm); flex-shrink: 0; margin-left: 4px;
  transition: color .15s, box-shadow .15s;
}
.nav-toggle:hover { color: var(--accent); }
.nav-toggle:active { box-shadow: var(--shadow-inset); }
.nav-toggle .ic { font-size: 17px; }
.nav-toggle .ic-x { display: none; }
.nav-toggle[aria-expanded="true"] .ic { display: none; }
.nav-toggle[aria-expanded="true"] .ic-x { display: block; }

/* ---------- 主内容区 ---------- */
.main-content { max-width: 880px; margin: 0 auto; padding: 24px 24px 48px; }

/* ---------- 首页 Hero ---------- */
.hero { padding: 28px 0 8px; text-align: center; }
.hero-avatar {
  width: 92px; height: 92px; margin: 0 auto 26px;
  display: flex; align-items: center; justify-content: center; font-size: 40px;
  border-radius: 50%; background: var(--bg); box-shadow: var(--shadow-dark); color: var(--accent);
}
.hero-badge {
  display: inline-block; font-size: 13px; color: var(--accent);
  background: var(--bg); border-radius: 999px; padding: 8px 22px;
  box-shadow: var(--shadow-sm); margin-bottom: 26px;
}
.page-title { font-size: clamp(30px, 5vw, 42px); font-weight: 700; letter-spacing: -1px; margin-bottom: 8px; color: var(--text); }
.page-subtitle { font-size: 15px; color: var(--text2); margin-bottom: 6px; }
.site-intro { font-size: 15px; color: var(--text2); line-height: 1.7; max-width: 560px; margin: 0 auto 8px; }

.section-label { display: flex; align-items: center; gap: 16px; margin: 32px 0 22px; }
.section-label span { font-size: 14px; font-weight: 600; color: var(--text2); letter-spacing: .5px; white-space: nowrap; }
.section-label::before, .section-label::after {
  content: ''; flex: 1; height: 3px; border-radius: 2px;
  background: var(--bg-deep); box-shadow: inset 1px 1px 2px var(--neu-dark);
}

.divider {
  border: none; height: 3px; border-radius: 2px;
  background: var(--bg-deep); box-shadow: inset 1px 1px 2px var(--neu-dark);
  margin: 24px 0;
}

/* ---------- 首页模块卡片 ---------- */
.module-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.module-item {
  background: var(--bg); border-radius: var(--radius); padding: 0;
  box-shadow: var(--shadow-dark); transition: box-shadow .2s, transform .2s;
  overflow: hidden;
}
.module-item:hover { transform: translateY(-2px); }
.module-item:active { box-shadow: var(--shadow-inset); transform: translateY(1px); }
.module-item-main { display: block; padding: 22px 26px; text-decoration: none; color: inherit; transition: background-color .15s; }
.module-item-main:hover { text-decoration: none; color: inherit; }
.module-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.module-item-title { font-size: 16px; font-weight: 700; color: var(--text); display: inline-flex; align-items: center; gap: 10px; }
.module-item-title .ic { font-size: 22px; color: var(--accent); flex-shrink: 0; }
.module-item-arrow { font-size: 14px; color: var(--text2); transition: transform .15s, color .15s; }
.module-item:hover .module-item-arrow { transform: translateX(3px); color: var(--accent); }
.module-item-desc { font-size: 13px; color: var(--text2); line-height: 1.55; }

/* ---------- 页面头（列表?联系页） ---------- */
.page-head { text-align: center; margin-bottom: 34px; }
.page-icon {
  width: 72px; height: 72px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  border-radius: var(--radius); background: var(--bg); box-shadow: var(--shadow-dark); color: var(--accent);
}
.page-head .page-title { font-size: 26px; margin-bottom: 6px; }
.page-head .page-subtitle { font-size: 14px; }

.crumb {
  display: inline-block; font-size: 12px; color: var(--text2); text-decoration: none;
  padding: 5px 14px; border-radius: 999px; background: var(--bg); box-shadow: var(--shadow-sm); margin-top: 14px;
}
.crumb:hover { color: var(--accent); text-decoration: none; }

/* ---------- 面包屑（保留?---------- */
.breadcrumb { margin-bottom: 20px; font-size: 14px; color: var(--text2); }
.breadcrumb a { color: var(--text2); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- 列表?---------- */
.content-list { display: flex; flex-direction: column; gap: 20px; }
.content-list-item {
  display: block; background: var(--bg); border-radius: var(--radius); padding: 22px 26px;
  box-shadow: var(--shadow-dark); text-decoration: none; color: inherit;
  transition: box-shadow .2s, transform .2s;
}
.content-list-item:hover { transform: translateY(-2px); text-decoration: none; color: inherit; }
.content-list-item:active { box-shadow: var(--shadow-inset); }
.content-list-item-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 6px; line-height: 1.4; }
.content-list-item-meta { font-size: 12px; color: var(--text2); margin-bottom: 8px; }
.content-list-item-summary { font-size: 13px; color: var(--text2); line-height: 1.6; }

/* ---------- 空状?---------- */
.empty-state { text-align: center; padding: 60px 24px; }
.empty-state-icon {
  width: 76px; height: 76px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center; font-size: 34px;
  border-radius: 50%; background: var(--bg); box-shadow: var(--shadow-dark); color: var(--text2);
}
.empty-state-icon .ic { font-size: 34px; }
.empty-state-title { font-size: 17px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.empty-state-desc { font-size: 14px; color: var(--text2); }

/* ---------- 文章详情?---------- */
.back-link {
  display: inline-block; font-size: 13px; color: var(--text2); text-decoration: none;
  padding: 7px 16px; border-radius: 999px; background: var(--bg);
  box-shadow: var(--shadow-sm); margin-bottom: 24px;
}
.back-link:hover { color: var(--accent); text-decoration: none; }

.article-detail { max-width: 100%; }
.article-panel { background: var(--bg); border-radius: var(--radius-lg); padding: 36px 40px; box-shadow: var(--shadow-dark); }
.article-title { font-size: 27px; font-weight: 700; line-height: 1.3; margin-bottom: 16px; letter-spacing: -.5px; color: var(--text); }
.article-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13px; padding-bottom: 20px; border-bottom: 2px solid var(--bg-deep); margin-bottom: 26px;
}
.article-date { font-size: 12px; color: var(--text2); display: inline-flex; align-items: center; gap: 4px; }
.article-date .ic { font-size: 12px; opacity: .8; }
.article-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.article-tag {
  display: inline-block; font-size: 11px; color: var(--accent);
  background: var(--bg); box-shadow: var(--shadow-sm); border-radius: 999px; padding: 3px 12px;
}

/* 文章正文排版 */
.article-body { font-size: 15px; line-height: 1.9; color: var(--text); }
.article-body h1 { font-size: 24px; font-weight: 700; margin: 28px 0 14px; line-height: 1.3; }
.article-body h2 { font-size: 21px; font-weight: 700; margin: 30px 0 14px; line-height: 1.4; }
.article-body h3 { font-size: 17px; font-weight: 700; margin: 24px 0 10px; line-height: 1.4; }
.article-body p { margin-bottom: 16px; }
.article-body ul, .article-body ol { margin-bottom: 16px; padding-left: 24px; }
.article-body li { margin-bottom: 6px; line-height: 1.7; }
.article-body blockquote {
  margin: 18px 0; padding: 18px 24px; border-radius: 14px;
  background: var(--bg); box-shadow: var(--shadow-inset); color: var(--text); font-size: 14px;
}
.article-body blockquote p { margin-bottom: 0; }
.article-body code {
  font-family: var(--mono); font-size: .9em;
  background: var(--bg); box-shadow: var(--shadow-sm); border-radius: 6px; padding: 2px 8px;
}
.article-body pre {
  margin: 18px 0; padding: 20px 24px; background: var(--bg);
  box-shadow: var(--shadow-inset); border-radius: 14px; overflow-x: auto; line-height: 1.6;
}
.article-body pre code { padding: 0; background: none; box-shadow: none; font-size: 13px; }
.article-body hr { border: none; height: 3px; border-radius: 2px; background: var(--bg-deep); box-shadow: inset 1px 1px 2px var(--neu-dark); margin: 30px 0; }
.article-body img { max-width: 100%; border-radius: var(--radius); margin: 16px 0; box-shadow: var(--shadow-sm); display: block; }
.article-body strong { font-weight: 600; }
.article-body a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 联系?---------- */
.contact-item {
  background: var(--bg); border-radius: var(--radius); padding: 22px 28px;
  box-shadow: var(--shadow-dark); transition: transform .2s; display: flex; align-items: center; gap: 20px;
  margin-bottom: 20px;
}
.contact-item:hover { transform: translateY(-2px); }
.contact-item:active { box-shadow: var(--shadow-inset); }
.contact-item-label { font-size: 13px; color: var(--text2); margin-bottom: 2px; display: block; }
.contact-item-value { font-size: 16px; font-weight: 600; color: var(--accent); text-decoration: none; word-break: break-all; }
.contact-item-value:hover { text-decoration: underline; }

/* ---------- 底部 Footer ---------- */
.site-footer { padding: 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); transition: background-color .3s ease; }
.footer-inner { max-width: 880px; margin: 0 auto; text-align: center; }
.footer-text { font-size: 12px; color: var(--text2); line-height: 1.8; }
.footer-text a { color: var(--text2); text-decoration: none; display: inline-block; padding: 6px 16px; border-radius: 999px; background: var(--bg); box-shadow: var(--shadow-sm); }
.footer-text a:hover { color: var(--accent); text-decoration: none; }
.footer-build-info { font-size: 11px; margin-top: 10px; opacity: .7; }

/* ---------- 响应式适配 ---------- */
@media (max-width: 720px) {
  .module-list { grid-template-columns: 1fr; }
  .site-header-inner { flex-wrap: wrap; }
  /* 导航折叠:默认只显示主题/汉堡按钮, 展开后链接占整行 */
  .site-nav a { display: none; }
  .site-nav.open {
    width: 100%; flex-wrap: wrap; gap: 6px; padding: 10px;
    background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow-dark);
  }
  .site-nav.open a { display: block; flex: 1 1 100%; padding: 10px 16px; font-size: 14px; }
  .nav-toggle { display: flex; }
  .article-panel { padding: 26px 22px; }
  /* 宽表格移动端横向滚动, 防止溢出 */
  .article-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 400px) {
  .main-content { padding: 20px 16px 36px; }
  .page-title { font-size: 26px; }
  .article-title { font-size: 23px; }
  .module-item-main { padding: 18px 20px; }
}

/* ---------- Article Table ---------- */
.article-body table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.article-body th, .article-body td { padding: 10px 14px; border: 1px solid var(--neu-dark); text-align: left; }
.article-body th { background: var(--bg-deep); font-weight: 600; }
.article-body tr:nth-child(even) { background: rgba(128, 128, 128, 0.06); }
@media (prefers-color-scheme: dark) {
  .article-body tr:nth-child(even) { background: rgba(255, 255, 255, 0.04); }
}
