:root {
  color-scheme: light;
  --bg: #f8f6f2;
  --paper: #fffdfa;
  --paper-soft: #f1eee8;
  --control: #fff;
  --ink: #262421;
  --muted: #7a746b;
  --line: #e4ded4;
  --accent: #5d7f78;
  --accent-deep: #315f58;
  --rose: #c8897c;
  --header-bg: rgba(248, 246, 242, 0.86);
  --header-border: rgba(228, 222, 212, 0.8);
  --button-hover: #244e48;
  --post-body: #34312d;
  --danger-border: #e6c7c1;
  --danger-bg: #fff7f5;
  --danger-text: #99483d;
  --danger-hover: #f6e6e2;
  --success-bg: #e8f1ed;
  --overlay-control: rgba(38, 36, 33, 0.78);
  --lock-overlay: rgba(248, 246, 242, 0.82);
  --field-error-border: #c94f43;
  --field-error-ring: rgba(201, 79, 67, 0.12);
  --shadow: 0 18px 55px rgba(64, 55, 43, 0.1);
  --card-shadow: 0 14px 40px rgba(64, 55, 43, 0.08);
  --soft-shadow: 0 14px 40px rgba(64, 55, 43, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #171d1b;
    --paper: #202724;
    --paper-soft: #2a332f;
    --control: #151a18;
    --ink: #eee8dc;
    --muted: #b8ada0;
    --line: #39433e;
    --accent: #90b7ab;
    --accent-deep: #b6d6cd;
    --rose: #d69a8f;
    --header-bg: rgba(23, 29, 27, 0.88);
    --header-border: rgba(57, 67, 62, 0.82);
    --button-hover: #7aa598;
    --post-body: #e7dfd2;
    --danger-border: #76504a;
    --danger-bg: #342421;
    --danger-text: #f1b6ac;
    --danger-hover: #442e2a;
    --success-bg: #263b34;
    --overlay-control: rgba(10, 12, 11, 0.76);
    --lock-overlay: rgba(23, 29, 27, 0.78);
    --field-error-border: #df7d70;
    --field-error-ring: rgba(223, 125, 112, 0.18);
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.26);
    --card-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
    --soft-shadow: 0 14px 40px rgba(0, 0, 0, 0.16);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171d1b;
  --paper: #202724;
  --paper-soft: #2a332f;
  --control: #151a18;
  --ink: #eee8dc;
  --muted: #b8ada0;
  --line: #39433e;
  --accent: #90b7ab;
  --accent-deep: #b6d6cd;
  --rose: #d69a8f;
  --header-bg: rgba(23, 29, 27, 0.88);
  --header-border: rgba(57, 67, 62, 0.82);
  --button-hover: #7aa598;
  --post-body: #e7dfd2;
  --danger-border: #76504a;
  --danger-bg: #342421;
  --danger-text: #f1b6ac;
  --danger-hover: #442e2a;
  --success-bg: #263b34;
  --overlay-control: rgba(10, 12, 11, 0.76);
  --lock-overlay: rgba(23, 29, 27, 0.78);
  --field-error-border: #df7d70;
  --field-error-ring: rgba(223, 125, 112, 0.18);
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.26);
  --card-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  --soft-shadow: 0 14px 40px rgba(0, 0, 0, 0.16);
}

* {
  box-sizing: border-box;
}

[hidden],
.is-hidden {
  display: none !important;
}

[data-editor-form].mode-article [data-note-mode],
[data-editor-form].mode-article [data-album-mode],
[data-editor-form].mode-note [data-article-mode],
[data-editor-form].mode-note [data-album-mode],
[data-editor-form].mode-album [data-article-mode],
[data-editor-form].mode-album [data-note-mode] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
}

html.theme-animating,
html.theme-animating * {
  transition:
    background-color 360ms ease,
    border-color 360ms ease,
    box-shadow 360ms ease,
    color 360ms ease,
    fill 360ms ease,
    stroke 360ms ease;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

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

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

input,
textarea,
select,
button {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 18px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid var(--header-border);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  font-weight: 700;
}

.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 9px 0 0 var(--rose);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  overflow-x: auto;
  color: var(--muted);
  white-space: nowrap;
}

.nav a,
.nav-form button,
.theme-toggle {
  padding: 7px 11px;
  border-radius: 999px;
}

.nav a:hover,
.nav-form button:hover,
.theme-toggle:hover,
.nav .active {
  background: var(--paper-soft);
  color: var(--ink);
}

.nav-form {
  margin: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: max-content;
  min-height: auto;
  border: 1px solid var(--line);
  background: var(--paper);
  color: inherit;
  cursor: pointer;
  font-weight: 700;
  transform-origin: center;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.theme-toggle-icon {
  display: inline-flex;
  line-height: 1;
  transform-origin: center;
}

.theme-toggle .theme-sun {
  display: none;
}

:root[data-resolved-theme="dark"] .theme-toggle .theme-sun {
  display: inline;
}

:root[data-resolved-theme="dark"] .theme-toggle .theme-moon {
  display: none;
}

.theme-toggle.is-switching {
  animation: theme-toggle-pop 420ms ease;
}

.theme-toggle.is-switching .theme-toggle-icon {
  animation: theme-icon-spin 420ms ease;
}

@keyframes theme-toggle-pop {
  0%,
  100% {
    transform: scale(1);
  }
  45% {
    transform: scale(0.92);
  }
  72% {
    transform: scale(1.06);
  }
}

@keyframes theme-icon-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(180deg);
  }
}

.page {
  flex: 1 0 auto;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 64px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  align-items: end;
  gap: 32px;
  min-height: 260px;
  padding: 24px 0 44px;
}

.eyebrow,
.meta {
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.intro h1,
.post-head h1,
.admin-panel h1 {
  max-width: 760px;
  margin: 8px 0 16px;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 7vw, 5rem);
  font-weight: 500;
  line-height: 1.02;
}

.intro-copy,
.post-head p,
.admin-panel p {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.search input,
.editor input,
.editor textarea,
.editor select,
.admin-filter input,
.admin-filter select,
.comment-form input,
.comment-form textarea,
.access-lock input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  color: var(--ink);
  outline: none;
}

.search input {
  border-color: transparent;
  padding: 10px 12px;
}

.search input:focus,
.editor input:focus,
.editor textarea:focus,
.editor select:focus,
.admin-filter input:focus,
.admin-filter select:focus,
.comment-form input:focus,
.comment-form textarea:focus,
.access-lock input:focus {
  border-color: var(--accent);
}

.field-invalid {
  border: 1px solid var(--field-error-border) !important;
  box-shadow: 0 0 0 3px var(--field-error-ring);
}

.field-error {
  display: block;
  color: var(--danger-text);
  font-size: 0.84rem;
  font-weight: 700;
}

.markdown-pane > .field-error {
  padding: 0 18px 14px;
  background: var(--control);
}

.note-compose-main > .field-error {
  margin-top: -6px;
}

.shake {
  animation: shake-field 260ms ease-in-out;
}

@keyframes shake-field {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-5px);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}

button,
.read-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent-deep);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

button:hover,
.read-more:hover {
  background: var(--button-hover);
}

.nav-form button,
.theme-toggle {
  min-height: auto;
  padding: 7px 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: inherit;
}

.nav-form button:hover,
.theme-toggle:hover {
  background: var(--paper-soft);
  color: var(--ink);
}

.ghost-button,
.danger-button,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 13px;
  border-radius: 8px;
  font-weight: 700;
}

.ghost-button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.ghost-button:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}

.danger-button {
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger-text);
}

.danger-button:hover {
  background: var(--danger-hover);
}

.text-link {
  min-height: auto;
  padding: 0;
  color: var(--accent-deep);
}

.result-note {
  margin: 0 0 18px;
  color: var(--muted);
}

.feed {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.tweet-card {
  grid-column: span 6;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--soft-shadow);
}

.tweet-avatar,
.note-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: var(--accent-deep);
  color: #fff;
  font-weight: 800;
}

.tweet-main {
  min-width: 0;
}

.tweet-text {
  display: block;
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.65;
}

a.tweet-text:hover {
  color: var(--accent-deep);
}

.tweet-media {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  overflow: hidden;
  margin-top: 12px;
  border-radius: 8px;
}

.tweet-media.media-count-1 {
  display: block;
  max-width: 480px;
}

.tweet-media img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.tweet-media.media-count-1 img {
  aspect-ratio: 16 / 10;
}

.tweet-actions {
  display: flex;
  gap: 18px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.tweet-actions a:hover {
  color: var(--accent-deep);
}

.locked-teaser {
  color: var(--muted);
  font-weight: 700;
}

.feed-card {
  grid-column: span 6;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--card-shadow);
}

.feed-card.note {
  grid-column: span 4;
}

.feed-card.album {
  grid-column: span 8;
}

.cover-link {
  display: block;
}

.cover {
  width: 100%;
  aspect-ratio: 16 / 8.5;
  object-fit: cover;
}

.card-body {
  padding: 24px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.card-body h2 {
  margin: 0 0 10px;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 500;
  line-height: 1.18;
}

.card-body h2 a:hover {
  color: var(--accent-deep);
}

.card-body p {
  margin: 0 0 20px;
  color: var(--muted);
}

.thumb-grid,
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 18px 0 22px;
}

.thumb-grid img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
}

.empty {
  grid-column: 1 / -1;
  padding: 42px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.empty h2 {
  margin: 0 0 8px;
  color: var(--ink);
}

.detail-page {
  max-width: 900px;
}

.post {
  padding: clamp(24px, 6vw, 56px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.tweet-detail {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 16px;
}

.tweet-detail .tweet-avatar {
  width: 52px;
  height: 52px;
}

.tweet-detail .tweet-text {
  font-size: 1.08rem;
}

.post-cover {
  width: 100%;
  max-height: 520px;
  margin: 32px 0;
  border-radius: 8px;
  object-fit: cover;
}

.post-body {
  color: var(--post-body);
  font-size: 1.08rem;
}

.gallery {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 32px;
}

.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  object-fit: cover;
}

.comments {
  margin-top: 28px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.access-lock {
  display: grid;
  place-items: center;
  min-height: min(620px, calc(100vh - 180px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(var(--lock-overlay), var(--lock-overlay)),
    var(--paper-soft);
}

.access-lock-panel {
  display: grid;
  gap: 14px;
  width: min(440px, 100%);
  padding: clamp(24px, 5vw, 38px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.access-lock-panel h1 {
  margin: 0;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 500;
  line-height: 1.08;
}

.access-lock-panel p {
  margin: 0;
  color: var(--muted);
}

.access-lock-panel label,
.check-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.comments-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.comments h2 {
  margin: 0;
  font-size: 1.3rem;
}

.comments-head span,
.muted {
  color: var(--muted);
}

.comment-list {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}

.comment {
  padding: 16px;
  border-radius: 8px;
  background: var(--paper-soft);
}

.comment div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.comment p {
  margin: 8px 0 0;
}

.comment-form,
.editor {
  display: grid;
  gap: 14px;
}

.compose-form {
  display: grid;
  gap: 18px;
}

.comment-form input,
.comment-form textarea,
.access-lock input,
.editor input,
.editor textarea,
.editor select,
.compose-meta input,
.compose-meta select,
.compose-extra textarea {
  padding: 11px 12px;
}

.admin-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(320px, 1fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: start;
}

.admin-page {
  max-width: 1380px;
}

.compose-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0 28px;
}

.compose-head h1 {
  max-width: 760px;
  margin: 8px 0 14px;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 500;
  line-height: 1.02;
}

.compose-head p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
}

.compose-meta,
.compose-extra,
.article-fields,
.compose-actions {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.compose-meta {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.article-fields {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.72fr);
}

.compose-meta label,
.compose-extra label,
.article-fields label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.check-field {
  align-self: end;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 43px;
  padding: 10px 0;
}

.check-field input {
  width: auto;
  min-width: 0;
}

.check-field input:disabled + span {
  opacity: 0.48;
}

.compose-meta input,
.compose-meta select,
.article-fields input,
.compose-extra textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  color: var(--ink);
  outline: none;
}

.compose-meta input:focus,
.compose-meta select:focus,
.article-fields input:focus,
.compose-extra textarea:focus,
.markdown-input:focus,
.note-input:focus {
  border-color: var(--accent);
}

.markdown-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  min-height: 680px;
}

.markdown-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.pane-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.mini-button {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 0.86rem;
}

.markdown-input {
  width: 100%;
  min-height: 640px;
  height: 100%;
  padding: 18px;
  border: 0;
  border-radius: 0;
  background: var(--control);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 1rem;
  line-height: 1.7;
  outline: none;
  resize: vertical;
}

.markdown-preview {
  min-height: 640px;
  padding: 24px;
  overflow: auto;
  background: var(--control);
}

.markdown-preview p:first-child,
.post-body p:first-child {
  margin-top: 0;
}

.markdown-preview img,
.post-body img {
  max-width: 100%;
  border-radius: 8px;
}

.markdown-preview pre,
.post-body pre {
  overflow-x: auto;
  padding: 14px;
  border-radius: 8px;
  background: var(--paper-soft);
}

.markdown-preview code,
.post-body code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.note-workbench {
  display: block;
}

.album-workbench {
  display: block;
}

.album-panel {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.album-fields {
  display: grid;
  grid-template-columns: minmax(220px, 0.5fr) minmax(260px, 1fr);
  gap: 14px;
}

.album-fields label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.album-fields input,
.album-fields textarea {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  color: var(--ink);
  outline: none;
}

.album-fields input:focus,
.album-fields textarea:focus {
  border-color: var(--accent);
}

.album-upload {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
}

.album-image-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  min-height: 160px;
  padding: 14px;
}

.album-image-item {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.album-image-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.album-image-item button {
  position: absolute;
  right: 8px;
  top: 8px;
  min-height: 30px;
  padding: 4px 9px;
  background: var(--overlay-control);
  font-size: 0.82rem;
}

.note-compose-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.note-compose-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.note-input {
  width: 100%;
  min-height: 220px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.65;
  outline: none;
  resize: vertical;
}

.note-image-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.note-image-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.note-image-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--control);
}

.note-image-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.note-image-item button {
  position: absolute;
  right: 8px;
  top: 8px;
  min-height: 30px;
  padding: 4px 9px;
  background: var(--overlay-control);
  font-size: 0.82rem;
}

.login-page {
  display: grid;
  place-items: center;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(300px, 420px);
  gap: clamp(28px, 6vw, 72px);
  align-items: start;
  width: min(860px, 100%);
}

.login-panel h1 {
  margin: 8px 0 16px;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 7vw, 4.4rem);
  font-weight: 500;
  line-height: 1.02;
}

.login-panel p {
  margin: 0;
  color: var(--muted);
}

.login-form {
  width: 100%;
}

.admin-list-page {
  max-width: 1180px;
}

.admin-list-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0 30px;
}

.admin-list-head h1 {
  margin: 8px 0 10px;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 500;
  line-height: 1.04;
}

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

.admin-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px 160px auto;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--soft-shadow);
}

.admin-filter input,
.admin-filter select {
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  color: var(--ink);
}

.content-table {
  display: grid;
  gap: 12px;
}

.content-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.content-main h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  line-height: 1.3;
}

.content-main h2 a:hover {
  color: var(--accent-deep);
}

.content-main p {
  margin: 0;
  color: var(--muted);
}

.content-actions,
.editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.content-actions form {
  margin: 0;
}

.editor {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.editor label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.flash {
  display: inline-flex;
  margin: 18px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--success-bg);
  color: var(--accent-deep);
}

.error-note {
  display: inline-flex;
  margin: 18px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger-text);
}

.site-footer {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.site-footer a:hover {
  color: var(--accent-deep);
}

@media (max-width: 880px) {
  .site-header,
  .intro,
  .admin-panel,
  .compose-head,
  .login-panel,
  .admin-list-head,
  .content-row {
    grid-template-columns: 1fr;
  }

  .site-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .site-header .nav {
    justify-content: flex-start;
  }

  .feed-card,
  .feed-card.note,
  .feed-card.album,
  .tweet-card {
    grid-column: 1 / -1;
  }

  .admin-list-head {
    display: grid;
    align-items: start;
  }

  .compose-head {
    display: grid;
    align-items: start;
  }

  .compose-meta {
    grid-template-columns: 1fr 1fr;
  }

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

  .markdown-workbench {
    grid-template-columns: 1fr;
  }

  .album-fields {
    grid-template-columns: 1fr;
  }

  .admin-filter {
    grid-template-columns: 1fr 1fr;
  }

  .content-actions {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.theme-animating,
  html.theme-animating *,
  .theme-toggle,
  .theme-toggle-icon {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 560px) {
  .page {
    width: min(100% - 24px, 1120px);
    padding-top: 24px;
  }

  .intro {
    min-height: auto;
    padding-top: 10px;
  }

  .intro h1,
  .post-head h1,
  .admin-panel h1,
  .compose-head h1 {
    font-size: 2.15rem;
  }

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

  .admin-filter {
    grid-template-columns: 1fr;
  }

  .compose-meta {
    grid-template-columns: 1fr;
  }

  .markdown-workbench,
  .markdown-input,
  .markdown-preview {
    min-height: 460px;
  }

  .tweet-card,
  .tweet-detail,
  .note-compose-card {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 11px;
  }

  .tweet-avatar,
  .note-avatar,
  .tweet-detail .tweet-avatar {
    width: 38px;
    height: 38px;
  }

  .card-body,
  .post,
  .comments,
  .editor,
  .compose-meta,
  .compose-extra,
  .article-fields,
  .compose-actions,
  .album-panel {
    padding: 18px;
  }
}
