@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-0: #edeef2;
  --bg-1: #f4f4f7;
  --bg-2: #f4f4f7;
  --bg-3: #edeef2;
  --bg-4: #e4e5eb;
  --bg-5: #dbdce3;
  --bg-hover: rgba(0,0,0,0.025);

  --text-high: #1a1d26;
  --text-mid: #5a6178;
  --text-low: #9098ad;
  --text-disabled: #c0c5d4;

  --primary: #16a34a;
  --primary-light: #22c55e;
  --primary-dim: rgba(22,163,74,0.08);
  --primary-glow: rgba(22,163,74,0.15);

  --up: #16a34a;
  --up-bg: rgba(22,163,74,0.08);
  --down: #dc2626;
  --down-bg: rgba(220,38,38,0.06);
  --warn: #d97706;
  --warn-bg: rgba(217,119,6,0.06);
  --info: #2563eb;
  --info-bg: rgba(37,99,235,0.06);

  --border: #d8dae2;
  --border-hover: #c5c8d2;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-card-hover: 0 4px 12px rgba(0,0,0,0.06);
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Inter', -apple-system, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  background: var(--bg-0);
  color: var(--text-high);
  font-size: 10px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ====== HEADER ====== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 24px;
  background: linear-gradient(180deg, #f8f8fb 0%, var(--bg-1) 100%);
  border-bottom: 1px solid var(--border);
  -webkit-app-region: drag;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(22,163,74,0.2);
}
.header-left h1 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-high);
}
.header-right { -webkit-app-region: no-drag; }
.status-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-3);
}
.status-pill.online { border-color: rgba(22,163,74,0.25); background: var(--up-bg); }
.status-pill.offline { border-color: rgba(220,38,38,0.2); background: var(--down-bg); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.status-dot.online {
  background: var(--up);
  box-shadow: 0 0 6px rgba(22,163,74,0.4);
  animation: pulse 2s ease-in-out infinite;
}
.status-dot.offline { background: var(--down); }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

/* ====== TAB NAV ====== */
.tab-nav {
  display: flex; align-items: stretch;
  padding: 0 24px; gap: 2px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  position: relative;
  padding: 0 18px; height: 40px;
  background: transparent; border: none;
  color: var(--text-low);
  font-size: 12px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; gap: 7px;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
}
.tab-btn:hover { color: var(--text-mid); background: var(--bg-hover); }
.tab-btn.active { color: var(--primary); }
.tab-btn.active::after {
  content: ''; position: absolute;
  bottom: 0; left: 6px; right: 6px; height: 2.5px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
}
.tab-icon { font-size: 13px; }

/* ====== CONTENT ====== */
.tab-content { padding: 16px 24px; margin: 0 auto; height: calc(100vh - 89px); }
.tab-pane { display: none; height: 100%; }
.tab-pane.active { display: flex; flex-direction: column; animation: fadeUp 0.25s ease; }
@keyframes fadeUp { from{opacity:0;transform:translateY(6px);} to{opacity:1;transform:translateY(0);} }

/* ====== CARD ====== */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-card-hover); }
.card.card-grow {
  flex: 1; display: flex; flex-direction: column;
  min-height: 0; margin-bottom: 0;
}
.card.card-grow .card-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}
.card-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700; color: var(--text-high);
}
.card-icon { font-size: 11px; }
.card-body { padding: 8px 12px; }

/* ====== ROW ====== */
.row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ====== INPUT ====== */
.input, .select {
  height: 26px; padding: 0 10px;
  background: var(--bg-1);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-high);
  font-size: 10px; font-family: inherit;
  outline: none; transition: all var(--transition);
}
.input::placeholder { color: var(--text-low); }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-dim); }
.input { min-width: 240px; }
.select {
  min-width: 140px; cursor: pointer;
  -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='%239098ad' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.select:focus { border-color: var(--primary); }
select option { background: var(--bg-1); color: var(--text-high); }

/* ====== BUTTONS ====== */
.btn {
  height: 26px; padding: 0 12px;
  border: none; border-radius: var(--radius-xs);
  font-size: 12px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: all var(--transition);
  display: inline-flex; align-items: center; justify-content: center;
  gap: 5px; white-space: nowrap;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 1px 4px var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-light);
  box-shadow: 0 3px 12px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-4); color: var(--text-mid);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-5); color: var(--text-high); }

.btn-danger {
  background: var(--down-bg); color: var(--down);
  border: 1px solid rgba(220,38,38,0.1);
}
.btn-danger:hover { background: rgba(220,38,38,0.1); }

.btn-sm { height: 22px; padding: 0 8px; font-size: 8px; }
.btn-lg { height: 40px; padding: 0 28px; font-size: 13px; border-radius: 10px; }

/* ====== DATA TABLE ====== */
.table-scroll-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 10px;
  table-layout: auto;
}
.data-table thead th {
  padding: 7px 6px; text-align: center;
  background: var(--bg-3); color: var(--text-mid);
  font-weight: 700; font-size: 10px;
  letter-spacing: 0.3px;
  white-space: nowrap; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 2;
}
.data-table thead th:first-child { padding-left: 8px; }
.data-table tbody td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--bg-4);
  color: var(--text-high);
  white-space: nowrap;
  font-size: 10px;
  vertical-align: middle;
  text-align: center;
  line-height: 1.5;
}
.data-table tbody td:first-child { padding-left: 8px; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--primary-dim); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* 允许多行内容的列 - <br>标签换行，overflow隐藏超长文本 */
.data-table tbody td.cell-wrap {
  white-space: normal;
  overflow: hidden;
  line-height: 1.5;
  font-size: 10px;
}
/* 多行内容：整体居中，行内左对齐 */
.cell-inner {
  display: inline-block;
  text-align: left;
}

/* 列宽定义 (table-layout: fixed, 需要在 th 上设宽度) */
.data-table .col-w50 { width: 50px; }
.data-table .col-w60 { width: 60px; }
.data-table .col-w70 { width: 70px; }
.data-table .col-w80 { width: 80px; }
.data-table .col-w90 { width: 90px; }
.data-table .col-w100 { width: 100px; }
.data-table .col-w120 { width: 120px; }
.data-table .col-w140 { width: 140px; }
.data-table .col-w160 { width: 160px; }

.match-name { font-weight: 700; white-space: nowrap; }
.match-vs { color: var(--text-low); margin: 0 4px; font-weight: 400; font-size: 10px; }
.score { font-weight: 800; font-size: 12px; color: var(--primary); }

/* ====== BADGES ====== */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 100px;
  font-size: 8px; font-weight: 700;
}
.badge-up { background: var(--up-bg); color: var(--up); }
.badge-down { background: var(--down-bg); color: var(--down); }
.badge-same { background: var(--bg-4); color: var(--text-low); }
.badge-status { background: var(--primary-dim); color: var(--primary); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-info { background: var(--info-bg); color: var(--info); }

/* ====== LOG ====== */
.log-area {
  height: calc(100vh - 220px);
  overflow-y: auto;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
  font-size: 9px; line-height: 1.8;
  color: var(--text-mid);
}
.log-line { display: flex; gap: 10px; align-items: baseline; }
.log-time { color: var(--text-low); font-size: 9px; min-width: 68px; flex-shrink: 0; }
.log-info { color: var(--text-main); }
.log-warn { color: var(--warn); }
.log-error { color: var(--down); }

/* ====== EMPTY STATE ====== */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-low); }
.empty-icon { font-size: 36px; margin-bottom: 12px; opacity: 0.3; }
.empty-state p { margin-top: 6px; font-size: 11px; color: var(--text-disabled); }

/* ====== RESULTS ====== */
.analysis-result, .archive-result {
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', 'Microsoft YaHei', monospace;
  font-size: 12px; line-height: 1.85;
  display: none; padding: 18px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 70vh; overflow-y: auto;
}
.analysis-result.has-data, .archive-result.has-data { display: block; }
.archive-result { white-space: pre-wrap; }
.status-msg { font-size: 12px; color: var(--text-mid); margin-left: 12px; }

.result-area {
  margin-top: 14px;
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', 'Microsoft YaHei', monospace;
  font-size: 11px; line-height: 1.8;
  white-space: pre-wrap; padding: 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* ====== ACTION BTNS ====== */
.action-btns { display: flex; gap: 5px; }

/* ====== MODAL ====== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; backdrop-filter: blur(6px);
}
.modal {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 92%; max-width: 1600px; max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
  animation: fadeUp 0.25s ease;
}
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 800;
}
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-4); border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-mid); font-size: 14px;
  cursor: pointer; transition: all var(--transition);
}
.modal-close:hover { background: var(--down-bg); color: var(--down); }

/* ====== SCROLLBAR ====== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-5); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ====== POLISH ====== */

/* Card left accent border */
.card { border-left: 3px solid transparent; }
.card:hover { border-left-color: var(--primary); }

/* Table zebra striping */
.data-table tbody tr:nth-child(even) { background: var(--bg-3); }
.data-table tbody tr:nth-child(even):hover { background: var(--primary-dim); }

/* Smooth button icon bounce on hover */
.btn-primary:hover .btn-icon { transform: scale(1.1); }

/* Input subtle inner shadow */
.input:focus { box-shadow: 0 0 0 2px var(--primary-dim); }

/* Badge subtle border */
.badge-up { border: 1px solid rgba(22,163,74,0.12); }
.badge-down { border: 1px solid rgba(220,38,38,0.1); }
.badge-status { border: 1px solid rgba(22,163,74,0.12); }

/* Tab active glow */
.tab-btn.active::after {
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Card header icon subtle color */
.card-header .card-icon { opacity: 0.7; }
.card:hover .card-header .card-icon { opacity: 1; }

/* Status pill transition */
.status-pill { transition: all var(--transition); }

/* Score glow on hover */
.data-table tbody tr:hover .score { color: var(--primary-light); }

/* Empty state icon float animation */
.empty-icon { animation: float 3s ease-in-out infinite; }
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Log area new line fade-in */
.log-line { animation: logIn 0.3s ease; }
@keyframes logIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }

/* Modal entrance */
.modal { transform-origin: center center; }

/* Smooth scrollbar appearance */
.table-scroll-wrapper::-webkit-scrollbar-thumb { background: var(--border); }
.table-scroll-wrapper::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* Header title hover effect */
.header-left h1 { transition: color var(--transition); }
.header-left:hover h1 { color: var(--primary); }

/* Action button hover glow */
.action-btns .btn-secondary:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.action-btns .btn-danger:hover { box-shadow: 0 2px 8px rgba(220,38,38,0.08); }

/* ====== MORE POLISH ====== */

/* Header logo spin on hover */
.logo { transition: transform 0.4s ease; }
.header-left:hover .logo { transform: rotate(15deg) scale(1.08); }

/* Card entrance stagger animation */
.card { animation: cardIn 0.35s ease backwards; }
.card:nth-child(1) { animation-delay: 0s; }
.card:nth-child(2) { animation-delay: 0.06s; }
.card:nth-child(3) { animation-delay: 0.12s; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Button press ripple effect */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255,255,255,0.25) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}
.btn:active::after { opacity: 1; }

/* Primary button subtle gradient */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #15803d 100%);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

/* Table header bottom gradient line */
.data-table thead tr {
  background: linear-gradient(180deg, var(--bg-3) 0%, var(--bg-4) 100%);
}
.data-table thead th { background: transparent; }

/* Table row left highlight on hover */
.data-table tbody tr { border-left: 3px solid transparent; }
.data-table tbody tr:hover { border-left-color: var(--primary); }

/* Badge pulse for status */
.badge-status::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--primary);
  margin-right: 5px;
  animation: pulse 2s ease-in-out infinite;
}

/* Input placeholder fade on focus */
.input:focus::placeholder { color: transparent; transition: color 0.2s; }

/* Card header separator dot */
.card-title::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

/* Tab hover underline preview */
.tab-btn::before {
  content: '';
  position: absolute;
  bottom: 0; left: 6px; right: 6px; height: 2.5px;
  background: var(--border);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.tab-btn:hover::before { transform: scaleX(1); }
.tab-btn.active::before { display: none; }

/* Tooltip style for status pill */
.status-pill { cursor: default; }
.status-pill:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); transform: translateY(-1px); }

/* Log area line number style */
.log-time {
  font-variant-numeric: tabular-nums;
  border-right: 2px solid var(--border);
  padding-right: 10px;
  margin-right: 2px;
}

/* Smooth card shadow transition */
.card {
  transition: border-color var(--transition), box-shadow var(--transition), border-left-color var(--transition);
}

/* Empty state text breathing */
.empty-state > :not(.empty-icon) {
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe {
  0%,100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Select dropdown arrow rotation on focus */
.select { transition: all var(--transition); }
.select:focus {
  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='%2316a34a' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* Match VS separator style */
.match-vs {
  background: var(--bg-4);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
}

/* Action buttons group rounded container */
.action-btns {
  display: inline-flex;
  gap: 4px;
  padding: 2px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg-3);
}
.action-btns:empty {
  display: none;
}
.action-btns .btn { border: none; background: transparent; }
.action-btns .btn:hover { background: var(--bg-5); }
.action-btns .btn-danger:hover { background: var(--down-bg); border: none; }

/* ====== DETAIL POLISH ROUND 3 ====== */

/* Header glass morphism effect */
.app-header {
  background: linear-gradient(180deg, rgba(248,248,251,0.92) 0%, rgba(244,244,247,0.88) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Logo inner shine */
.logo {
  position: relative;
  overflow: hidden;
}
.logo::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.2) 50%, transparent 60%);
  animation: logoShine 4s ease-in-out infinite;
}
@keyframes logoShine {
  0%,100% { transform: translateX(-100%) rotate(45deg); }
  50% { transform: translateX(100%) rotate(45deg); }
}

/* Tab active state enhanced */
.tab-btn.active {
  background: rgba(22,163,74,0.04);
}

/* Card inner content subtle top shadow */
.card-body {
  position: relative;
}
.card-body::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  pointer-events: none;
}

/* Table cell tabular nums */
.data-table tbody td {
  font-variant-numeric: tabular-nums;
}

/* Score cell special treatment */
.score {
  background: var(--primary-dim);
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
  text-align: center;
  letter-spacing: 1px;
  border: 1px solid rgba(22,163,74,0.08);
}

/* Table header sticky */
.data-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}
.data-table thead th {
  border-top: none;
}

/* Input group visual connection */
.row .input + .btn,
.row .select + .btn {
  margin-left: -2px;
}

/* Card header subtle gradient */
.card-header {
  background: linear-gradient(180deg, var(--bg-3) 0%, rgba(228,229,235,0.5) 100%);
}

/* Smooth focus ring for all interactive elements */
.btn:focus-visible,
.select:focus-visible,
.tab-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.input:focus-visible {
  outline: none;
}

/* Log area enhanced styling */
.log-area {
  background: linear-gradient(180deg, var(--bg-3) 0%, rgba(237,238,242,0.5) 100%);
}

/* Log level icons */
.log-info::before { content: '● '; font-size: 8px; vertical-align: middle; }
.log-warn::before { content: '▲ '; font-size: 8px; vertical-align: middle; }
.log-error::before { content: '✕ '; font-size: 9px; vertical-align: middle; }

/* Empty state refined */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}
.empty-icon {
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-4);
  border-radius: 50%;
  margin-bottom: 16px;
  border: 2px dashed var(--border);
}

/* Result area code block style */
.analysis-result h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-high);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-dim);
}

/* Duplicate result area */
.result-area {
  display: block;
  color: var(--text-mid);
}

/* Select hover state */
.select:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-0);
}

/* Button group spacing in card body */
.card-body .row .btn + .btn {
  margin-left: 2px;
}

/* Table responsive horizontal scroll */
.table-scroll-wrapper {
  position: relative;
}

/* Match name cell */
.match-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Status badge variants */
.badge-status[data-status="已获取"] { background: var(--up-bg); color: var(--up); }
.badge-status[data-status="获取中"] { background: var(--warn-bg); color: var(--warn); }
.badge-status[data-status="错误"] { background: var(--down-bg); color: var(--down); }

/* Subtle divider between card sections */
.card + .card::before {
  content: '';
  display: block;
  height: 0;
}

/* Header title letter spacing */
.header-left h1 {
  letter-spacing: 0.5px;
}

/* Tab badge count */
.tab-btn .tab-count {
  background: var(--primary);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 100px;
  margin-left: 4px;
  min-width: 18px;
  text-align: center;
}

/* Micro-interaction: card body link style */
.card-body a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px dashed var(--primary);
  transition: all var(--transition);
}
.card-body a:hover {
  border-bottom-style: solid;
  color: var(--primary-light);
}

/* Archive result enhanced */
.archive-result {
  color: var(--text-mid);
}
.archive-result.has-data {
  border-left: 3px solid var(--primary);
}

/* Tool card icon hover */
.card:hover .card-title .card-icon {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

/* Refined scrollbar for log area */
.log-area::-webkit-scrollbar { width: 5px; }
.log-area::-webkit-scrollbar-track { background: transparent; margin: 8px 0; }
.log-area::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

/* Table first column bold */
.data-table tbody td:first-child {
  font-weight: 600;
  color: var(--text-mid);
}

/* Keyboard shortcut hint on input */
.input[placeholder]::after {
  content: 'Enter ↵';
  color: var(--text-disabled);
  font-size: 10px;
}

/* Status pill online breathing glow */
.status-pill.online {
  box-shadow: 0 0 0 0 rgba(22,163,74,0.1);
  animation: statusGlow 3s ease-in-out infinite;
}
@keyframes statusGlow {
  0%,100% { box-shadow: 0 0 0 0 rgba(22,163,74,0.1); }
  50% { box-shadow: 0 0 0 4px rgba(22,163,74,0.06); }
}

/* Card hover lift effect */
.card:hover {
  transform: translateY(-1px);
}
.card {
  transition: border-color var(--transition), box-shadow var(--transition), border-left-color var(--transition), transform var(--transition);
}

/* Analysis result inner styling */
.analysis-result p {
  margin: 6px 0;
  line-height: 1.8;
}
.analysis-result table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
}
.analysis-result table th,
.analysis-result table td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  font-size: 11px;
}
.analysis-result table th {
  background: var(--bg-4);
  font-weight: 700;
  color: var(--text-mid);
}

/* Footer subtle branding line */
body::after {
  content: '';
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.15;
  pointer-events: none;
  z-index: 999;
}

/* ====== HEADER EXTRAS ====== */

/* Version badge */
.header-version {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-low);
  background: var(--bg-4);
  padding: 2px 7px;
  border-radius: 100px;
  border: 1px solid var(--border);
  letter-spacing: 0.5px;
}

/* Header clock */
.header-clock {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mid);
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
  margin-right: 12px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  -webkit-app-region: no-drag;
}

/* ====== LOADING SKELETON ====== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-4) 25%, var(--bg-3) 50%, var(--bg-4) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
  display: inline-block;
}
.skeleton-text { width: 80px; height: 14px; }
.skeleton-badge { width: 50px; height: 20px; border-radius: 100px; }

/* ====== NOTIFICATION DOT ====== */
.tab-btn[data-has-update]::after {
  content: '';
  position: absolute;
  top: 8px; right: 8px;
  width: 6px; height: 6px;
  background: var(--down);
  border-radius: 50%;
  border: 1.5px solid var(--bg-1);
}

/* ====== PROGRESS INDICATOR ====== */
.progress-bar {
  height: 3px;
  background: var(--bg-4);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 2px;
  transition: width 0.4s ease;
}
.progress-bar-indeterminate .progress-bar-fill {
  width: 30%;
  animation: indeterminate 1.5s ease-in-out infinite;
}
@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* ====== KEYBOARD SHORTCUT HINTS ====== */
.kbd {
  display: inline-block;
  padding: 1px 5px;
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-low);
  background: var(--bg-4);
  border: 1px solid var(--border);
  border-radius: 3px;
  box-shadow: 0 1px 0 var(--border);
  margin-left: 6px;
  vertical-align: middle;
}

/* ====== REFINED TRANSITIONS ====== */
.tab-pane.active {
  animation: fadeUp 0.2s ease;
}

/* Card body content fade */
.card-body > * {
  animation: contentIn 0.3s ease backwards;
}
.card-body > *:nth-child(1) { animation-delay: 0.05s; }
.card-body > *:nth-child(2) { animation-delay: 0.1s; }
.card-body > *:nth-child(3) { animation-delay: 0.15s; }
@keyframes contentIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ====== RESPONSIVE TWEAKS ====== */
@media (max-width: 1200px) {
  .tab-content { padding: 12px 16px; }
  .app-header { padding: 0 16px; }
  .tab-nav { padding: 0 16px; }
  .input { min-width: 180px; }
}

/* ====== MOBILE RESPONSIVE ====== */
@media (max-width: 768px) {
  .app-header { padding: 0 10px; }
  .app-header h1 { font-size: 14px; }
  .header-version { display: none; }
  .header-clock { font-size: 12px; }

  .tab-nav { padding: 0 6px; gap: 0; overflow-x: auto; flex-wrap: nowrap; }
  .tab-btn { font-size: 11px; padding: 8px 8px; white-space: nowrap; min-width: auto; }
  .tab-btn .tab-icon { display: none; }

  .tab-content { padding: 8px 10px; height: auto !important; min-height: calc(100vh - 89px); overflow-y: auto; -webkit-overflow-scrolling: touch; }

  .tab-pane { height: auto !important; }
  .tab-pane.active { height: auto !important; display: block; }

  .card { margin-bottom: 8px; overflow: visible !important; }
  .card-body { padding: 10px; overflow: visible !important; }
  .card.card-grow { flex: none; min-height: 0; }
  .card.card-grow .card-body { overflow: visible !important; flex: none; }
  .card-header { padding: 8px 10px; }
  .card:hover { transform: none; }

  .row { flex-wrap: wrap; gap: 6px; }
  .input { min-width: 120px; flex: 1; font-size: 13px; }
  .btn { font-size: 11px; padding: 6px 10px; }
  .select { font-size: 11px; min-width: 80px; }

  .table-scroll-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { font-size: 9px; min-width: 1200px; }
  .data-table thead th { font-size: 9px; padding: 5px 4px; }
  .data-table tbody td { font-size: 9px; padding: 3px 4px; }

  .analysis-result, .archive-result {
    font-size: 11px;
    padding: 10px;
    max-height: none !important;
    overflow: visible !important;
    -webkit-overflow-scrolling: touch;
  }
  .analysis-result.has-data, .archive-result.has-data {
    overflow: visible !important;
    max-height: none !important;
  }

  /* Analysis match block cards - scale down for mobile */
  .analysis-match-block {
    margin-bottom: 8px !important;
  }
  .analysis-match-block > summary {
    font-size: 12px !important;
    padding: 8px 10px !important;
  }
  .analysis-match-block > summary span:first-child {
    font-size: 14px !important;
  }
  .analysis-match-block > div {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Scale down the backend-generated analysis HTML content */
  .analysis-match-block > div > div {
    transform: scale(0.72);
    transform-origin: top left;
    width: 138.9%;
  }

  .log-area { font-size: 8px; height: calc(100vh - 280px); }
  .log-time { min-width: 55px; font-size: 8px; }

  .empty-state { padding: 24px 12px; min-height: 120px; }
  .empty-icon { width: 48px; height: 48px; font-size: 28px; }

  /* Modal responsive */
  .modal { width: 98%; max-height: 95vh; border-radius: 10px; }
  .modal-header { padding: 12px 16px; font-size: 13px; }
  .modal-body { padding: 12px; }
}

/* ====== HANDICAP ABNORMAL ALERT ====== */
.handicap-alert {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  background: linear-gradient(135deg, #ff6b35, #dc2626);
  color: #fff;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(220, 38, 38, 0.4);
  font-size: 14px;
  line-height: 1.6;
  max-width: 420px;
  animation: alertSlideIn 0.4s ease;
}
.handicap-alert strong {
  font-size: 15px;
  display: block;
  margin-bottom: 4px;
}
@keyframes alertSlideIn {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}
