/* ============ 江苏交易雷达 · 移动优先样式 ============ */

:root {
  --blue-900: #082f6b;
  --blue-800: #0b3f8f;
  --blue-700: #0b4dba;
  --blue-600: #1565d8;
  --blue-100: #e4eefc;
  --blue-50: #f1f6ff;
  --red-600: #d92b2b;
  --red-50: #fff1f1;
  --yellow-500: #e8a300;
  --green-600: #12855b;
  --ink-900: #16202f;
  --ink-700: #35455c;
  --ink-500: #64748b;
  --ink-400: #8595aa;
  --ink-300: #aebacb;
  --line: #e3e9f2;
  --bg: #f2f5fa;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --shadow-sm: 0 1px 2px rgba(16, 32, 56, 0.06), 0 1px 3px rgba(16, 32, 56, 0.05);
  --shadow-md: 0 4px 16px rgba(16, 32, 56, 0.08);
  --shadow-lg: 0 18px 48px rgba(10, 30, 60, 0.18);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --tap: 44px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
}

html[data-theme="dark"] {
  --blue-900: #0a1d3a;
  --blue-800: #12386f;
  --blue-700: #3b82f6;
  --blue-600: #60a5fa;
  --blue-100: #1b2f4d;
  --blue-50: #16233a;
  --red-600: #f87171;
  --red-50: #3a1d1d;
  --ink-900: #e9eef7;
  --ink-700: #c4cfdf;
  --ink-500: #93a2b8;
  --ink-400: #7c8ca3;
  --ink-300: #5d6b80;
  --line: #263348;
  --bg: #0d131c;
  --surface: #151d29;
  --surface-2: #1a2431;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: calc(64px + var(--safe-bottom));
}

body.no-scroll {
  overflow: hidden;
}

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

button {
  cursor: pointer;
  border: 0;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--blue-700);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  display: block;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 200;
  background: var(--surface);
  padding: 8px 14px;
  border-radius: 8px;
}

.skip-link:focus {
  left: 8px;
}

.app-shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 0 8px;
}

/* ------------------------------ 顶部栏 ------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + var(--safe-top)) 14px 10px;
  background: linear-gradient(135deg, var(--blue-800), var(--blue-700) 55%, #1a6ad4);
  color: #fff;
  box-shadow: 0 2px 14px rgba(8, 40, 90, 0.22);
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.34);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
}

.brand-text {
  min-width: 0;
}

.brand-text h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text p {
  margin: 1px 0 0;
  font-size: 11px;
  opacity: 0.82;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  transition: background 0.18s ease, transform 0.18s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffd34d;
  box-shadow: 0 0 0 0 rgba(255, 211, 77, 0.7);
  animation: pulse 2s infinite;
}

.live-pill.is-live .live-dot {
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
}

.live-pill.is-down .live-dot {
  background: #fca5a5;
  animation: none;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

.notify-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffd34d;
  border: 1.5px solid var(--blue-700);
}

/* ------------------------------ 搜索 ------------------------------ */

.search-wrap {
  position: sticky;
  top: calc(58px + var(--safe-top));
  z-index: 28;
  padding: 10px 14px 8px;
  background: var(--bg);
}

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

.search-box:focus-within {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(21, 101, 216, 0.14);
}

.search-box svg {
  width: 19px;
  height: 19px;
  color: var(--ink-400);
  flex: 0 0 auto;
}

.search-box input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
}

.search-box input::placeholder {
  color: var(--ink-400);
}

.search-clear {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 19px;
  line-height: 1;
  color: var(--ink-500);
  background: var(--surface-2);
}

/* ------------------------------ 板块 Tab ------------------------------ */

.section-tabs {
  display: flex;
  gap: 8px;
  padding: 2px 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.section-tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 0 0 auto;
  position: relative;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-700);
  background: var(--surface);
  border: 1px solid var(--line);
  white-space: nowrap;
  transition: all 0.18s ease;
}

.tab:hover {
  border-color: var(--blue-600);
  color: var(--blue-700);
}

.tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--blue-700), var(--blue-600));
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(11, 77, 186, 0.28);
}

.tab-count {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--red-600);
  color: #fff;
  vertical-align: 1px;
}

.tab.is-active .tab-count {
  background: rgba(255, 255, 255, 0.26);
}

/* ------------------------------ 筛选工具条 ------------------------------ */

.toolbar {
  padding: 0 14px 6px;
}

.subcats {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.subcats::-webkit-scrollbar {
  display: none;
}

.subcats:empty {
  display: none;
}

.chip {
  flex: 0 0 auto;
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-500);
  background: var(--surface);
  border: 1px solid var(--line);
  white-space: nowrap;
  transition: all 0.16s ease;
}

.chip:hover {
  color: var(--blue-700);
  border-color: var(--blue-600);
}

.chip.is-active {
  color: var(--blue-700);
  background: var(--blue-50);
  border-color: var(--blue-600);
  font-weight: 700;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  row-gap: 8px;
  padding: 2px 0 6px;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filters #refreshBtn {
  margin-left: auto;
}

.field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  height: 32px;
  padding: 0 4px 0 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-500);
}

.field select {
  height: 30px;
  padding: 0 4px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-900);
  max-width: 130px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  font-size: 12.5px;
  color: var(--ink-500);
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch-track {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--ink-300);
  transition: background 0.2s ease;
  flex: 0 0 auto;
}

.switch-track i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.switch input:checked + .switch-track {
  background: var(--blue-600);
}

.switch input:checked + .switch-track i {
  transform: translateX(14px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--blue-600);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.16s ease;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn-ghost {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 11px;
  font-size: 12.5px;
  color: var(--blue-700);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
}

.btn-ghost:hover {
  background: var(--blue-100);
}

.btn-ghost.is-busy svg {
  animation: spin 0.9s linear infinite;
}

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

/* ------------------------------ 状态行 ------------------------------ */

.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 16px 8px;
  font-size: 12px;
  color: var(--ink-500);
}

.result-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-meta strong {
  color: var(--blue-700);
  font-weight: 700;
}

.status-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.update-time {
  font-variant-numeric: tabular-nums;
}

.source-tag {
  display: none;
}

/* ------------------------------ 卡片列表 ------------------------------ */

.card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 14px 6px;
}

.card {
  position: relative;
  padding: 13px 14px 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  outline: none;
  animation: card-in 0.26s ease both;
}

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

.card:hover {
  border-color: #c7d8f2;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.card:focus-visible {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(21, 101, 216, 0.18);
}

.card.is-new {
  border-left: 3px solid var(--red-600);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
  color: var(--blue-700);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
}

.badge-jsgc { color: #0b5cad; background: #eaf3ff; border-color: #cfe4ff; }
.badge-jtgc { color: #0d7a63; background: #e8f8f2; border-color: #c6ecdf; }
.badge-slgc { color: #1668a8; background: #e9f6fd; border-color: #c7e8f8; }
.badge-zfcg { color: #a15a00; background: #fff5e6; border-color: #ffe2b8; }
.badge-tdky { color: #7a4a10; background: #fbf2e3; border-color: #f0ddbe; }
.badge-gycq { color: #6b3fa0; background: #f4edff; border-color: #e3d3fa; }
.badge-yp { color: #a3216b; background: #fff0f7; border-color: #fbd3e6; }

.badge-plain {
  color: var(--ink-500);
  background: var(--surface-2);
  border-color: var(--line);
  font-weight: 500;
}

.new-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  background: var(--red-600);
  animation: breathe 2.4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.62; }
}

.card-time {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--ink-400);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-900);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.card-title em {
  font-style: normal;
  color: var(--red-600);
  font-weight: 800;
  background: var(--red-50);
  border-radius: 3px;
  padding: 0 1px;
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  font-size: 12px;
  color: var(--ink-500);
  min-width: 0;
}

.district-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-700);
}

.district-chip svg {
  width: 12px;
  height: 12px;
  color: var(--ink-400);
}

.card-cat {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-400);
  font-size: 11.5px;
}

.card-go {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-700);
}

.card-go svg {
  width: 14px;
  height: 14px;
}

.card-fav {
  width: 24px;
  height: 24px;
  margin-left: 2px;
  display: grid;
  place-items: center;
  color: var(--ink-300);
  flex: 0 0 auto;
  transition: color 0.15s ease, transform 0.15s ease;
}

.card-fav:hover {
  transform: scale(1.12);
}

.card-fav.is-fav {
  color: var(--yellow-500);
}

.card-fav svg {
  width: 17px;
  height: 17px;
}

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

.skeleton-card {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.sk-line {
  height: 12px;
  margin-bottom: 9px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}

.sk-line.sk-title {
  height: 16px;
  width: 86%;
}

.sk-line.short {
  width: 46%;
  margin-bottom: 0;
}

.sk-line.sk-badge {
  height: 18px;
  width: 72px;
  margin-bottom: 12px;
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 52px 24px;
  text-align: center;
  color: var(--ink-500);
}

.state-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue-50);
  color: var(--blue-600);
}

.state-icon svg {
  width: 28px;
  height: 28px;
}

.state-box h3 {
  margin: 0;
  font-size: 15px;
  color: var(--ink-900);
}

.state-box p {
  margin: 0;
  font-size: 13px;
  max-width: 320px;
}

.state-box .btn-ghost {
  margin-top: 4px;
  height: 36px;
  padding: 0 16px;
}

/* ------------------------------ 列表底部 ------------------------------ */

.list-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 10px;
}

.btn-more {
  width: 100%;
  max-width: 420px;
  height: 42px;
  font-size: 14px;
  color: var(--blue-700);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.btn-more:hover {
  border-color: var(--blue-600);
  background: var(--blue-50);
}

.btn-more.is-busy {
  opacity: 0.6;
  pointer-events: none;
}

.end-hint {
  padding: 6px 0;
  font-size: 12px;
  color: var(--ink-400);
}

.end-hint::before {
  content: "— ";
}

.end-hint::after {
  content: " —";
}

.sense {
  height: 1px;
  width: 100%;
}

.page-footer {
  padding: 8px 22px 18px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-400);
}

.page-footer p {
  margin: 0 0 4px;
}

.footer-dim {
  opacity: 0.8;
}

/* ------------------------------ 新内容悬浮按钮 ------------------------------ */

.new-fab {
  position: fixed;
  left: 50%;
  bottom: calc(74px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--red-600), #ef5350);
  box-shadow: 0 8px 22px rgba(217, 43, 43, 0.36);
  animation: drop-in 0.26s ease both;
}

@keyframes drop-in {
  from {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.new-fab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: breathe 1.6s ease-in-out infinite;
}

.new-fab-arrow {
  font-size: 14px;
  line-height: 1;
}

/* ------------------------------ 底部导航 ------------------------------ */

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 50;
  width: 100%;
  max-width: 1180px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 6px calc(6px + var(--safe-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}

.bottom-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 0;
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-400);
  transition: color 0.16s ease;
}

.bottom-item svg {
  width: 21px;
  height: 21px;
}

.bottom-item.is-active {
  color: var(--blue-700);
  font-weight: 700;
}

.bottom-badge {
  position: absolute;
  top: 1px;
  right: calc(50% - 22px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--red-600);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

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

.toast-stack {
  position: fixed;
  top: calc(12px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 24px);
  max-width: 420px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(22, 32, 47, 0.95);
  color: #f5f8ff;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  line-height: 1.5;
  pointer-events: auto;
  animation: toast-in 0.24s ease both;
}

.toast.is-out {
  animation: toast-out 0.24s ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(-8px); }
}

.toast-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  font-size: 12px;
  font-weight: 800;
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 700;
  margin-bottom: 1px;
}

.toast-text {
  opacity: 0.86;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.toast-close {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  line-height: 1;
}

.toast.is-ok .toast-icon {
  color: #4ade80;
}

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

.sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 35, 0.48);
  backdrop-filter: blur(2px);
  animation: fade-in 0.2s ease both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sheet-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 92vh;
  max-height: 92dvh;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  box-shadow: var(--shadow-lg);
  animation: sheet-up 0.28s cubic-bezier(0.22, 0.8, 0.3, 1) both;
  overflow: hidden;
}

@keyframes sheet-up {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

.sheet-grabber {
  width: 38px;
  height: 4px;
  margin: 7px auto 2px;
  border-radius: 2px;
  background: var(--line);
  flex: 0 0 auto;
}

.sheet-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 8px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.sheet-head h2 {
  flex: 1;
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-500);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-head .icon-btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  color: var(--ink-700);
  background: transparent;
}

.sheet-head .icon-btn:hover {
  background: var(--surface-2);
}

.sheet-head .icon-btn.is-fav {
  color: var(--yellow-500);
}

.sheet-actions {
  display: flex;
  gap: 2px;
  flex: 0 0 auto;
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(28px + var(--safe-bottom));
}

/* ------------------------------ 详情内容 ------------------------------ */

.detail-head {
  margin-bottom: 12px;
}

.detail-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink-900);
  word-break: break-word;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.detail-meta {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--ink-500);
}

.detail-meta-row {
  display: flex;
  gap: 8px;
}

.detail-meta-row b {
  flex: 0 0 56px;
  font-weight: 600;
  color: var(--ink-500);
}

.detail-meta-row span {
  color: var(--ink-700);
  word-break: break-word;
}

.detail-actions {
  display: flex;
  gap: 8px;
  margin: 12px 0 14px;
  flex-wrap: wrap;
}

.detail-actions .btn {
  height: 38px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 9px;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--blue-700), var(--blue-600));
  box-shadow: 0 4px 12px rgba(11, 77, 186, 0.24);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-outline {
  color: var(--blue-700);
  background: var(--surface);
  border: 1px solid var(--blue-100);
}

.btn-outline:hover {
  background: var(--blue-50);
}

.detail-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 18px 0 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-700);
}

.detail-section-title::before {
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: var(--blue-600);
}

.detail-content {
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink-700);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.detail-content p {
  margin: 0 0 12px;
}

.detail-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 8px 0;
  background: var(--surface-2);
}

.detail-content table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.detail-content th,
.detail-content td {
  border: 1px solid var(--line);
  padding: 7px 9px;
  text-align: left;
  vertical-align: top;
}

.detail-content caption {
  caption-side: top;
  text-align: left;
  padding: 4px 2px 8px;
  position: sticky;
  left: 0;
  color: var(--ink-900);
}

.detail-content caption h1,
.detail-content caption h2,
.detail-content caption h3,
.detail-content caption h4 {
  margin: 0;
}

.detail-content th {
  background: var(--surface-2);
  font-weight: 600;
}

.detail-content h1,
.detail-content h2,
.detail-content h3,
.detail-content h4 {
  margin: 16px 0 8px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-900);
}

.detail-content a {
  word-break: break-all;
}

.detail-content blockquote {
  margin: 12px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--blue-100);
  background: var(--surface-2);
  color: var(--ink-500);
  font-size: 14px;
}

.detail-content ul,
.detail-content ol {
  padding-left: 20px;
  margin: 0 0 12px;
}

.attach-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attach-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-700);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.attach-item:hover {
  border-color: var(--blue-600);
  background: var(--blue-50);
  text-decoration: none;
}

.attach-item svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--blue-600);
}

.attach-name {
  flex: 1;
  min-width: 0;
  word-break: break-all;
}

.attach-size {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--ink-400);
}

.detail-origin {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--ink-400);
}

.detail-origin a {
  word-break: break-all;
}

.detail-skeleton {
  padding: 4px 0;
}

.detail-skeleton .sk-line {
  height: 13px;
}

.detail-skeleton .sk-title {
  height: 22px;
  width: 80%;
}

.detail-error {
  padding: 36px 16px;
  text-align: center;
  color: var(--ink-500);
  font-size: 13.5px;
}

.detail-error .btn {
  margin-top: 12px;
}

/* ------------------------------ 深色模式细节 ------------------------------ */

html[data-theme="dark"] .badge-jsgc { color: #8ec2ff; background: #14273f; border-color: #1f3d61; }
html[data-theme="dark"] .badge-jtgc { color: #6fe0bd; background: #122f28; border-color: #1d4a3f; }
html[data-theme="dark"] .badge-slgc { color: #7dd0f7; background: #122b3b; border-color: #1d4457; }
html[data-theme="dark"] .badge-zfcg { color: #f7c375; background: #33260f; border-color: #4d3a1a; }
html[data-theme="dark"] .badge-tdky { color: #e0b877; background: #302619; border-color: #493a26; }
html[data-theme="dark"] .badge-gycq { color: #c4a0f5; background: #271c3b; border-color: #3d2c5c; }
html[data-theme="dark"] .badge-yp { color: #f7a0cd; background: #351c2a; border-color: #52293f; }

html[data-theme="dark"] .card:hover {
  border-color: #35507a;
}

html[data-theme="dark"] .topbar {
  background: linear-gradient(135deg, #0a1b33, #123468 55%, #17457f);
}

html[data-theme="dark"] .toast {
  background: rgba(30, 43, 62, 0.97);
}

html[data-theme="dark"] .bottom-nav {
  background: rgba(21, 29, 41, 0.94);
}

/* ------------------------------ 平板 / 桌面 ------------------------------ */

@media (min-width: 640px) {
  .brand-text h1 {
    font-size: 19px;
  }

  .brand-text p {
    font-size: 12px;
  }

  .card-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
  }

  .state-box {
    grid-column: 1 / -1;
  }

  .skeleton-card {
    min-height: 118px;
  }

  .source-tag {
    display: inline;
  }

  .status-line {
    padding: 2px 16px 10px;
  }

  .field select {
    max-width: 180px;
  }
}

@media (min-width: 960px) {
  body {
    padding-bottom: 0;
  }

  .bottom-nav {
    display: none;
  }

  .app-shell {
    padding-top: 14px;
  }

  .topbar {
    position: relative;
    top: auto;
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    margin: 0 16px;
  }

  .search-wrap {
    position: sticky;
    top: 8px;
    padding: 12px 16px 8px;
    background: transparent;
    backdrop-filter: blur(8px);
  }

  .search-box {
    max-width: 640px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
  }

  .section-tabs {
    padding: 4px 16px 10px;
  }

  .toolbar,
  .status-line,
  .card-list {
    padding-left: 16px;
    padding-right: 16px;
  }

  .card-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .new-fab {
    bottom: 28px;
  }

  .sheet {
    align-items: center;
    padding: 24px;
  }

  .sheet-panel {
    width: min(820px, 100%);
    max-height: 88vh;
    border-radius: var(--radius-lg);
    animation: sheet-pop 0.24s ease both;
  }

  @keyframes sheet-pop {
    from { opacity: 0; transform: translateY(12px) scale(0.99); }
    to { opacity: 1; transform: none; }
  }

  .sheet-grabber {
    display: none;
  }

  .sheet-head {
    padding: 10px 12px;
  }

  .sheet-body {
    padding: 22px 26px 30px;
  }

  .page-footer {
    padding-bottom: 28px;
  }
}

@media (min-width: 1280px) {
  .card-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ------------------------------ 减少动效 ------------------------------ */

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

/* ------------------------------ 打印 ------------------------------ */

@media print {
  .topbar,
  .search-wrap,
  .section-tabs,
  .toolbar,
  .bottom-nav,
  .new-fab,
  .toast-stack,
  .sheet-head {
    display: none !important;
  }

  body {
    background: #fff;
    padding: 0;
  }

  .sheet {
    position: static;
    display: block;
  }

  .sheet-backdrop {
    display: none;
  }

  .sheet-panel {
    max-height: none;
    box-shadow: none;
    border-radius: 0;
  }

  .sheet-body {
    overflow: visible;
    padding: 0;
  }
}
