:root {
  --app-bg: #eef2ec;
  --app-accent: #1f7a5a;
  --app-accent-strong: #17604a;
  --app-accent-soft: #e3efe9;
  --app-text: #1b2520;
  --app-muted: #66756d;
  --app-border: #dfe6e0;
  --app-card: #ffffff;
  --app-danger: #c04545;
  --app-warn: #b8860b;
  --radius-s: 4px;
  --radius-m: 8px;
  --shadow: 0 1px 2px rgba(27, 37, 32, 0.05);
  --font: "Inter", "Microsoft YaHei", "PingFang SC", -apple-system, sans-serif;
  --mono: "Consolas", "SF Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--app-bg);
  color: var(--app-text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--app-accent); text-decoration: none; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; flex-shrink: 0;
  background: var(--app-card);
  border-right: 1px solid var(--app-border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  padding: 20px 18px 16px;
  font-size: 17px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--app-accent-strong);
  border-bottom: 1px solid var(--app-border);
}
.brand small { display: block; font-size: 11px; font-weight: 400; color: var(--app-muted); margin-top: 2px; }
.nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; margin-bottom: 2px;
  border-radius: var(--radius-m);
  color: var(--app-text); cursor: pointer;
  font-size: 13.5px; transition: background 0.15s, color 0.15s;
  user-select: none;
}
.nav-item:hover { background: var(--app-accent-soft); }
.nav-item.active { background: var(--app-accent); color: #fff; font-weight: 600; }
.nav-icon { width: 17px; height: 17px; flex-shrink: 0; }
.sidebar-footer { padding: 12px 14px; border-top: 1px solid var(--app-border); font-size: 12px; color: var(--app-muted); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 52px; background: var(--app-card); border-bottom: 1px solid var(--app-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-size: 15px; font-weight: 600; }
.topbar-user { font-size: 13px; color: var(--app-muted); display: flex; align-items: center; gap: 12px; }
.content { padding: 22px; flex: 1; }

/* ---------- 卡片与表格 ---------- */
.card {
  background: var(--app-card);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card-header {
  padding: 13px 16px; border-bottom: 1px solid var(--app-border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.card-title { font-size: 14px; font-weight: 600; }
.card-body { padding: 16px; }
.card-body.flush { padding: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card {
  background: var(--app-card); border: 1px solid var(--app-border); border-radius: var(--radius-m);
  padding: 15px 16px; box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(27,37,32,0.08); }
.stat-label { font-size: 12px; color: var(--app-muted); margin-bottom: 6px; }
.stat-value { font-size: 24px; font-weight: 700; font-family: var(--mono); color: var(--app-accent-strong); }
.stat-sub { font-size: 12px; color: var(--app-muted); margin-top: 4px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: 10px 14px; font-weight: 600; font-size: 12px;
  color: var(--app-muted); background: #f6f9f6; border-bottom: 1px solid var(--app-border);
  white-space: nowrap;
}
td { padding: 10px 14px; border-bottom: 1px solid var(--app-border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: #f6faf7; }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* ---------- 控件 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-s);
  border: 1px solid var(--app-border); background: var(--app-card);
  color: var(--app-text); font-size: 13px; cursor: pointer;
  transition: all 0.15s; font-family: var(--font); white-space: nowrap;
}
.btn:hover { border-color: var(--app-accent); color: var(--app-accent); }
.btn-primary { background: var(--app-accent); border-color: var(--app-accent); color: #fff; }
.btn-primary:hover { background: var(--app-accent-strong); border-color: var(--app-accent-strong); color: #fff; }
.btn-danger { color: var(--app-danger); }
.btn-danger:hover { border-color: var(--app-danger); color: var(--app-danger); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.input, .select, textarea.input {
  padding: 7px 11px; border: 1px solid var(--app-border); border-radius: var(--radius-s);
  font-size: 13px; font-family: var(--font); background: var(--app-card); color: var(--app-text);
  transition: border-color 0.15s, box-shadow 0.15s; outline: none;
}
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--app-accent); box-shadow: 0 0 0 2px rgba(31, 122, 90, 0.12);
}
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .spacer { flex: 1; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-block; padding: 2px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 500; line-height: 1.7; white-space: nowrap;
  background: var(--app-accent-soft); color: var(--app-accent-strong);
}
.tag-green { background: #e2f2e7; color: #1f7a4b; }
.tag-gray { background: #eef1ee; color: #66756d; }
.tag-red { background: #f9e6e6; color: var(--app-danger); }
.tag-yellow { background: #f7efdc; color: var(--app-warn); }
.tag-blue { background: #e3ecf7; color: #2f5f8f; }

/* ---------- 分页 ---------- */
.pagination { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-size: 12.5px; color: var(--app-muted); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(27, 37, 32, 0.35);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  animation: fadeIn 0.15s;
}
.modal {
  background: var(--app-card); border-radius: var(--radius-m); width: 480px; max-width: 92vw;
  max-height: 86vh; overflow-y: auto; box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  animation: slideUp 0.18s;
}
.modal-header { padding: 15px 18px; border-bottom: 1px solid var(--app-border); font-weight: 600; font-size: 14.5px; }
.modal-body { padding: 18px; }
.modal-footer { padding: 13px 18px; border-top: 1px solid var(--app-border); display: flex; justify-content: flex-end; gap: 8px; }
.form-row { margin-bottom: 14px; }
.form-label { display: block; font-size: 12.5px; color: var(--app-muted); margin-bottom: 5px; }
.form-row .input, .form-row .select, .form-row textarea.input { width: 100%; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 10px 16px; border-radius: var(--radius-s); font-size: 13px;
  background: var(--app-text); color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  animation: slideUp 0.18s; max-width: 340px;
}
.toast.error { background: var(--app-danger); }

/* ---------- 空状态 ---------- */
.empty { padding: 44px 0; text-align: center; color: var(--app-muted); font-size: 13px; }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 360px; max-width: 92vw; }
.login-card .brand-area { text-align: center; padding: 26px 0 6px; }
.login-card .brand-area h1 { font-size: 21px; color: var(--app-accent-strong); }
.login-card .brand-area p { font-size: 12.5px; color: var(--app-muted); margin-top: 5px; }

/* ---------- 移动端 ---------- */
.mobile-tabbar { display: none; }
@media (max-width: 768px) {
  .sidebar { display: none; }
  .content { padding: 14px 12px 74px; }
  .mobile-tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: var(--app-card); border-top: 1px solid var(--app-border);
  }
  .mobile-tab {
    flex: 1; padding: 8px 0 7px; text-align: center; font-size: 11px;
    color: var(--app-muted); cursor: pointer;
  }
  .mobile-tab.active { color: var(--app-accent); font-weight: 600; }
  .mobile-tab .nav-icon { width: 19px; height: 19px; margin: 0 auto 2px; display: block; }
}

/* ---------- 领卡页 ---------- */
.claim-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 34px 16px 60px; }
.claim-card { width: 430px; max-width: 100%; }
.claim-brand { text-align: center; margin-bottom: 18px; }
.claim-brand h1 { font-size: 20px; color: var(--app-accent-strong); }
.claim-brand p { font-size: 12.5px; color: var(--app-muted); margin-top: 4px; }
.claim-status { text-align: center; padding: 8px 0 4px; }
.claim-status .big { font-size: 17px; font-weight: 700; }
.claim-field {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 11px 0; border-bottom: 1px dashed var(--app-border); font-size: 13.5px;
}
.claim-field:last-child { border-bottom: none; }
.claim-field .k { color: var(--app-muted); }
.claim-field .v { font-family: var(--mono); font-weight: 600; text-align: right; word-break: break-all; }
.claim-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.claim-actions .btn { justify-content: center; padding: 11px; font-size: 14px; }
.copy-btn { cursor: pointer; color: var(--app-accent); font-size: 12px; margin-left: 8px; }
