/* ============================================================
   中国移动签到管理面板 — 样式表
   零外部依赖：系统字体栈 + 内联 SVG 图标
   配色：深色底 + 蓝绿主色
   ============================================================ */

:root {
  --bg:        #0e1116;
  --bg-soft:   #151a22;
  --card:      #1a2029;
  --card-2:    #202833;
  --line:      #2a3341;
  --line-soft: #222a36;

  --text:      #e6edf6;
  --text-2:    #9fb0c4;
  --text-3:    #6b7c91;

  --blue:      #4da3ff;
  --blue-dim:  #2b6cb8;
  --green:     #39d0a0;
  --amber:     #f0b429;
  --red:       #f2686a;
  --purple:    #9b7ef0;

  --radius:    10px;
  --radius-sm: 7px;
  --shadow:    0 6px 24px rgba(0, 0, 0, .38);
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
               "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: #303c4d; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #3d4c61; }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1100px 500px at 50% -12%, rgba(77, 163, 255, .13), transparent 62%),
    radial-gradient(800px 420px at 88% 108%, rgba(57, 208, 160, .09), transparent 60%),
    var(--bg);
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 372px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 38px 32px 30px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-logo { margin-bottom: 14px; }
.login-card h1 { font-size: 19px; font-weight: 650; letter-spacing: .4px; }
.login-sub { color: var(--text-3); font-size: 13px; margin: 6px 0 22px; }
.login-card input {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 13px;
  font-size: 14px;
  margin-bottom: 14px;
  outline: none;
  transition: border-color .16s;
}
.login-card input:focus { border-color: var(--blue); }
.login-msg { color: var(--red); font-size: 12.5px; min-height: 20px; margin-top: 12px; }

/* ---------------- 布局 ---------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 214px;
  flex: 0 0 214px;
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 18px 18px 16px;
  font-weight: 650;
  font-size: 15px;
  border-bottom: 1px solid var(--line-soft);
  letter-spacing: .3px;
}
.side-nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 3px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background .14s, color .14s;
}
.nav-item svg { width: 17px; height: 17px; fill: currentColor; flex: 0 0 17px; }
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active { background: rgba(77, 163, 255, .15); color: var(--blue); font-weight: 600; }
.side-foot { padding: 10px; border-top: 1px solid var(--line-soft); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  background: rgba(21, 26, 34, .82);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h2 { font-size: 16px; font-weight: 620; }
.top-right { display: flex; align-items: center; gap: 10px; }
.content { padding: 20px 22px 40px; flex: 1; }

/* ---------------- 通用组件 ---------------- */
.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 550;
  cursor: pointer;
  transition: filter .14s, background .14s, border-color .14s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { filter: brightness(.94); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn-primary { background: var(--blue); color: #06121f; }
.btn-ghost { background: var(--card-2); color: var(--text-2); border-color: var(--line); }
.btn-danger { background: rgba(242, 104, 106, .14); color: var(--red); border-color: rgba(242, 104, 106, .35); }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.icon-btn {
  background: none; border: none; color: var(--text-3);
  font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.icon-btn:hover { color: var(--text); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.card-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .015);
}
.card-hd h3 { font-size: 14px; font-weight: 620; }
.card-bd { padding: 16px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1080px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------------- 统计卡 ---------------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px;
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--blue);
}
.stat.s-green::before { background: var(--green); }
.stat.s-amber::before { background: var(--amber); }
.stat.s-red::before { background: var(--red); }
.stat.s-purple::before { background: var(--purple); }
.stat-label { color: var(--text-3); font-size: 12px; margin-bottom: 5px; }
.stat-value { font-size: 25px; font-weight: 680; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--text-3); font-size: 11.5px; margin-top: 2px; }

/* ---------------- 表格 ---------------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; color: var(--text-3); font-weight: 550; font-size: 12px;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  text-transform: none; white-space: nowrap;
}
.tbl td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(255, 255, 255, .018); }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 560; white-space: nowrap;
  background: var(--card-2); color: var(--text-2); border: 1px solid var(--line);
}
.tag.ok      { background: rgba(57,208,160,.14); color: var(--green); border-color: rgba(57,208,160,.3); }
.tag.err     { background: rgba(242,104,106,.14); color: var(--red);   border-color: rgba(242,104,106,.3); }
.tag.run     { background: rgba(77,163,255,.15);  color: var(--blue);  border-color: rgba(77,163,255,.32); }
.tag.warn    { background: rgba(240,180,41,.14);  color: var(--amber); border-color: rgba(240,180,41,.3); }
.tag.purple  { background: rgba(155,126,240,.14); color: var(--purple);border-color: rgba(155,126,240,.3); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 20px; font-size: 12px;
  background: rgba(77,163,255,.14); color: var(--blue); border: 1px solid rgba(77,163,255,.3);
}
.chip::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue); animation: pulse 1.3s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.empty { color: var(--text-3); text-align: center; padding: 26px 10px; font-size: 13px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------- 表单 ---------------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; color: var(--text-2); font-size: 12.5px; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 11px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.field textarea { font-family: var(--mono); font-size: 12px; resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); }
.field select { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.check input { width: 15px; height: 15px; accent-color: var(--blue); cursor: pointer; }
.hint { color: var(--text-3); font-size: 12px; margin: -6px 0 14px; }
.preset-row { display: flex; gap: 7px; flex-wrap: wrap; margin: -4px 0 12px; }

/* ---------------- 日志框 ---------------- */
.logbox {
  background: #0a0d12;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px;
  font-family: var(--mono);
  font-size: 12.2px;
  line-height: 1.65;
  color: #b9c7d8;
  white-space: pre-wrap;
  word-break: break-all;
  height: 420px;
  overflow-y: auto;
}
.logbox-tall { height: 56vh; }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(6, 9, 14, .72);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  width: 100%; max-width: 520px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-wide { max-width: 820px; }
.modal-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
}
.modal-hd h3 { font-size: 15px; font-weight: 620; }
.modal-bd { padding: 18px; overflow-y: auto; }
.modal-ft {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line-soft);
}

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; bottom: 26px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(242,104,106,.45); color: var(--red); }
.toast.ok { border-color: rgba(57,208,160,.45); color: var(--green); }
