:root {
  --bg-color: #f7f8fa;
  --surface-1: #ffffff;
  --surface-2: #f3f4f6;
  --color-text: #111;
  --color-muted: #666;
  --text-muted: #6b7280;
  --color-border: #e2e6ea;
  --color-border-subtle: rgba(0, 0, 0, 0.06);
  --color-border-strong: #c0d3eb;
  --color-timeline: #e1e7ef;
  --color-link: #2563eb;
  --color-link-hover: #1d4ed8;
  --color-link-visited: #1e40af;
  --color-quote-bg: #fafafa;
  --color-quote-border: #e0e0e0;
  --color-code-bg: #f6f6f6;
  --color-code-border: #e2e2e2;
  --color-highlight: #ff9800;
  --shadow-card: 0 1px 6px rgba(30, 41, 59, 0.05);
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Palatino Linotype", "Book Antiqua", Palatino, "Times New Roman", STKaiti, SimSun, serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg-color);
  color: var(--color-text);
  font-family: var(--font-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg-color);
  line-height: 1.8;
  padding-top: 54px;
}

a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 0.08em;
  text-decoration-skip-ink: auto;
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: color 0.2s ease, text-decoration-thickness 0.2s ease;
}

a:hover,
a:focus {
  color: var(--color-link-hover);
  text-decoration-thickness: 0.12em;
}

a:visited {
  color: var(--color-link-visited);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  min-height: 54px;
  padding: 0 15px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid #e7e7e7;
  box-shadow: none;
}

.brand {
  color: #777;
  font-family: var(--font-serif);
  font-size: 20px;
  height: 54px;
  line-height: 54px;
  padding: 0 15px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover,
.brand:focus {
  color: #333;
  text-decoration: none;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 44px;
  height: 34px;
  padding: 9px 10px;
  background-color: transparent;
  background-image: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  margin-left: auto;
  margin-right: 10px;
  -webkit-tap-highlight-color: transparent;
}

.menu-toggle .icon-bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #888;
  border-radius: 1px;
  transition: all 0.2s ease;
}

.menu-toggle:hover,
.menu-toggle:focus {
  background-color: rgba(0, 0, 0, 0.05);
}

.nav-collapse {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  gap: 8px;
  font-size: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list li {
  display: inline-block;
}

.nav-list a {
  display: block;
  color: #777;
  height: 54px;
  line-height: 52px; /* 54px minus border */
  padding: 0 15px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.nav-list a:hover,
.nav-list a:focus {
  color: var(--color-link-hover);
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: 10px;
  text-decoration: none;
}

/* Glassmorphism active state for light mode navbar */
.nav-list li.active a {
  color: var(--color-link);
  background: rgba(255, 255, 255, 0.36);
  border: 1px solid rgba(148, 163, 184, 0.26);
  -webkit-backdrop-filter: saturate(140%) blur(6px);
  backdrop-filter: saturate(140%) blur(6px);
  box-shadow: 0 1px 6px rgba(30, 41, 59, 0.05);
  border-radius: 12px;
  text-decoration: none;
}

.micro-blog {
  width: min(1080px, calc(100% - 48px));
  margin: 56px auto 64px;
  font-size: 16px;
}

.toolbar {
  margin-bottom: 24px;
}

.tabs {
  width: 100%;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 8px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
}

.tabs::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

.tab {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--surface-1);
  color: var(--color-text);
  font: inherit;
  line-height: 1;
  cursor: pointer;
  transition: all 0.25s ease;
}

.tab:hover {
  background: var(--surface-2);
  color: var(--color-link-hover);
}

.tab[aria-selected="true"] {
  border-color: var(--color-link);
  background: #f1f8ff;
  color: var(--color-link);
  box-shadow: var(--shadow-card);
}



.tab:focus-visible,
.brand:focus-visible,
.nav-list a:focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 2px;
}

.status-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin: 0 0 28px;
  color: var(--text-muted);
  font-size: 14px;
}

.status-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.total-meta {
  color: var(--text-muted);
}

.status-divider {
  width: 1px;
  height: 14px;
  background: var(--color-border);
}

.timeline {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-item {
  position: relative;
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  background: var(--surface-1);
  box-shadow: var(--shadow-card);
  scroll-margin-top: 76px;
  min-width: 0;
}

.timeline-item::after {
  position: absolute;
  top: 0;
  bottom: -41px;
  left: 15px;
  z-index: -1;
  display: block;
  width: 2px;
  content: "";
  background-color: var(--color-timeline);
}

.timeline-item:last-child::after {
  display: none;
}

.timeline-item.highlight {
  border-color: var(--color-highlight);
  box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.32), 0 0 10px rgba(255, 152, 0, 0.42);
  transition: box-shadow 0.5s ease, border-color 0.5s ease;
}

.item-date {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 20px;
  border-bottom: 1px solid var(--color-border-strong);
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  background: #f1f8ff;
  color: #000;
  font-size: 90%;
  line-height: 1.6;
}

.item-date a {
  text-decoration: none;
  color: var(--color-link);
  flex-shrink: 0;
  margin-left: 12px;
}

.item-date a:hover,
.item-date a:focus {
  text-decoration: underline;
}

.content {
  padding: 4px 20px 16px;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
}

.content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
  margin: 1em auto;
}

.content p,
.content ul,
.content ol,
.content table {
  display: block;
  margin-block: 1em;
  margin-inline: 0;
  line-height: 1.7;
}

.content ul,
.content ol {
  padding-left: 1.4em;
}

.content blockquote {
  background: var(--color-quote-bg);
  border-left: 4px solid var(--color-quote-border);
  padding: 0.6em 1em;
  margin: 1em 0;
  color: var(--color-text);
  font-size: 0.95rem;
  border-radius: 0 4px 4px 0;
}

.content blockquote p,
.content blockquote ul {
  margin-block: 0;
}

.content pre {
  font-size: 0.88em;
  line-height: 1.5;
  background: var(--color-code-bg);
  border: 1px solid var(--color-code-border);
  border-radius: 6px;
  padding: 10px 14px;
  margin: 1.2em 0;
  overflow: auto;
}

.content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Noto Sans Mono CJK SC", "Source Han Mono SC", monospace;
}

.content :not(pre) > code {
  font-size: 0.88em;
  background: var(--color-code-bg);
  border: 1px solid var(--color-code-border);
  border-radius: 3px;
  padding: 0.1em 0.3em;
  margin: 0 0.1em;
  word-break: break-word;
}

.content table {
  display: block;
  width: 100%;
  border-collapse: collapse;
  overflow-wrap: normal;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.content table tr {
  background-color: var(--surface-1);
  border-top: 1px solid var(--color-border);
}

.content table tr:nth-child(2n) {
  background-color: var(--surface-2);
}

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

.empty,
.error,
.loading {
  padding: 28px 20px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--surface-1);
  color: var(--color-muted);
  text-align: center;
}

.loading {
  position: relative;
  min-height: 120px;
}

.loading span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border: 4px solid #77b3e0;
  border-radius: 50%;
  opacity: 1;
  animation: ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.loading span:nth-child(2) {
  border-color: #e90c59;
  animation-delay: -0.5s;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

@keyframes ripple {
  0% {
    width: 0;
    height: 0;
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  100% {
    width: 86px;
    height: 86px;
    opacity: 0;
    transform: translate(-50%, -50%);
  }
}

@media (max-width: 860px) {
  body {
    padding-top: 50px;
  }

  .site-header {
    position: fixed;
    align-items: center;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0 8px;
    border-radius: 0;
  }

  .brand {
    height: 44px;
    padding: 0 10px;
    font-size: 17px;
    line-height: 44px;
  }

  .nav-list {
    font-size: 17px;
  }

  .nav-list a {
    height: 44px;
    line-height: 42px; /* 44px minus border */
    padding: 0 10px;
  }

  .micro-blog {
    width: calc(100% - 28px);
    margin-top: 34px;
    font-size: 16px;
  }

  .status-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px 16px;
  }

  .item-date {
    padding: 10px 16px;
  }

  .content {
    padding: 4px 16px 16px;
  }
}

@media (max-width: 413px) {
  .menu-toggle {
    display: flex;
  }

  .nav-collapse {
    display: none;
    position: absolute;
    top: 100%;
    right: 15px; /* Aligned to drawer padding */
    z-index: 1040;
    box-sizing: border-box;
    background: var(--surface-1);
    border: 1px solid var(--color-border-subtle);
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1);
    margin-top: 6px;
    padding: 0 4px;
    width: fit-content;
    min-width: 76px;
    max-width: calc(100% - 30px);
  }

  .nav-collapse.open {
    display: block;
  }

  .nav-list {
    display: flex;
    flex-direction: column;
    margin: 6px 0;
    padding: 0;
    gap: 0;
    font-size: 17px;
  }

  .nav-list li {
    display: block;
    width: 100%;
  }

  .nav-list li a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 15px;
    min-height: 40px;
    border-radius: 10px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    height: auto;
    line-height: normal;
  }

  .nav-list li.active a {
    border-radius: 10px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #0f1115;
    --surface-1: #12161a;
    --surface-2: #0f1317;
    --color-text: #e7e7e7;
    --color-muted: #a6a6a6;
    --text-muted: #9aa4b2;
    --color-link: #8ab4f8;
    --color-link-hover: #a9c6ff;
    --color-link-visited: #a0b3ff;
    --color-border: #2a2f37;
    --color-border-subtle: rgba(255, 255, 255, 0.08);
    --color-border-strong: #39506b;
    --color-timeline: #293341;
    --color-quote-bg: #141a20;
    --color-quote-border: #2a2f37;
    --color-code-bg: #12161a;
    --color-code-border: #2a2f37;
  }

  .site-header {
    background: rgba(26, 31, 38, 0.9);
    border-color: #2a2f37;
  }

  .brand {
    color: #9aa4b2;
  }

  .brand:hover,
  .brand:focus {
    color: #fff;
  }

  .nav-list a {
    color: #9aa4b2;
  }

  .menu-toggle {
    border-color: #444;
  }

  .menu-toggle .icon-bar {
    background-color: #aaa;
  }

  .menu-toggle:hover,
  .menu-toggle:focus {
    background-color: rgba(255, 255, 255, 0.1);
  }

  .nav-list a:hover,
  .nav-list a:focus {
    background-color: rgba(255, 255, 255, 0.06);
  }

  /* Glassmorphism active state for dark mode navbar */
  .nav-list li.active a {
    color: var(--color-link);
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(148, 163, 184, 0.20);
    -webkit-backdrop-filter: saturate(140%) blur(6px);
    backdrop-filter: saturate(140%) blur(6px);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
  }

  .tab[aria-selected="true"] {
    background: rgba(138, 180, 248, 0.08);
    color: var(--color-link);
    border-color: var(--color-link);
  }

  .item-date {
    background: #18283a;
    color: #eef2f7;
  }

  .content pre,
  .content :not(pre) > code {
    background: var(--color-code-bg);
    border-color: var(--color-code-border);
  }

  .content table tr,
  .content table tr:nth-child(2n) {
    background-color: transparent;
  }
}
