/* ============================================================
   API 模型监控面板 - 设计系统
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   CSS 变量
   ============================================================ */
:root {
  /* 主色调 */
  --primary: #6C5CE7;
  --primary-light: #A29BFE;
  --primary-dark: #5A4BD1;

  /* 状态色 */
  --success: #00D68F;
  --success-bg: rgba(0, 214, 143, 0.1);
  --warning: #FFB800;
  --warning-bg: rgba(255, 184, 0, 0.1);
  --danger: #FF4757;
  --danger-bg: rgba(255, 71, 87, 0.1);

  /* 深色主题 */
  --bg-primary: #0F0F1A;
  --bg-secondary: #1A1A2E;
  --bg-card: rgba(30, 30, 50, 0.7);
  --bg-card-hover: rgba(40, 40, 65, 0.8);
  --bg-input: rgba(255, 255, 255, 0.05);

  /* 文字 */
  --text-primary: #EAEAEF;
  --text-secondary: #8888A0;
  --text-muted: #555570;

  /* 边框 */
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);

  /* 毛玻璃 */
  --glass-bg: rgba(30, 30, 50, 0.5);
  --glass-border: rgba(255, 255, 255, 0.08);

  /* 圆角 & 阴影 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.15);

  /* 过渡 */
  --transition-fast: 0.15s ease;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   重置 & 基础
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 背景装饰 */
body::before {
  content: '';
  position: fixed;
  top: -30%;
  left: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(108, 92, 231, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -30%;
  right: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(0, 214, 143, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary);
}

/* ============================================================
   滚动条
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ============================================================
   布局
   ============================================================ */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  min-height: 100vh;
}

/* ============================================================
   顶部栏
   ============================================================ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}

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

.header-logo {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-logo svg {
  width: 26px;
  height: 26px;
  fill: white;
}

.header-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

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

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 6px 14px;
  background: var(--bg-input);
  border-radius: 99px;
  border: 1px solid var(--border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(0, 214, 143, 0.5);
  animation: pulse-dot 2s infinite;
}

.status-dot.checking {
  background: var(--warning);
  box-shadow: 0 0 8px rgba(255, 184, 0, 0.5);
  animation: pulse-dot-warning 1s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes pulse-dot-warning {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

/* ============================================================
   公告栏
   ============================================================ */
.announcement {
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.12), rgba(162, 155, 254, 0.08));
  border: 1px solid rgba(108, 92, 231, 0.2);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  animation: slideDown 0.5s ease;
}

.announcement-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.announcement-icon svg {
  width: 20px;
  height: 20px;
  fill: var(--primary-light);
}

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

/* ============================================================
   搜索栏
   ============================================================ */
.search-bar-wrapper {
  margin-bottom: 20px;
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  fill: var(--text-muted);
  pointer-events: none;
  transition: fill var(--transition-fast);
}

.search-input {
  width: 100%;
  padding: 13px 100px 13px 44px;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
}

.search-input:focus ~ .search-icon,
.search-input:not(:placeholder-shown) ~ .search-icon {
  fill: var(--primary-light);
}

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

.search-count {
  position: absolute;
  right: 18px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   统计概览
   ============================================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

.stat-icon.purple {
  background: rgba(108, 92, 231, 0.15);
}
.stat-icon.purple svg { fill: var(--primary-light); }

.stat-icon.green {
  background: var(--success-bg);
}
.stat-icon.green svg { fill: var(--success); }

.stat-icon.yellow {
  background: var(--warning-bg);
}
.stat-icon.yellow svg { fill: var(--warning); }

.stat-icon.red {
  background: var(--danger-bg);
}
.stat-icon.red svg { fill: var(--danger); }

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ============================================================
   分组标题
   ============================================================ */
.group-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 28px 0 16px;
  padding-left: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-title::before {
  content: '';
  width: 3px;
  height: 18px;
  background: var(--primary);
  border-radius: 2px;
}

/* ============================================================
   模型卡片网格
   ============================================================ */
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.model-card {
  background: linear-gradient(145deg, rgba(40, 40, 60, 0.8), rgba(25, 25, 45, 0.6));
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.4s ease;
}

.model-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.model-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  transition: opacity var(--transition);
  opacity: 0;
}

.model-card:hover::before {
  opacity: 1;
}

.model-card.status-good::before { background: var(--success); }
.model-card.status-warn::before { background: var(--warning); }
.model-card.status-bad::before { background: var(--danger); }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.model-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.model-name {
  font-size: 1.05rem;
  font-weight: 600;
  word-break: break-word;
  line-height: 1.4;
  flex: 1;
  padding-right: 12px;
}

.model-id {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* 环形进度 */
.ring-container {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.ring-svg {
  width: 64px;
  height: 64px;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 5;
}

.ring-progress {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1),
              stroke 0.5s ease;
}

.ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.82rem;
  font-weight: 700;
}

.ring-text .percent {
  font-size: 0.58rem;
  font-weight: 400;
  opacity: 0.7;
}

/* 历史记录点阵 */
.history-dots {
  display: flex;
  gap: 3px;
  margin: 16px 0;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.history-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  transition: all var(--transition-fast);
  cursor: default;
  position: relative;
}

.history-dot:hover {
  transform: scale(1.3);
  z-index: 1;
}

.history-dot.success { background: var(--success); }
.history-dot.fail { background: var(--danger); }
.history-dot.empty { background: rgba(255, 255, 255, 0.04); }

/* 卡片状态标签 */
.card-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.tag-ok {
  background: var(--success-bg);
  color: var(--success);
}

.tag-err {
  background: var(--danger-bg);
  color: var(--danger);
}

.model-info {
  flex: 1;
  min-width: 0;
  padding-right: 12px;
}

/* Tooltip */
.tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.7rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.history-dot:hover .tooltip {
  opacity: 1;
}

/* ============================================================
   空状态
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 80px 40px;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  fill: var(--text-muted);
  margin-bottom: 20px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 0.88rem;
  max-width: 400px;
  margin: 0 auto;
}

/* ============================================================
   页脚
   ============================================================ */
.footer {
  text-align: center;
  padding: 28px 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ============================================================
   管理后台 - 登录
   ============================================================ */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: fadeInUp 0.5s ease;
}

.login-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.login-card p {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 32px;
}

/* ============================================================
   表单控件
   ============================================================ */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.form-input::placeholder {
  color: var(--text-muted);
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

/* ============================================================
   按钮
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  outline: none;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-full {
  width: 100%;
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.btn-success {
  background: linear-gradient(135deg, #00B37E, #00D68F);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, #E0374D, #FF4757);
  color: white;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.78rem;
}

/* ============================================================
   管理后台 - 布局
   ============================================================ */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  min-height: calc(100vh - 48px);
}

.admin-sidebar {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 0;
  height: fit-content;
  position: sticky;
  top: 24px;
}

.sidebar-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 20px;
  margin-bottom: 12px;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
}

.sidebar-nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-input);
}

.sidebar-nav-item.active {
  color: var(--primary-light);
  background: rgba(108, 92, 231, 0.08);
  border-left-color: var(--primary);
}

.sidebar-nav-item svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

.admin-content {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  min-height: 500px;
}

.admin-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.admin-section-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
  animation: fadeInUp 0.3s ease;
}

/* 分割线 */
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* ============================================================
   表格
   ============================================================ */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

th {
  text-align: left;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* 状态标签 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 500;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ============================================================
   Toast 通知
   ============================================================ */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--primary); }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(30px); }
}

/* ============================================================
   加载动画
   ============================================================ */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, rgba(255,255,255,0.05) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   倒计时进度条
   ============================================================ */
.countdown-card {
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.1), rgba(162, 155, 254, 0.05));
  border: 1px solid rgba(108, 92, 231, 0.15);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 24px;
}

.countdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.countdown-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.countdown-time {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-light);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.countdown-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.countdown-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 3px;
  transition: width 1s linear;
}

.countdown-card.checking {
  border-color: rgba(255, 184, 0, 0.3);
  background: linear-gradient(135deg, rgba(255, 184, 0, 0.1), rgba(255, 184, 0, 0.03));
}

.countdown-card.checking .countdown-time {
  color: var(--warning);
}

.countdown-card.checking .countdown-bar-fill {
  background: linear-gradient(90deg, var(--warning), #FFD700);
  animation: progress-pulse 1.5s ease-in-out infinite;
}

@keyframes progress-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ============================================================
   响应式
   ============================================================ */

/* 平板 */
@media (max-width: 768px) {
  .app-container {
    padding: 12px;
  }

  .header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
    padding: 14px 16px;
  }

  .header-left {
    gap: 10px;
  }

  .header-logo {
    width: 34px;
    height: 34px;
  }

  .header-logo svg {
    width: 18px;
    height: 18px;
  }

  .header-title {
    font-size: 1.05rem;
  }

  .header-right {
    width: 100%;
    justify-content: center;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .model-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .model-card {
    padding: 18px;
  }

  .model-name {
    font-size: 1.1rem;
  }

  .ring-container {
    width: 52px;
    height: 52px;
  }

  .ring-svg {
    width: 52px;
    height: 52px;
  }

  .ring-text {
    font-size: 0.72rem;
  }

  .history-dot {
    width: 11px;
    height: 11px;
  }

  /* 管理后台移动端 */
  .admin-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-primary);
    padding: 12px 0;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
  }

  .sidebar-title {
    display: none;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    padding: 0 8px;
    gap: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .sidebar-nav-item {
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 0.78rem;
    border-left: none;
    border-bottom: 2px solid transparent;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    gap: 6px;
  }

  .sidebar-nav-item svg {
    width: 15px;
    height: 15px;
  }

  .sidebar-nav-item.active {
    border-left: none;
    border-bottom-color: var(--primary);
  }

  .admin-content {
    flex: 1;
    padding: 18px 14px;
    border-radius: var(--radius-md);
  }

  .admin-section-title {
    font-size: 1rem;
  }

  /* 表格移动端 */
  .table-container {
    margin: 0 -14px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  th, td {
    padding: 8px 12px;
    font-size: 0.75rem;
  }

  .countdown-card {
    padding: 14px 16px;
  }

  .countdown-time {
    font-size: 1.1rem;
  }

  .login-card {
    padding: 36px 24px;
    border-radius: var(--radius-lg);
  }

  .announcement {
    padding: 12px 14px;
    font-size: 0.82rem;
  }

  .empty-state {
    padding: 50px 24px;
  }

  .btn {
    padding: 9px 16px;
    font-size: 0.82rem;
  }
}

/* 手机 */
@media (max-width: 480px) {
  .app-container {
    padding: 8px;
  }

  .stats-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .stat-card {
    padding: 14px;
    gap: 12px;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
  }

  .stat-icon svg {
    width: 18px;
    height: 18px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .header {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
  }

  .model-card {
    padding: 16px;
  }

  .model-card-header {
    margin-bottom: 14px;
  }

  .model-name {
    font-size: 1.15rem;
  }

  .ring-container {
    width: 48px;
    height: 48px;
  }
  .ring-svg {
    width: 48px;
    height: 48px;
  }
  .ring-text {
    font-size: 0.68rem;
  }

  .model-meta {
    font-size: 0.7rem;
    padding-top: 10px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .login-card {
    padding: 28px 18px;
  }

  .login-card h1 {
    font-size: 1.35rem;
  }

  .form-input,
  .search-input {
    padding: 12px 14px;
    font-size: 16px; /* 防止 iOS 自动页面缩放 */
  }

  .footer {
    padding: 18px 0;
    font-size: 0.7rem;
  }

  .countdown-info {
    font-size: 0.78rem;
  }

  .countdown-time {
    font-size: 1rem;
  }
}

