/* ============================================================
   Mav1 · GitHub Dashboard 风格
   ============================================================ */

:root {
  --canvas: #ffffff;
  --subtle: #f6f8fa;
  --border: #d0d7de;
  --border-soft: #eaeef2;
  --fg: #1f2328;
  --muted: #57606a;
  --accent: #0969da;
  --green: #1a7f37;
  --green-btn: #1f883d;
  --purple: #8250df;
  --danger: #cf222e;
  --titlebar: #24292f;
  --shadow-pop: 0 8px 24px rgba(140, 149, 159, 0.25);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--fg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

img {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
}

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

.skip {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 500;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  transform: translateY(-300%);
}

.skip:focus {
  transform: translateY(0);
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ------------------------------------------------------------
   顶部窗口标题栏
   ------------------------------------------------------------ */
.titlebar {
  position: sticky;
  top: 0;
  z-index: 300;
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 8px 0 16px;
  background: var(--titlebar);
  color: #fff;
}

.title-brand {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #e6edf3;
}

.win-btns {
  margin-left: auto;
  display: flex;
  height: 40px;
}

.win-btn {
  width: 46px;
  height: 100%;
  display: grid;
  place-items: center;
  color: #b9c0c8;
}

.win-btn svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
}

.win-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.win-btn.warn:hover {
  background: #e81123;
  color: #fff;
}

/* ------------------------------------------------------------
   顶部工具栏
   ------------------------------------------------------------ */
.app-header {
  position: sticky;
  top: 40px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(8px);
}

.side-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 240px;
  flex-shrink: 0;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  transition: background 0.12s, color 0.12s;
}

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

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

.menu-btn {
  display: none;
}

.burger {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.burger i {
  width: 15px;
  height: 1.6px;
  border-radius: 1px;
  background: currentColor;
}

.logo-link {
  display: grid;
  place-items: center;
}

.octocat {
  width: 30px;
  height: 30px;
  color: var(--fg);
}

.side-title {
  font-size: 15px;
  font-weight: 600;
}

.top-tools {
  position: relative;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 320px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--subtle);
  color: var(--muted);
}

.top-search:focus-within {
  background: #fff;
  border-color: var(--accent);
}

.top-search svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.top-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--fg);
}

.top-search input::placeholder {
  color: #6e7781;
}

.tool-divider {
  width: 1px;
  height: 20px;
  background: var(--border-soft);
  margin: 0 4px;
}

.avatar-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: none;
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.avatar-btn:hover {
  box-shadow: 0 0 0 2px rgba(9, 105, 218, 0.25);
}

.avatar-btn img {
  width: 100%;
  height: 100%;
}

/* 头像下拉菜单 */
.popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 260;
  width: 300px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}

.popover[hidden] {
  display: none;
}

.pop-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
}

.pop-head img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.pop-head strong {
  font-size: 14px;
  font-weight: 600;
}

.pop-head-btn {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--muted);
}

.pop-head-btn svg {
  width: 14px;
  height: 14px;
  transform: rotate(180deg);
}

.pop-list {
  padding: 4px 0 8px;
}

.pop-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  font-size: 13px;
  color: var(--fg);
}

.pop-list a:hover {
  background: var(--subtle);
}

.pop-list a svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
}

.pop-sep {
  height: 1px;
  background: var(--border-soft);
  margin: 6px 0;
}

.pop-badge {
  margin-left: auto;
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 7px;
  color: var(--muted);
  line-height: 16px;
}

.pop-badge.blue {
  color: var(--accent);
  border-color: #54aeff;
}

/* ------------------------------------------------------------
   三栏主体
   ------------------------------------------------------------ */
.app-body {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 28px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 24px 32px;
  flex: 1;
}

.app-body.with-rail {
  grid-template-columns: 240px minmax(0, 1fr) 300px;
}

.main {
  min-width: 0;
}

/* 左侧栏 */
.sidebar {
  padding-top: 4px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--fg);
  transition: background 0.12s;
}

.side-item:hover {
  background: var(--subtle);
}

.side-item.on {
  background: var(--subtle);
  font-weight: 600;
}

.side-item svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.side-repos {
  margin-top: 24px;
}

.side-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.mini-search {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.mini-search svg {
  width: 14px;
  height: 14px;
}

.side-repo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-repo:hover {
  background: var(--subtle);
}

.side-repo img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border-soft);
  flex-shrink: 0;
}

.side-repo.more {
  color: var(--muted);
  font-size: 12.5px;
}

.side-repo.more svg {
  width: 14px;
  height: 14px;
}

.side-links {
  margin-top: 22px;
  padding: 12px 10px 0;
  border-top: 1px solid var(--border-soft);
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
}

.side-links a:hover {
  color: var(--accent);
}

/* 右侧栏 */
.rail {
  padding-top: 4px;
  min-width: 0;
}

.rail-title {
  font-size: 14px;
  font-weight: 600;
  margin: 8px 0 4px;
}

.feed-item {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}

.feed-item time {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.feed-item p {
  margin: 3px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg);
}

.feed-item:hover p {
  color: var(--accent);
}

.rail-more {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  color: var(--accent);
}

.rail-more:hover {
  text-decoration: underline;
}

.rail-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  margin-top: 8px;
}

.rail-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.rail-name {
  margin: 10px 0 0;
  font-size: 16px;
  font-weight: 600;
}

.rail-handle {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.rail-bio {
  margin: 8px 0 14px;
  font-size: 13px;
  color: var(--muted);
}

.rail-btn {
  display: block;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--subtle);
}

.rail-btn:hover {
  border-color: #afb8c1;
}

.rail-links {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}

.rail-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-links a:hover {
  color: var(--accent);
}

.rail-links svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   首页
   ------------------------------------------------------------ */
.greet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 18px;
  flex-wrap: wrap;
}

.greet-icon {
  display: grid;
  grid-template-columns: repeat(2, 12px);
  gap: 2px;
}

.greet-icon i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.greet-icon i:nth-child(1) { background: #1f883d; }
.greet-icon i:nth-child(2) { background: #0969da; }
.greet-icon i:nth-child(3) { background: #bf3989; }
.greet-icon i:nth-child(4) { background: #d4a72c; }

.greet-row h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.greet-user {
  color: var(--fg);
}

.preview-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #4ac26b;
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
}

.preview-pill svg {
  width: 11px;
  height: 11px;
  color: var(--muted);
}

/* Ask 搜索框 */
.ask-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px 8px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(31, 35, 40, 0.04), 0 8px 24px rgba(66, 74, 83, 0.1);
  margin-bottom: 12px;
}

.ask-box:focus-within {
  border-color: #54aeff;
  box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.12), 0 8px 24px rgba(66, 74, 83, 0.1);
}

.ask-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  color: var(--fg);
  padding: 2px 2px 14px;
}

.ask-input::placeholder {
  color: #6e7781;
}

.ask-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ask-left,
.ask-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gh-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--fg);
  background: #fff;
  white-space: nowrap;
}

.gh-select svg {
  width: 11px;
  height: 11px;
  color: var(--muted);
}

.gh-icon-btn {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.gh-icon-btn:hover {
  background: var(--subtle);
  color: var(--fg);
}

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

.send-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  transition: background 0.12s, color 0.12s;
}

.send-btn:hover {
  background: var(--subtle);
  color: var(--accent);
}

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

/* 快捷按钮行 */
.quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 22px;
}

.quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12.5px;
  color: var(--fg);
  background: #fff;
  transition: background 0.12s, border-color 0.12s;
}

.quick-btn:hover {
  background: var(--subtle);
  border-color: #afb8c1;
}

.quick-btn svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

/* 横幅 */
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--subtle);
  border-radius: 8px;
  padding: 14px 20px;
  margin-bottom: 28px;
}

.banner[hidden] {
  display: none;
}

.banner-text strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.new-pill {
  font-size: 10px;
  font-weight: 600;
  border: 1px solid #4ac26b;
  border-radius: 999px;
  padding: 0 7px;
  line-height: 16px;
  color: var(--green);
}

.banner-text p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.banner-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.btn-green {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--green-btn);
  border: 1px solid rgba(31, 35, 40, 0.15);
  border-radius: 6px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  white-space: nowrap;
}

.btn-green:hover {
  background: #1a7f37;
}

.btn-green svg {
  width: 11px;
  height: 11px;
}

.banner-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.banner-close:hover {
  background: rgba(175, 184, 193, 0.2);
  color: var(--fg);
}

.banner-close svg {
  width: 15px;
  height: 15px;
}

/* 区块与列表 */
.gh-section {
  margin-bottom: 28px;
}

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

.gh-section-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.section-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.view-all {
  font-size: 12.5px;
  color: var(--accent);
}

.view-all:hover {
  text-decoration: underline;
}

.filter-btn {
  display: grid;
  place-items: center;
  color: var(--muted);
}

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

.gh-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.gh-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-top: 1px solid var(--border-soft);
  transition: background 0.12s;
}

.gh-row:first-child {
  border-top: none;
}

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

.row-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.row-icon svg {
  width: 16px;
  height: 16px;
}

.row-icon.green { color: var(--green); }
.row-icon.purple { color: var(--purple); }
.row-icon.gray { color: var(--muted); }

.row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.row-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gh-row:hover .row-title {
  color: var(--accent);
}

.row-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-labels {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.gh-label {
  font-size: 11.5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 8px;
  line-height: 18px;
  color: var(--muted);
  background: #fff;
  white-space: nowrap;
}

.row-comment {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.row-comment svg {
  width: 14px;
  height: 14px;
}

.state-pill {
  flex-shrink: 0;
  font-size: 11.5px;
  border: 1px solid rgba(74, 194, 107, 0.65);
  border-radius: 999px;
  padding: 0 9px;
  line-height: 18px;
  color: var(--green);
  white-space: nowrap;
}

.gh-year {
  margin: 20px 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.empty {
  padding: 24px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* ------------------------------------------------------------
   博客列表页
   ------------------------------------------------------------ */
.page-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 4px;
}

.page-title-row h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.count-badge {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 10px;
  line-height: 20px;
}

.page-sub {
  margin: 0 0 18px;
  color: var(--muted);
}

.blog-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 360px;
  max-width: 100%;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--subtle);
  margin-bottom: 20px;
  color: var(--muted);
}

.blog-search:focus-within {
  background: #fff;
  border-color: var(--accent);
}

.blog-search svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.blog-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--fg);
}

/* ------------------------------------------------------------
   文章页
   ------------------------------------------------------------ */
.article-wrap {
  max-width: 860px;
  margin: 8px auto 0;
}

.back {
  font-size: 13px;
  color: var(--muted);
}

.back:hover {
  color: var(--accent);
}

.gh-article {
  margin-top: 16px;
}

.gh-article h1 {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.3px;
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.avatar-mini img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.meta-strong {
  font-weight: 600;
  color: var(--fg);
}

.meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #afb8c1;
}

.meta-tags {
  display: inline-flex;
  gap: 6px;
}

.article-rule {
  border: none;
  border-top: 1px solid var(--border-soft);
  margin: 16px 0 24px;
}

/* GitHub Markdown 正文 */
.prose {
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg);
  word-wrap: break-word;
}

.prose p {
  margin: 0.9em 0;
}

.prose h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 1.8em 0 0.6em;
  padding-bottom: 0.25em;
  border-bottom: 1px solid var(--border-soft);
}

.prose h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 1.5em 0 0.5em;
}

.prose a {
  color: var(--accent);
}

.prose a:hover {
  text-decoration: underline;
}

.prose ul,
.prose ol {
  margin: 0.8em 0;
  padding-left: 1.6em;
}

.prose li {
  margin: 0.3em 0;
}

.prose li::marker {
  color: var(--muted);
}

.prose blockquote {
  margin: 1em 0;
  padding: 0 1em;
  border-left: 0.25em solid var(--border);
  color: var(--muted);
}

.prose blockquote p {
  margin: 0.4em 0;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(175, 184, 193, 0.2);
  border-radius: 6px;
  padding: 0.15em 0.4em;
  color: var(--fg);
}

.prose pre {
  position: relative;
  margin: 1.2em 0;
  padding: 16px;
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--font);
  font-size: 11.5px;
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  transition: background 0.12s;
}

.copy-btn:hover {
  background: var(--subtle);
  color: var(--fg);
}

/* Pygments 代码高亮（GitHub light） */
.hl .k, .hl .kd, .hl .kn, .hl .kr, .hl .kt { color: #cf222e; }
.hl .s, .hl .s1, .hl .s2, .hl .sb, .hl .sd, .hl .se, .hl .si, .hl .sx { color: #0a3069; }
.hl .c, .hl .c1, .hl .cm, .hl .cs { color: #6e7781; font-style: italic; }
.hl .nf, .hl .fm { color: #8250df; }
.hl .nb, .hl .bp { color: #953800; }
.hl .mi, .hl .mf, .hl .mh, .hl .m { color: #0550ae; }
.hl .nc, .hl .nn { color: #8250df; }
.hl .o, .hl .ow { color: #0550ae; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 14px;
}

.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 6px 13px;
}

.prose th {
  font-weight: 600;
  background: var(--subtle);
}

.prose tr:nth-child(2n) td {
  background: var(--subtle);
}

.prose img {
  border-radius: 6px;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border-soft);
  margin: 24px 0;
}

.pager-row {
  max-width: 860px;
  margin: 20px auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.pager {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 18px;
  transition: border-color 0.12s, background 0.12s;
}

.pager:hover {
  border-color: #afb8c1;
  background: var(--subtle);
}

.pager span {
  font-size: 12px;
  color: var(--muted);
}

.pager strong {
  font-size: 14px;
  font-weight: 600;
}

.pager.next {
  text-align: right;
  align-items: flex-end;
}

/* ------------------------------------------------------------
   项目页
   ------------------------------------------------------------ */
.repo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.repo-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  background: #fff;
}

.repo-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.repo-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.repo-name:hover {
  text-decoration: underline;
}

.badge {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 8px;
  line-height: 18px;
}

.repo-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
  flex: 1;
}

.repo-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.lang-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c, #0969da);
}

/* ------------------------------------------------------------
   关于页
   ------------------------------------------------------------ */
.profile-grid {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.profile-card {
  min-width: 0;
}

.profile-avatar {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.profile-card h1 {
  margin: 14px 0 2px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
}

.profile-handle {
  margin: 0;
  font-size: 16px;
  font-weight: 300;
  color: var(--muted);
}

.profile-bio {
  margin: 10px 0 14px;
  font-size: 14px;
  color: var(--fg);
}

.profile-btn {
  display: block;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px;
  font-size: 13px;
  font-weight: 600;
  background: var(--subtle);
}

.profile-btn:hover {
  border-color: #afb8c1;
}

.profile-links {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-links a:hover {
  color: var(--accent);
}

.profile-links svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
}

.profile-section {
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border-soft);
}

.profile-section:last-child {
  border-bottom: none;
}

.profile-section h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}

.profile-section p {
  margin: 0.6em 0;
  font-size: 14px;
  line-height: 1.7;
}

.skills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.skill-group h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 10px;
  line-height: 20px;
  background: var(--subtle);
}

.timeline-list .gh-row {
  align-items: flex-start;
}

.timeline-list .row-icon {
  margin-top: 2px;
}

/* ------------------------------------------------------------
   页脚
   ------------------------------------------------------------ */
.gh-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 24px 16px 32px;
  border-top: 1px solid var(--border-soft);
  width: 100%;
  max-width: 1440px;
  margin: 16px auto 0;
  font-size: 12px;
  color: var(--muted);
}

.gh-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ------------------------------------------------------------
   响应式
   ------------------------------------------------------------ */
@media (max-width: 1200px) {
  .app-body.with-rail {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .rail {
    display: none;
  }
}

@media (max-width: 960px) {
  .app-body,
  .app-body.with-rail {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px 16px 24px;
  }

  .menu-btn {
    display: grid;
  }

  .side-head {
    width: auto;
  }

  .sidebar {
    position: fixed;
    top: 40px;
    bottom: 0;
    left: 0;
    z-index: 250;
    width: 260px;
    padding: 16px 12px;
    background: #fff;
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-pop);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    overflow: auto;
  }

  .sidebar.open {
    transform: none;
  }

  .top-search {
    width: 220px;
  }

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

  .profile-avatar {
    width: 160px;
    height: 160px;
  }
}

@media (max-width: 720px) {
  .app-header {
    padding: 8px 14px;
    gap: 10px;
  }

  .side-title {
    font-size: 14px;
  }

  .octocat {
    width: 26px;
    height: 26px;
  }

  .top-search,
  .tool-divider,
  .top-tools > .icon-btn {
    display: none;
  }

  .greet-row h1 {
    font-size: 20px;
  }

  .preview-pill {
    display: none;
  }

  .ask-right .gh-select:nth-child(-n + 2) {
    display: none;
  }

  .banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .banner-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .row-labels {
    display: none;
  }

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

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

  .gh-article h1 {
    font-size: 26px;
  }

  .pager-row {
    grid-template-columns: 1fr;
  }

  .blog-search {
    width: 100%;
  }
}

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

  html {
    scroll-behavior: auto;
  }
}
