:root {
  --bg: #0c0e12;
  --bg-soft: #11141a;
  --panel: #151922;
  --panel-2: #1a202a;
  --line: #262d3a;
  --line-soft: #1e2430;
  --text: #e8ebf2;
  --dim: #98a2b6;
  --faint: #6a7488;
  --accent: #ffc65c;
  --accent-2: #ffd88a;
  --accent-ink: #241a05;
  --jike: #ffd60a;
  --x: #dfe5f1;
  --danger: #ff6b6b;
  --ok: #4ade80;
  --radius: 16px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 560px at 88% -12%, rgba(255, 198, 92, 0.075), transparent 62%),
    radial-gradient(900px 500px at -10% 110%, rgba(96, 130, 255, 0.05), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

button, input, select { font-family: inherit; }
::selection { background: rgba(255, 198, 92, 0.28); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #232a36; border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #2e3746; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ---------- 布局 ---------- */

.app {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

/* ---------- 侧边栏 ---------- */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 14px 14px;
  background: linear-gradient(180deg, #10131a 0%, #0c0f14 100%);
  border-right: 1px solid var(--line-soft);
  min-height: 0;
  z-index: 70;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px 4px; }

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 17px;
  color: var(--accent-ink);
  background: linear-gradient(140deg, #ffdf9a 0%, #ffc65c 45%, #f5a83e 100%);
  box-shadow: 0 6px 18px rgba(255, 178, 61, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 16px; letter-spacing: 0.02em; }
.brand-text span { font-size: 10.5px; color: var(--faint); letter-spacing: 0.14em; }

.sidebar-close { display: none; margin-left: auto; }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--dim);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover { background: #171c25; color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(255, 198, 92, 0.15), rgba(255, 198, 92, 0.035));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 198, 92, 0.18);
}

.nav-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  background: #232a36;
  color: #cfd6e4;
  flex: none;
}
.nav-icon.jike { background: linear-gradient(135deg, #ffd60a, #ffb800); color: #241a05; }
.nav-icon.x { background: #e8ecf4; color: #0c0e12; }
.nav-icon.rss { background: #2b3342; color: #9aa4b8; }
.nav-icon.all { background: #232a36; color: #b9c3d6; }

.nav-label { flex: 1; }

.nav-count {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
  background: #1b212c;
  border-radius: 99px;
  padding: 1px 7px;
  min-width: 22px;
  text-align: center;
}
.nav-item.active .nav-count { background: rgba(255, 198, 92, 0.17); color: var(--accent); }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 0;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.feed-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 2px 6px;
  scrollbar-width: thin;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  color: var(--dim);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.feed-item:hover { background: #161b24; color: var(--text); }
.feed-item.active { background: #1a2029; border-color: #2b3443; color: var(--text); }
.feed-item.disabled { opacity: 0.45; }

.feed-avatar {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  flex: none;
  object-fit: cover;
  background: #232a36;
}

.feed-initial {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  background: #232a36;
  color: #cbd4e4;
}
.feed-initial.jike { background: rgba(255, 214, 10, 0.16); color: var(--jike); }
.feed-initial.x { background: rgba(223, 229, 241, 0.14); color: var(--x); }

.feed-name {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-unread {
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: rgba(255, 198, 92, 0.16);
  color: var(--accent);
  text-align: center;
}

.feed-error { width: 6px; height: 6px; border-radius: 50%; background: var(--danger); flex: none; }

.feed-empty {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 8px;
  font-size: 12px;
  color: var(--faint);
}

.feed-actions { display: none; gap: 1px; margin-left: auto; }
.feed-item:hover .feed-actions { display: flex; }
.feed-item:hover .feed-unread { display: none; }
.feed-item:focus-visible { outline: 1px solid rgba(255, 198, 92, 0.5); outline-offset: 1px; }

.sidebar-foot {
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.foot-meta {
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* ---------- 主区域 ---------- */

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100vh;
  height: 100dvh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 28px 13px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(12, 14, 18, 0.72);
  backdrop-filter: blur(14px);
  z-index: 20;
}

.view-title { min-width: 0; }
.view-title h1 { margin: 0; font-size: 18.5px; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-title p { margin: 2px 0 0; font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(300px, 30vw);
  padding: 0 10px 0 12px;
  background: #141922;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search:focus-within { border-color: rgba(255, 198, 92, 0.45); box-shadow: 0 0 0 3px rgba(255, 198, 92, 0.09); }
.search .icon { width: 15px; height: 15px; color: var(--faint); }
.search input { flex: 1; min-width: 0; padding: 8px 0; border: 0; outline: none; background: none; color: var(--text); font-size: 13px; }
.search input::placeholder { color: var(--faint); }
.search kbd { font-size: 10px; color: var(--faint); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 28px 6px;
}

.toolbar-spacer { flex: 1; }

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: #12161e;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}
.segmented button {
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 12.5px;
  padding: 5px 13px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: #232b38; color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }

.timeline {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 28px 70px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.sentinel { height: 1px; flex: none; }

/* ---------- 动态卡片 ---------- */

.card {
  position: relative;
  padding: 15px 18px 11px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.014), transparent 40%), var(--panel);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s, opacity 0.2s;
  animation: card-in 0.24s ease both;
  content-visibility: auto;
  contain-intrinsic-size: auto 220px;
}

@keyframes card-in { from { opacity: 0; transform: translateY(6px); } }

.card:hover { border-color: #2d3646; background-color: #171c25; }
.card.active { border-color: rgba(255, 198, 92, 0.5); box-shadow: 0 0 0 1px rgba(255, 198, 92, 0.22), 0 14px 34px rgba(0, 0, 0, 0.34); }
.card.is-read { opacity: 0.62; }
.card.is-read:hover, .card.is-read.active { opacity: 1; }

.card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }

.avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-ink);
  background: linear-gradient(140deg, #ffd76e, #f7ae43);
  overflow: hidden;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar img.broken { display: none; }
.avatar.sm { width: 26px; height: 26px; border-radius: 9px; font-size: 11px; }
.avatar.x { color: #0c0e12; background: linear-gradient(140deg, #eef2f8, #c3ccdb); }
.avatar.rss { color: #cbd4e4; background: linear-gradient(140deg, #2c3544, #1e2530); }

.who { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.who .name { font-size: 13.5px; font-weight: 600; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .handle { font-size: 11.5px; color: var(--faint); white-space: nowrap; }

.platform-chip {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 5px;
  background: #232a36;
  color: #b9c3d6;
  flex: none;
}
.platform-chip.jike { background: rgba(255, 214, 10, 0.14); color: var(--jike); }
.platform-chip.x { background: rgba(223, 229, 241, 0.12); color: var(--x); }

.card-time { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.unread-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(255, 198, 92, 0.7); flex: none; }

.card-title { margin: 10px 0 5px; font-size: 15px; line-height: 1.45; font-weight: 600; letter-spacing: -0.005em; }

.card-text {
  margin: 0;
  font-size: 13.8px;
  line-height: 1.7;
  color: #c3cbda;
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.media-grid { margin-top: 10px; display: grid; gap: 6px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.media-grid.count-1 { grid-template-columns: minmax(0, 1fr); max-width: 540px; }
.media-grid.count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.media-grid a {
  display: block;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: #0e1218;
  aspect-ratio: 16 / 9;
  max-height: 230px;
}
.media-grid.count-1 a { aspect-ratio: 16 / 7.2; max-height: 300px; }
.media-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; }
.media-grid a:hover img { transform: scale(1.035); }

.card-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding-top: 9px;
  border-top: 1px dashed var(--line-soft);
  font-size: 12px;
  color: var(--faint);
}
.card-foot .source { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-foot a, .card-foot button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: none;
  padding: 0;
  color: var(--dim);
  font: inherit;
  cursor: pointer;
  transition: color 0.15s;
}
.card-foot a:hover, .card-foot button:hover { color: var(--accent); }
.card-foot .star { margin-left: 0; }
.card-foot .star.on { color: var(--accent); }
.card-foot .star.on svg { fill: rgba(255, 198, 92, 0.25); }

/* ---------- 空状态 / 骨架屏 ---------- */

.empty {
  margin: auto;
  padding: 70px 20px;
  text-align: center;
  color: var(--faint);
  max-width: 420px;
}
.empty .icon { width: 46px; height: 46px; color: #3a4456; stroke-width: 1.1; margin-bottom: 14px; }
.empty h3 { margin: 0 0 6px; font-size: 15px; color: var(--dim); font-weight: 600; }
.empty p { margin: 0 0 16px; font-size: 12.5px; line-height: 1.7; }

.skeleton {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sk-line { height: 11px; border-radius: 6px; background: linear-gradient(90deg, #1b212b 25%, #232b38 50%, #1b212b 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.sk-line.w40 { width: 40%; }
.sk-line.w70 { width: 70%; }
.sk-line.w95 { width: 95%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 正文里的图片（详情） ---------- */

.article-content { font-size: 14.2px; line-height: 1.78; color: #d3d9e5; word-break: break-word; }
.article-content p { margin: 0 0 12px; }
.article-content a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(255, 198, 92, 0.3); }
.article-content a:hover { border-bottom-color: var(--accent); }
.article-content img { max-width: 100%; height: auto; border-radius: 10px; margin: 8px 0; }
.article-content blockquote { margin: 12px 0; padding: 8px 14px; border-left: 2px solid rgba(255, 198, 92, 0.5); color: var(--dim); background: #12161e; border-radius: 0 8px 8px 0; }
.article-content pre { background: #0d1117; padding: 12px; border-radius: 10px; overflow: auto; font-size: 12.5px; }
.article-content code { background: #1b212b; padding: 1px 5px; border-radius: 5px; font-size: 0.92em; }
.article-content ul, .article-content ol { padding-left: 22px; margin: 0 0 12px; }
.article-content h1, .article-content h2, .article-content h3 { font-size: 1.05em; margin: 16px 0 8px; }

/* ---------- 详情抽屉 ---------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(5, 7, 10, 0.55);
  opacity: 0;
  transition: opacity 0.22s;
}
.scrim.show { opacity: 1; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  width: min(540px, 94vw);
  transform: translateX(102%);
  transition: transform 0.26s cubic-bezier(0.22, 0.7, 0.3, 1);
  display: flex;
}
.drawer.open { transform: none; }
.drawer[hidden] { display: none; }

.drawer-panel {
  flex: 1;
  min-width: 0;
  background: #10141b;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  flex: none;
}
.drawer-head h2 { margin: 0; font-size: 13px; font-weight: 600; color: var(--dim); letter-spacing: 0.04em; }
.drawer-actions { margin-left: auto; display: flex; gap: 4px; }

.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px 40px; }

.detail-author { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.detail-author .name { font-size: 13.5px; font-weight: 600; }
.detail-author .handle { font-size: 11.5px; color: var(--faint); }
.detail-time { margin-left: auto; font-size: 11.5px; color: var(--faint); }

.detail-title { margin: 0 0 12px; font-size: 19px; line-height: 1.4; letter-spacing: -0.01em; }

.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 22px; padding-top: 14px; border-top: 1px dashed var(--line-soft); font-size: 11.5px; color: var(--faint); }
.detail-meta a { color: var(--accent); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.detail-meta a:hover { text-decoration: underline; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #171c25;
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, filter 0.15s;
  white-space: nowrap;
}
.btn:hover { background: #1e2531; border-color: #303a49; }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn.primary {
  background: linear-gradient(180deg, #ffd071, #ffbe4d);
  border-color: #e0a437;
  color: var(--accent-ink);
  font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: #1b212b; }
.btn.small { padding: 6px 10px; font-size: 11.5px; border-radius: 8px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--faint);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: #1b212b; color: var(--text); }
.icon-btn.tiny { width: 22px; height: 22px; border-radius: 6px; }
.icon-btn.tiny .icon { width: 13px; height: 13px; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: none;
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 2px;
}
.link-btn:hover { color: var(--accent); }

.spinner { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 弹窗 ---------- */

.dialog {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  width: min(660px, 93vw);
  max-height: 92vh;
}
.dialog::backdrop { background: rgba(5, 7, 10, 0.68); backdrop-filter: blur(5px); }

.dialog-card {
  background: #12161e;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
  max-height: 88vh;
  overflow-y: auto;
}

.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dialog-head h2 { margin: 0; font-size: 16px; font-weight: 650; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--dim); }
.field em { color: var(--accent); font-style: normal; }
.field input, .field select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0d1117;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus { border-color: rgba(255, 198, 92, 0.5); box-shadow: 0 0 0 3px rgba(255, 198, 92, 0.1); }
.field input::placeholder { color: #4e5769; }

.field textarea {
  width: 100%;
  min-height: 150px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0d1117;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea:focus { border-color: rgba(255, 198, 92, 0.5); box-shadow: 0 0 0 3px rgba(255, 198, 92, 0.1); }
.field textarea::placeholder { color: #4e5769; }

.bulk-preview { margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; background: #0e1218; }
.bulk-summary { font-size: 12px; color: var(--dim); }
.bulk-summary strong { color: var(--accent); font-size: 13px; }
.bulk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bulk-chip { padding: 3px 8px; border: 1px solid var(--line-soft); border-radius: 99px; background: #1a2029; color: var(--dim); font-size: 11px; }
.bulk-chip em { margin-left: 2px; color: var(--faint); font-style: normal; }
.bulk-preview .preview-error { margin: 8px 0 0; }

.form-hint { margin: -2px 0 0; }

.span-2 { grid-column: span 2; }

.check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--dim); }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }

.hint { margin: 12px 0 0; font-size: 11.5px; line-height: 1.65; color: var(--faint); }
.hint code { padding: 1px 5px; border-radius: 5px; background: #1b212b; color: #c3ccdb; }

.dialog-foot { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.spacer { flex: 1; }

.preview { margin-top: 12px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 12px; background: #0e1218; }
.preview-title { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.preview-item { padding: 7px 0; border-top: 1px dashed var(--line-soft); font-size: 12px; color: var(--dim); line-height: 1.5; }
.preview-item strong { display: block; margin-bottom: 2px; font-weight: 500; color: var(--text); }
.preview-error { color: #ffb4b4; font-size: 12px; }

.section-card { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 12px; background: #0f131a; }
.section-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-card-head strong { font-size: 12.5px; font-weight: 600; color: var(--dim); }
.section-card .hint { margin: 6px 0 10px; overflow-wrap: anywhere; }

.file-btn { position: relative; overflow: hidden; }

.switch-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 0; }
.switch-list .check { font-size: 12.5px; }

/* ---------- 顶部提示条 ---------- */

.notice {
  margin: 10px 28px 0;
  padding: 9px 14px;
  border: 1px solid rgba(255, 198, 92, 0.28);
  border-radius: 10px;
  background: rgba(255, 198, 92, 0.08);
  color: #f0d9a8;
  font-size: 12px;
  line-height: 1.55;
}
.notice[hidden] { display: none; }

/* ---------- 登录页 ---------- */

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  overflow: auto;
  padding: 24px;
}

.login-card {
  width: min(380px, 100%);
  padding: 26px 26px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #12161e;
  box-shadow: var(--shadow);
}

.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.login-card h1 { margin: 0 0 6px; font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.login-hint { margin: 0 0 18px; font-size: 11.5px; line-height: 1.65; color: var(--faint); }
.login-hint code { padding: 1px 5px; border-radius: 5px; background: #1b212b; color: #c3ccdb; font-size: 11px; }
.login-card .field { margin-bottom: 12px; }
.login-submit { width: 100%; margin-top: 4px; padding: 10px; }
.login-error { margin: 0 0 10px; font-size: 12px; line-height: 1.5; color: #ffb4b4; }
.login-error[hidden] { display: none; }

/* ---------- Toast ---------- */

.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
}

.toast {
  padding: 9px 16px;
  border: 1px solid #2c3646;
  border-radius: 99px;
  background: #1c2330;
  color: var(--text);
  font-size: 12.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  animation: toast-in 0.2s ease both;
  max-width: 80vw;
  text-align: center;
}
.toast.ok { border-color: rgba(74, 222, 128, 0.35); }
.toast.error { border-color: rgba(255, 107, 107, 0.45); color: #ffc0c0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

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

.mobile-only { display: none; }

@media (max-width: 1080px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(302px, 84vw);
    transform: translateX(-102%);
    transition: transform 0.24s cubic-bezier(0.22, 0.7, 0.3, 1);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
  }
  .sidebar.open { transform: none; }
  .sidebar-close { display: grid; }
  .mobile-only { display: grid; }
  .topbar { padding: 12px 16px 10px; gap: 10px; }
  .timeline { padding: 6px 14px 70px; gap: 10px; }
  .toolbar { padding: 10px 16px 4px; }
  .search { width: auto; flex: 1; }
  .view-title p { display: none; }
  .view-title h1 { font-size: 16px; }
  .btn-label { display: none; }
  .topbar #refreshBtn { padding: 8px; }
  .card { padding: 13px 14px 10px; }
  .who .name { max-width: 40vw; }
  .dialog-card { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .drawer { width: 100%; }
}

@media (max-width: 520px) {
  .card-foot { gap: 10px; flex-wrap: wrap; }
  .card-foot .source { width: 100%; order: 3; }
  .card-foot .star { margin-left: auto; }
  .segmented button { padding: 5px 10px; }
}

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