/* 极简编辑风双栏学术个人主页 · 无冗余边框，重排版与呼吸感 */

:root {
  --bg: #fbfaf8;
  --bg-subtle: #f3f1ec;
  --text: #161618;
  --text-secondary: #575760;
  --text-muted: #8b8b95;
  --line: rgba(22, 22, 24, 0.1);
  --line-strong: rgba(22, 22, 24, 0.24);
  --accent: #b9382c;
  --green: #1e8758;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Georgia, "Songti SC", "STSong", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101012;
    --bg-subtle: #18181c;
    --text: #ededf0;
    --text-secondary: #a2a2ae;
    --text-muted: #6f6f7b;
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.25);
    --accent: #e56556;
    --green: #38c98a;
  }
}

:root[data-theme="dark"] {
  --bg: #101012;
  --bg-subtle: #18181c;
  --text: #ededf0;
  --text-secondary: #a2a2ae;
  --text-muted: #6f6f7b;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.25);
  --accent: #e56556;
  --green: #38c98a;
}

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

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

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.72;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

strong {
  font-weight: 600;
  color: var(--text);
}

/* 整体双栏容器 */
.layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 36px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 72px;
  align-items: start;
}

/* 左侧固定边栏 */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 56px 0 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.monogram {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  position: relative;
}

.monogram::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.name {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.affiliation {
  margin: 0 0 22px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

.bio {
  margin: 0 0 34px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* 左侧目录导航 */
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--text-muted);
  position: relative;
  transition: color 0.18s ease, transform 0.18s ease;
}

.nav-link::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--line-strong);
  transition: width 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
}

.nav-link.is-active::before {
  width: 26px;
  background: var(--accent);
}

.nav-index {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.7;
}

/* 左侧底部联系与主题 */
.sidebar-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.contact-link {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: color 0.18s ease;
}

.contact-link:hover {
  color: var(--text);
}

.contact-k {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  width: 46px;
  flex-shrink: 0;
}

.contact-v {
  word-break: break-all;
}

.copy-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.copy-icon-btn:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.copy-icon-btn svg {
  width: 14px;
  height: 14px;
}

.sidebar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.theme-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text);
}

/* 右侧主内容流 */
.content {
  padding: 56px 0 88px;
}

.block {
  padding-bottom: 52px;
  margin-bottom: 52px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 48px;
}

.block-last {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 16px;
}

.block-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 26px;
}

.block-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}

.block-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.block-en {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

/* 01 概览 */
.lead {
  margin: 0 0 32px;
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-secondary);
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.stat {
  padding: 20px 18px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat + .stat {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.stat-k {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-v {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.stat-v small {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
}

.stat-note {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.interest-line {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.interest-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* 02 论文列表（无框杂志目录排版） */
.paper-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.paper-row {
  padding: 20px 0;
  border-top: 1px solid var(--line);
  transition: padding-left 0.18s ease;
}

.paper-row:first-child {
  padding-top: 4px;
  border-top: none;
}

.paper-row:last-child {
  padding-bottom: 0;
}

.paper-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-review {
  color: var(--accent);
}

.status-review::before {
  background: var(--accent);
}

.status-accepted {
  color: var(--green);
}

.status-accepted::before {
  background: var(--green);
}

.paper-year {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.paper-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

.paper-title-en {
  font-family: var(--font-serif);
  font-size: 17.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.paper-desc {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 03 科研课题 */
.entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.entry {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  gap: 20px;
  align-items: baseline;
}

.entry-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.entry-body h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.role-tag {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--bg-subtle);
}

.entry-body p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* 04 荣誉列表 */
.clean-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.clean-rows li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.clean-rows li:first-child {
  padding-top: 2px;
}

.clean-rows li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.row-main {
  font-size: 14.5px;
  color: var(--text);
}

.row-sub {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* 05 实践两列细顶线排版 */
.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 32px;
}

.col-item {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.col-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.col-head h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
}

.col-head span {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.col-item p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.68;
}

.mobile-footer {
  display: none;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 14px);
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 响应式：平板与手机端自动切单栏 */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0 22px;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 36px 0 28px;
    border-bottom: 1px solid var(--line);
    gap: 20px;
  }

  .bio {
    margin-bottom: 20px;
  }

  .side-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 16px;
  }

  .nav-link::before,
  .nav-index {
    display: none;
  }

  .sidebar-bottom {
    padding-top: 18px;
  }

  .content {
    padding: 36px 0 56px;
  }

  .mobile-footer {
    display: block;
  }

  .copyright {
    display: none;
  }
}

@media (max-width: 620px) {
  .stat-strip {
    grid-template-columns: 1fr;
  }

  .stat {
    padding: 16px 0;
  }

  .stat + .stat {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--line);
  }

  .interest-line {
    flex-direction: column;
    gap: 4px;
  }

  .entry {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}
