/* ---------------------------------------------------------
   MiSans：全站正文与等宽场景统一用它（可变字重 150–700）
   字体文件是 MiSansVF.ttf 的子集，保留站点用到的字符，约 2.6 MB
   --------------------------------------------------------- */
@font-face {
  font-family: "MiSans";
  src: url("../fonts/MiSans.woff2?v=20261030") format("woff2");
  font-weight: 150 700;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------
   设计变量
   --------------------------------------------------------- */
:root {
  --bg: #fbfbf9;
  --bg-soft: #f4f3ef;
  --surface: #ffffff;
  --ink: #1b1d1b;
  --ink-soft: #4d524d;
  --muted: #6b706a;
  --line: #e6e4de;
  --line-strong: #d3d1ca;
  --hover: #f1f0eb;
  --accent: #2f6a58;
  --accent-ink: #245446;
  --accent-soft: rgba(47, 106, 88, 0.09);
  --code-bg: #f3f2ed;
  --radius: 12px;
  --radius-sm: 8px;
  --shell: 1000px;
  --head-h: 68px;
  --font-sans: "MiSans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "MiSans", ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0e100f;
  --bg-soft: #121513;
  --surface: #151816;
  --ink: #e9ebe6;
  --ink-soft: #b7bdb5;
  --muted: #8a9188;
  --line: #242925;
  --line-strong: #363c36;
  --hover: #191d19;
  --accent: #7fb9a4;
  --accent-ink: #a3d0bd;
  --accent-soft: rgba(127, 185, 164, 0.12);
  --code-bg: #161a17;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body > main {
  flex: 1 0 auto;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
}

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

img,
svg {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

button {
  font: inherit;
  color: inherit;
}

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

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -56px;
  z-index: 60;
  padding: 9px 13px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  transition: top 0.15s var(--ease);
}

.skip-link:focus {
  top: 12px;
}

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

.shell--narrow {
  max-width: 780px;
}

.muted {
  color: var(--muted);
}

/* ---------------------------------------------------------
   顶栏
   --------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: var(--head-h);
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 顶栏比正文栏宽一档（1120px，与课程表官网一致），品牌贴左、导航靠右更松。
   只横屏生效：竖屏（手机）维持原来的 1000px 栏宽不变。 */
@media (orientation: landscape) {
  .site-header .shell {
    max-width: 1120px;
  }
}

/* 品牌区尺寸与课程表官网一致：标志 34px / 站名 18px，≥900px 放到 42px / 22px */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: none;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  color: var(--accent);
}

.brand-logo {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  object-fit: cover;
}

@media (min-width: 900px) {
  :root {
    --head-h: 82px;
  }

  .brand {
    gap: 12px;
    font-size: 22px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 11px;
  }
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav > a,
.nav-item > a {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.nav > a:hover,
.nav-item > a:hover {
  background: var(--hover);
}

.nav > a[aria-current="page"],
.nav-item > a[aria-current="page"] {
  color: var(--ink);
  background: var(--hover);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-item > a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.nav-chevron {
  display: none;
  flex: none;
  width: 9px;
  height: 6px;
  color: var(--muted);
  transition: transform 0.15s var(--ease);
}

.nav-pop {
  display: none;
}

/* 菜单外观：桌面悬停和移动端点开共用。
   .nav-pop 默认 display:none，所以这些规则放在媒体查询外面也不会露出来。 */
.nav-panel {
  width: 244px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 9px;
}

a.menu-item:hover {
  background: var(--hover);
}

div.menu-item {
  opacity: 0.55;
}

.menu-icon {
  flex: none;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font: 8px var(--font-mono);
}

.menu-icon.has-icon {
  overflow: hidden;
  background: none;
}

.menu-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.nav-loading,
.nav-empty {
  padding: 14px 10px;
  color: var(--muted);
  font-size: 11.5px;
}

/* 桌面：纯 CSS 悬停 + 键盘聚焦展开，点击顶栏仍然直接跳转 */
@media (hover: hover) and (pointer: fine) and (min-width: 721px) {
  .nav-chevron {
    display: block;
  }

  .nav-pop {
    display: block;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 45;
    padding-top: 9px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.15s var(--ease), transform 0.15s var(--ease), visibility 0.15s;
  }

  .nav:hover .nav-item:not(:hover) .nav-pop {
    opacity: 0;
    visibility: hidden;
    transition: none;
  }

  .nav-item.has-menu:hover .nav-pop,
  .nav-item.has-menu:focus-within .nav-pop {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }

  .nav-item.has-menu:hover .nav-chevron,
  .nav-item.has-menu:focus-within .nav-chevron {
    transform: rotate(180deg);
  }
}

/* 触屏 / 窄屏：点顶栏展开菜单，点别处收起（.is-open 由 chrome.js 切换） */
@media (hover: none), (pointer: coarse), (max-width: 720px) {
  .nav-chevron {
    display: block;
  }

  .nav-item.is-open .nav-pop {
    display: block;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 45;
    padding-top: 6px;
  }

  .nav-item.is-open > a {
    color: var(--ink);
    background: var(--hover);
  }

  .nav-item.is-open .nav-chevron {
    transform: rotate(180deg);
  }

  .nav-item.is-open .nav-panel {
    width: min(244px, calc(100vw - 32px));
  }
}

.theme-btn {
  flex: none;
  width: 38px;
  height: 38px;
  margin-left: 2px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.theme-btn:hover {
  background: var(--hover);
  color: var(--ink);
}

.theme-btn.is-animating {
  background: var(--hover);
}

.theme-btn svg {
  width: 21px;
  height: 21px;
  display: block;
}

.theme-icon {
  width: 21px;
  height: 21px;
  display: block;
  background: currentColor;
  --theme-icon: url("/assets/icons/theme/light.svg");
  -webkit-mask: var(--theme-icon) center / contain no-repeat;
  mask: var(--theme-icon) center / contain no-repeat;
}

html:not([data-theme]) .theme-icon,
html[data-theme="light"][data-mode="light"] .theme-icon {
  --theme-icon: url("/assets/icons/theme/light.svg");
}

html[data-theme="dark"][data-mode="dark"] .theme-icon {
  --theme-icon: url("/assets/icons/theme/dark.svg");
}

html[data-theme="light"][data-mode="auto"] .theme-icon {
  --theme-icon: url("/assets/icons/theme/light-a.svg");
}

html[data-theme="dark"][data-mode="auto"] .theme-icon {
  --theme-icon: url("/assets/icons/theme/dark-a.svg");
}

/* ---------------------------------------------------------
   首页
   --------------------------------------------------------- */
.hero {
  position: relative;
  padding-top: 94px;
  padding-bottom: 78px;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 650px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 {
  margin: 22px 0 20px;
  font-size: clamp(2.15rem, 5.2vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.hero .lede {
  max-width: 34em;
  color: var(--ink-soft);
  font-size: 16.5px;
  line-height: 1.8;
}

.hero-art {
  position: absolute;
  right: -26px;
  top: 22px;
  width: 380px;
  height: 380px;
  color: var(--accent);
  opacity: 0.16;
  pointer-events: none;
}

.section {
  padding-top: 54px;
  padding-bottom: 54px;
  border-top: 1px solid var(--line);
}

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

.section-head h2 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.quiet-link {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.quiet-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 文章行 */
.post-list {
  display: flex;
  flex-direction: column;
}

.post-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  margin: 0 -12px;
  padding: 18px 12px;
  border-bottom: 1px solid var(--line);
  border-radius: 10px;
  transition: background-color 0.15s var(--ease);
}

.post-row:hover {
  background: var(--hover);
}

.post-row:hover .post-title {
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

.post-date {
  padding-top: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.post-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.post-title {
  font-size: 16.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.post-summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  color: var(--muted);
}

.post-tags {
  display: flex;
  gap: 6px;
  padding-top: 3px;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------------------------------------------------------
   通用按钮 / 页面头
   --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.btn:hover {
  background: var(--hover);
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
}

.btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.page-head {
  padding: 74px 0 36px;
}

.page-head h1 {
  margin: 18px 0 14px;
  font-size: clamp(2rem, 4.6vw, 2.9rem);
  letter-spacing: -0.03em;
}

.page-head .lede {
  max-width: 40em;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.8;
}

/* ---------------------------------------------------------
   博客列表
   --------------------------------------------------------- */
.blog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 30px;
}

.chip {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}

.chip:hover {
  background: var(--hover);
  color: var(--ink);
}

.chip[aria-pressed="true"] {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.year-group {
  margin-bottom: 36px;
}

.year-label {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.post-row--full {
  padding: 22px 12px;
}

.post-row--full .post-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
}

/* ---------------------------------------------------------
   文章页
   --------------------------------------------------------- */
.article-wrap {
  padding-top: 58px;
  padding-bottom: 84px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.back-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article {
  margin-top: 34px;
}

.article h1 {
  font-size: clamp(1.95rem, 4.4vw, 2.7rem);
  line-height: 1.22;
  letter-spacing: -0.03em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 18px 0 38px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}

.article-tag {
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10.5px;
  line-height: 1.6;
}

.article-body {
  color: var(--ink-soft);
  font-size: 16.5px;
  line-height: 1.9;
}

.article-body > p:first-child {
  color: var(--ink);
  font-size: 1.06em;
}

.article-body p {
  margin: 0 0 1.2em;
}

.article-body h2 {
  margin: 2.3em 0 0.7em;
  color: var(--ink);
  font-size: 1.4rem;
  letter-spacing: -0.015em;
}

.article-body h3 {
  margin: 1.9em 0 0.6em;
  color: var(--ink);
  font-size: 1.12rem;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.2em;
  padding-left: 1.35em;
}

.article-body li + li {
  margin-top: 0.35em;
}

.article-body blockquote {
  margin: 1.6em 0;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}

.article-body blockquote p:last-child {
  margin-bottom: 0;
}

.article-body code {
  padding: 0.1em 0.35em;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: 0.86em;
}

.article-body pre {
  margin: 1.6em 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--code-bg);
  overflow-x: auto;
  line-height: 1.7;
}

.article-body pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: 12.8px;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(47, 106, 88, 0.35);
  text-underline-offset: 3px;
}

.article-body a:hover {
  text-decoration-color: currentColor;
}

.article-body img {
  border: 1px solid var(--line);
  border-radius: 10px;
}

.article-body hr {
  margin: 2em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.article-body strong {
  color: var(--ink);
  font-weight: 600;
}

.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.article-nav a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.article-nav a:hover {
  background: var(--hover);
  border-color: var(--line-strong);
}

.article-nav a.is-next {
  grid-column: 2;
  align-items: flex-end;
  text-align: right;
}

.article-nav--single {
  grid-template-columns: 1fr;
}

.article-nav--single a.is-next {
  grid-column: 1;
  align-items: flex-start;
  text-align: left;
}

.article-nav .label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.article-nav .title {
  font-size: 14px;
  line-height: 1.5;
}

.article-error {
  max-width: 30em;
  padding: 24px 0 40px;
}

.article-error h1 {
  margin: 14px 0 10px;
  font-size: 1.9rem;
}

.article-error p {
  margin-bottom: 22px;
  color: var(--muted);
}

/* ---------------------------------------------------------
   软件
   --------------------------------------------------------- */
.app-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 44px;
}

.app-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}

.app-card:hover {
  border-color: var(--line-strong);
}

.app-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-icon.has-icon {
  overflow: hidden;
  background: none;
}

.app-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.app-titleline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.app-titleline h2 {
  font-size: 18.5px;
  letter-spacing: -0.02em;
}

.badge {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--muted);
}

.app-summary {
  margin-top: 6px;
  font-size: 14.5px;
  color: var(--ink);
}

.app-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 8px;
  max-width: 56em;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.app-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.app-meta > span {
  position: relative;
}

.app-meta > span + span::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 50%;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--line-strong);
  transform: translateY(-50%);
}

.app-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.app-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.app-file {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
}

/* ---------------------------------------------------------
   云端
   --------------------------------------------------------- */
.cloud-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 14px;
  padding-bottom: 8px;
}

.panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-lede {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

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

.status.is-online::before {
  background: #3f9d72;
}

.status.is-offline::before {
  background: #c0563f;
}

.endpoint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--code-bg);
}

.endpoint code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
}

.endpoint code::-webkit-scrollbar {
  display: none;
}

.icon-btn {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.icon-btn:hover {
  background: var(--hover);
  color: var(--ink);
}

.icon-btn.is-copied {
  color: #3f9d72;
}

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

.kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  margin: 18px 0 0;
}

.kv dt {
  margin-bottom: 3px;
  font-size: 11.5px;
  color: var(--muted);
}

.kv dd {
  margin: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.kv dd.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.kv dd.is-hidden {
  color: var(--muted);
  font-size: 12.5px;
}

.note {
  margin-top: 18px;
  padding: 10px 12px;
  border-left: 2px solid var(--line-strong);
  border-radius: 0 8px 8px 0;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.setup {
  padding: 48px 0 20px;
}

.setup-item {
  border-bottom: 1px solid var(--line);
}

.setup-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 4px;
  list-style: none;
  font-size: 14.5px;
  cursor: pointer;
}

.setup-item summary::-webkit-details-marker {
  display: none;
}

.setup-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--muted);
}

.setup-item[open] summary::after {
  content: "–";
}

.setup-body {
  padding: 2px 4px 22px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.8;
}

.setup-body ol {
  margin: 0 0 12px;
  padding-left: 1.3em;
}

.setup-body li + li {
  margin-top: 4px;
}

.setup-body p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.code-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0;
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--code-bg);
}

.code-row code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
}

/* ---------------------------------------------------------
   状态 / 404 / 页脚
   --------------------------------------------------------- */
.loading,
.empty-state,
.error-state {
  padding: 24px 0;
  color: var(--muted);
  font-size: 14px;
}

.error-state p {
  margin-bottom: 12px;
}

.error-page {
  padding: 110px 0;
  text-align: center;
}

.error-code {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.error-page h1 {
  margin: 16px 0 12px;
  font-size: clamp(2rem, 5vw, 3rem);
}

.error-page p {
  margin-bottom: 26px;
  color: var(--muted);
}

.site-footer {
  margin-top: 44px;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 76px;
  padding-top: 22px;
  padding-bottom: 22px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.footer-beian {
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.footer-beian a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 备案号下面一行：字体授权说明，跟备案号同样的小号等宽 */
.footer-font {
  font-family: var(--font-mono);
  font-size: 11.5px;
}


/* 友情链接：四站互链，按「个人网站 / 软件 / 服务」分三列、列内竖排；配色跟各站 token，深浅色自动适配 */
.friend-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 32px;
  width: 100%;
  margin-top: 12px;
  font-size: 12px;
  text-align: left;
}
.friend-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 72px;
}
.friend-group-title {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.friend-links a {
  color: var(--muted);
  text-decoration: none;
  line-height: 1.6;
}
.friend-links a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 返回顶部：只在页面滚离顶部后出现，靠 chrome.js 切 is-visible */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 40;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease),
    background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}

.to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-top:hover {
  border-color: var(--line-strong);
  background: var(--hover);
  color: var(--ink);
}

.to-top svg {
  width: 17px;
  height: 17px;
}

@media (max-width: 640px) {
  .to-top {
    right: 14px;
    bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .to-top {
    transition: opacity 0.15s linear, background-color 0.15s linear, border-color 0.15s linear, color 0.15s linear;
  }
}

/* ---------------------------------------------------------
   主题切换时只做颜色过渡
   --------------------------------------------------------- */
html.theme-anim *:not(svg):not(svg *) {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* ---------------------------------------------------------
   响应式
   --------------------------------------------------------- */
@media (max-width: 880px) {
  .hero {
    padding-top: 74px;
    padding-bottom: 60px;
  }

  .hero-art {
    right: -110px;
    width: 320px;
    height: 320px;
    opacity: 0.12;
  }

  .cloud-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 0 20px;
  }

  .header-inner {
    height: 58px;
    gap: 8px;
  }

  .brand {
    gap: 6px;
    font-size: 12.5px;
  }

  .brand-mark {
    width: 17px;
    height: 17px;
  }

  .brand-logo {
    width: 17px;
    height: 17px;
    border-radius: 5px;
  }

  .nav {
    gap: 0;
  }

  .nav > a,
  .nav-item > a {
    padding: 6px 7px;
    font-size: 12.5px;
  }

  .theme-btn {
    width: 32px;
    height: 32px;
    margin-left: 0;
  }

  .hero {
    padding-top: 54px;
    padding-bottom: 46px;
  }

  .hero-art {
    display: none;
  }

  .hero h1 {
    margin: 18px 0 16px;
    font-size: clamp(1.95rem, 9vw, 2.6rem);
  }

  .hero .lede {
    font-size: 15px;
  }

  .section {
    padding-top: 42px;
    padding-bottom: 42px;
  }

  .post-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    padding: 15px 10px;
    margin: 0 -10px;
  }

  .post-date {
    grid-row: 1;
    grid-column: 1;
    padding-top: 0;
    font-size: 11px;
  }

  .post-tags {
    grid-row: 1;
    grid-column: 2;
    padding-top: 0;
  }

  .post-main {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .post-summary {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
  }

  .post-row--full {
    padding: 18px 10px;
  }

  .page-head {
    padding: 50px 0 26px;
  }

  .page-head h1 {
    margin: 14px 0 10px;
  }

  .page-head .lede {
    font-size: 14.5px;
  }

  .blog-toolbar {
    padding-bottom: 22px;
  }

  .article-wrap {
    padding-top: 40px;
    padding-bottom: 60px;
  }

  .article {
    margin-top: 26px;
  }

  .article-meta {
    margin-bottom: 28px;
  }

  .article-body {
    font-size: 16px;
    line-height: 1.85;
  }

  .article-nav {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 48px;
  }

  .article-nav a.is-next {
    grid-column: 1;
    align-items: flex-start;
    text-align: left;
  }

  .app-card {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
    padding: 20px;
  }

  .app-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    font-size: 13px;
  }

  .app-action {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
  }

  .app-buttons {
    flex: none;
    justify-content: flex-start;
  }

  .app-file {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    text-align: right;
  }

  .kv {
    gap: 12px 14px;
  }

  .panel {
    padding: 20px;
  }

  .setup {
    padding-top: 36px;
  }

  .footer-inner {
    min-height: auto;
    padding: 18px 0;
    font-size: 11.5px;
  }

  .error-page {
    padding: 76px 0;
  }
}

@media (max-width: 400px) {
  .header-inner {
    gap: 6px;
  }

  .nav > a,
  .nav-item > a {
    padding: 6px;
    font-size: 12.5px;
  }

  .theme-btn {
    width: 32px;
    height: 32px;
  }

  .hero h1 {
    font-size: 1.9rem;
  }
}

@media (max-width: 370px) {
  .header-inner {
    height: auto;
    flex-wrap: wrap;
    padding-top: 9px;
    padding-bottom: 7px;
    row-gap: 2px;
  }

  .brand {
    order: 1;
  }

  .theme-btn {
    order: 2;
    margin-left: auto;
  }

  .nav {
    order: 3;
    flex-basis: 100%;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* 云端服务入口 */
.service-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 12px;
}

.setup-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(47, 106, 88, 0.35);
  text-underline-offset: 3px;
}

.setup-body a:hover {
  text-decoration-color: currentColor;
}
