/* ============================================================
   笔记 · 设计系统
   自包含样式，无外部框架依赖
   ============================================================ */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f1f2f5;
  --border: #e4e6eb;
  --border-strong: #cdd1d9;
  --text: #1b1f27;
  --muted: #6b7280;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: rgba(79, 70, 229, .10);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, .09);
  --success: #047857;
  --success-soft: rgba(4, 120, 87, .12);
  --warning: #b45309;
  --warning-soft: rgba(180, 83, 9, .12);
  --topbar-bg: rgba(255, 255, 255, .84);
  --overlay: rgba(15, 18, 25, .46);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow-2: 0 10px 30px rgba(16, 24, 40, .12);
  --ring: 0 0 0 3px rgba(79, 70, 229, .16);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --surface: #1c1f24;
    --surface-2: #23272e;
    --border: #2f343d;
    --border-strong: #414751;
    --text: #e8eaed;
    --muted: #99a0ab;
    --primary: #8b83f5;
    --primary-hover: #9d96f7;
    --primary-soft: rgba(139, 131, 245, .16);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, .14);
    --success: #34d399;
    --success-soft: rgba(52, 211, 153, .14);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, .14);
    --topbar-bg: rgba(28, 31, 36, .84);
    --overlay: rgba(0, 0, 0, .6);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-2: 0 12px 34px rgba(0, 0, 0, .5);
    --ring: 0 0 0 3px rgba(139, 131, 245, .28);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: .55rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: .01em;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
}
.topbar-actions { display: flex; align-items: center; gap: .5rem; }
.user-chip {
  font-size: .78rem;
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 布局 ---------- */
.main {
  max-width: 780px;
  margin: 0 auto;
  padding: 1.4rem 1rem 4rem;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .5rem .85rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .875rem;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .38rem .68rem; font-size: .82rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { border-color: var(--border); background: var(--surface); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); }
.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-xs { padding: .22rem .5rem; font-size: .76rem; border-radius: 6px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.btn.is-loading { color: transparent !important; pointer-events: none; position: relative; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  color: #fff;
  animation: spin .7s linear infinite;
}
.btn-ghost.is-loading::after { color: var(--text); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: .95rem;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.icon-btn.is-loading { pointer-events: none; opacity: .6; }
.icon-btn.is-loading svg { animation: spin .8s linear infinite; }

/* ---------- 表单 ---------- */
.input, .textarea {
  width: 100%;
  padding: .55rem .75rem;
  font: inherit;
  font-size: .9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.input-sm { padding: .38rem .6rem; font-size: .84rem; }
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.62; }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .85; }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }

.field { display: block; margin-bottom: .85rem; }
.field:last-child { margin-bottom: 0; }
.field-label {
  display: block;
  margin-bottom: .3rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .01em;
}
.field-inline { display: flex; align-items: center; gap: .45rem; margin: 0; }
.field-inline .field-label { margin: 0; white-space: nowrap; }
.field-color input[type="color"] {
  width: 34px; height: 32px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}
.row { display: flex; align-items: center; gap: .45rem; }
.row > .input { flex: 1; min-width: 0; }
.hint { font-size: .74rem; color: var(--muted); }
.filebtn { cursor: pointer; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 74vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 100%;
  max-width: 372px;
  padding: 1.75rem 1.5rem 1.35rem;
  text-align: center;
}
.login-mark { color: var(--primary); }
.login-title { margin: .6rem 0 .2rem; font-size: 1.2rem; font-weight: 650; letter-spacing: .01em; }
.login-sub { margin: 0 0 1.5rem; font-size: .83rem; color: var(--muted); }
.login-card .field { text-align: left; }
.login-note { margin: 1.05rem 0 0; font-size: .73rem; color: var(--muted); }
.pw { position: relative; display: block; }
.pw .input { padding-right: 3.6rem; }
.pw-toggle {
  position: absolute;
  right: .4rem;
  top: 50%;
  transform: translateY(-50%);
  padding: .18rem .38rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .74rem;
  cursor: pointer;
}
.pw-toggle:hover { color: var(--primary); background: var(--primary-soft); }

/* ---------- 编辑器 ---------- */
.composer { padding: 1rem; margin-bottom: 1rem; transition: border-color .15s, box-shadow .15s; }
.composer.is-dragover { border-color: var(--primary); box-shadow: var(--ring); }
.composer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: .35rem 0 .15rem;
  font-size: .74rem;
  color: var(--muted);
}
.composer-tools {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-top: .7rem;
}
.composer-tools .btn-primary { margin-left: auto; }

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; }
.toolbar .count { font-size: .76rem; color: var(--muted); white-space: nowrap; }

/* ---------- 列表筛选 ---------- */
.filters { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin: -.35rem 0 .9rem; }
.chip-btn {
  padding: .22rem .62rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: .74rem;
  line-height: 1.5;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.chip-btn:hover { border-color: var(--border-strong); color: var(--text); }
.chip-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.chip-btn.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

/* ---------- 工作区：左列表 / 右详情 ---------- */
/* 必须用 minmax(0,1fr)：1fr 的最小尺寸是 min-content，列表行标题是 nowrap，
   会把整列撑到内容宽度、进而把整页顶出视口（移动端横向滚动条的元凶） */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.list-pane, .detail-pane { min-width: 0; }

@media (min-width: 861px) {
  .main, .topbar-inner { max-width: 1040px; }
  .workspace { grid-template-columns: 336px minmax(0, 1fr); }
  .list-pane {
    position: sticky;
    top: 4.1rem;
    max-height: calc(100vh - 5.6rem);
    overflow-y: auto;
    padding-right: .1rem;
  }
}
@media (max-width: 860px) {
  .workspace.is-detail .list-pane { display: none; }
  .workspace:not(.is-detail) .detail-pane { display: none; }
  .workspace.is-detail .detail-bar { display: flex; }
}
.detail-bar { display: none; margin-bottom: .6rem; }

/* ---------- 列表行 ---------- */
.note-list { display: flex; flex-direction: column; gap: .4rem; }
.note-row {
  --note-tint: transparent;
  --note-accent: var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: .28rem;
  width: 100%;
  padding: .58rem .7rem .58rem .72rem;
  text-align: left;
  font: inherit;
  color: var(--text);
  background-color: var(--surface);
  background-image: linear-gradient(var(--note-tint), var(--note-tint));
  border: 1px solid var(--border);
  border-left: 3px solid var(--note-accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.note-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-1); }
.note-row:focus-visible { outline: none; box-shadow: var(--ring); }
.note-row.is-active { border-color: var(--primary); }
.note-row.is-active .row-title { color: var(--primary); }

.row-title {
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.42;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-meta {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  font-size: .71rem;
  color: var(--muted);
}
.row-atts {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-wrap: wrap;
  font-size: .71rem;
  color: var(--muted);
}
.row-atts .chip {
  padding: 0 .32rem;
  border-radius: 5px;
  background: var(--surface-2);
  white-space: nowrap;
}
.row-atts-size { margin-left: auto; color: var(--muted); }
.tag-mini {
  padding: 0 .35rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
}
.badge-mini {
  padding: 0 .35rem;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-weight: 600;
}
/* 徽章做成可点：列表里是 span，详情里是 button，两者样式保持一致 */
.badge-btn {
  border: 0;
  font-family: inherit;
  line-height: 1.6;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.badge-btn:hover { background: var(--success); color: var(--surface); }

/* ---------- 长文折叠 ---------- */
.collapsible { position: relative; }
.collapsible.is-collapsed {
  max-height: 420px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 58%, rgba(0, 0, 0, 0) 100%);
          mask-image: linear-gradient(to bottom, #000 58%, rgba(0, 0, 0, 0) 100%);
}
.expand-btn {
  display: block;
  width: 100%;
  margin-top: .6rem;
  padding: .42rem .6rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.expand-btn:hover { background: var(--primary-soft); border-color: var(--primary); }
.expand-btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- 笔记卡片 ---------- */
.note {
  --note-tint: transparent;
  --note-accent: var(--border-strong);
  background-color: var(--surface);
  background-image: linear-gradient(var(--note-tint), var(--note-tint));
  border: 1px solid var(--border);
  border-left: 4px solid var(--note-accent);
  border-radius: var(--radius);
  padding: .95rem 1.05rem;
  margin-bottom: .8rem;
  box-shadow: var(--shadow-1);
  transition: box-shadow .18s;
}
.note:hover { box-shadow: var(--shadow-2); }
.note-body { overflow-wrap: anywhere; }
.note-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: .8rem;
  padding-top: .6rem;
  border-top: 1px dashed var(--border);
}
.note-meta {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
  font-size: .75rem;
  color: var(--muted);
}
.note-actions { display: flex; gap: .1rem; flex-wrap: wrap; }
.author { font-weight: 600; color: var(--text); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: .22rem;
  padding: .06rem .45rem;
  border-radius: 999px;
  font-size: .71rem;
  font-weight: 600;
  background: var(--success-soft);
  color: var(--success);
}
.tag {
  display: inline-flex;
  align-items: center;
  margin-top: .5rem;
  padding: .1rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  color: var(--primary);
  background: var(--primary-soft);
}

/* ---------- Markdown 渲染 ---------- */
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 1.1em 0 .5em; line-height: 1.35; font-weight: 650; }
.md h1 { font-size: 1.35rem; }
.md h2 { font-size: 1.18rem; }
.md h3 { font-size: 1.04rem; }
.md p { margin: .6em 0; }
.md ul, .md ol { margin: .6em 0; padding-left: 1.35em; }
.md li { margin: .2em 0; }
.md a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.md code {
  padding: .12em .38em;
  border-radius: 5px;
  background: var(--surface-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
}
.md pre {
  padding: .75rem .9rem;
  margin: .7em 0;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow-x: auto;
}
.md pre code { padding: 0; background: none; font-size: .84em; }
.md blockquote {
  margin: .7em 0;
  padding: .15rem 0 .15rem .8rem;
  border-left: 3px solid var(--border-strong);
  color: var(--muted);
}
.md img { max-width: 100%; border-radius: var(--radius-sm); }
.md table { width: 100%; border-collapse: collapse; margin: .7em 0; font-size: .86rem; }
.md th, .md td { padding: .35rem .55rem; border: 1px solid var(--border); text-align: left; }
.md th { background: var(--surface-2); font-weight: 600; }
.md hr { height: 1px; border: none; background: var(--border); margin: 1.1em 0; }
.md input[type="checkbox"] { margin-right: .35em; }

/* ---------- 附件 ---------- */
.attachments { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .6rem; }
.attachments:empty { display: none; }
.attachment-item {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  max-width: 100%;
  padding: .3rem .5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: .8rem;
}
.attachment-item img, .attachment-item .file-thumb {
  width: 42px; height: 42px;
  flex: none;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-2);
  cursor: zoom-in;
}
.attachment-item .file-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  color: var(--muted);
}
.attachment-item .name {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.name { color: var(--text); text-decoration: none; }
a.name:hover { color: var(--primary); text-decoration: underline; }
.attachment-item .size { color: var(--muted); font-size: .72rem; flex: none; }
.attachment-item .remove {
  flex: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1;
  padding: .1rem .2rem;
  border-radius: 5px;
  cursor: pointer;
}
.attachment-item .remove:hover { background: var(--danger-soft); color: var(--danger); }
.attachment-broken {
  display: inline-flex;
  align-items: center;
  padding: .25rem .55rem;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: var(--warning);
  font-size: .78rem;
}

/* ---------- 音视频附件（内联播放，独占一行） ---------- */
.attachment-media {
  flex: 1 1 100%;
  width: 100%;
  padding: .6rem .7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.attachment-media .media-audio { display: block; width: 100%; height: 40px; }
.attachment-media .media-video {
  display: block;
  width: 100%;
  max-height: 340px;
  border-radius: 6px;
  background: #000;
}
.attachment-media .media-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .45rem;
  font-size: .8rem;
}
.attachment-media .media-meta .name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-media .media-meta .size { flex: none; color: var(--muted); font-size: .72rem; }
.attachment-media .media-meta .media-dl {
  flex: none;
  color: var(--primary);
  font-size: .75rem;
  text-decoration: none;
}
.attachment-media .media-meta .media-dl:hover { text-decoration: underline; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.is-open { display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-backdrop { position: absolute; inset: 0; background: var(--overlay); backdrop-filter: blur(2px); }
.modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  animation: pop .16s ease-out;
}
.modal-card-sm { max-width: 400px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 1.05rem;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; font-size: .98rem; font-weight: 650; }
.modal-body { padding: 1.05rem; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  padding: .8rem 1.05rem;
  border-top: 1px solid var(--border);
}
.confirm-text { margin: 0; font-size: .88rem; color: var(--muted); }

.qr-box { text-align: center; margin-top: .35rem; }
.qr-box img {
  display: block;
  margin: 0 auto .4rem;
  padding: 8px;
  max-width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  image-rendering: pixelated;
}

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  background: rgba(8, 10, 14, .88);
}
.lightbox img {
  max-width: 100%;
  max-height: 86vh;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
}
.lightbox-close {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .26); }

/* ---------- Toast ---------- */
.toasts {
  position: fixed;
  top: 3.6rem;
  right: 1rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  min-width: 200px;
  max-width: 330px;
  padding: .55rem .65rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  font-size: .83rem;
  pointer-events: auto;
  animation: slide-in .18s ease-out;
}
.toast-text { flex: 1; overflow-wrap: anywhere; }
.toast-close {
  flex: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1;
  padding: 0 .1rem;
  cursor: pointer;
}
.toast-close:hover { color: var(--text); }
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--primary); }

/* ---------- 状态 ---------- */
.loading { padding: 1.6rem 0; text-align: center; font-size: .85rem; color: var(--muted); }
.empty {
  padding: 2.6rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: .86rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.empty-icon { display: block; margin-bottom: .45rem; font-size: 1.5rem; }

/* ---------- 公开分享页 ---------- */
.public-wrap { max-width: 680px; margin: 0 auto; }
.public-note {
  --note-tint: transparent;
  --note-accent: var(--border-strong);
  background-color: var(--surface);
  background-image: linear-gradient(var(--note-tint), var(--note-tint));
  border: 1px solid var(--border);
  border-left: 4px solid var(--note-accent);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow-1);
}
.public-foot { margin-top: 1.1rem; text-align: center; font-size: .8rem; }
.public-foot a { color: var(--primary); }
.notice {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: .88rem;
}
.notice a { color: var(--primary); }

/* ---------- 动画 ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.99); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(12px); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 移动端 ---------- */
@media (max-width: 600px) {
  .main { padding: 1rem .75rem 3rem; }
  .composer-tools { flex-direction: column; align-items: stretch; }
  .composer-tools .btn-primary { margin-left: 0; }
  .field-inline { justify-content: space-between; }
  .composer-meta .hint { display: none; }
  .attachment-item .name { max-width: 130px; }
  .note-actions { width: 100%; }
  .toasts { left: 1rem; right: 1rem; }
  .toast { max-width: none; }
}
