:root {
  color-scheme: light;
  --bg: #f7faf5;
  --surface: #ffffff;
  --surface-soft: #eef6ec;
  --surface-raised: #ffffff;
  --text: #142019;
  --muted: #67736b;
  --faint: #98a29a;
  --border: #e1e8df;
  --accent: #4f8f45;
  --accent-strong: #26722b;
  --accent-warm: #d87838;
  --danger: #b34045;
  --shadow: 0 18px 44px rgba(48, 73, 55, 0.09);
  --radius: 14px;
  --radius-lg: 18px;
  --max: 1440px;
  --article: 760px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101511;
  --surface: #171d18;
  --surface-soft: #1f2a21;
  --surface-raised: #1a211c;
  --text: #eef5ee;
  --muted: #afbaaf;
  --faint: #7e8d80;
  --border: #2c382f;
  --accent: #8bcf7f;
  --accent-strong: #b7e8ae;
  --accent-warm: #f3a76a;
  --danger: #ff8b91;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-soft), transparent 55%) 0, transparent 460px),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  width: 18px;
  height: 18px;
}

.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;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid color-mix(in srgb, var(--border), transparent 28%);
  background: color-mix(in srgb, var(--bg), transparent 8%);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
  width: min(var(--max), calc(100vw - 40px));
  margin: 0 auto;
  padding: 16px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark,
.profile-avatar {
  display: grid;
  place-items: center;
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  font-size: 19px;
}

.brand-copy strong,
.brand-copy small {
  display: block;
}

.brand-copy strong {
  line-height: 1.1;
  font-size: 18px;
}

.brand-copy small {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.site-nav a {
  border-radius: 999px;
  color: var(--muted);
  padding: 8px 13px;
  transition:
    background 160ms ease,
    color 160ms ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--surface-soft);
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: clamp(190px, 21vw, 310px);
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 12px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus,
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent), transparent 84%);
}

.app {
  min-height: calc(100vh - 146px);
}

.app:focus {
  outline: none;
}

.section {
  width: min(var(--max), calc(100vw - 40px));
  margin: 0 auto;
  padding: 56px 0;
}

.section-tight {
  padding-top: 22px;
}

.home-hero {
  padding-top: 58px;
}

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 34px;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 34px;
  background:
    radial-gradient(circle at 12% 12%, color-mix(in srgb, var(--accent), transparent 80%), transparent 34%),
    radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--accent-warm), transparent 82%), transparent 28%),
    var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(28px, 5vw, 56px);
}

.hero-copy h1,
.page-head h1,
.article h1,
.project-detail h1,
.about-intro h1 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.02;
}

.hero-copy h1 {
  max-width: 760px;
  font-size: clamp(58px, 10vw, 118px);
}

.hero-copy p {
  max-width: 660px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.profile-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-raised), transparent 10%);
  padding: 24px;
}

.profile-avatar {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  margin-bottom: 18px;
  font-size: 24px;
}

.profile-avatar-large {
  width: 82px;
  height: 82px;
  border-radius: 28px;
}

.profile-name {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.profile-role,
.muted {
  color: var(--muted);
}

.profile-role {
  margin: 2px 0 0;
}

.profile-stats,
.about-index {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 22px 0 0;
}

.profile-stats div,
.about-index div {
  border-radius: 16px;
  background: var(--surface-soft);
  padding: 14px;
}

.profile-stats dt,
.about-index span {
  color: var(--muted);
  font-size: 12px;
}

.profile-stats dd,
.about-index strong {
  display: block;
  margin: 0;
  font-size: 24px;
  font-weight: 800;
}

.content-layout,
.article-layout,
.project-layout {
  display: grid;
  grid-template-columns: minmax(0, 820px) 300px;
  gap: 36px;
  align-items: start;
}

.main-column {
  min-width: 0;
}

.section-head,
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 24px;
}

.section-head h2,
.page-head h1 {
  margin: 0;
}

.section-head h2 {
  font-size: clamp(34px, 4vw, 52px);
  letter-spacing: 0;
  line-height: 1.08;
}

.page-head {
  padding-top: 72px;
}

.page-head h1 {
  font-size: clamp(44px, 7vw, 82px);
}

.page-head p {
  max-width: 640px;
  color: var(--muted);
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--accent-warm);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.post-row,
.project-card,
.comment,
.side-box,
.rail-section,
.comment-login,
.empty-state {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.post-thumb img,
.project-cover-link img,
.article-cover,
.project-cover {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--surface-soft);
}

.post-row h3,
.project-card h3 {
  margin: 8px 0 8px;
  line-height: 1.25;
}

.post-row p,
.project-card p {
  color: var(--muted);
}

.post-list,
.project-list {
  display: grid;
  gap: 16px;
}

.post-list-wide {
  max-width: 920px;
}

.post-row {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr);
  gap: 20px;
  padding: 18px;
  min-height: 190px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.post-row:hover,
.project-card:hover,
.mini-project:hover {
  border-color: color-mix(in srgb, var(--accent), var(--border) 45%);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.post-thumb img {
  height: 100%;
  min-height: 150px;
  aspect-ratio: 1 / 1;
}

.post-thumb {
  display: block;
  min-height: 150px;
}

.post-thumb-fallback {
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent), transparent 74%), transparent 62%),
    var(--surface-soft);
  color: var(--accent-strong);
  font-size: 34px;
  font-weight: 900;
}

.post-row-body {
  min-width: 0;
  padding: 6px 4px 4px 0;
}

.post-row h3 {
  font-size: clamp(24px, 2.7vw, 34px);
}

.post-row p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  margin: 0;
  font-size: 16px;
}

.card-meta,
.article-meta,
.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--faint);
  font-size: 13px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 14px 0 0;
  list-style: none;
}

.tag,
.category-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid color-mix(in srgb, var(--border), transparent 22%);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 4px 11px;
  font-size: 13px;
}

.topic-list,
.link-stack,
.mini-projects {
  display: grid;
  gap: 10px;
}

.rail,
.sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 16px;
}

.rail-section,
.side-box {
  padding: 22px;
}

.rail-section h2,
.side-box h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.mini-project {
  display: grid;
  gap: 2px;
  border: 1px solid color-mix(in srgb, var(--border), transparent 20%);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-raised), transparent 22%);
  padding: 14px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.mini-project span {
  color: var(--muted);
  font-size: 13px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.filters input,
.filters select {
  min-height: 44px;
  padding: 8px 12px;
}

.article-layout,
.project-layout {
  grid-template-columns: minmax(0, var(--article)) 280px;
  justify-content: center;
  padding-top: 76px;
}

.article,
.project-detail {
  min-width: 0;
}

.article-head {
  margin-bottom: 28px;
}

.article h1,
.project-detail h1 {
  margin-top: 16px;
  font-size: clamp(38px, 6vw, 68px);
}

.article-summary {
  max-width: 680px;
  color: var(--muted);
  font-size: 20px;
}

.article-cover,
.project-cover {
  aspect-ratio: 16 / 8;
  margin: 24px 0 32px;
}

.markdown {
  color: color-mix(in srgb, var(--text), var(--muted) 8%);
  font-size: 18px;
}

.markdown > *:first-child {
  margin-top: 0;
}

.markdown h2,
.markdown h3 {
  margin-top: 38px;
  line-height: 1.25;
}

.markdown p,
.markdown li {
  margin: 16px 0;
}

.markdown a,
.text-link,
.link-stack a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.markdown blockquote {
  margin: 24px 0;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-soft);
  padding: 14px 18px;
}

.markdown pre {
  overflow: auto;
  border-radius: var(--radius);
  padding: 18px;
}

.markdown :not(pre) > code {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 2px 6px;
}

.project-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-card {
  overflow: hidden;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.project-cover-link img {
  aspect-ratio: 16 / 9;
  border-radius: 0;
}

.project-card-body {
  padding: 20px;
}

.comments-section {
  margin-top: 58px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.comments {
  display: grid;
  gap: 12px;
}

.comment {
  padding: 16px;
}

.comment-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.comment p {
  margin-bottom: 0;
}

.comment-login {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  padding: 18px;
}

.comment-login p {
  margin: 4px 0 0;
  color: var(--muted);
}

.comment-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.comment-form textarea {
  min-height: 132px;
  resize: vertical;
  padding: 14px;
}

.comment-form-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.about-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 46px;
  align-items: end;
  padding-top: 92px;
}

.about-intro h1 {
  margin-top: 16px;
  font-size: clamp(48px, 8vw, 92px);
}

.about-intro p {
  max-width: 690px;
  color: var(--muted);
  font-size: 20px;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.about-index {
  margin: 0;
}

.empty-state {
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.empty-state-compact {
  padding: 18px;
}

.button,
.icon-button,
.modal-close {
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  background: var(--text);
  color: var(--bg);
  padding: 9px 17px;
  font-weight: 800;
}

.button:hover,
.icon-button:hover,
.modal-close:hover {
  transform: translateY(-1px);
}

.button-soft {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.button-danger {
  border-color: color-mix(in srgb, var(--danger), transparent 58%);
  background: color-mix(in srgb, var(--danger), transparent 86%);
  color: var(--danger);
}

.button-github {
  width: 100%;
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.icon-button,
.modal-close {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(20, 17, 14, 0.52);
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none;
}

.auth-modal {
  position: relative;
  width: min(460px, 100%);
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  padding: 30px;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.auth-intro {
  padding-right: 54px;
}

.auth-intro h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.12;
}

.auth-intro p:not(.eyebrow) {
  color: var(--muted);
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 5px;
  margin: 24px 0 18px;
}

.auth-switch button {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.auth-switch button[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(65, 50, 31, 0.08);
}

.auth-form {
  display: grid;
  gap: 13px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.auth-form input {
  min-height: 48px;
  padding: 10px 13px;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--faint);
  font-size: 13px;
  margin: 18px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}

.form-message {
  min-height: 23px;
  color: var(--muted);
  font-size: 14px;
}

.admin-gate {
  display: grid;
  min-height: 58vh;
  align-items: center;
}

.admin-gate h1,
.admin-head h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 1.02;
}

.admin-gate p,
.admin-head p,
.panel-head p {
  color: var(--muted);
}

.admin-sql {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 16px;
}

.admin-page {
  padding-top: 72px;
}

.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 24px;
}

.admin-actions,
.form-actions,
.admin-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.admin-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 22px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.panel-head h2 {
  margin: 0;
}

.panel-head p {
  margin: 4px 0 0;
  font-size: 14px;
}

.admin-form {
  display: grid;
  gap: 14px;
}

.admin-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  padding: 10px 12px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.content-editor {
  min-height: 300px;
  resize: vertical;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  line-height: 1.55;
}

.checkbox-field {
  display: flex !important;
  grid-template-columns: auto 1fr;
  flex-direction: row;
  align-items: center;
}

.checkbox-field input {
  width: auto;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-item {
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  padding: 16px;
}

.admin-item h3 {
  margin: 6px 0 4px;
}

.admin-item p {
  margin: 0;
  color: var(--muted);
}

.admin-users-panel {
  grid-column: 1 / -1;
}

.approval-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.approval-item {
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  padding: 16px;
}

.approval-item h3 {
  margin: 8px 0 4px;
}

.approval-item p {
  margin: 0 0 8px;
  color: var(--muted);
}

.approval-item code {
  display: block;
  overflow-wrap: anywhere;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 6px 8px;
  color: var(--muted);
  font-size: 12px;
}

.approval-status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 800;
}

.approval-status.pending {
  background: color-mix(in srgb, var(--accent-warm), transparent 84%);
  color: var(--accent-warm);
}

.approval-status.approved {
  background: color-mix(in srgb, var(--accent), transparent 84%);
  color: var(--accent-strong);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(var(--max), calc(100vw - 40px));
  margin: 0 auto;
  padding: 30px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 960px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .header-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .search-box {
    flex: 1;
    width: auto;
  }

  .home-hero,
  .hero-shell,
  .content-layout,
  .article-layout,
  .project-layout,
  .about-page,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .rail,
  .sidebar {
    position: static;
  }

  .project-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .section {
    width: min(100vw - 28px, var(--max));
    padding: 38px 0;
  }

  .header-inner,
  .site-footer {
    width: min(100vw - 28px, var(--max));
  }

  .brand-copy small {
    display: none;
  }

  .home-hero,
  .page-head,
  .article-layout,
  .project-layout,
  .about-page {
    padding-top: 42px;
  }

  .post-row {
    grid-template-columns: 1fr;
  }

  .post-thumb img {
    min-height: auto;
    aspect-ratio: 16 / 9;
  }

  .post-thumb,
  .post-thumb-fallback {
    min-height: 180px;
  }

  .section-head,
  .admin-head,
  .comment-login,
  .comment-form-foot,
  .site-footer {
    display: block;
  }

  .text-link,
  .comment-login .button,
  .comment-form-foot .button {
    margin-top: 12px;
  }

  .profile-stats,
  .about-index,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .auth-modal {
    border-radius: 24px;
    padding: 24px;
  }
}

/* Notes home redesign */
body {
  background:
    linear-gradient(180deg, #fbfdf9 0, var(--bg) 420px),
    var(--bg);
}

[data-theme="dark"] body {
  background:
    linear-gradient(180deg, #151c16 0, var(--bg) 420px),
    var(--bg);
}

.site-header {
  border-bottom: 1px solid rgba(30, 68, 35, 0.08);
  background: color-mix(in srgb, var(--surface), transparent 6%);
}

.header-inner {
  width: min(var(--max), calc(100vw - 32px));
  min-height: 74px;
  padding: 12px 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: #ffffff;
}

.brand-mark svg {
  width: 23px;
  height: 23px;
  fill: color-mix(in srgb, #ffffff, transparent 28%);
}

.brand-copy strong {
  font-size: 22px;
}

.brand-copy small {
  color: var(--accent-strong);
  font-size: 11px;
}

.site-nav {
  gap: 18px;
}

.site-nav a {
  position: relative;
  border-radius: 0;
  padding: 10px 6px;
  color: color-mix(in srgb, var(--text), transparent 22%);
  font-weight: 760;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: transparent;
  color: var(--accent-strong);
}

.site-nav a[aria-current="page"]::after {
  position: absolute;
  right: 2px;
  bottom: 3px;
  left: 2px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-strong);
  content: "";
}

.search-box {
  width: clamp(260px, 29vw, 440px);
  min-height: 44px;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(46, 71, 52, 0.04);
}

.write-button {
  min-height: 44px;
  border-color: color-mix(in srgb, var(--accent), transparent 34%);
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  white-space: nowrap;
}

.notes-home {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 300px;
  gap: 24px;
  width: min(var(--max), calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 32px;
  align-items: start;
}

.notes-sidebar {
  position: sticky;
  top: 98px;
  display: grid;
  gap: 18px;
}

.side-card,
.profile-card,
.welcome-card,
.note-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(47, 75, 54, 0.07);
}

.side-card {
  padding: 18px;
}

.side-card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.25;
}

.side-card h2 svg {
  width: 18px;
  height: 18px;
  color: var(--accent-strong);
}

.side-link-list,
.recent-list,
.recommend-list {
  display: grid;
  gap: 8px;
}

.side-link,
.recent-item,
.recommend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  transition:
    background 160ms ease,
    color 160ms ease;
}

.side-link {
  min-height: 36px;
  padding: 6px 8px;
}

.side-link::before {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent), transparent 28%);
  content: "";
}

.side-link span {
  flex: 1;
}

.side-link em,
.recent-item time,
.hot-tag em,
.archive-list em {
  color: var(--faint);
  font-style: normal;
  font-size: 13px;
}

.side-link:hover,
.recent-item:hover,
.recommend-item:hover {
  background: var(--surface-soft);
  color: var(--accent-strong);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud .tag {
  min-height: 31px;
  border-radius: 8px;
  background: #f6faf4;
  color: color-mix(in srgb, var(--text), transparent 12%);
  gap: 8px;
}

[data-theme="dark"] .tag-cloud .tag {
  background: var(--surface-soft);
}

.tag-cloud .tag span {
  color: var(--faint);
  font-size: 12px;
}

.subtle-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 13px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 760;
}

.subtle-link svg {
  width: 15px;
  height: 15px;
}

.recent-item {
  min-height: 28px;
}

.recent-item span {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-card {
  padding: 18px;
}

.profile-topline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-topline strong,
.profile-topline span {
  display: block;
}

.profile-topline span {
  color: var(--accent-strong);
  font-size: 13px;
}

.profile-avatar-soft {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 6px solid #e7f2e3;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffffff, #dbeed6);
  color: var(--accent-strong);
  font-size: 22px;
  font-weight: 850;
}

[data-theme="dark"] .profile-avatar-soft {
  border-color: #263a29;
  background: linear-gradient(145deg, #223027, #18251b);
}

.profile-card p {
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
}

.profile-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border-top: 1px solid var(--border);
  padding-top: 13px;
  text-align: center;
}

.profile-mini-stats span {
  display: grid;
  color: var(--muted);
  font-size: 12px;
}

.profile-mini-stats strong {
  color: var(--text);
  font-size: 17px;
}

.notes-main-column {
  display: grid;
  min-width: 0;
  gap: 20px;
}

.welcome-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.52fr);
  min-height: 278px;
  overflow: hidden;
  background:
    linear-gradient(110deg, #ffffff 0%, #fbfdf9 54%, #eef7eb 100%);
}

[data-theme="dark"] .welcome-card {
  background:
    linear-gradient(110deg, var(--surface) 0%, #1b241d 58%, #243426 100%);
}

.welcome-copy {
  padding: clamp(28px, 4vw, 46px);
}

.welcome-copy .eyebrow {
  color: var(--accent-strong);
  letter-spacing: 0.08em;
}

.welcome-copy h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: #102319;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.1;
}

[data-theme="dark"] .welcome-copy h1 {
  color: var(--text);
}

.welcome-copy h1 svg {
  width: 30px;
  height: 30px;
  color: var(--accent);
  fill: color-mix(in srgb, var(--accent), transparent 46%);
}

.welcome-copy > p:not(.eyebrow) {
  max-width: 520px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.welcome-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
  margin: 34px 0 0;
}

.welcome-stats div {
  display: grid;
  gap: 2px;
}

.welcome-stats dt {
  order: 2;
  color: var(--muted);
  font-size: 13px;
}

.welcome-stats dd {
  margin: 0;
  color: var(--text);
  font-size: 27px;
  font-weight: 850;
  line-height: 1;
}

.desk-visual {
  position: relative;
  min-height: 278px;
}

.notebook {
  position: absolute;
  right: 68px;
  bottom: 35px;
  width: 220px;
  height: 118px;
  border: 1px solid #e5dcc8;
  border-radius: 8px 8px 18px 18px;
  background: linear-gradient(90deg, #f8efd9 0 49%, #fff6df 50% 100%);
  box-shadow: 0 16px 28px rgba(77, 91, 55, 0.14);
  transform: rotate(-3deg);
}

.notebook::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: #e0d0b5;
  content: "";
}

.notebook span {
  position: absolute;
  right: 18px;
  left: 18px;
  height: 1px;
  background: rgba(154, 132, 91, 0.26);
}

.notebook span:nth-child(1) { top: 28px; }
.notebook span:nth-child(2) { top: 48px; }
.notebook span:nth-child(3) { top: 68px; }
.notebook span:nth-child(4) { top: 88px; }

.pen {
  position: absolute;
  right: 143px;
  bottom: 93px;
  width: 118px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #263227 0 72%, #d9a958 73% 100%);
  box-shadow: 0 7px 12px rgba(40, 50, 38, 0.18);
  transform: rotate(-18deg);
}

.cup {
  position: absolute;
  right: 42px;
  bottom: 105px;
  width: 76px;
  height: 70px;
  border-radius: 9px 9px 24px 24px;
  background: #f3e7c5;
  box-shadow: inset 0 10px 0 rgba(255, 255, 255, 0.56), 0 15px 22px rgba(94, 91, 54, 0.12);
}

.cup::before {
  position: absolute;
  top: 16px;
  right: -20px;
  width: 26px;
  height: 28px;
  border: 7px solid #f3e7c5;
  border-left: 0;
  border-radius: 0 22px 22px 0;
  content: "";
}

.cup span {
  position: absolute;
  top: 10px;
  right: 13px;
  left: 13px;
  height: 14px;
  border-radius: 50%;
  background: #b88950;
}

.plant {
  position: absolute;
  right: 156px;
  bottom: 159px;
  width: 72px;
  height: 92px;
}

.plant::after {
  position: absolute;
  right: 14px;
  bottom: 0;
  left: 14px;
  height: 42px;
  border-radius: 7px 7px 15px 15px;
  background: #e5dfc5;
  box-shadow: inset 0 9px 0 rgba(255, 255, 255, 0.42);
  content: "";
}

.plant span {
  position: absolute;
  bottom: 38px;
  left: 31px;
  width: 26px;
  height: 48px;
  border-radius: 26px 0 26px 0;
  background: linear-gradient(145deg, #8dbd59, #2f7b39);
  transform-origin: bottom center;
}

.plant span:nth-child(1) { transform: rotate(-48deg); }
.plant span:nth-child(2) { transform: rotate(-18deg) translateY(-9px); }
.plant span:nth-child(3) { transform: rotate(20deg) translateY(-12px); }
.plant span:nth-child(4) { transform: rotate(48deg) translateY(1px); }

.notes-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}

.filter-pills,
.view-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-pills button,
.view-toggle button,
.category-select select,
.bookmark-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-weight: 750;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.filter-pills button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
}

.filter-pills button[aria-selected="true"],
.view-toggle button[aria-selected="true"] {
  border-color: color-mix(in srgb, var(--accent), transparent 25%);
  background: var(--accent);
  color: #ffffff;
}

.filter-pills button:hover,
.view-toggle button:hover,
.bookmark-button:hover {
  transform: translateY(-1px);
}

.category-select select {
  min-height: 40px;
  padding: 0 38px 0 14px;
  border-radius: 999px;
}

.view-toggle button,
.bookmark-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.note-grid[data-view="list"] {
  grid-template-columns: 1fr;
}

.note-grid[data-view="list"] .note-card {
  min-height: 150px;
}

.note-grid > .empty-state {
  grid-column: 1 / -1;
}

.note-card {
  display: grid;
  min-height: 198px;
  padding: 22px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.note-card:hover {
  border-color: color-mix(in srgb, var(--accent), transparent 35%);
  box-shadow: 0 18px 42px rgba(47, 75, 54, 0.12);
  transform: translateY(-2px);
}

.note-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.note-category {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 760;
}

.note-card h2 {
  margin: 12px 0 0;
  font-size: 21px;
  line-height: 1.35;
}

.note-card p {
  margin: 14px 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.note-tags a {
  min-height: 28px;
  border-radius: 7px;
  background: #edf6e9;
  color: var(--accent-strong);
  padding: 3px 9px;
  font-size: 12px;
}

[data-theme="dark"] .note-tags a {
  background: var(--surface-soft);
}

.note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
  color: var(--faint);
  font-size: 13px;
}

.note-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.note-meta svg {
  width: 15px;
  height: 15px;
}

.hot-tag-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.hot-tag {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface), var(--surface-soft) 38%);
  padding: 6px 10px;
  color: var(--muted);
  font-size: 14px;
}

.hot-tag:hover {
  border-color: color-mix(in srgb, var(--accent), transparent 35%);
  color: var(--accent-strong);
}

.archive-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.archive-list li {
  position: relative;
  padding-left: 18px;
}

.archive-list li::before {
  position: absolute;
  top: 10px;
  left: 0;
  width: 9px;
  height: 9px;
  border: 2px solid color-mix(in srgb, var(--accent), transparent 30%);
  border-radius: 50%;
  background: var(--surface);
  content: "";
}

.archive-list li:first-child::before {
  background: var(--accent);
}

.archive-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.archive-list a:hover {
  color: var(--accent-strong);
}

.inspiration-card blockquote {
  margin: 0;
}

.inspiration-card p {
  position: relative;
  margin: 0;
  padding-left: 28px;
  color: var(--muted);
  font-size: 14px;
}

.inspiration-card p::before {
  position: absolute;
  left: 0;
  color: color-mix(in srgb, var(--accent), transparent 30%);
  content: "“";
  font-size: 42px;
  line-height: 0.8;
}

.inspiration-card cite {
  display: block;
  margin-top: 12px;
  color: var(--text);
  font-style: normal;
  text-align: right;
}

.recommend-item {
  display: grid;
  justify-content: stretch;
  padding: 10px;
}

.recommend-item strong {
  color: var(--text);
  font-size: 14px;
}

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

@media (max-width: 1240px) {
  .notes-home {
    grid-template-columns: 230px minmax(0, 1fr) 260px;
    gap: 18px;
  }

  .welcome-card {
    grid-template-columns: 1fr;
  }

  .desk-visual {
    display: none;
  }
}

@media (max-width: 1020px) {
  .notes-home {
    grid-template-columns: 1fr;
  }

  .notes-main-column {
    order: 1;
  }

  .notes-sidebar-left {
    order: 2;
  }

  .notes-sidebar-right {
    order: 3;
  }

  .notes-sidebar {
    position: static;
  }

  .notes-sidebar-left,
  .notes-sidebar-right {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .header-inner {
    width: min(100vw - 24px, var(--max));
  }

  .site-nav {
    gap: 14px;
  }

  .write-button {
    width: 44px;
    padding: 0;
    font-size: 0;
  }

  .write-button svg {
    width: 18px;
    height: 18px;
  }

  .notes-home {
    width: min(100vw - 24px, var(--max));
    padding-top: 16px;
  }

  .notes-sidebar-left,
  .notes-sidebar-right,
  .note-grid {
    grid-template-columns: 1fr;
  }

  .welcome-card {
    min-height: 0;
  }

  .welcome-copy {
    padding: 24px;
  }

  .welcome-copy h1 {
    font-size: 34px;
  }

  .welcome-stats {
    gap: 20px;
  }

  .notes-toolbar {
    grid-template-columns: 1fr;
  }

  .category-select select {
    width: 100%;
  }

  .view-toggle {
    justify-content: flex-end;
  }
}
