/* 周末去哪儿 · 管理后台  —— Ant Design 视觉语言 */
:root {
  --primary: #1677ff;
  --primary-hover: #4096ff;
  --primary-active: #0958d9;
  --success: #52c41a;
  --warning: #faad14;
  --danger: #ff4d4f;
  --sider: #001529;
  --sider-sub: #000c17;
  --text: rgba(0, 0, 0, .88);
  --text-2: rgba(0, 0, 0, .65);
  --text-3: rgba(0, 0, 0, .45);
  --border: #f0f0f0;
  --border-2: #d9d9d9;
  --bg: #f5f5f5;
  --card: #fff;
  --radius: 8px;
  --shadow: 0 1px 2px 0 rgba(0, 0, 0, .03), 0 1px 6px -1px rgba(0, 0, 0, .02), 0 2px 4px 0 rgba(0, 0, 0, .02);
  --shadow-lg: 0 6px 16px -8px rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .18); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- 登录 */
.login-wrap {
  height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e6f4ff 0%, #f5f5f5 55%, #f6ffed 100%);
}
.login-card {
  width: 380px; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 40px 32px 28px;
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-logo {
  width: 32px; height: 32px; border-radius: 8px; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 16px;
}
.login-title { font-size: 20px; font-weight: 600; }
.login-sub { color: var(--text-3); font-size: 13px; margin-bottom: 28px; }

/* ---------------------------------------------------------------- 布局 */
.layout { display: flex; min-height: 100vh; }
.sider {
  width: 208px; flex: 0 0 208px; background: var(--sider); color: rgba(255, 255, 255, .85);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 10;
}
.sider-brand {
  height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  font-size: 15px; font-weight: 600; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sider-logo {
  width: 26px; height: 26px; border-radius: 6px; background: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.sider-menu { flex: 1; padding: 8px 0; overflow-y: auto; }
.menu-group { padding: 12px 16px 6px; font-size: 12px; color: rgba(255, 255, 255, .35); }
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; margin: 2px 8px;
  border-radius: 6px; cursor: pointer; font-size: 14px; transition: background .15s;
}
.menu-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.menu-item.active { background: var(--primary); color: #fff; }
.menu-item .mi-ico { width: 16px; text-align: center; opacity: .9; }

.main { flex: 1; margin-left: 208px; display: flex; flex-direction: column; min-width: 0; }
.header {
  height: 56px; background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  position: sticky; top: 0; z-index: 9;
}
.header-title { font-size: 16px; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 14px; color: var(--text-2); font-size: 13px; }
.content { padding: 20px 24px 40px; }

/* ---------------------------------------------------------------- 组件 */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; justify-content: space-between; }
.card-desc { color: var(--text-3); font-size: 12px; margin-bottom: 16px; }

.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g2 { grid-template-columns: 1fr; } }

.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 20px 18px; }
.stat-label { color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 28px; font-weight: 600; line-height: 1.2; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.stat-foot { font-size: 12px; color: var(--text-3); }
.stat-foot .up { color: var(--danger); }
.stat-foot .down { color: var(--success); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }

input, select, textarea {
  font: inherit; color: var(--text); background: #fff;
  border: 1px solid var(--border-2); border-radius: 6px; padding: 6px 11px;
  outline: none; transition: border-color .15s, box-shadow .15s; width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 2px rgba(22, 119, 255, .1);
}
textarea { resize: vertical; min-height: 88px; line-height: 1.6; }
label.fl { display: block; font-size: 13px; color: var(--text-2); margin: 0 0 6px; }
.field { margin-bottom: 16px; }
.field-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 15px; border-radius: 6px; border: 1px solid var(--border-2);
  background: #fff; color: var(--text); cursor: pointer; font-size: 14px; white-space: nowrap;
  transition: all .15s;
}
.btn:hover { color: var(--primary-hover); border-color: var(--primary-hover); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { height: 26px; padding: 0 10px; font-size: 13px; }
.btn-text { border: none; background: none; padding: 0 4px; color: var(--primary); }
.btn-text:hover { background: none; text-decoration: underline; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-weight: 600; font-size: 13px; color: var(--text-2);
  background: #fafafa; padding: 12px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: top; }
tbody tr:hover { background: #fafafa; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }

.tag {
  display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px;
  background: #fafafa; border: 1px solid var(--border); color: var(--text-2); margin: 0 4px 4px 0;
}
.tag-blue { background: #e6f4ff; border-color: #91caff; color: #0958d9; }
.tag-green { background: #f6ffed; border-color: #b7eb8f; color: #389e0d; }
.tag-red { background: #fff2f0; border-color: #ffccc7; color: #cf1322; }
.tag-grey { background: #fafafa; border-color: var(--border); color: var(--text-3); }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; color: var(--text-2); font-size: 13px; }

.empty { text-align: center; padding: 48px 0; color: var(--text-3); }

/* ------------------------------------------------------- 抽屉 / 弹窗 */
.mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 100;
  display: flex; justify-content: flex-end; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.mask.show { opacity: 1; pointer-events: auto; }
.drawer {
  width: 560px; max-width: 92vw; background: #fff; height: 100%; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s ease;
}
.mask.show .drawer { transform: translateX(0); }
.drawer-head { padding: 16px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.drawer-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px; }
.drawer-foot { padding: 12px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.close-x { cursor: pointer; color: var(--text-3); font-size: 18px; line-height: 1; }

.modal-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal { width: 420px; max-width: 92vw; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 24px; }
.modal h4 { margin: 0 0 12px; font-size: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%) translateY(-16px);
  background: #fff; box-shadow: var(--shadow-lg); border-radius: var(--radius);
  padding: 10px 18px; font-size: 14px; z-index: 300; opacity: 0; transition: all .2s; pointer-events: none;
  display: flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { color: var(--danger); }
.toast.ok { color: var(--success); }

/* ---------------------------------------------------------------- 图表 */
.chart svg { display: block; width: 100%; overflow: visible; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.bar-name { width: 84px; flex: 0 0 84px; color: var(--text-2); text-align: right; }
.bar-track { flex: 1; height: 18px; background: #f5f5f5; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width .4s; }
.bar-val { width: 56px; flex: 0 0 56px; font-variant-numeric: tabular-nums; color: var(--text-2); }

.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv span:first-child { color: var(--text-2); }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.hint { background: #f6ffed; border: 1px solid #b7eb8f; border-radius: 6px; padding: 12px 14px; font-size: 13px; color: #389e0d; line-height: 1.7; }
.hint.warn { background: #fffbe6; border-color: #ffe58f; color: #d48806; }
