/* * 商帆 - 核心样式表 
 * 修改：默认主色已调整为霓虹橙 (#FF5F1F)
 */

:root {
  --ui-scale: 0.9;
  
  /* === 核心色彩 (Main Elements) === */
  --primary: #FF5F1F;       /* 主色：霓虹橙 */
  --secondary: #E04810;     /* 次色：深橙 (用于渐变/深色模式) */
  --neon: #FF8552;          /* 亮色：高亮橙 */
  
  /* === 状态色彩 === */
  --success: #10b981;       /* 成功 (保持绿色) */
  --danger: #ef4444;        /* 危险 (保持红色) */
  --warning: #f59e0b;       /* 警告 (保持黄色) */
  
  /* === 基础背景与文字 (Light Mode) === */
  --bg: #ffffff;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --elev: #f8fafc;
  
  /* === 柔和/阴影/组件 === */
  --soft: rgba(255, 95, 31, 0.08);       /* 橙色调柔和背景 */
  --soft-2: rgba(255, 95, 31, 0.12);
  --shadow: 0 10px 30px rgba(2, 6, 23, .06);
  --shadow-hover: 0 16px 40px rgba(2, 6, 23, .08);
  
  --progress-bg: rgba(255, 95, 31, 0.15);
  --progress-border: rgba(255, 95, 31, 0.2);
  
  --scroll-track: #f1f5f9;
  --scroll-thumb: #cbd5e1;
  --scroll-thumb-hover: #94a3b8;
}

/* === 暗色模式 (Dark Mode) === */
.theme-dark {
  --bg: #0f1310;
  --card: rgba(16, 24, 19, .78);
  --text: #e8f5ec;
  --muted: #b7c4bd;
  
  /* 暗模式下的橙色适配 */
  --border: rgba(255, 95, 31, 0.28);
  --elev: #111a14;
  --soft: rgba(0, 0, 0, .22);
  --soft-2: rgba(255, 95, 31, 0.12);
  
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-hover: 0 16px 40px rgba(0, 0, 0, .45);
  
  --progress-bg: rgba(255, 95, 31, 0.18);
  --progress-border: rgba(255, 95, 31, 0.22);
  
  --scroll-track: rgba(0, 0, 0, .2);
  --scroll-thumb: rgba(255, 255, 255, .22);
  --scroll-thumb-hover: rgba(255, 255, 255, .35);
}

/* === 全局重置与基础布局 === */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  transition: background .25s, color .25s;
}

.container {
  width: 100%;
  max-width: 980px;
  padding: 2rem 1.25rem;
  position: relative;
  z-index: 1;
  transform: scale(var(--ui-scale));
  transform-origin: top center;
}

/* === Header === */
header { text-align: center; margin-bottom: 1.8rem; }

.header-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }

.theme-toggle {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--card); border: 1px solid var(--border);
  padding: .35rem .5rem; border-radius: 999px;
  box-shadow: var(--shadow); cursor: pointer;
}
.theme-toggle .icon { width: 18px; height: 18px; display: grid; place-items: center; }
.theme-toggle .label { font-size: .82rem; font-weight: 700; color: var(--muted); }
.theme-toggle .sep { width: 1px; height: 16px; background: var(--border); margin: 0 .2rem; }

.logo { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-bottom: .4rem; }
.logo-icon .icon-svg { fill: var(--primary); }

h1, h2 {
  font-weight: 800;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: .6px;
}
h2 { font-size: 1.85rem; }

.subtitle { color: var(--muted); font-size: 1rem; max-width: 720px; margin: .4rem auto 0; }

/* === Stats === */
.stats { display: flex; justify-content: center; gap: 1.1rem; margin: 1.1rem 0; flex-wrap: wrap; }
.stat-item {
  text-align: center; min-width: 94px;
  background: var(--elev); padding: .7rem .8rem;
  border-radius: 12px; border: 1px solid var(--border);
}
.stat-value { font-size: 1.2rem; color: var(--secondary); margin-bottom: .15rem; font-weight: 800; }
.stat-label { font-size: .8rem; color: var(--muted); }

/* === Main Content === */
.main-content { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; }

.card {
  background: var(--card); border-radius: 16px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 1.1rem 1rem;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .7rem; }
.card-title { display: flex; align-items: center; font-size: 1.05rem; font-weight: 800; color: var(--text); }
.card-title .icon-svg { color: var(--primary); fill: currentColor; margin-right: .45rem; }

.card-right { display: flex; align-items: center; gap: .5rem; }
.card-badge {
  padding: .3rem .7rem; border-radius: 999px;
  font-size: .72rem; font-weight: 800;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  color: #fff; letter-spacing: .6px;
}

.status { display: flex; align-items: center; font-size: .95rem; margin-bottom: .75rem; gap: .5rem; color: var(--text); }

/* === Progress Bar === */
.progress-container {
  width: 100%; height: 8px;
  background: var(--progress-bg);
  border-radius: 999px; margin: .6rem 0 1rem;
  overflow: hidden; border: 1px solid var(--progress-border);
}
.progress-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 999px; transition: width .28s;
}

/* === Domain List === */
.domain-list {
  background: var(--soft); border-radius: 12px;
  padding: .6rem; margin-top: .2rem;
  max-height: 240px; overflow-y: auto;
  border: 1px solid var(--border);
}
.domain-item {
  padding: .55rem .6rem;
  border-bottom: 1px solid var(--soft-2);
  display: flex; justify-content: space-between; align-items: center;
  font-size: .92rem;
}
.domain-item:last-child { border-bottom: none; }

.domain-status { font-size: .78rem; padding: .22rem .6rem; border-radius: 7px; border: 1px solid transparent; font-weight: 800; display: inline-flex; align-items: center; gap: .45rem; }
.status-success { background: #ecfdf5; color: var(--success); border-color: #d1fae5; }
.status-fail { background: #fef2f2; color: var(--danger); border-color: #fee2e2; }
.status-testing { background: #fff7ed; color: #b45309; border-color: #ffedd5; }

/* === Buttons === */
.register-section { display: flex; flex-direction: column; align-items: center; margin-top: 1rem; gap: .5rem; }
.register-btn { padding: .9rem 2rem; font-size: 1.02rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .8rem 1rem; border-radius: 12px;
  font-size: .9rem; font-weight: 800;
  text-decoration: none; cursor: pointer;
  transition: all .2s ease; border: 1px solid transparent;
}
.btn-primary { background: linear-gradient(90deg, var(--primary), var(--secondary)); color: #fff; }
.btn-secondary { background: var(--card); color: var(--text); border-color: var(--border); }
.btn-disabled { background: #f3f4f6; color: #9ca3af; border-color: #e5e7eb; cursor: not-allowed; }
.btn-compact { padding: .45rem .7rem; font-size: .85rem; border-radius: .6rem; }
.mr-2 { margin-right: .2rem; }

/* === Components === */
.loading-spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 3px solid rgba(107, 114, 128, .25);
  border-radius: 50%; border-top-color: var(--primary);
  animation: spin 1s linear infinite; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.browser-warning {
  display: none; background: #fff8f0;
  border: 1px solid var(--warning); color: #92400e;
  border-radius: 10px; padding: 1rem; margin-bottom: 1.2rem;
  text-align: center;
}

/* === Particles === */
.particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.particle { position: absolute; background: rgba(255, 95, 31, 0.08); border-radius: 50%; }

.footer { margin-top: 1.4rem; text-align: center; font-size: .86rem; color: var(--muted); }

/* === Downloads Card === */
.downloads-card .card-content { padding-top: .4rem; }
.download-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; }
@media (max-width: 900px) { .download-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .download-grid { grid-template-columns: 1fr; } }

.dl-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: .9rem;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: .5rem;
}
.dl-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--soft); border: 1px solid var(--border);
}
.dl-title { font-weight: 800; font-size: 1rem; color: var(--text); }
.dl-desc { font-size: .82rem; color: var(--muted); min-height: 2.2em; }
.dl-btn { width: 100%; margin-top: .2rem; }

/* === Latency Dots === */
.lat-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #d1d5db; }
.lat-dot.green { background: #22c55e; }
.lat-dot.red { background: #ef4444; }
.lat-dot.amber { background: #f59e0b; }
.lat-ms { color: var(--muted); font-weight: 700; letter-spacing: .2px; }

/* === QR Popover === */
.qr-popover {
  position: absolute; padding: 12px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--border);
  box-shadow: var(--shadow-hover); z-index: 1000;
  pointer-events: none; box-sizing: border-box; overflow: visible;
}
.qr-popover .qr-head { font-size: .9rem; color: var(--muted); margin: 4px 6px 6px 6px; }
.qr-popover .qr-body { display: flex; align-items: center; justify-content: center; }
.qr-popover .qr-canvas, .qr-popover .qr-img { width: 128px; height: 128px; display: block; image-rendering: pixelated; }

/* === Skeleton Loading === */
.domain-status.status-testing .lat-ms {
  position: relative; display: inline-block; color: transparent;
  min-width: 56px !important; height: 10px; line-height: 10px;
  margin-left: 0 !important; vertical-align: middle;
}
.domain-status.status-testing .lat-ms::before {
  content: ''; display: block;
  width: 56px !important; height: 10px !important; border-radius: 8px !important;
  background: linear-gradient(90deg, rgba(200, 200, 200, .25) 0%, rgba(200, 200, 200, .45) 50%, rgba(200, 200, 200, .25) 100%);
  animation: nebula-shimmer 1.0s linear infinite;
}
@keyframes nebula-shimmer { 0% { transform: translateX(-20%); } 100% { transform: translateX(20%); } }

/* === Right-aligned actions (Addon) === */
.nebula-color-toggle { margin-left: .5rem; }
.nebula-actions { display: flex; gap: .5rem; margin-left: auto; }