/* 星途客客户端管理系统 — Apple 风格设计系统 */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --line: rgba(0, 0, 0, 0.08);
  --blue: #0071e3;
  --blue-soft: #e8f2ff;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Text", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 50% -10%, #e9f2ff 0%, #f5f5f7 55%);
  padding: 24px;
}
.login-card {
  width: 380px; background: rgba(255,255,255,0.86); backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(255,255,255,0.8); border-radius: 24px; padding: 40px 36px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.12);
}
.login-logo { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; text-align: center; }
.login-sub { text-align: center; color: var(--text-2); margin: 8px 0 28px; font-size: 13px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12); background: rgba(255,255,255,0.9);
  outline: none; transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,113,227,0.12); }
textarea.input { height: auto; padding: 10px 14px; resize: vertical; min-height: 80px; }
.btn {
  height: 42px; padding: 0 20px; border-radius: 12px; border: none; cursor: pointer;
  background: var(--blue); color: #fff; font-weight: 590; letter-spacing: -0.01em;
  transition: transform .15s var(--ease), opacity .2s, background .2s;
}
.btn:hover { background: #0077ed; }
.btn:active { transform: scale(0.98); }
.btn.block { width: 100%; height: 46px; }
.btn.ghost { background: rgba(0,0,0,0.05); color: var(--text); }
.btn.ghost:hover { background: rgba(0,0,0,0.08); }
.btn.danger { background: #fff0ef; color: var(--red); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex: 0 0 236px; padding: 22px 14px;
  background: rgba(255,255,255,0.72); backdrop-filter: saturate(180%) blur(24px);
  border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
}
.brand { padding: 6px 12px 22px; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.brand-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; letter-spacing: .04em; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: var(--text); cursor: pointer; margin-bottom: 2px; font-weight: 500;
  transition: background .18s var(--ease);
}
.nav-item:hover { background: rgba(0,0,0,0.045); }
.nav-item.active { background: var(--blue); color: #fff; }
.nav-item.active .nav-ico { opacity: 1; }
.nav-ico { width: 18px; text-align: center; opacity: .8; font-size: 15px; }
.nav-group { font-size: 11px; color: var(--text-3); padding: 16px 12px 6px; letter-spacing: .06em; }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); }
.who { font-size: 13px; font-weight: 600; }
.who small { display: block; color: var(--text-3); font-weight: 400; font-size: 11px; margin-top: 3px; }
.logout { margin-top: 10px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.logout:hover { color: var(--red); }

.main { flex: 1; min-width: 0; padding: 28px 32px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.page-desc { color: var(--text-2); font-size: 13px; margin-top: 4px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.03);
}
.card-pad { padding: 20px 22px; }
.grid { display: grid; gap: 16px; }
.grid.c4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.c2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (max-width: 1100px) { .grid.c4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .grid.c3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .grid.c4, .grid.c3, .grid.c2 { grid-template-columns: 1fr; } .sidebar { display: none; } .main { padding: 20px 16px 40px; } }

.stat-label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.stat-value { font-size: 34px; font-weight: 700; letter-spacing: -0.04em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat-foot { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.stat-value .unit { font-size: 14px; font-weight: 500; color: var(--text-3); margin-left: 4px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3);
  padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 14px; border-bottom: 1px solid rgba(0,0,0,0.05); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s var(--ease); }
tbody tr:hover { background: rgba(0,0,0,0.018); }
.cell-title { font-weight: 590; }
.cell-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #e9e9ee;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: #8a8a8e;
}
.user-cell { display: flex; align-items: center; gap: 10px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 11px; font-weight: 600; background: rgba(0,0,0,0.05); color: var(--text-2);
}
.badge.green { background: rgba(52,199,89,0.12); color: #1d8f3f; }
.badge.orange { background: rgba(255,149,0,0.13); color: #b26b00; }
.badge.red { background: rgba(255,59,48,0.1); color: #c3221b; }
.badge.blue { background: var(--blue-soft); color: #0062c4; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- 工具条 ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search {
  height: 38px; padding: 0 14px 0 34px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center;
  width: 260px; outline: none;
}
.search:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,113,227,.1); }
.select { height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; outline: none; }
.spacer { flex: 1; }

/* ---------- 开关 ---------- */
.switch { position: relative; width: 46px; height: 28px; flex: 0 0 46px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; background: #e5e5ea; border-radius: 999px; cursor: pointer;
  transition: background .25s var(--ease);
}
.switch span::after {
  content: ''; position: absolute; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  top: 2px; left: 2px; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .25s var(--ease);
}
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }

/* ---------- 模块行 ---------- */
.row-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid rgba(0,0,0,0.05); }
.row-item:last-child { border-bottom: none; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 590; }
.row-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ---------- 分段控件 ---------- */
.segmented { display: inline-flex; background: rgba(0,0,0,0.055); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button {
  border: none; background: transparent; height: 32px; padding: 0 16px; border-radius: 8px;
  cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-2);
}
.segmented button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); font-weight: 600; }

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.28); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  width: 520px; max-width: 100%; max-height: 86vh; overflow: auto; background: #fff;
  border-radius: 22px; padding: 26px; box-shadow: 0 40px 100px rgba(0,0,0,.25);
  animation: pop .22s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } }
.modal h3 { font-size: 19px; letter-spacing: -0.02em; margin-bottom: 4px; }
.modal .m-sub { color: var(--text-3); font-size: 12px; margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 20px);
  background: rgba(29,29,31,0.94); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all .25s var(--ease); z-index: 200;
  backdrop-filter: blur(10px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.empty { text-align: center; padding: 56px 20px; color: var(--text-3); }
.empty .e-ico { font-size: 34px; margin-bottom: 10px; opacity: .5; }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg,#eee 25%,#f6f6f8 50%,#eee 75%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

.section-title { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; margin-bottom: 4px; }
.section-desc { font-size: 12px; color: var(--text-3); margin-bottom: 16px; }
.hr { height: 1px; background: var(--line); margin: 20px 0; }
.mono { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 12px; color: var(--text-2); }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { color: var(--text); font-weight: 500; }
