:root {
  --bg-core: #090d16;
  --bg-surface: #0f172a;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(28, 38, 58, 0.85);
  --bg-card-active: #172033;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-default: rgba(255, 255, 255, 0.12);
  --border-active: #38bdf8;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;

  --accent-cyan: #38bdf8;
  --accent-cyan-hover: #7dd3fc;
  --accent-cyan-subtle: rgba(56, 189, 248, 0.12);
  --accent-amber: #fbbf24;
  --accent-purple: #c084fc;
  --accent-emerald: #34d399;
  --accent-rose: #f87171;
  --accent-indigo: #818cf8;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* 全局基础重置，彻底防止浏览器默认原生按钮/下拉框样式外露 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  background-color: var(--bg-core);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  overflow: hidden;
  letter-spacing: -0.01em;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  box-sizing: border-box;
}

button {
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

select {
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
}

option {
  background: #0f172a;
  color: #f8fafc;
}

input, textarea {
  outline: none;
  border: none;
}

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

/* 顶部与背景微光 */
.glow-bg {
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.08) 0%, rgba(129, 140, 248, 0.03) 50%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.app-layout {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 1680px;
  margin: 0 auto;
}

/* ============================================================
   顶部主导航 (Header)
============================================================ */
.app-header {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(9, 13, 22, 0.88);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(129, 140, 248, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  font-size: 19px;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
}

.brand-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.pulse-ring {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-ring 2.5s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px var(--accent-emerald); }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.status-indicator.offline .pulse-ring {
  background: var(--accent-rose);
  box-shadow: none;
  animation: none;
}

.status-indicator.reconnecting .pulse-ring {
  background: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
}

.header-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 5px 10px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.header-icon-btn i {
  font-size: 0.95rem;
}

.header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* 顶部中间流程状态 Tab (Pill Nav) */
.header-center {
  display: flex;
  align-items: center;
}

.pill-nav {
  display: flex;
  background: rgba(15, 23, 42, 0.85);
  padding: 3px;
  border-radius: 30px;
  border: 1px solid var(--border-subtle);
  gap: 2px;
}

.pill-btn {
  color: var(--text-secondary);
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.pill-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.pill-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pill-btn.todo.active {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.pill-btn.doing.active {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.pill-btn.review.active {
  background: rgba(192, 132, 252, 0.18);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.35);
}

.pill-btn.done.active {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.pill-btn.confirm.active {
  background: rgba(244, 63, 94, 0.18);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.pill-badge {
  background: rgba(0, 0, 0, 0.4);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 500;
}

/* 顶部右侧操作与用户头像 */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.primary-create-btn {
  background: var(--accent-cyan);
  color: #090d16;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 15px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 12px rgba(56, 189, 248, 0.3);
}

.primary-create-btn i {
  font-size: 1rem;
}

.primary-create-btn:hover {
  background: #7dd3fc;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.4);
}

.user-menu-wrapper {
  position: relative;
}

.user-profile-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
}

.user-profile-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
}

.user-avatar-icon {
  font-size: 1.05rem;
  color: var(--accent-cyan);
}

.menu-arrow {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  transition: transform 0.2s;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 6px;
  width: 220px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  display: none;
  flex-direction: column;
  z-index: 1000;
  backdrop-filter: blur(20px);
}

.user-dropdown-menu.show {
  display: flex;
  animation: dropdownFadeIn 0.15s ease-out;
}

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

.dropdown-header {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-label {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dropdown-header strong {
  font-size: 0.88rem;
  color: #fff;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

.dropdown-item {
  width: 100%;
  color: var(--text-secondary);
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: flex-start;
  text-align: left;
}

.dropdown-item i {
  font-size: 1rem;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.dropdown-item.danger {
  color: var(--accent-rose);
}

.dropdown-item.danger:hover {
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
}

/* ============================================================
   过滤器与搜索栏 (Toolbar)
============================================================ */
.filter-toolbar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid var(--border-subtle);
  gap: 14px;
  flex-shrink: 0;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 12px;
  flex: 1;
  max-width: 420px;
  transition: all 0.2s;
}

.search-box:focus-within {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.search-icon {
  font-size: 0.95rem;
  color: var(--text-tertiary);
}

.search-box input {
  background: transparent;
  width: 100%;
  color: var(--text-primary);
  font-size: 0.82rem;
}

.search-box input::placeholder {
  color: var(--text-tertiary);
}

.select-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-select {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 28px 6px 10px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: all 0.15s;
}

.filter-select:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.18);
}

.filter-select:focus {
  border-color: var(--accent-cyan);
  outline: none;
}

/* ============================================================
   主工作区 (Main Content: Split View)
============================================================ */
.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* 左侧任务列表面板 */
.todo-list-pane {
  width: 380px;
  min-width: 320px;
  max-width: 460px;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  background: rgba(11, 16, 28, 0.7);
  flex-shrink: 0;
  overflow: hidden;
}

.pane-header {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.5);
  flex-shrink: 0;
}

.pane-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pane-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.pane-counter {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 8px;
}

.compact-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.compact-toggle-label input[type="checkbox"] {
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.list-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 列表滚动条美化 */
.list-container::-webkit-scrollbar,
.todo-detail-pane::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.list-container::-webkit-scrollbar-thumb,
.todo-detail-pane::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
.list-container::-webkit-scrollbar-thumb:hover,
.todo-detail-pane::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* 状态加载中与空列表 */
.loading-state, .empty-list-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 20px;
  color: var(--text-tertiary);
  gap: 12px;
  font-size: 0.85rem;
}

.spinner {
  width: 26px;
  height: 26px;
  border: 2px solid rgba(56, 189, 248, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* 任务卡片项 (Task Card) */
.todo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.todo-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.todo-card.active {
  background: var(--bg-card-active);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 1px var(--accent-cyan), 0 4px 16px rgba(0, 0, 0, 0.4);
}

.todo-card.is-merged {
  opacity: 0.6;
  border-style: dashed;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.channel-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}

.project-tag {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 6px;
  border-radius: 4px;
}

.priority-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

.priority-badge.urgent { background: rgba(248, 113, 113, 0.15); color: #f87171; }
.priority-badge.high { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.priority-badge.normal { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.priority-badge.low { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

.status-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

.status-badge.todo { background: rgba(56, 189, 248, 0.12); color: #38bdf8; }
.status-badge.in_progress { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.status-badge.review { background: rgba(192, 132, 252, 0.15); color: #c084fc; }
.status-badge.done { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.status-badge.needs_confirm { background: rgba(244, 63, 94, 0.15); color: #fb7185; }
.status-badge.merged { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }

.card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.card-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-id-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--accent-indigo);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.card-images-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-secondary);
}

.card-time {
  font-family: var(--font-mono);
}

.card-quick-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.btn-quick {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.btn-quick:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-quick.confirm-yes {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.btn-quick.confirm-yes:hover {
  background: rgba(16, 185, 129, 0.25);
}

/* ============================================================
   右侧任务详情面板 (Detail Pane)
============================================================ */
.todo-detail-pane {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--bg-core);
  position: relative;
}

.detail-empty {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  max-width: 440px;
  gap: 14px;
}

.empty-glow {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.detail-empty h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.detail-empty p {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  line-height: 1.6;
}

.detail-content {
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 1000px;
}

/* 详情顶部操作头 */
.detail-header-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 18px;
}

.detail-header-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-id-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
}

.copy-id-btn {
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 2px 4px;
  border-radius: 4px;
}
.copy-id-btn:hover { color: var(--accent-cyan); }

.detail-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  letter-spacing: -0.015em;
  word-break: break-word;
}

.detail-meta-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.detail-actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-detail-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  gap: 6px;
}

.btn-detail-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-detail-action.primary {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}
.btn-detail-action.primary:hover {
  background: rgba(56, 189, 248, 0.25);
}

.btn-detail-action.success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}
.btn-detail-action.success:hover {
  background: rgba(16, 185, 129, 0.25);
}

.btn-detail-action.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}
.btn-detail-action.warning:hover {
  background: rgba(245, 158, 11, 0.25);
}

.btn-detail-action.danger {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}
.btn-detail-action.danger:hover {
  background: rgba(248, 113, 113, 0.22);
}

/* 详情属性网格 (Meta Grid) */
.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px 18px;
}

.meta-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.meta-val {
  font-size: 0.82rem;
  color: var(--text-primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 详情分区卡片 */
.detail-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 7px;
}

.section-title i {
  color: var(--accent-cyan);
}

/* Markdown 渲染样式 */
.markdown-body {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 18px 22px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #cbd5e1;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  color: #fff;
  margin: 16px 0 8px;
  font-weight: 700;
}
.markdown-body h1 { font-size: 1.3rem; }
.markdown-body h2 { font-size: 1.15rem; }
.markdown-body h3 { font-size: 1rem; }

.markdown-body p { margin-bottom: 10px; }
.markdown-body ul, .markdown-body ol { padding-left: 20px; margin-bottom: 10px; }
.markdown-body li { margin-bottom: 4px; }
.markdown-body blockquote {
  border-left: 3px solid var(--accent-cyan);
  padding: 6px 14px;
  background: rgba(56, 189, 248, 0.05);
  color: var(--text-secondary);
  border-radius: 0 6px 6px 0;
  margin-bottom: 12px;
}
.markdown-body pre {
  background: #0b0f19;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  margin: 12px 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.markdown-body code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.82rem;
  color: #38bdf8;
}
.markdown-body pre code {
  background: transparent;
  padding: 0;
  color: #f8fafc;
}
.markdown-body table {
  margin: 12px 0;
  width: 100%;
  border-collapse: collapse;
}
.markdown-body th, .markdown-body td {
  border: 1px solid var(--border-subtle);
  padding: 8px 12px;
  text-align: left;
}
.markdown-body th {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* 图片产物网格 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  background: #000;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  transition: opacity 0.2s;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

/* 来源列表 (Sources) */
.sources-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 0.8rem;
}

.source-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.source-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-link-btn {
  color: var(--accent-cyan);
  font-size: 0.78rem;
  padding: 3px 8px;
  background: rgba(56, 189, 248, 0.1);
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.source-link-btn:hover { background: rgba(56, 189, 248, 0.2); }

/* 审核与结论横幅 */
.claim-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.6);
}

.claim-banner-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

/* 历史时间轴 (Timeline) */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-left: 2px solid rgba(255, 255, 255, 0.08);
  margin-left: 8px;
  padding-left: 16px;
}

.timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-dot {
  position: absolute;
  left: -22px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-cyan);
  border: 2px solid var(--bg-core);
}

.timeline-header {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-header strong {
  color: var(--text-primary);
}

.timeline-time {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
}

.timeline-body {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ============================================================
   模态框系统 (Modals)
============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.modal-card {
  width: 100%;
  max-width: 580px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-card.modal-large {
  max-width: 860px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.modal-close-btn {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-tertiary);
  padding: 4px;
  border-radius: 6px;
}
.modal-close-btn:hover { color: #fff; }

.modal-tip-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

/* 表单组件 */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-row {
  display: flex;
  gap: 14px;
}

.col-half {
  flex: 1;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 9px 12px;
  font-size: 0.85rem;
  transition: all 0.2s;
  width: 100%;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
  font-family: inherit;
}

/* 图片拖拽区域 */
.image-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.image-dropzone:hover, .image-dropzone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.05);
}

.image-dropzone p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.image-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.preview-thumb-wrap {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

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

.btn-remove-thumb {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 11px;
}

/* 模态框操作按钮组 */
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

.btn-cancel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}
.btn-cancel:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.btn-save {
  background: var(--accent-cyan);
  color: #090d16;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.25);
}
.btn-save:hover { background: #7dd3fc; }

.btn-action-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 600;
}
.btn-action-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-primary-small {
  background: var(--accent-cyan);
  color: #090d16;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-primary-small:hover { background: #7dd3fc; }

/* 配置中心 Tab */
.settings-modal-tabs {
  display: flex;
  gap: 8px;
}

.settings-tab-btn {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  gap: 6px;
}
.settings-tab-btn:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.settings-tab-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
}

.settings-tab-content {
  display: none;
  flex-direction: column;
  gap: 16px;
}
.settings-tab-content.active {
  display: flex;
}

.tab-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tab-desc {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* 数据表格 (Data Table) */
.table-responsive {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-secondary);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* 存储度量面板 */
.storage-card-overview {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.storage-metric-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}
.storage-metric-title { font-weight: 600; color: #fff; }
.storage-metric-ratio { font-family: var(--font-mono); color: var(--accent-cyan); }

.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.policy-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px 18px;
}

.policy-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}
.policy-label { color: var(--text-tertiary); }
.policy-value { color: var(--text-primary); font-family: var(--font-mono); }

.cleanup-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cleanup-result-box {
  background: #080c14;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #94a3b8;
  max-height: 160px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* 事件勾选网格 */
.events-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
}
.events-checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.events-checkbox-grid input[type="checkbox"] {
  accent-color: var(--accent-cyan);
}

/* ============================================================
   灯箱大图画廊 (Lightbox)
============================================================ */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: none;
  align-items: center;
  justify-content: center;
}
.lightbox-modal.show { display: flex; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(16px);
}

.lightbox-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-close {
  position: absolute;
  top: -46px;
  right: 0;
  color: #fff;
  font-size: 1.8rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 36px;
  height: 36px;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.2); }

.lightbox-stage img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.lightbox-caption { font-size: 0.85rem; color: var(--text-secondary); }
.lightbox-origin-btn {
  font-size: 0.78rem;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.lightbox-origin-btn:hover { background: rgba(56, 189, 248, 0.2); }

/* ============================================================
   移动端与响应式断点控制 (Mobile Optimization)
============================================================ */
/* 桌面端显式强制隐藏手机端专属元素 */
@media (min-width: 769px) {
  .mobile-bottom-nav,
  .mobile-fab,
  .mobile-back-bar {
    display: none !important;
  }
}

/* 手机端响应式 (≤ 768px) */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-tap-highlight-color: transparent;
  }

  .glow-bg {
    display: none;
  }

  /* ------------------------------------------------------------
     1. 顶部 Header: 严密紧凑自适应，杜绝挤压变形与文字竖排
  ------------------------------------------------------------ */
  .app-header {
    height: 50px;
    padding: 0 12px;
    gap: 8px;
    justify-content: space-between;
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
  }

  .brand-logo {
    width: 30px;
    height: 30px;
    font-size: 16px;
    border-radius: 8px;
    flex-shrink: 0;
  }

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

  .brand-title {
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .system-status {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  /* 状态指示器：仅保留呼吸光点，隐藏“在线”/“重连中...”等易换行文字 */
  .status-indicator {
    padding: 4px;
    gap: 0;
    flex-shrink: 0;
  }

  .status-indicator .indicator-text {
    display: none !important;
  }

  /* 系统设置按钮：手机端化为纯图标小按钮，隐藏“系统设置”四个汉字 */
  .header-icon-btn {
    padding: 0;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .header-icon-btn span {
    display: none !important;
  }

  .header-icon-btn i {
    font-size: 1.05rem;
  }

  /* 隐藏桌面端居中的状态栏 Tab（手机端由底部原生 Tab 栏接管） */
  .header-center {
    display: none !important;
  }

  .header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  /* 核心修复：手机端隐藏顶部的新建任务按钮，避免和 FAB 重复并避免顶栏被撑爆 */
  .primary-create-btn {
    display: none !important;
  }

  /* 用户登录态按钮紧凑化 */
  .user-menu-wrapper {
    position: relative;
    flex-shrink: 0;
  }

  .user-profile-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
    gap: 4px;
    max-width: 92px;
    border-radius: 6px;
  }

  .user-name-text {
    max-width: 50px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .menu-arrow {
    font-size: 0.75rem;
  }

  .user-dropdown-menu {
    right: 0;
    width: 200px;
  }

  /* ------------------------------------------------------------
     2. 搜索与筛选工具栏 (Toolbar): 双行横向滑动标签胶囊
  ------------------------------------------------------------ */
  .filter-toolbar {
    padding: 8px 12px;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
  }

  .search-box {
    max-width: 100%;
    height: 36px;
    padding: 0 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
  }

  .search-box input {
    font-size: 0.8rem;
  }

  /* 横向单行流畅滑动容器（类似原生 App 筛选栏） */
  .select-group {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 0 4px;
    width: 100%;
  }

  .select-group::-webkit-scrollbar {
    display: none;
  }

  .filter-select {
    flex: 0 0 auto;
    min-width: 96px;
    height: 32px;
    padding: 0 24px 0 10px;
    font-size: 0.75rem;
    border-radius: 16px;
    background-position: right 6px center;
    background-size: 14px;
  }

  /* ------------------------------------------------------------
     3. 主视图布局与列表面板
  ------------------------------------------------------------ */
  .main-content {
    flex-direction: column;
    overflow: visible;
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  .todo-list-pane {
    width: 100%;
    max-width: 100%;
    border-right: none;
    overflow-y: visible;
  }

  .pane-header {
    padding: 8px 12px;
    margin-bottom: 4px;
  }

  .pane-title {
    font-size: 0.88rem;
  }

  .pane-counter {
    font-size: 0.75rem;
  }

  .compact-toggle-label {
    font-size: 0.72rem;
  }

  .list-container {
    padding: 0 12px;
  }

  /* ------------------------------------------------------------
     4. 任务卡片触摸与样式优化
  ------------------------------------------------------------ */
  .todo-card {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border-subtle);
    transition: transform 0.12s ease, background 0.12s ease;
  }

  .todo-card:active {
    transform: scale(0.985);
    background: rgba(30, 41, 59, 0.9);
  }

  .card-header {
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
  }

  .card-title {
    font-size: 0.92rem;
    line-height: 1.4;
    margin-bottom: 8px;
  }

  .card-meta {
    font-size: 0.72rem;
  }

  /* ------------------------------------------------------------
     5. 任务详情抽屉（移动端平滑滑入）
  ------------------------------------------------------------ */
  .todo-detail-pane {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: var(--bg-core);
    padding: 0 0 calc(70px + env(safe-area-inset-bottom, 0px));
  }

  .todo-detail-pane.mobile-open {
    display: block;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: slideInRight 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
  }

  .detail-content {
    padding: 16px 14px;
  }

  .mobile-back-bar {
    position: sticky;
    top: 0;
    background: rgba(9, 13, 22, 0.96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
  }

  .mobile-back-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .mobile-back-btn:active {
    background: rgba(255, 255, 255, 0.15);
  }

  /* ------------------------------------------------------------
     6. 模态框 (Bottom Sheet 移动端底部抽屉交互与设置弹窗彻底优化)
  ------------------------------------------------------------ */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 88vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7);
    position: relative;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 抽屉顶部把手条 (Pull Handle) */
  .modal-card::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0 auto 12px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  /* 设置模态框顶栏重构：解除挤压，Tab 与关闭按钮各就其位 */
  #settingsModal .modal-header {
    flex-direction: column;
    align-items: stretch;
    position: relative;
    padding-right: 40px;
    margin-bottom: 12px;
    gap: 10px;
  }

  #settingsModal .modal-close-btn {
    position: absolute;
    top: -2px;
    right: 0;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
  }

  #settingsModal .modal-close-btn:active {
    background: rgba(255, 255, 255, 0.16);
  }

  /* 设置 Tab 栏：顺滑横向滑动胶囊药丸 */
  .settings-modal-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    padding: 2px 0 4px;
    width: 100%;
  }

  .settings-modal-tabs::-webkit-scrollbar {
    display: none;
  }

  .settings-tab-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
  }

  .settings-tab-btn.active {
    background: rgba(56, 189, 248, 0.18);
    border-color: rgba(56, 189, 248, 0.4);
    color: var(--accent-cyan);
    font-weight: 700;
  }

  /* 设置面板操作栏：上下解耦，彻底修复“+ 添加渠道”文字竖排被挤压变形 */
  .tab-action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
  }

  .tab-desc {
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-tertiary);
    background: rgba(255, 255, 255, 0.02);
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 2px solid var(--accent-cyan);
  }

  .tab-action-bar .btn-primary-small {
    width: 100%;
    height: 38px;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 10px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  /* 移动端数据表格全自动升级为精致“卡片流”(Card View) */
  .table-responsive {
    border: none;
    max-height: 50vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: transparent;
    padding-bottom: 12px;
  }

  .data-table {
    display: block;
    width: 100%;
    border: none;
  }

  .data-table thead {
    display: none !important;
  }

  .data-table tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .data-table tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 12px 14px;
    gap: 8px 12px;
    width: 100%;
    box-sizing: border-box;
    transition: background 0.15s ease;
  }

  .data-table tr:hover,
  .data-table tr:active {
    background: rgba(255, 255, 255, 0.06);
  }

  .data-table td {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  /* 渠道卡片专属排版 */
  #channelsTableBody tr td:nth-child(1) {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.92rem;
    font-weight: 600;
    flex: 1 1 auto;
    min-width: 0;
  }

  #channelsTableBody tr td:nth-child(2) {
    display: inline-flex;
    align-items: center;
  }

  #channelsTableBody tr td:nth-child(2) code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
  }

  #channelsTableBody tr td:nth-child(4) {
    margin-left: auto;
    display: inline-flex;
  }

  #channelsTableBody tr td:nth-child(4) .btn-quick {
    padding: 3px 10px;
    font-size: 0.75rem;
    border-radius: 14px;
  }

  #channelsTableBody tr td:nth-child(3) {
    width: 100%;
    font-size: 0.72rem;
    color: var(--text-tertiary);
    word-break: break-all;
    padding-top: 6px !important;
    border-top: 1px dashed rgba(255, 255, 255, 0.07) !important;
  }

  #channelsTableBody tr td:nth-child(5) {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 4px !important;
  }

  /* Webhook 卡片专属排版 */
  #webhooksTableBody tr td:nth-child(1) {
    width: 100%;
    font-weight: 600;
    word-break: break-all;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
  }

  #webhooksTableBody tr td:nth-child(2) {
    width: 100%;
    font-size: 0.72rem;
    color: var(--text-secondary);
  }

  #webhooksTableBody tr td:nth-child(3) {
    display: inline-flex;
  }

  #webhooksTableBody tr td:nth-child(4) {
    display: inline-flex;
    font-size: 0.72rem;
    margin-left: 8px;
  }

  #webhooksTableBody tr td:nth-child(5) {
    margin-left: auto;
    display: flex;
    gap: 6px;
  }

  /* 存储策略面板移动端精致排版 */
  .storage-card-overview {
    padding: 14px 16px;
    border-radius: 12px;
  }

  .policy-details {
    padding: 12px 14px;
    border-radius: 12px;
    gap: 10px;
  }

  .policy-row {
    font-size: 0.78rem;
  }

  .cleanup-actions .btn-action-outline {
    width: 100%;
    height: 40px;
    justify-content: center;
    border-radius: 10px;
  }

  /* ------------------------------------------------------------
     7. 手机端底部导航条 (Tab Bar)
  ------------------------------------------------------------ */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(9, 13, 22, 0.96);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-subtle);
    z-index: 50;
    justify-content: space-around;
    align-items: center;
    padding-left: 6px;
    padding-right: 6px;
  }

  .mob-btn {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--text-tertiary);
    padding: 4px 6px;
    border-radius: 8px;
    flex: 1;
    transition: color 0.15s ease, transform 0.12s ease;
  }

  .mob-btn:active {
    transform: scale(0.92);
  }

  .mob-btn.active {
    color: var(--accent-cyan);
  }

  .mob-icon {
    font-size: 1.2rem;
  }

  .mob-label {
    font-size: 0.65rem;
    font-weight: 700;
  }

  /* ------------------------------------------------------------
     8. 手机端悬浮新建按钮 (FAB)
  ------------------------------------------------------------ */
  .mobile-fab {
    display: flex !important;
    position: fixed;
    right: 18px;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent-cyan);
    color: #090d16;
    font-size: 1.6rem;
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
    align-items: center;
    justify-content: center;
    z-index: 90;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .mobile-fab:active {
    transform: scale(0.9);
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.35);
  }
}

/* 二级弹窗提升层级避免被配置模态框遮盖 */
#channelFormModal,
#webhookFormModal,
#webhookLogsModal {
  z-index: 1100;
}
