/**
 * 设备环境在线检测 - 全局样式
 * 设计方向：深邃科技蓝 + 青绿强调，政务运维场景
 * 兼容：IE9+（transition/animation），IE7/8 降级为静态显示
 */

/* ==================== 设计变量 ==================== */
:root {
  --brand: #0d6efd;
  --brand-dark: #1d4ed8;
  --accent: #10b981;
  --accent-light: #38f0c0;
  --bg-dark: #0a1128;
  --bg-deep: #060b1f;
  --text: #1f2937;
  --text-light: #6b7280;
  --line: #e5e7eb;
  --surface: #ffffff;
}

/* ==================== 全局重置 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: #f4f6f9;
  line-height: 1.6;
  /* sticky footer：body flex列布局，内容撑满，footer固定底部 */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }

/* ==================== 按钮 ==================== */
.btn {
  display: inline-block;
  padding: 7px 18px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  cursor: pointer;
  border-radius: 5px;
  line-height: 1.5;
  vertical-align: middle;
  transition: all 0.2s ease;
}
.btn:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); box-shadow: 0 2px 6px rgba(13,110,253,0.12); }
.btn:active { transform: translateY(0); }
.btn:disabled { background: #f3f4f6; border-color: #e5e7eb; color: #c0c4cc; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-success { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-success:hover { background: #0da271; border-color: #0da271; color: #fff; }
.btn-warning { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; border-color: #d97706; color: #fff; }

/* ==================== 登录页 ==================== */
.login-page { background: var(--bg-deep); overflow: hidden; }

.login-bg { position: fixed; inset: 0; z-index: 0; }
.login-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 46px 46px;
  animation: gridShift 18s linear infinite;
}
.login-bg-orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; }
.orb-a { width: 460px; height: 460px; background: #0d6efd; top: -140px; left: -120px; animation: orbFloatA 12s ease-in-out infinite; }
.orb-b { width: 380px; height: 380px; background: #10b981; bottom: -120px; right: -100px; animation: orbFloatB 14s ease-in-out infinite; }

@keyframes gridShift { from { background-position: 0 0; } to { background-position: 46px 46px; } }
@keyframes orbFloatA { 0%,100% { transform: translate(0,0); } 50% { transform: translate(60px,40px); } }
@keyframes orbFloatB { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-50px,-40px); } }

.login-shell {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 20px;
}

.login-brand { text-align: center; margin-bottom: 30px; animation: fadeUp 0.7s ease both; }
.brand-badge {
  display: inline-block;
  font-size: 11px; letter-spacing: 3px; color: var(--accent-light);
  border: 1px solid rgba(56,240,192,0.4); border-radius: 20px;
  padding: 4px 14px; margin-bottom: 16px;
}
.brand-title {
  font-size: 32px; font-weight: 700; color: #fff;
  letter-spacing: 1px; margin-bottom: 10px;
}
.brand-sub { font-size: 14px; color: #8b96ad; }

.login-card {
  width: 420px; max-width: 100%;
  background: #fff; border-radius: 12px;
  padding: 36px 36px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  animation: fadeUp 0.7s 0.1s ease both;
}

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

/* 步骤指示器 */
.step-indicator { display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.step-dot {
  width: 30px; height: 30px; border-radius: 50%;
  background: #e5e7eb; color: #9ca3af;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  transition: all 0.3s ease;
}
.step-dot.active { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px rgba(13,110,253,0.15); }
.step-dot.done { background: var(--accent); color: #fff; }
.step-line { width: 60px; height: 2px; background: #e5e7eb; transition: all 0.3s ease; }
.step-line.active { background: var(--brand); }
.step-labels { display: flex; justify-content: space-between; max-width: 180px; margin: 0 auto 24px; }
.step-label { font-size: 12px; color: #9ca3af; transition: color 0.3s; }
.step-label.active { color: var(--brand); font-weight: 600; }

/* 表单 */
.login-form { animation: fadeUp 0.4s ease both; }
.form-group { margin-bottom: 18px; }
.form-label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; color: #374151; }
.form-input {
  width: 100%; padding: 11px 14px;
  border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 14px; color: #111827; background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(13,110,253,0.12); }
.form-input:read-only { background: #f9fafb; color: #6b7280; }
.code-input { letter-spacing: 8px; font-size: 18px; font-weight: 700; text-align: center; }

.btn-login {
  width: 100%; padding: 12px; font-size: 15px; font-weight: 600;
  background: var(--brand); border: none; color: #fff; border-radius: 6px;
  cursor: pointer; transition: all 0.25s ease;
}
.btn-login:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(13,110,253,0.3); }
.btn-login:disabled { background: #9ca3af; cursor: not-allowed; transform: none; box-shadow: none; }

.login-error {
  background: #fef2f2; border: 1px solid #fecaca; color: #dc2626;
  border-radius: 6px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px;
  animation: shake 0.4s ease;
}
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.code-sent-tip {
  background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857;
  border-radius: 6px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px;
}
.code-actions { display: flex; justify-content: space-between; margin-top: 14px; font-size: 13px; }
.link-muted { color: #9ca3af; }
.link-accent { color: var(--brand); }

.login-footer { margin-top: 28px; font-size: 12px; color: #5b6577; animation: fadeUp 0.7s 0.2s ease both; }
.login-footer .footer-brand { color: var(--accent-light); font-weight: 600; }

/* ==================== 主页导航 ==================== */
.header {
  display: flex; justify-content: space-between; align-items: center;
  background: #0f1b3d; color: #fff;
  height: 58px; padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
  flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-logo { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.header-version { font-size: 12px; color: #6b7a99; }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-user { font-size: 14px; color: #c8d2e6; }
.header-logout { color: #7ea6ff; font-size: 14px; }

/* ==================== 主容器 ==================== */
.main-container { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; flex: 1 0 auto; width: 100%; }

/* 标签页 */
.tabs { display: flex; gap: 6px; border-bottom: 2px solid #e5e7eb; margin-bottom: 24px; }
.tab {
  padding: 11px 22px; font-size: 15px; color: #6b7280;
  cursor: pointer; border-radius: 8px 8px 0 0;
  position: relative; transition: all 0.25s ease;
  user-select: none;
}
.tab:hover { color: var(--brand); background: #eef3ff; }
.tab.active { color: var(--brand); font-weight: 700; }
.tab.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--brand);
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: tabIn 0.35s ease; }
@keyframes tabIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* 面板 */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.panel-header {
  padding: 15px 22px; border-bottom: 1px solid var(--line);
  font-size: 16px; font-weight: 700; color: #111827;
  background: #fafbfc; border-radius: 10px 10px 0 0;
}
.panel-body { padding: 22px; }

/* 提示框 */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; animation: tabIn 0.3s ease; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #b45309; }
.alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }

/* 控件版本检测 */
.version-box { background: #f9fafb; border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; margin-bottom: 20px; }
.version-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; color: #4b5563; }
.version-label { font-weight: 600; color: #374151; }

/* 诊断操作 */
.diag-actions { display: flex; gap: 10px; margin-bottom: 16px; }

/* 进度条 */
.progress-track { height: 22px; background: #eef1f5; border-radius: 11px; overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%; text-align: center; line-height: 22px;
  font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  background-color: var(--brand);
  transition: width 0.3s ease;
}
.progress-text { text-align: center; margin-top: 8px; font-size: 13px; color: #6b7280; }

/* 诊断表格 */
.diag-table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.diag-table th, .diag-table td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; font-size: 13px; }
.diag-table th { background: #f9fafb; font-weight: 700; color: #374151; }
.diag-table tbody tr { animation: rowIn 0.3s ease; }
@keyframes rowIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }
.critical { color: #dc2626; }
.diag-status { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.diag-pass { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.diag-fail { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.diag-warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.diag-skip { background: #f3f4f6; color: #9ca3af; border: 1px solid #e5e7eb; }
.diag-run { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ==================== 设备控制 ==================== */
.capture-stage {
  min-height: 340px; background: #0b1220; border: 1px solid #1e2a45;
  border-radius: 8px; overflow: hidden; margin-bottom: 18px;
}
.control-group { margin-bottom: 16px; padding: 14px; background: #fafbfc; border-radius: 8px; }
.ctrl-label { display: inline-block; margin-right: 6px; font-weight: 600; font-size: 13px; color: #374151; }
.ctrl-select { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 5px; font-size: 13px; min-width: 130px; margin-right: 14px; }
.ctrl-input { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 5px; font-size: 13px; width: 70px; margin-right: 6px; }
.status-line { font-size: 13px; color: #6b7280; margin-top: 8px; min-height: 20px; }

/* 身份证 */
.idcard-grid { display: flex; gap: 20px; }
.idcard-grid .form-group { flex: 1; }

/* 合同 */
.contract-stage { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-top: 16px; }

/* 下载 */
.download-grid { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.download-card {
  width: 280px; padding: 28px 22px; text-align: center;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  transition: all 0.3s ease;
}
.download-card:hover { border-color: var(--brand); box-shadow: 0 8px 24px rgba(13,110,253,0.12); transform: translateY(-4px); }
.download-icon { font-size: 42px; margin-bottom: 12px; }
.download-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.download-desc { font-size: 12px; color: #6b7280; margin-bottom: 18px; min-height: 40px; }

/* 页脚 */
.footer { text-align: center; padding: 18px; color: #9ca3af; font-size: 12px; border-top: 1px solid var(--line); background: #fff; flex-shrink: 0; }
.footer .footer-brand { color: var(--brand); font-weight: 600; }

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .login-card { width: 100%; padding: 26px 22px; }
  .brand-title { font-size: 24px; }
  .idcard-grid { flex-direction: column; gap: 0; }
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; }
}
