/* ============================================================
 * 江苏省安培宣教 · 智能考核系统 — 前台公共样式（驾考宝典风格）
 * 统一：浅色底 + 蓝色渐变头图 + 白色圆角卡片 + 蓝主色按钮
 * 引入：<link rel="stylesheet" href="common/front.css">
 * 自包含：字号变量/Reset/根字号在本文件内定义（多数前台页面仅引本文件）；与 base.css 保持一致，修改需同步
 * ============================================================ */
:root {
  --brand: #1d4ed8;
  --brand-2: #38bdf8;
  --brand-grad: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #38bdf8 100%);
  --bg: #f5f7fa;
  --card: #ffffff;
  --txt: #1f2d3d;
  --txt-2: #8a94a6;
  --txt-3: #9aa4b6;
  --line: #eef1f6;
  --radius: 1rem;
  --radius-sm: 0.72rem;
  --shadow: 0 4px 14px rgba(15, 52, 96, 0.06);
  --shadow-lg: 0 12px 30px rgba(29, 78, 216, 0.32);
  --ok: #1d7a3a;
  --ok-bg: #e7f6ec;
  --warn: #f97316;
  --warn-grad: linear-gradient(135deg, #f97316, #fb923c);
  --err: #c0392b;
  --err-bg: #fdeaea;
  /* ===== 字号变量（自包含：80+ 前台页面仅引本文件不引 base.css，与 base.css 保持同步） ===== */
  --fs-xxs: 0.72rem;   /* 最小：时间戳/小标签 */
  --fs-xs: 0.75rem;    /* 次要说明 */
  --fs-sm: 0.8rem;     /* 小正文/表头 */
  --fs: 0.875rem;      /* 正文 */
  --fs-md: 0.95rem;    /* 卡片标题 */
  --fs-lg: 1rem;       /* 顶栏标题 */
  --fs-xl: 1.25rem;    /* 页面大标题 */
}

/* 根字号固定 16px：PC/手机/平板三端一致（rem 基准；base.css 无此规则，非覆盖） */
html { font-size: 1rem; }

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  min-height: 100vh;
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 800px; margin: 0 auto; padding: 0.9rem 1rem 2rem; }

/* ===== 顶部蓝色渐变头图（品牌/用户条） ===== */
.hero {
  position: relative;
  background: var(--brand-grad);
  border-radius: 1.2rem;
  padding: 1.15rem 1.2rem 1.3rem;
  color: #fff;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; right: -3rem; top: -3rem;
  width: 9rem; height: 9rem; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.hero::after {
  content: ''; position: absolute; right: 2.2rem; bottom: -4rem;
  width: 7rem; height: 7rem; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.hero-top { display: flex; align-items: center; gap: 0.7rem; position: relative; z-index: 1; }
.hero-logo {
  width: 2.7rem; height: 2.7rem; border-radius: 0.8rem; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.22);
  display: flex; align-items: center; justify-content: center;
}
.hero-logo svg { width: 1.375rem; height: 1.375rem; }
.hero-brand { font-size: 1rem; font-weight: 700; letter-spacing: 1px; }
.hero-slogan { font-size: 0.72rem; opacity: 0.85; margin-top: 0.15rem; letter-spacing: 2px; }
.hero-user {
  position: relative; z-index: 1;
  margin-top: 1rem; padding-top: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  display: flex; align-items: center; justify-content: space-between; gap: 0.72rem;
}
.hero-who { font-size: 0.875rem; font-weight: 600; }
.hero-id { font-size: 0.72rem; opacity: 0.8; margin-top: 0.2rem; }
.btn-logout {
  flex-shrink: 0; border: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.22); color: #fff;
  font-size: 0.75rem; padding: 0.42rem 0.85rem; border-radius: 0.72rem;
  transition: background 0.2s;
}
.btn-logout:active { background: rgba(255, 255, 255, 0.34); }

/* ===== 顶部蓝色窄导航条（返回 + 标题） ===== */
.navbar {
  position: relative;
  background: var(--brand-grad);
  border-radius: 1.2rem;
  padding: 0.9rem 1rem;
  color: #fff;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.72rem;
  margin-bottom: 1rem;
}
.navbar-back {
  grid-column: 1; justify-self: start; color: #fff; font-size: 0.875rem;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 0.72rem; padding: 0.4rem 0.8rem;
  text-decoration: none; cursor: pointer;
}
.navbar-back:active { background: rgba(255, 255, 255, 0.34); }
.navbar-title {
  grid-column: 2; text-align: center;
  font-size: 1rem; font-weight: 700; letter-spacing: 1px;
  /* 抵消粗体大字视觉下沉，让标题视觉中心与返回按钮几何中心对齐 */
  line-height: 1; transform: translateY(-0.06em);
}
.navbar-sp { width: 3.2rem; flex-shrink: 0; }
/* 倒计时（正式考核 navbar 右侧，替换占位） */
.navbar-timer {
  grid-column: 3; justify-self: end;
  background: rgba(255, 255, 255, 0.22); color: #fff;
  border-radius: 999px; padding: 0.32rem 0.75rem;
  font-size: 0.8rem; font-variant-numeric: tabular-nums;
  min-width: 3.6rem; text-align: center;
}
.navbar-timer.warn { background: #d93025; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.55; } }

/* ===== 区块标题 ===== */
.sec-title { display: flex; align-items: center; gap: 0.45rem; margin: 0 0.1rem 0.7rem; }
.sec-bar { width: 4px; height: 15px; border-radius: 2px; background: var(--brand); }
.sec-txt { font-size: 1rem; font-weight: 700; letter-spacing: 1px; }
.sec-more { margin-left: auto; font-size: 0.72rem; color: var(--txt-2); }

/* ===== 宫格入口 ===== */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.pl-item {
  background: var(--card); border-radius: var(--radius);
  padding: 1.1rem 0.7rem 1rem; text-align: center;
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform 0.12s, box-shadow 0.2s;
}
.pl-item:active { transform: scale(0.97); box-shadow: 0 2px 8px rgba(15, 52, 96, 0.1); }
.pl-ico {
  width: 3.5rem; height: 3.5rem; margin: 0 auto 0.72rem;
  border-radius: 1rem; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(2, 12, 35, 0.14);
}
.pl-ico svg { width: 1.75rem; height: 1.75rem; }
.pl-ico.i-low    { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.pl-ico.i-high   { background: linear-gradient(135deg, #ef4444, #f87171); }
.pl-ico.i-weld   { background: linear-gradient(135deg, #ea580c, #f97316); }
.pl-ico.i-height { background: linear-gradient(135deg, #0891b2, #22d3ee); }
.pl-txt { font-size: 1rem; font-weight: 600; }
.pl-desc { font-size: 0.72rem; color: var(--txt-3); margin-top: 0.25rem; line-height: 1.4; }

/* 状态标签 */
.tag {
  display: inline-block; margin-top: 0.45rem;
  font-size: 0.72rem; font-weight: 600;
  padding: 0.18rem 0.72rem; border-radius: 999px;
}
.tag.ok     { background: var(--ok-bg); color: var(--ok); }
.tag.none   { background: var(--warn-grad); color: #fff; }
.tag.retry  { background: #fdf0e3; color: #b45309; }
.tag.locked { background: var(--err-bg); color: var(--err); }

/* ===== 通用白卡片 ===== */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ===== 通用按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 999px; cursor: pointer;
  font-size: 1rem; font-weight: 600;
  padding: 0.8rem 1.6rem; text-decoration: none;
  transition: transform 0.12s, filter 0.2s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35); }
.btn-ghost { background: #fff; color: var(--txt-2); border: 1px solid #dfe5ee; }

/* ===== 提示条 ===== */
.notice {
  background: #e8f0fe; color: #185fa5;
  border-radius: 0.9rem; padding: 0.75rem 0.95rem;
  font-size: 0.8rem; line-height: 1.7; margin-top: 1rem;
}

/* ===== 登录卡片 ===== */
.login-card {
  background: var(--card); border-radius: 1.2rem;
  padding: 2rem 1.6rem 1.6rem;
  box-shadow: var(--shadow-lg);
}
.login-field {
  display: flex; align-items: center; gap: 0.65rem;
  border: 1.5px solid #e2e8f2; border-radius: 0.85rem;
  padding: 0.8rem 0.95rem; margin-bottom: 0.8rem;
  background: #f6f8fc;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.login-field:focus-within { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3.5px rgba(29, 78, 216, 0.12); }
.login-field .ico { font-size: 1rem; flex-shrink: 0; width: 1.5rem; text-align: center; opacity: 0.7; }
.login-field input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 1rem; color: var(--txt); min-width: 0;
  user-select: text; -webkit-user-select: text; letter-spacing: 0.5px;
}
.login-field input::placeholder { color: #a8b1c2; }
.login-error { font-size: 0.75rem; color: var(--err); min-height: 1.1rem; margin-bottom: 0.5rem; display: none; }
.login-error.show { display: block; }
.login-hint { text-align: center; font-size: 0.72rem; color: var(--txt-3); margin-top: 1rem; }

/* ===== 页脚 ===== */
.foot { text-align: center; font-size: 0.72rem; color: #b0b8c6; margin-top: 1.3rem; letter-spacing: 1px; }

@media (max-width: 360px) {
  .wrap { padding: 0.7rem 0.7rem 1.375rem; }
  .pl-ico { width: 3rem; height: 3rem; }
  .pl-item { padding: 0.95rem 0.5rem 0.9rem; }
}
