/* ==========================================================================
   创意库 · 视觉样式
   ========================================================================== */

:root {
  color-scheme: light;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "STSong", "Noto Serif SC",
    "Source Han Serif SC", "SimSun", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --paper: #f4efe4;
  --paper-2: #ece4d4;
  --surface: #fffdf7;
  --surface-2: #faf5ea;
  --ink: #211d17;
  --ink-2: #3b342b;
  --muted: #857a69;
  --line: #e2d8c6;
  --line-strong: #cfc1aa;
  --accent: #b1441f;
  --accent-2: #8e3417;
  --accent-soft: #f2e0d3;
  --gold: #b8873b;
  --ok: #3e7a54;
  --danger: #a92a21;
  --danger-soft: #f7e2df;
  --shadow-sm: 0 1px 2px rgba(64, 46, 24, 0.05), 0 6px 18px rgba(64, 46, 24, 0.045);
  --shadow-md: 0 18px 44px rgba(64, 46, 24, 0.13), 0 3px 10px rgba(64, 46, 24, 0.06);
  --shadow-lg: 0 40px 90px rgba(46, 32, 16, 0.24), 0 10px 30px rgba(46, 32, 16, 0.12);
  --radius: 16px;
  --sidebar-w: 272px;
  --content-max: 1280px;
}

[hidden] {
  display: none !important;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141210;
  --paper-2: #1b1814;
  --surface: #211d18;
  --surface-2: #191612;
  --ink: #f1e9db;
  --ink-2: #d8cdbc;
  --muted: #9c907e;
  --line: #332c23;
  --line-strong: #4a4033;
  --accent: #e07a4c;
  --accent-2: #f19a70;
  --accent-soft: #3a2419;
  --gold: #d2a35c;
  --ok: #7fbd94;
  --danger: #e0655b;
  --danger-soft: #3a1e1b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 20px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 18px 44px rgba(0, 0, 0, 0.5), 0 3px 10px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 40px 90px rgba(0, 0, 0, 0.7), 0 10px 30px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --paper: #141210;
    --paper-2: #1b1814;
    --surface: #211d18;
    --surface-2: #191612;
    --ink: #f1e9db;
    --ink-2: #d8cdbc;
    --muted: #9c907e;
    --line: #332c23;
    --line-strong: #4a4033;
    --accent: #e07a4c;
    --accent-2: #f19a70;
    --accent-soft: #3a2419;
    --gold: #d2a35c;
    --ok: #7fbd94;
    --danger: #e0655b;
    --danger-soft: #3a1e1b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 20px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 18px 44px rgba(0, 0, 0, 0.5), 0 3px 10px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 40px 90px rgba(0, 0, 0, 0.7), 0 10px 30px rgba(0, 0, 0, 0.4);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 10% -8%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 65%),
    radial-gradient(820px 520px at 100% 0%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 62%);
}

body.modal-open {
  overflow: hidden;
}

::selection {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
}

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

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

mark {
  background: color-mix(in srgb, var(--gold) 34%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1;
}

.icon {
  flex: 0 0 auto;
  display: block;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

/* ------------------------------ 按钮 ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff9f2;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 24%, transparent);
}

.btn--primary:hover {
  border-color: var(--accent-2);
  background: var(--accent-2);
  color: #fff9f2;
}

.btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.btn--ghost:hover {
  border-color: transparent;
  background: var(--surface-2);
  color: var(--ink);
}

.btn--danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.btn--danger:hover {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 86%, #000);
  color: #fff;
}

.btn--danger-text {
  color: var(--danger);
}

.btn--full {
  width: 100%;
}

.btn--lg {
  height: 50px;
  border-radius: 13px;
  font-size: 15px;
}

.btn--sm {
  height: 32px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 13px;
}

.btn[disabled] {
  opacity: 0.62;
  cursor: default;
  transform: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.icon-btn:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.icon-btn--frost {
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--ink-2);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(30, 20, 10, 0.08);
}

.icon-btn--frost:hover {
  background: var(--surface);
  color: var(--ink);
}

.icon-btn--light {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.icon-btn--light:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

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

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------ 表单 ------------------------------ */

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field__label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.field__label em {
  color: var(--accent);
  font-style: normal;
}

.field__label--row {
  justify-content: space-between;
}

.field__hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
}

.field--flush {
  gap: 5px;
}

.field--grow {
  flex: 1;
}

.input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14.5px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input::placeholder,
.textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 72%, transparent);
}

.input:hover {
  border-color: var(--line-strong);
}

.input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.input--title {
  height: auto;
  padding: 6px 2px 10px;
  border: 0;
  border-bottom: 1px dashed var(--line-strong);
  border-radius: 0;
  background: transparent;
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.input--title:focus {
  border-bottom-color: var(--accent);
  box-shadow: none;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap > .icon {
  position: absolute;
  left: 12px;
  color: var(--muted);
  pointer-events: none;
}

.input--with-icon {
  padding-left: 38px;
}

.input-reveal {
  position: absolute;
  right: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}

.input-reveal:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.input--code {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}

.textarea {
  min-height: 150px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.8;
  resize: vertical;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.form-error {
  margin: 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.badge--pending {
  background: color-mix(in srgb, var(--gold) 20%, transparent);
  color: color-mix(in srgb, var(--gold) 82%, var(--ink));
}

.badge--error {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ------------------------------ 应用骨架 ------------------------------ */

.shell {
  display: flex;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex: 0 0 var(--sidebar-w);
  flex-direction: column;
  width: var(--sidebar-w);
  height: 100dvh;
  padding: 26px 20px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 48%, transparent), transparent 46%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
  user-select: none;
}

.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}

.brand__text {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.brand__edition {
  margin-left: auto;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.sidebar__new {
  width: 100%;
  justify-content: flex-start;
}

.sidebar__new kbd {
  margin-left: auto;
  border-color: color-mix(in srgb, #fff 26%, transparent);
  background: color-mix(in srgb, #fff 12%, transparent);
  color: color-mix(in srgb, #fff 72%, transparent);
}

.filters {
  display: grid;
  gap: 3px;
  margin-top: 10px;
}

.filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease;
}

.filter:hover {
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.filter.is-active {
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
}

.filter__count {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.filter.is-active .filter__count {
  color: color-mix(in srgb, var(--paper) 62%, transparent);
}

.sidebar__note {
  margin-top: 18px;
  padding: 15px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface-2) 74%, transparent);
}

.sidebar__note-title {
  margin: 0 0 5px;
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.sidebar__note-text {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.sidebar__spacer {
  flex: 1;
}

.sidebar__stats {
  padding: 0 4px 12px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.sidebar__bottom {
  display: grid;
  gap: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.side-action {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  text-align: left;
}

.side-action:hover {
  background: var(--surface);
  color: var(--ink);
}

.side-action .icon {
  color: var(--muted);
}

.account {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin-top: 4px;
  padding: 9px 8px 2px;
  border: 0;
  background: transparent;
  text-align: left;
}

.account:hover .avatar {
  border-color: var(--accent);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
}

.account__meta {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.account__meta strong {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account__meta small {
  color: var(--muted);
  font-size: 10px;
}

.account > .icon {
  color: var(--muted);
}

.main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 44px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.1);
}

.topbar__heading {
  min-width: 0;
}

.topbar h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.topbar__sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

.topbar__tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 330px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.search input::-webkit-search-cancel-button {
  display: none;
}

.search__kbd {
  flex: 0 0 auto;
}

.search__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--muted);
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.sync-pill:hover {
  border-color: var(--line-strong);
  color: var(--ink-2);
}

.sync-pill__dot,
.sync-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}

.sync-pill--ok .sync-pill__dot,
.sync-dot.is-ok {
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 14%, transparent);
}

.sync-pill--syncing .sync-pill__dot {
  background: var(--gold);
  animation: pulse 1.2s ease-in-out infinite;
}

.sync-pill--error .sync-pill__dot,
.sync-dot.is-error {
  background: var(--danger);
}

.sync-pill--offline .sync-pill__dot,
.sync-dot.is-offline {
  background: var(--muted);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.offline-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 44px -4px;
  padding: 9px 14px;
  border: 1px solid color-mix(in srgb, var(--gold) 26%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  color: color-mix(in srgb, var(--gold) 70%, var(--ink));
  font-size: 12px;
}

.content {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 26px 44px 90px;
}

.only-mobile {
  display: none;
}

.scrim {
  display: none;
}

.fab {
  display: none;
}

.boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  gap: 2px;
  text-align: center;
}

.boot-mark {
  width: 62px;
  height: 62px;
  margin-bottom: 14px;
  color: var(--accent);
  animation: float 3.2s ease-in-out infinite;
}

.boot-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: 0.16em;
}

.boot-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.noscript {
  padding: 20px;
  text-align: center;
}

/* ------------------------------ 时间线 ------------------------------ */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 38px;
}

.month {
  min-width: 0;
}

.month__head {
  position: sticky;
  top: 98px;
  z-index: 6;
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  padding: 6px 0 10px;
  background: linear-gradient(180deg, var(--paper) 74%, transparent);
}

.month__head h2 {
  margin: 0;
  color: var(--ink-2);
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.month__count {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.month__line {
  flex: 1;
  height: 1px;
  margin-bottom: 4px;
  background: var(--line);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.28s ease, border-color 0.28s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--paper-2);
}

.card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(30, 20, 10, 0) 55%, rgba(30, 20, 10, 0.28));
  pointer-events: none;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.card:hover .card__media img {
  transform: scale(1.035);
}

.card__date,
.card__imgcount {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 23px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(28, 20, 12, 0.55);
  color: rgba(255, 250, 242, 0.94);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
}

.card__date {
  bottom: 11px;
  left: 11px;
}

.card__imgcount {
  top: 11px;
  right: 11px;
}

.card__rule {
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--gold) 70%, transparent);
  opacity: 0.62;
}

.card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 15px 18px 14px;
}

.card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 20px;
}

.card__date-inline {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.03em;
}

.card__title {
  display: -webkit-box;
  overflow: hidden;
  margin: 7px 0 7px;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.card__insight {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.78;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.card__insight--empty {
  color: color-mix(in srgb, var(--muted) 62%, transparent);
  font-style: italic;
}

.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 10.5px;
}

.card__link,
.card__images {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.card__link span {
  overflow: hidden;
  max-width: 200px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card__foot-empty {
  color: color-mix(in srgb, var(--gold) 55%, transparent);
  font-size: 11px;
}

.card__actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.card:hover .card__actions,
.card:focus-within .card__actions {
  opacity: 1;
  transform: none;
}

.card.is-pending {
  border-color: color-mix(in srgb, var(--gold) 40%, var(--line));
}

/* ------------------------------ 空状态 ------------------------------ */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 540px;
  margin: 40px auto 0;
  padding: 40px 24px 30px;
  text-align: center;
}

.empty__illustration {
  width: min(260px, 70vw);
  height: auto;
  margin-bottom: 22px;
  opacity: 0.95;
}

.empty h2 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.empty p {
  max-width: 380px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.empty--filtered {
  padding-top: 70px;
}

.empty__art {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin-bottom: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
}

/* ------------------------------ 弹层基础 ------------------------------ */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(26, 18, 10, 0.46);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.overlay.is-open {
  opacity: 1;
}

.modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(720px, 94vw);
  max-height: 92dvh;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(0.99);
  opacity: 0.65;
  transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.22s ease;
}

.overlay.is-open .modal {
  transform: none;
  opacity: 1;
}

.modal--confirm {
  width: min(440px, 92vw);
}

.confirm {
  padding: 26px 26px 22px;
}

.confirm__title {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
}

.confirm__message {
  margin: 0 0 6px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.75;
}

.confirm__detail {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.confirm__actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

/* ------------------------------ 详情 ------------------------------ */

.modal--detail {
  width: min(1080px, 94vw);
}

.detail {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  height: min(740px, 88dvh);
}

.modal--detail-text {
  width: min(760px, 94vw);
}

.modal--detail-text .detail {
  display: block;
  height: auto;
  max-height: 88dvh;
  overflow-y: auto;
}

.detail__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 6;
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(30, 20, 10, 0.1);
}

.detail__gallery {
  min-width: 0;
  min-height: 0;
  padding: 14px;
  border-right: 1px solid var(--line);
  background: var(--paper-2);
}

.gallery {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 10px;
}

.gallery__stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 6%, var(--paper-2));
}

.gallery__stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
}

.gallery__nav {
  position: absolute;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(26, 18, 10, 0.5);
  color: #fff;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
}

.gallery__nav:hover {
  background: rgba(26, 18, 10, 0.72);
}

.gallery__nav--prev {
  left: 12px;
}

.gallery__nav--next {
  right: 12px;
}

.gallery__counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(26, 18, 10, 0.55);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
}

.gallery__thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.gallery__thumb {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 9px;
  background: var(--surface);
  opacity: 0.65;
}

.gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__thumb.is-active {
  border-color: var(--accent);
  opacity: 1;
}

.detail__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 42px 38px 28px;
  overflow-y: auto;
}

.modal--detail-text .detail__body {
  padding: 54px 48px 40px;
}

.detail__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.detail__title {
  margin: 14px 0 18px;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.detail__insight {
  margin: 0 0 26px;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.98;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail__noinsight {
  margin: 0 0 26px;
  color: color-mix(in srgb, var(--muted) 72%, transparent);
  font-size: 13.5px;
  font-style: italic;
  line-height: 1.9;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.link-card:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 42%, var(--surface-2));
}

.link-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}

.link-card__meta {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.45;
}

.link-card__meta strong {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-card__meta small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-card > .icon {
  color: var(--muted);
}

.detail__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px dashed var(--line);
}

.detail__dates {
  color: var(--muted);
  font-size: 10.5px;
}

.detail__actions {
  display: flex;
  gap: 8px;
}

.modal--detail-text .detail__foot {
  margin-top: 40px;
}

/* ------------------------------ 大图 ------------------------------ */

.overlay:has(.modal--lightbox) {
  padding: 0;
  background: rgba(8, 7, 6, 0.96);
  backdrop-filter: blur(8px);
}

.modal--lightbox {
  width: 100vw;
  height: 100dvh;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.lightbox {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: #f6efe3;
}

.lightbox__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent);
}

.lightbox__title {
  overflow: hidden;
  max-width: 60vw;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox__counter {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.lightbox__stage {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 12px 20px 26px;
}

.lightbox__stage img {
  max-width: 92vw;
  max-height: 82dvh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
}

.lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.18);
}

.lightbox__nav[data-lightbox="prev"] {
  left: 22px;
}

.lightbox__nav[data-lightbox="next"] {
  right: 22px;
}

/* ------------------------------ 编辑器 ------------------------------ */

.modal--editor {
  width: min(780px, 94vw);
}

.editor {
  display: flex;
  flex-direction: column;
  max-height: 92dvh;
}

.editor__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 26px 16px;
  border-bottom: 1px solid var(--line);
}

.editor__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.editor__body {
  display: grid;
  gap: 20px;
  padding: 22px 26px 24px;
  overflow-y: auto;
}

.editor__row {
  display: flex;
  gap: 16px;
}

.editor__row > .field:first-child {
  flex: 0 0 168px;
}

.editor__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 26px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.editor__foot-actions {
  display: flex;
  gap: 8px;
}

.dropzone {
  width: 100%;
  min-height: 104px;
  padding: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.dropzone.is-dragging {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 58%, var(--surface-2));
}

.dropzone__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 82px;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

.dropzone__empty u {
  color: var(--accent);
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  width: 100%;
}

.thumbs:empty {
  display: none;
}

.thumb {
  position: relative;
  aspect-ratio: 1;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb__badge {
  position: absolute;
  left: 5px;
  bottom: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(28, 20, 12, 0.6);
  color: #fff;
  font-size: 9px;
  backdrop-filter: blur(6px);
}

.thumb__tools {
  position: absolute;
  top: 5px;
  right: 5px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.thumb:hover .thumb__tools,
.thumb:focus-within .thumb__tools {
  opacity: 1;
}

.thumb__tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(24, 17, 10, 0.62);
  color: #fff;
  backdrop-filter: blur(6px);
}

.thumb__tool:hover {
  background: rgba(24, 17, 10, 0.85);
}

.thumb--loading {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

/* ------------------------------ 设置 ------------------------------ */

.modal--settings {
  width: min(720px, 94vw);
}

.settings {
  display: flex;
  flex-direction: column;
  max-height: 92dvh;
}

.settings__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--line);
}

.settings__head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.settings__body {
  padding: 2px 28px 28px;
  overflow-y: auto;
}

.panel {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.panel:last-child {
  border-bottom: 0;
}

.panel h3 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.panel__row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.panel__row .field {
  flex: 1;
}

.panel__hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.panel__status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  font-size: 13px;
}

.panel--danger h3 {
  color: var(--danger);
}

.panel--about p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.details {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.details summary {
  padding: 4px 0;
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
}

.details summary::marker {
  color: var(--muted);
}

.details__body {
  display: grid;
  gap: 10px;
  padding: 10px 0 4px;
}

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.segmented button {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
}

.segmented button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ------------------------------ 登录 / 初始化 ------------------------------ */

.auth {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  min-height: 100dvh;
}

.auth__panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 32px clamp(24px, 6vw, 76px) 22px;
  background: var(--paper);
}

.brand--auth {
  margin-bottom: 0;
}

.auth__inner {
  width: min(420px, 100%);
  margin: auto;
  padding: 38px 0;
}

.auth__title {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: clamp(32px, 3.6vw, 46px);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.26;
}

.auth__lead {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.9;
}

.auth__form {
  display: grid;
  gap: 15px;
}

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

.auth__hello strong {
  color: var(--ink);
  font-weight: 500;
}

.auth__foot {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.8;
}

.auth__copy {
  margin: auto 0 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.auth__aside {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 42px;
  overflow: hidden;
  padding: clamp(30px, 5vw, 72px);
  background: linear-gradient(150deg, #2b1e14 0%, #45291b 52%, #1c1410 100%);
  color: #f7eee0;
}

.auth__aside::before {
  content: "";
  position: absolute;
  inset: -20%;
  pointer-events: none;
  background:
    radial-gradient(420px 320px at 78% 18%, rgba(224, 140, 80, 0.38), transparent 70%),
    radial-gradient(520px 420px at 8% 92%, rgba(184, 135, 59, 0.24), transparent 70%);
}

.auth__stack {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(310px, 86%);
}

.stack-card {
  position: relative;
  padding: 16px 18px;
  border: 1px solid rgba(255, 244, 224, 0.16);
  border-radius: 14px;
  background: rgba(255, 244, 224, 0.075);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
}

.stack-card span {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 244, 224, 0.45);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.stack-card strong {
  display: block;
  margin-bottom: 3px;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.stack-card p {
  margin: 0;
  color: rgba(255, 244, 224, 0.58);
  font-size: 11px;
  line-height: 1.7;
}

.stack-card--1 {
  transform: rotate(-6deg);
}

.stack-card--2 {
  margin-top: -4px;
  margin-left: 44px;
  transform: rotate(2.5deg);
}

.stack-card--3 {
  margin-top: -4px;
  margin-left: 14px;
  transform: rotate(-1.5deg);
}

.auth__aside blockquote {
  position: relative;
  margin: 0;
  color: rgba(255, 246, 232, 0.82);
  font-family: var(--font-serif);
  font-size: clamp(18px, 1.7vw, 22px);
  line-height: 1.8;
  letter-spacing: 0.03em;
}

.auth__aside-note {
  position: absolute;
  left: clamp(30px, 5vw, 72px);
  bottom: 26px;
  margin: 0;
  color: rgba(255, 244, 224, 0.32);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ------------------------------ 轻提示 ------------------------------ */

.toast-root {
  position: fixed;
  bottom: calc(22px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(560px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding: 11px 12px 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 13px;
  background: #26211b;
  color: #f6efe3;
  box-shadow: 0 18px 40px rgba(20, 12, 6, 0.32);
  font-size: 12.5px;
  line-height: 1.55;
  pointer-events: auto;
  animation: toastIn 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

.toast__icon {
  display: inline-flex;
  color: #e9c98f;
}

.toast--ok .toast__icon {
  color: #8fd0a4;
}

.toast--warn .toast__icon {
  color: #e6bd73;
}

.toast--error .toast__icon {
  color: #f08a80;
}

.toast__text {
  flex: 1;
  min-width: 0;
}

.toast__action {
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 11.5px;
  white-space: nowrap;
}

.toast__action:hover {
  background: rgba(255, 255, 255, 0.22);
}

.toast__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
}

.toast__close:hover {
  color: #fff;
}

/* ------------------------------ 进度 / 恢复 / 恢复码 / 安装 ------------------------------ */

.modal--progress {
  width: min(440px, 92vw);
}

.progress {
  padding: 28px;
}

.progress h2 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
}

.progress__label {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12.5px;
}

.progress__track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-2);
}

.progress__bar {
  width: 8%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 0.3s ease;
}

.progress__bar.is-error {
  background: var(--danger);
}

.progress__error {
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.7;
}

.progress__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.modal--restore {
  width: min(560px, 94vw);
}

.restore {
  padding: 24px 26px 22px;
  overflow-y: auto;
}

.restore__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.restore__head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
}

.restore__summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

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

.restore__summary strong {
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restore__summary span {
  color: var(--muted);
  font-size: 10px;
}

.restore__modes {
  display: grid;
  gap: 8px;
}

.mode-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  text-align: left;
}

.mode-card:hover {
  border-color: var(--line-strong);
}

.mode-card.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 42%, var(--surface));
}

.mode-card__radio {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
}

.mode-card.is-active .mode-card__radio {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--surface);
}

.mode-card strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.mode-card small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  color: var(--ink-2);
  font-size: 12px;
}

.checkline input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.restore__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.modal--recovery {
  width: min(520px, 92vw);
}

.recovery {
  padding: 30px 28px 26px;
}

.recovery h2 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 600;
}

.recovery__lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.code-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
}

.code-box code {
  flex: 1;
  font-size: 15px;
  letter-spacing: 0.12em;
  overflow-wrap: anywhere;
}

.recovery__actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
}

.recovery__hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.modal--install {
  width: min(600px, 94vw);
}

.install-help {
  padding: 28px;
  overflow-y: auto;
}

.install-help__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.install-help__head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
}

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

.steps li {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.steps__num {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.steps p {
  margin: 0;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.75;
}

.install-help__note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.install-help__meta {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  text-align: center;
}

/* ------------------------------ 失败页 ------------------------------ */

.center-screen {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
}

.center-card {
  width: min(420px, 100%);
  padding: 34px 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.center-card__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.center-card h1 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 24px;
}

.center-card p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

/* ------------------------------ 响应式 ------------------------------ */

@media (max-width: 1180px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(262px, 1fr));
  }

  .search {
    width: 280px;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 70;
    height: 100dvh;
    transform: translateX(-102%);
    border-right: 1px solid var(--line);
    background: var(--paper);
    box-shadow: var(--shadow-lg);
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .nav-open .sidebar {
    transform: none;
  }

  .nav-open .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(20, 14, 8, 0.42);
    backdrop-filter: blur(2px);
  }

  .topbar {
    padding: 18px 24px 14px;
  }

  .topbar h1 {
    font-size: 25px;
  }

  .content {
    padding: 20px 24px 90px;
  }

  .offline-bar {
    margin: 12px 24px -4px;
  }

  .only-mobile {
    display: inline-flex;
  }

  .detail {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 44%) 1fr;
    height: 90dvh;
  }

  .detail__gallery {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .month__head {
    top: 82px;
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
    gap: 9px 10px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 12px;
  }

  .topbar__heading {
    order: 2;
    flex: 1;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .topbar__sub {
    font-size: 10.5px;
  }

  .topbar__tools {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .search {
    flex: 1;
    width: auto;
  }

  .sync-pill {
    flex: 0 1 auto;
    max-width: 46%;
    padding: 0 9px;
  }

  .sync-pill span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .content {
    padding: 14px 16px 112px;
  }

  .offline-bar {
    margin: 10px 16px -4px;
  }

  .month__head {
    position: static;
    padding-top: 0;
    background: none;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .sidebar {
    width: min(86vw, 320px);
  }

  .fab {
    position: fixed;
    right: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 40;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    color: #fff9f2;
    box-shadow: 0 14px 30px rgba(140, 60, 25, 0.34);
  }

  .fab:active {
    transform: scale(0.96);
  }

  .overlay {
    padding: 16px;
    align-items: flex-end;
  }

  .modal {
    width: 100%;
    max-height: calc(100dvh - 32px);
    border-radius: 18px;
  }

  .modal--editor,
  .modal--settings,
  .modal--detail,
  .modal--lightbox {
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .modal--editor,
  .modal--settings {
    background: var(--surface);
  }

  .modal--confirm,
  .modal--progress,
  .modal--restore,
  .modal--recovery,
  .modal--install {
    max-height: calc(100dvh - 32px);
    border-radius: 18px;
  }

  .editor,
  .settings {
    height: 100%;
    max-height: 100dvh;
  }

  .editor__head,
  .settings__head {
    padding-top: calc(16px + env(safe-area-inset-top));
  }

  .editor__body {
    padding: 18px;
  }

  .editor__head,
  .editor__foot,
  .settings__head,
  .settings__body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .editor__row {
    flex-direction: column;
    gap: 14px;
  }

  .editor__row > .field:first-child {
    flex: none;
  }

  .editor__foot {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .detail {
    height: 100%;
    grid-template-rows: minmax(0, 40%) 1fr;
  }

  .modal--detail-text .detail {
    display: block;
    height: 100%;
    overflow-y: auto;
  }

  .detail__gallery {
    padding: 10px;
  }

  .detail__body {
    padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  }

  .modal--detail-text .detail__body {
    padding: 64px 22px calc(30px + env(safe-area-inset-bottom));
  }

  .detail__title {
    font-size: 24px;
  }

  .detail__foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-top: 24px;
  }

  .detail__actions {
    width: 100%;
  }

  .detail__actions .btn {
    flex: 1;
  }

  .detail__close {
    top: 10px;
    right: 10px;
  }

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

  .auth__aside {
    display: none;
  }

  .auth__panel {
    padding: calc(18px + env(safe-area-inset-top)) 22px calc(16px + env(safe-area-inset-bottom));
  }

  .auth__inner {
    padding: 22px 0;
  }

  .auth__title {
    font-size: 34px;
  }

  .toast-root {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .toast {
    width: 100%;
  }

  .lightbox__stage {
    padding: 8px 6px 20px;
  }

  .lightbox__stage img {
    max-width: 100vw;
    max-height: 76dvh;
  }

  .lightbox__nav {
    width: 40px;
    height: 40px;
  }

  .lightbox__nav[data-lightbox="prev"] {
    left: 8px;
  }

  .lightbox__nav[data-lightbox="next"] {
    right: 8px;
  }

  .restore__summary {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .restore__summary div {
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
  }

  .recovery__actions {
    flex-direction: column-reverse;
  }

  .recovery__actions .btn {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .search__kbd,
  .sidebar__new kbd {
    display: none;
  }

  .topbar__tools {
    gap: 8px;
  }

  .sync-pill {
    font-size: 10px;
  }

  .card__title {
    font-size: 18px;
  }
}

@media (hover: none) {
  .card__actions {
    opacity: 1;
    transform: none;
  }

  .thumb__tools {
    opacity: 1;
  }
}

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

* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line-strong) 72%, transparent);
  background-clip: padding-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}
