:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --line: #e5e2da;
  --ink: #242824;
  --ink-muted: #676d67;
  --accent: #365b4b;
  --accent-soft: #356448;
  --warn: #885f21;
  --danger: #a13535;
  --info: #315f79;
  --wrap: 1080px;
  --reading: 720px;
  --radius: 3px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { font-weight: 600; line-height: 1.35; margin: 0; }
h1 { font-size: 32px; letter-spacing: -0.01em; }
h2 { font-size: 20px; }

p { margin: 0.5em 0; }

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

.muted { color: var(--ink-muted); }
.small { font-size: 14px; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--bg);
  padding: 10px 16px; z-index: 10;
}
.skip-link:focus { left: 0; }

.site-header {
  position: sticky; top: 0; z-index: 5;
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); font-weight: 600; letter-spacing: 0.01em; flex: 0 0 auto;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  background: var(--accent); color: #fff;
  border-radius: var(--radius);
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
}
.brand-name { font-size: 17px; }

.tabs { display: flex; gap: 28px; margin-left: 8px; flex: 1 1 auto; }

.tab {
  position: relative; padding: 20px 0;
  color: var(--ink-muted); font-size: 15px;
  transition: color 150ms ease;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.is-active { color: var(--ink); }
.tab.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 1px; background: var(--accent);
}
.tab:focus-visible, a:focus-visible, button:focus-visible,
input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius);
}

.auth-button {
  flex: 0 0 auto; padding: 7px 16px;
  background: transparent; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; font-size: 14px; cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}
.auth-button:hover { border-color: var(--accent); color: var(--accent); }

.panel { padding: 56px 0 72px; }

.section-head { margin-bottom: 28px; }
.section-head.row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.section-head p { margin: 6px 0 0; }

.login-form {
  max-width: 380px; padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 14px; color: var(--ink-muted); }
.field input {
  padding: 9px 12px; font: inherit; font-size: 15px;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 150ms ease;
}
.field input:hover { border-color: var(--ink-muted); }

.button-primary {
  width: 100%; padding: 10px 16px;
  font: inherit; font-size: 15px;
  color: #fff; background: var(--accent);
  border: 1px solid var(--accent); border-radius: var(--radius);
  cursor: pointer; transition: background 150ms ease;
}
.button-primary:hover { background: var(--accent-soft); }
.button-primary[disabled] { opacity: 0.6; cursor: progress; }

.button-quiet {
  display: inline-block; padding: 6px 14px;
  font: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; transition: border-color 150ms ease, color 150ms ease;
}
.button-quiet:hover:not([disabled]) { border-color: var(--accent); color: var(--accent); }
.button-quiet[disabled] { opacity: 0.45; cursor: default; }
a.button-quiet:hover { text-decoration: none; }

.link-button {
  padding: 0; margin: 0 0 20px;
  background: none; border: 0;
  font: inherit; font-size: 14px; color: var(--ink-muted);
  cursor: pointer; transition: color 150ms ease;
}
.link-button:hover { color: var(--accent); }

.notice {
  margin: 16px 0; padding: 10px 14px;
  border-left: 2px solid var(--info);
  background: var(--surface);
  font-size: 14px; color: var(--ink-muted);
}
.notice-error { border-left-color: var(--danger); color: var(--danger); }
.notice-warn { border-left-color: var(--warn); color: var(--warn); }

.search { margin-bottom: 8px; }
.search input {
  width: 100%; max-width: 380px; padding: 9px 12px;
  font: inherit; font-size: 15px;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 150ms ease;
}
.search input:hover { border-color: var(--ink-muted); }

.notes-list { list-style: none; margin: 8px 0 0; padding: 0; }
.notes-list li { border-bottom: 1px solid var(--line); }
.notes-list li:first-child { border-top: 1px solid var(--line); }

.note-link {
  display: block; padding: 20px 4px; color: inherit;
  transition: background 150ms ease;
}
.note-link:hover { background: var(--surface); text-decoration: none; }
.note-title { display: block; font-size: 17px; font-weight: 600; }
.note-excerpt { display: block; margin-top: 4px; font-size: 14px; color: var(--ink-muted); }
.note-date { display: block; margin-top: 6px; font-size: 13px; color: var(--ink-muted); }

.pager { display: flex; align-items: center; gap: 16px; margin-top: 24px; }

.prose { max-width: var(--reading); font-size: 16px; }
.prose h2 { margin: 32px 0 8px; }
.prose h3 { margin: 24px 0 6px; }
.prose p { margin: 1em 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 4px 0; }
.prose blockquote {
  margin: 20px 0; padding: 4px 0 4px 18px;
  border-left: 2px solid var(--line); color: var(--ink-muted);
}
.prose code {
  padding: 2px 5px; background: var(--line); border-radius: var(--radius);
  font-size: 0.9em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.prose pre {
  overflow-x: auto; padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.prose pre code { padding: 0; background: none; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 15px; }
.prose th, .prose td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

.external-image {
  display: inline-block; padding: 2px 6px;
  font-size: 13px; color: var(--ink-muted);
  background: var(--line); border-radius: var(--radius);
}

.picker { display: flex; flex-direction: column; gap: 8px; max-width: 460px; margin-bottom: 32px; }
.picker label { font-size: 14px; color: var(--ink-muted); }
.picker select {
  padding: 10px 12px; font: inherit; font-size: 15px;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
}

.project-detail {
  max-width: var(--reading);
  padding-top: 28px; border-top: 1px solid var(--line);
}
.project-summary { font-size: 17px; }
.project-meta {
  display: flex; flex-wrap: wrap; gap: 10px 24px;
  margin: 20px 0; font-size: 14px; color: var(--ink-muted);
}
.project-stack { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.project-stack li {
  padding: 3px 10px; font-size: 13px; color: var(--ink-muted);
  border: 1px solid var(--line); border-radius: 999px;
}
.project-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 24px; }
.project-entry { font-size: 13px; color: var(--ink-muted); word-break: break-all; }
.status-online { color: var(--accent); }
.status-intro { color: var(--warn); }

.site-footer { border-top: 1px solid var(--line); margin-top: 24px; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding-top: 20px; padding-bottom: 28px;
}
.footer-inner .link-button { margin: 0; }
.footer-beian { font-size: 14px; color: var(--ink-muted); }

@media (max-width: 720px) {
  .wrap { padding: 0 18px; }
  .header-inner { gap: 12px; min-height: 56px; }
  .brand-name { display: none; }
  .tabs { gap: 20px; }
  .tab { padding: 16px 0; font-size: 14px; }
  .auth-button { padding: 6px 12px; font-size: 13px; }
  .panel { padding: 36px 0 56px; }
  h1 { font-size: 26px; }
  .login-form { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
