/* ============================================================
   网络可达性与延迟检测工具 - 现代移动优先样式表
   Design: Sleek Dark Glassmorphism, Fluid Typography, Micro-animations
   ============================================================ */

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: rgba(19, 27, 44, 0.75);
  --bg-card-hover: rgba(28, 40, 65, 0.85);
  --bg-card-active: rgba(36, 52, 85, 0.95);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(59, 130, 246, 0.4);

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

  --color-online: #10b981;
  --color-online-bg: rgba(16, 185, 129, 0.12);
  --color-online-border: rgba(16, 185, 129, 0.3);

  --color-timeout: #ef4444;
  --color-timeout-bg: rgba(239, 68, 68, 0.12);
  --color-timeout-border: rgba(239, 68, 68, 0.3);

  --color-blocked: #f59e0b;
  --color-blocked-bg: rgba(245, 158, 11, 0.12);
  --color-blocked-border: rgba(245, 158, 11, 0.3);

  --color-testing: #3b82f6;
  --color-testing-bg: rgba(59, 130, 246, 0.15);

  --color-accent-grad: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
  --color-primary-btn: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  --color-success-btn: linear-gradient(135deg, #059669 0%, #10b981 100%);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.5);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, Monaco, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.12) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 20px));
  line-height: 1.5;
  overflow-x: hidden;
}

/* 顶部安全区适配 */
.safe-top {
  height: env(safe-area-inset-top, 0px);
}

/* 容器布局 */
.app-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px 24px;
}

/* 顶部导航标题 */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

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

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--color-accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.brand-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover, .icon-btn:active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: translateY(-1px);
}

/* 核心原则与本地网络诊断条 */
.security-notice {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  color: #93c5fd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.sec-notice-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.security-notice .icon {
  font-size: 15px;
  flex-shrink: 0;
}

.sec-notice-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.net-env-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
  user-select: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
}

.net-env-badge:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.net-env-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
  flex-shrink: 0;
}

/* IPv4/IPv6 双栈状态 */
.net-env-badge.dual-stack {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}
.net-env-badge.dual-stack .net-env-dot {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

/* 仅 IPv4 状态 */
.net-env-badge.ipv4-only {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}
.net-env-badge.ipv4-only .net-env-dot {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

/* 检测中状态 */
.net-env-badge.checking .net-env-dot {
  background: #3b82f6;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.8);
  animation: pulseDot 1.2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* 目标网站 IPv6 专属徽章样式 */
.target-ipv6-tag {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
  letter-spacing: 0.2px;
  vertical-align: middle;
}

/* 缺少 IPv6 环境卡片状态 */
.target-card.status-ipv6-need {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.03);
}

.status-badge.status-ipv6-need {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

@media (max-width: 640px) {
  .security-notice {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .sec-notice-text {
    white-space: normal;
  }
  .net-env-badge {
    align-self: flex-start;
  }
}

/* 统计卡片仪表盘 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 6px;
  text-align: center;
  transition: transform 0.2s ease;
}

.stat-val {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1.2;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-total .stat-val { color: #f8fafc; }
.stat-online .stat-val { color: var(--color-online); }
.stat-timeout .stat-val { color: var(--color-timeout); }
.stat-avg .stat-val { color: #a78bfa; }

/* 进度条 */
.progress-container {
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  height: 6px;
  overflow: hidden;
  margin-bottom: 16px;
  display: none;
}

.progress-container.active {
  display: block;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--color-accent-grad);
  border-radius: var(--radius-full);
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 主操作按钮组 */
.action-banner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.btn-row-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.btn-primary {
  background: var(--color-primary-btn);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
  min-height: 48px;
}

.btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.btn-primary.running {
  background: linear-gradient(135deg, #1e3a8a 0%, #312e81 100%);
  animation: pulse-bg 1.8s infinite;
}

@keyframes pulse-bg {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.82; }
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 48px;
}

.btn-secondary:active {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(0.98);
}

/* ================= 网址分类下拉式选择长条栏 ================= */
.category-dropdown-container {
  position: relative;
  margin-bottom: 12px;
  z-index: 30;
}

.category-bar {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.category-bar:hover {
  background: linear-gradient(135deg, rgba(37, 52, 75, 0.9) 0%, rgba(20, 30, 52, 0.95) 100%);
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
  transform: translateY(-1px);
}

.category-bar:active {
  transform: scale(0.99);
}

.category-bar.open {
  border-color: #3b82f6;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

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

.category-icon {
  font-size: 18px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.category-name {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.category-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

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

.category-switch-tip {
  font-size: 11px;
  color: var(--text-muted);
}

.category-chevron {
  font-size: 13px;
  color: #94a3b8;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s;
}

.category-bar.open .category-chevron {
  transform: rotate(180deg);
  color: #60a5fa;
}

/* 下拉菜单面板 */
.category-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #111a2e;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: menu-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes menu-pop {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.category-menu.show {
  display: flex;
}

.category-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.category-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.category-menu-item.active {
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.35);
}

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

.cat-item-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.cat-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
}

.category-menu-item.active .cat-item-title {
  color: #60a5fa;
}

.cat-item-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cat-item-count {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.category-menu-item.active .cat-item-count {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.25);
}

.cat-item-check {
  font-size: 13px;
  color: transparent;
  font-weight: bold;
}

.category-menu-item.active .cat-item-check {
  color: #3b82f6;
}

/* 快捷工具栏（复制、筛选、快速搜索） */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-pills {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.pill-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.pill-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 600;
}

.tools-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

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

/* 目标列表区 */
.target-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.target-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.target-card:hover {
  background: var(--bg-card-hover);
}

.target-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--text-muted);
  transition: background 0.3s;
}

.target-card.status-online::before { background: var(--color-online); }
.target-card.status-timeout::before { background: var(--color-timeout); }
.target-card.status-blocked::before { background: var(--color-blocked); }
.target-card.status-testing::before { background: var(--color-testing); }
.target-card.status-retrying::before { background: #f59e0b; }

.target-card.disabled {
  opacity: 0.45;
}

/* 卡片内容区域 */
.target-info {
  flex: 1;
  min-width: 0;
}

.target-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.target-name {
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.target-group {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  flex-shrink: 0;
}

.target-url {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* 卡片右侧状态与操作 */
.target-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.status-badge.online {
  background: var(--color-online-bg);
  color: #34d399;
  border-color: var(--color-online-border);
}

.status-badge.timeout {
  background: var(--color-timeout-bg);
  color: #f87171;
  border-color: var(--color-timeout-border);
}

.status-badge.blocked {
  background: var(--color-blocked-bg);
  color: #fbbf24;
  border-color: var(--color-blocked-border);
}

.status-badge.testing {
  background: var(--color-testing-bg);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}

.status-badge.retrying {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

/* 旋转 Loading */
.spin-icon {
  display: inline-block;
  animation: spin 1s linear infinite;
}

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

.retest-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.retest-btn:hover, .retest-btn:active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* 底部最后更新信息 */
.footer-info {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-info a {
  color: #60a5fa;
  text-decoration: none;
}

/* 模态弹窗系统 (Modal) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
    padding: 20px;
  }
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #131c2e;
  border: 1px solid var(--border-color);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px 18px calc(24px + env(safe-area-inset-bottom, 10px));
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .modal-content {
    border-radius: 20px;
    transform: translateY(20px);
  }
}

.modal-overlay.show .modal-content {
  transform: translateY(0);
}

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.form-group {
  margin-bottom: 16px;
}

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

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-textarea {
  font-family: var(--font-mono);
  font-size: 12px;
  resize: vertical;
  min-height: 120px;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Toast 提示 */
.toast-container {
  position: fixed;
  bottom: calc(30px + env(safe-area-inset-bottom, 10px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.toast {
  background: rgba(17, 24, 39, 0.95);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-md);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: toast-in 0.2s ease forwards;
}

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

/* 管理与排序列表项样式 */
.manage-items-list::-webkit-scrollbar {
  width: 5px;
}
.manage-items-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.manage-item {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background 0.15s;
}

.manage-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.manage-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.manage-item-idx {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  width: 22px;
  flex-shrink: 0;
  text-align: center;
}

.manage-item-text {
  min-width: 0;
  flex: 1;
}

.manage-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.manage-item-url {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.manage-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.order-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: #94a3b8;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: all 0.15s;
  user-select: none;
}

.order-btn:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.25);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
}

.order-btn:active:not(:disabled) {
  transform: translateY(0);
}

.order-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.order-btn.del-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

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

.empty-state .icon {
  font-size: 36px;
  margin-bottom: 8px;
}

/* 底部页脚与 GitHub 链接 */
.footer-info {
  margin-top: 36px;
  padding: 24px 10px 36px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-note {
  font-size: 11px;
  opacity: 0.75;
}

.footer-github {
  margin-top: 6px;
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: #94a3b8;
  text-decoration: none;
  font-size: 12px;
  font-family: var(--font-mono);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.github-link:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.github-link:active {
  transform: translateY(0);
}

.github-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ============================================================
   安全鉴权与部署密码保护模态弹窗样式
   ============================================================ */

/* 锁定状态下的主容器高斯模糊与隔离 */
.app-container.auth-locked {
  filter: blur(14px);
  pointer-events: none;
  user-select: none;
  opacity: 0.12;
  transition: filter 0.4s ease, opacity 0.4s ease;
}

/* 全屏高斯毛玻璃遮罩 */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 14, 23, 0.92);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.auth-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* 居中安全认证卡片 */
.auth-card {
  width: 100%;
  max-width: 400px;
  background: rgba(19, 27, 44, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 36px 26px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(99, 102, 241, 0.2);
  text-align: center;
  position: relative;
  overflow: hidden;
  transform: translateY(12px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-overlay.active .auth-card {
  transform: translateY(0) scale(1);
}

/* 认证图标与微动效 */
.auth-shield {
  position: relative;
  width: 68px;
  height: 68px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(139, 92, 246, 0.3));
  border: 1px solid rgba(139, 92, 246, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.35);
}

.auth-shield-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
  animation: authGlowPulse 2.8s infinite alternate ease-in-out;
  pointer-events: none;
}

@keyframes authGlowPulse {
  0% { transform: scale(0.92); opacity: 0.4; }
  100% { transform: scale(1.15); opacity: 0.85; }
}

.auth-shield-icon {
  font-size: 32px;
  position: relative;
  z-index: 2;
}

.auth-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: #f8fafc;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* 输入框与密码显隐组件 */
.auth-form {
  display: flex;
  flex-direction: column;
}

.auth-input-group {
  margin-bottom: 12px;
  text-align: left;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(10, 14, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
  transition: all 0.2s ease;
}

.auth-input-wrapper:focus-within {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.28), inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.auth-input {
  width: 100%;
  height: 48px;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-size: 15px;
  font-family: var(--font-sans);
  padding: 0 46px 0 42px;
}

.auth-input::placeholder {
  color: rgba(148, 163, 184, 0.6);
  font-size: 13.5px;
}

.auth-toggle-pwd {
  position: absolute;
  right: 6px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border-radius: var(--radius-sm);
  transition: background 0.2s, opacity 0.2s;
}

.auth-toggle-pwd:hover {
  background: rgba(255, 255, 255, 0.08);
}

.auth-error-msg {
  font-size: 12px;
  color: #ef4444;
  margin-top: 6px;
  padding-left: 2px;
  min-height: 18px;
  display: none;
  animation: fadeIn 0.2s ease;
}

/* 记住密码选项 */
.auth-options {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 22px;
}

.auth-remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.auth-remember-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #3b82f6;
  cursor: pointer;
}

/* 解锁提交按钮 */
.auth-submit-btn {
  width: 100%;
  height: 46px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.auth-submit-btn:hover {
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}


/* 密码错误时的晃动特效 */
@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  15%, 45%, 75% { transform: translateX(-8px); }
  30%, 60%, 90% { transform: translateX(8px); }
}

.auth-card.shake {
  animation: authShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

