:root {
  --blue: #1677ff;
  --blue-dark: #0b5fd8;
  --blue-soft: #e8f1ff;
  --bg: #f2f4f8;
  --card: #ffffff;
  --text: #1f2329;
  --text-2: #4e5969;
  --muted: #8a919e;
  --line: #e9edf3;
  --green: #00b578;
  --green-soft: #e6f9f1;
  --orange: #ff8f1f;
  --orange-soft: #fff5e6;
  --red: #f5222d;
  --red-soft: #ffeceb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

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

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- 登录 ---------------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 10% -10%, #dbe9ff 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #e6f7f1 0%, transparent 50%),
    var(--bg);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 36px 34px 30px;
}

.login-logo {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), #52a0ff);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; font-weight: 700;
  margin-bottom: 18px;
}

.login-card h1 { font-size: 20px; margin: 0 0 6px; }
.login-card p.sub { margin: 0 0 26px; color: var(--muted); font-size: 13px; }

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

.sidebar {
  width: 216px;
  flex: 0 0 216px;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.brand .mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--blue), #52a0ff);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.brand .name { font-weight: 600; font-size: 14px; letter-spacing: .2px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  color: var(--text-2); font-size: 14px;
  text-decoration: none; transition: background .15s, color .15s;
}
.nav a:hover { background: #f4f6fa; text-decoration: none; }
.nav a.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.nav a .ico { width: 18px; text-align: center; opacity: .85; }

.sidebar-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.sidebar-foot .who { font-size: 12px; color: var(--muted); margin-bottom: 8px; }

.main { flex: 1; min-width: 0; padding: 26px 30px 60px; }
.main-inner { max-width: 1180px; margin: 0 auto; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: .2px; }
.page-head .desc { color: var(--muted); font-size: 13px; margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head .hint { color: var(--muted); font-size: 12.5px; }

/* ---------------- 统计 ---------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: #fff; border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat .k { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.stat .v { font-size: 24px; font-weight: 650; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.stat.blue .v { color: var(--blue); }
.stat.green .v { color: var(--green); }
.stat.orange .v { color: var(--orange); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 8px 15px; border-radius: 9px; font-size: 13.5px; cursor: pointer;
  transition: all .15s; white-space: nowrap; font-family: inherit;
}
.btn:hover { border-color: #c9d3e3; background: #fafbfe; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn.danger { color: var(--red); border-color: #ffd4d2; background: #fff; }
.btn.danger:hover { background: var(--red-soft); }
.btn.ghost { border-color: transparent; background: transparent; padding: 6px 10px; font-size: 13px; color: var(--blue); }
.btn.ghost:hover { background: var(--blue-soft); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }
.btn.block { width: 100%; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.field .tip { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 13.5px; font-family: inherit; color: var(--text); background: #fff;
  transition: border-color .15s, box-shadow .15s; outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, .12);
}
textarea { resize: vertical; min-height: 76px; line-height: 1.6; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238a919e' d='M0 0h10L5 6z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted);
  background: #fafbfd; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 11px 14px; border-bottom: 1px solid #f2f4f8; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fbfcfe; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

/* ---------------- 徽标 ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 500;
  background: #f2f4f8; color: var(--text-2); white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge.green { background: var(--green-soft); color: #00905f; }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.orange { background: var(--orange-soft); color: #c96a00; }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.gray { background: #f2f4f8; color: var(--muted); }
.badge.nodot::before { display: none; }

/* ---------------- 进度 ---------------- */
.progress { height: 8px; background: #eef1f6; border-radius: 20px; overflow: hidden; }
.progress > i {
  display: block; height: 100%; border-radius: 20px;
  background: linear-gradient(90deg, var(--blue), #5aa6ff);
  transition: width .4s ease;
}
.progress.green > i { background: linear-gradient(90deg, #00b578, #4fd6a7); }

/* ---------------- 上传区 ---------------- */
.dropzone {
  border: 1.5px dashed #cdd7e6; border-radius: 12px; padding: 34px 20px;
  text-align: center; background: #fbfcff; cursor: pointer; transition: all .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--blue); background: var(--blue-soft); }
.dropzone .big { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.dropzone .small { font-size: 12.5px; color: var(--muted); }
.dropzone .icon { font-size: 26px; margin-bottom: 8px; opacity: .55; }

/* ---------------- 步骤 ---------------- */
.steps { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.step {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px;
  border-radius: 24px; background: #fff; box-shadow: var(--shadow); font-size: 13px; color: var(--muted);
}
.step .n {
  width: 20px; height: 20px; border-radius: 50%; background: #eef1f6; color: var(--muted);
  display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600;
}
.step.done { color: #00905f; }
.step.done .n { background: var(--green-soft); color: #00905f; font-size: 12px; font-weight: 700; }
.step.active { color: var(--blue); font-weight: 600; }
.step.active .n { background: var(--blue); color: #fff; }

/* ---------------- 空状态 ---------------- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 13.5px; }
.empty .icon { font-size: 30px; opacity: .35; margin-bottom: 8px; }

/* ---------------- 弹窗 ---------------- */
.mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .42);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 520px;
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
  animation: pop .18s cubic-bezier(.2, .9, .3, 1.1);
}
.modal.wide { max-width: 860px; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0 } to { transform: none; opacity: 1 } }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.x-btn { border: none; background: none; font-size: 20px; color: var(--muted); cursor: pointer; line-height: 1; padding: 4px; border-radius: 6px; }
.x-btn:hover { background: #f2f4f8; color: var(--text); }

/* ---------------- Toast ---------------- */
#toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #1f2329; color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  animation: slidein .2s ease; max-width: 80vw;
}
.toast.err { background: #c81f26; }
.toast.ok { background: #0a8f5f; }
@keyframes slidein { from { transform: translateY(-8px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------------- 其它 ---------------- */
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt { margin-top: 14px; }
.mb0 { margin-bottom: 0; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.pill-tabs { display: inline-flex; background: #f2f4f8; border-radius: 10px; padding: 3px; gap: 2px; }
.pill-tabs button {
  border: none; background: transparent; padding: 6px 14px; border-radius: 8px;
  font-size: 13px; color: var(--text-2); cursor: pointer; font-family: inherit;
}
.pill-tabs button.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }
.kv { display: grid; grid-template-columns: 108px 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.alert { border-radius: 10px; padding: 12px 16px; font-size: 13px; line-height: 1.65; margin-bottom: 16px; }
.alert.info { background: var(--blue-soft); color: #0b4ea8; }
.alert.warn { background: var(--orange-soft); color: #9a5200; }
.alert.ok { background: var(--green-soft); color: #00694a; }
.alert.err { background: var(--red-soft); color: #a5121a; }
.alert b { font-weight: 600; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; flex-direction: row; align-items: center; padding: 10px 14px; overflow-x: auto; }
  .brand { padding: 0 12px 0 0; }
  .nav { flex-direction: row; gap: 2px; }
  .nav a span.txt { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; border: none; padding: 0; }
  .sidebar-foot .who { display: none; }
  .main { padding: 18px 16px 50px; }
}
