* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #F7F4EC;
  --surface: #FFFFFF;
  --surface-hover: #FCFBF7;
  --ink: #161616;
  --muted: #68645B;
  --line: #E0DBD0;
  --lime: #B3DF2A;
  --lime-soft: #E9F5BE;
  --orange: #FF6A1A;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang TC", "Noto Sans TC", "Hiragino Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.top-bar {
  height: 5px;
  width: 100%;
  background: var(--ink);
  position: relative;
}

.top-bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 120px;
  background: var(--lime);
}

main {
  margin: 0 auto;
  padding: 36px 24px 56px;
}

.home-main {
  max-width: 640px;
  padding-top: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.list-main {
  max-width: 680px;
}

.article-main {
  max-width: 680px;
  padding-bottom: 60px;
}

.narrow-main {
  max-width: 600px;
  padding-top: 40px;
}

/* Site Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.site-header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.site-brand img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--lime);
  border: 1.5px solid var(--ink);
  display: block;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.site-nav a {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.14s ease;
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.site-nav a.is-active {
  background: var(--lime);
  color: var(--ink);
  border-color: var(--ink);
}

@media (max-width: 520px) {
  .site-header-inner {
    padding: 10px 16px;
    gap: 8px;
  }

  .site-nav a {
    padding: 5px 9px;
    font-size: 12.5px;
  }
}

/* Home Hero */
.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--lime);
  border: 3px solid var(--ink);
  overflow: hidden;
  display: block;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-main h1 {
  margin-top: 16px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.3px;
  text-align: center;
}

.handle {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.bio {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.65;
  color: #3D3A34;
  text-align: center;
  max-width: 440px;
}

.feature-grid {
  width: 100%;
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.feature-card:hover {
  border-color: var(--ink);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.feature-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--lime-soft);
  border: 1px solid #C7DE78;
  color: var(--ink);
}

.feature-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
}

.feature-desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

@media (max-width: 560px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

/* Top Nav */
.nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.nav-top a {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.nav-top a:hover {
  color: var(--orange);
}

.rss-pill {
  font-size: 12px !important;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted) !important;
  text-decoration: none;
}

.rss-pill:hover {
  border-color: var(--ink);
  color: var(--ink) !important;
}

/* Social Link Cards */
.links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.link-card:hover {
  border-color: var(--ink);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.link-card.primary {
  border: 2px solid var(--ink);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.link-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.icon-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.link-card.primary .icon-box {
  background: var(--lime-soft);
  border-color: #C7DE78;
}

.icon-box svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.link-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.link-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill {
  font-size: 11px;
  font-weight: 700;
  background: var(--lime);
  color: var(--ink);
  padding: 2px 8px;
  border-radius: 999px;
}

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

.arrow {
  font-size: 18px;
  font-weight: 700;
  color: var(--orange);
  flex-shrink: 0;
  transition: transform 0.16s ease;
}

.link-card:hover .arrow {
  transform: translateX(3px);
}

/* Sections & Post Cards */
.section {
  width: 100%;
  margin-top: 32px;
}

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

.section-head h2 {
  font-size: 16px;
  font-weight: 800;
}

.section-more {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
}

.section-more:hover {
  color: var(--ink);
}

.page-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.lead {
  margin-top: 8px;
  margin-bottom: 22px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
}

.search-box {
  margin-bottom: 14px;
}

.search-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  border-color: var(--ink);
}

.empty-search {
  margin-top: 16px;
  padding: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 14px;
}

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.14s ease;
}

.filter-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-btn.is-active {
  background: var(--lime);
  border-color: var(--ink);
  color: var(--ink);
  font-weight: 700;
}

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-card {
  display: block;
  padding: 18px 20px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.post-card:hover {
  border-color: var(--ink);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.post-card[hidden] {
  display: none;
}

.post-meta {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.post-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}

.list-main .post-title {
  font-size: 17px;
}

.post-desc {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.list-main .post-desc {
  font-size: 14px;
}

.post-tags {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
}

/* Article & Prose */
.article-card,
.surface-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 32px 28px;
}

@media (max-width: 520px) {
  .article-card,
  .surface-card {
    padding: 24px 18px;
  }
}

.article-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.article-card h1 {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.4px;
}

.prose {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 16px;
  line-height: 1.85;
  color: #24221F;
}

.prose h2 {
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.4;
}

.prose h3 {
  margin-top: 22px;
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 700;
}

.prose p {
  margin-bottom: 16px;
}

.prose ul,
.prose ol {
  margin: 0 0 18px 22px;
}

.prose li {
  margin-bottom: 6px;
}

.prose blockquote {
  margin: 18px 0;
  padding: 12px 16px;
  background: var(--bg);
  border-left: 3px solid var(--lime);
  border-radius: 0 10px 10px 0;
  color: #3D3A34;
}

.prose blockquote p {
  margin-bottom: 0;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 6px;
}

.code-block {
  position: relative;
  margin: 18px 0;
}

.prose pre,
.code-block pre {
  margin: 0;
  padding: 40px 16px 16px;
  background: #1C1B19;
  color: #F7F4EC;
  border-radius: 12px;
  overflow-x: auto;
  line-height: 1.6;
}

.prose pre code,
.code-block pre code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: 13px;
}

.prompt-card {
  padding: 20px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  scroll-margin-top: 20px;
}

.prompt-card:target {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--lime-soft);
}

.prompt-card[hidden] {
  display: none;
}

.prompt-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.prompt-cat {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--lime-soft);
  border: 1px solid #C7DE78;
  color: var(--ink);
}

.prompt-card h2 {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;
}

.prompt-summary {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.prompt-card .code-block {
  margin: 14px 0 0;
}

.prompt-card .code-block pre {
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt-note {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.prompt-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #F7F4EC;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.copy-btn.is-copied {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--ink);
}

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-underline-offset: 3px;
}

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

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin: 14px 0;
}

.prose .table-wrap {
  margin: 18px 0;
  overflow-x: auto;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.6;
}

.prose th,
.prose td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.prose th {
  background: var(--bg);
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.prose tbody tr:last-child td {
  border-bottom: none;
}

.share-row {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.share-copy-btn {
  padding: 7px 14px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.share-copy-btn:hover {
  border-color: var(--ink);
}

.share-copy-btn.is-copied {
  background: var(--lime-soft);
  border-color: var(--ink);
}

.share-threads-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
}

.share-threads-link:hover {
  color: var(--ink);
}

/* Newsletter Card */
.newsletter-card {
  width: 100%;
  margin-top: 24px;
  padding: 20px;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.newsletter-card h2 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 6px;
}

.newsletter-card p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 14px;
}

.newsletter-form {
  display: flex;
  gap: 8px;
}

.newsletter-form input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
}

.newsletter-form input[type="email"]:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--surface);
}

.newsletter-form button {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--ink);
  background: var(--lime);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.14s ease;
}

.newsletter-form button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.newsletter-form button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.newsletter-msg {
  margin-top: 12px;
  margin-bottom: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
}

.newsletter-msg.is-success {
  background: var(--lime-soft);
  border: 1px solid #C7DE78;
  color: var(--ink);
}

.newsletter-msg.is-error {
  background: #FFF3EE;
  border: 1px solid var(--orange);
  color: #9A3400;
}

.newsletter-hero .newsletter-form {
  margin-top: 18px;
}

@media (max-width: 480px) {
  .newsletter-form {
    flex-direction: column;
  }
}

/* About, Empty, 404 */
.pill-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--lime-soft);
  border: 1px solid #C7DE78;
  color: var(--ink);
  margin-bottom: 12px;
}

.surface-card h1 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.35;
}

.surface-card h2 {
  margin-top: 24px;
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 800;
}

.surface-card p,
.surface-card li {
  font-size: 15px;
  line-height: 1.75;
  color: #3D3A34;
}

.surface-card p + p {
  margin-top: 10px;
}

.surface-card ul {
  margin: 8px 0 0 20px;
}

.surface-card li + li {
  margin-top: 6px;
}

.surface-card a.inline-link {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-underline-offset: 3px;
}

.tip-box {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--bg);
  border-left: 3px solid var(--lime);
  border-radius: 0 12px 12px 0;
}

.tip-box p {
  font-size: 14px;
  line-height: 1.65;
}

.actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.btn-primary {
  background: var(--lime);
  border: 1.5px solid var(--ink);
  color: var(--ink);
}

.btn-secondary {
  background: var(--bg);
  border: 1.5px solid var(--line);
  color: var(--ink);
}

/* Footer */
footer {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  font-size: 12px;
  color: var(--muted);
}

footer a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

footer a:hover {
  color: var(--ink);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
