/* 爱卡同城 · 运营管理后台样式（暖色调，与前台视觉统一） */

:root {
  --brown: #3A2A22;
  --brown-2: #6B5145;
  --muted: #8A7268;
  --line: #EFE3D9;
  --line-2: #F7F0E9;
  --bg: #FBF6F1;
  --card: #FFFFFF;
  --primary: #C0492B;
  --primary-d: #A63D2E;
  --primary-l: #FBF0EA;
  --green: #2E7D5B;
  --green-l: #EAF6EF;
  --blue: #2F6FB0;
  --blue-l: #EAF2FB;
  --warn: #B7791F;
  --warn-l: #FDF5E6;
  --danger: #C0392B;
  --danger-l: #FCEDEB;
  --radius: 10px;
  --shadow: 0 2px 14px rgba(122, 63, 34, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--brown);
  font: 14px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-d); }

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

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

.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid var(--line); }
.brand-logo {
  width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #C0492B, #E8834F); color: #fff; font-weight: 700; font-size: 14px;
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.3; overflow: hidden; }
.brand-txt strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-txt small { color: var(--muted); font-size: 11px; }

.nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 8px;
  color: var(--brown-2); font-size: 13.5px; margin-bottom: 2px; transition: .15s;
}
.nav-item:hover { background: var(--line-2); color: var(--brown); }
.nav-item.active { background: var(--primary-l); color: var(--primary-d); font-weight: 600; }
.nav-icon { font-size: 15px; width: 18px; text-align: center; }
.nav-text { flex: 1; }
.nav-badge {
  background: var(--primary); color: #fff; font-size: 11px; padding: 1px 6px;
  border-radius: 9px; min-width: 18px; text-align: center; font-weight: 600;
}

.sidebar-foot { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12.5px; }
.who { color: var(--brown-2); margin-bottom: 4px; font-weight: 600; }
.logout { color: var(--muted); font-size: 12px; }
.logout:hover { color: var(--danger); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: #fff; border-bottom: 1px solid var(--line); padding: 0 22px;
  height: 56px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 16px; margin: 0; font-weight: 600; }
.topbar-right { display: flex; gap: 14px; align-items: center; }
.link-plain { color: var(--muted); font-size: 13px; }

.content { padding: 20px 22px 26px; flex: 1; }
.foot { padding: 14px 22px 20px; color: var(--muted); font-size: 12px; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden;
}
.card-head {
  padding: 13px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card-head .sub { color: var(--muted); font-size: 12.5px; font-weight: 400; margin-left: 8px; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

/* ---------------- 统计卡 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.stat .label { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.stat .value { font-size: 23px; font-weight: 700; color: var(--primary-d); line-height: 1.2; }
.stat .value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.stat .extra { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.list th {
  text-align: left; padding: 11px 12px; background: #FDFAF7; color: var(--brown-2);
  font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.list td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr:hover td { background: #FEFCFA; }
table.list .nowrap { white-space: nowrap; }
table.list .id-col { color: var(--muted); font-size: 12.5px; }

.thumb {
  width: 40px; height: 40px; border-radius: 7px; object-fit: cover; background: var(--line-2);
  display: inline-block; vertical-align: middle; border: 1px solid var(--line);
}
.thumb-ph {
  width: 40px; height: 40px; border-radius: 7px; display: inline-grid; place-items: center;
  background: linear-gradient(135deg, #E8C9B4, #D9A88A); color: #fff; font-size: 13px; font-weight: 600;
  vertical-align: middle;
}
.cell-main { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.cell-main .t { font-weight: 600; color: var(--brown); }
.cell-main .d { color: var(--muted); font-size: 12px; margin-top: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.price { color: var(--primary-d); font-weight: 700; }

/* ---------------- 徽标 ---------------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px;
  font-weight: 600; line-height: 1.7; white-space: nowrap;
}
.badge-default { background: var(--line-2); color: var(--brown-2); }
.badge-success { background: var(--green-l); color: var(--green); }
.badge-warn    { background: var(--warn-l);  color: var(--warn); }
.badge-danger  { background: var(--danger-l); color: var(--danger); }
.badge-blue    { background: var(--blue-l);  color: var(--blue); }
.badge-primary { background: var(--primary-l); color: var(--primary-d); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 13px; border-radius: 7px;
  border: 1px solid var(--line); background: #fff; color: var(--brown-2); font-size: 13px;
  cursor: pointer; transition: .15s; font-family: inherit; line-height: 1.6; text-decoration: none;
}
.btn:hover { border-color: #E3CFC0; background: #FEFCFA; color: var(--brown); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); color: #fff; }
.btn-ok { background: var(--green); border-color: var(--green); color: #fff; }
.btn-ok:hover { background: #256B4C; border-color: #256B4C; color: #fff; }
.btn-danger { background: #fff; border-color: #E9C4BE; color: var(--danger); }
.btn-danger:hover { background: var(--danger-l); border-color: var(--danger); }
.btn-sm { padding: 4px 9px; font-size: 12.5px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------- 表单 ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; color: var(--brown-2); font-weight: 600; }
.field label .req { color: var(--danger); margin-left: 2px; }
.field .hint { color: var(--muted); font-size: 12px; }
input[type=text], input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: 7px;
  font: inherit; font-size: 13.5px; color: var(--brown); background: #fff; transition: .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(192, 73, 43, .1);
}
textarea { resize: vertical; min-height: 80px; }
.form-actions { margin-top: 16px; display: flex; gap: 10px; align-items: center; }

.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 12px 16px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 14px;
}
.filter-bar input[type=text], .filter-bar select { width: auto; min-width: 130px; }
.filter-bar .spacer { flex: 1; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; gap: 5px; align-items: center; padding: 13px 16px; flex-wrap: wrap; }
.pager-info { color: var(--muted); font-size: 12.5px; margin-right: 8px; }
.pg {
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 12.5px;
  color: var(--brown-2); background: #fff;
}
.pg:hover { border-color: #E3CFC0; background: #FEFCFA; }
.pg.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pg-dot { color: var(--muted); padding: 0 2px; }

/* ---------------- 提示 ---------------- */
.flash {
  margin: 14px 22px 0; padding: 10px 15px; border-radius: 8px; font-size: 13.5px; font-weight: 500;
}
.flash-success { background: var(--green-l); color: var(--green); border: 1px solid #CBE7D8; }
.flash-error { background: var(--danger-l); color: var(--danger); border: 1px solid #F0CFC9; }
.flash-info { background: var(--blue-l); color: var(--blue); border: 1px solid #CFE1F4; }

.empty { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty .ico { font-size: 34px; display: block; margin-bottom: 8px; opacity: .55; }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(140deg, #FBF6F1 0%, #F5E6DB 55%, #EFD9C8 100%);
}
.login-card {
  width: 100%; max-width: 384px; background: #fff; border-radius: 16px;
  box-shadow: 0 14px 44px rgba(122, 63, 34, .13); padding: 32px 30px 26px;
}
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.login-brand .brand-logo { width: 44px; height: 44px; font-size: 15px; }
.login-brand h1 { font-size: 18px; margin: 0; }
.login-brand p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn-primary { width: 100%; justify-content: center; padding: 10px; font-size: 14.5px; margin-top: 6px; }
.login-tip { margin-top: 16px; color: var(--muted); font-size: 12px; text-align: center; line-height: 1.7; }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(58, 42, 34, .42); display: none;
  place-items: center; z-index: 100; padding: 20px;
}
.modal-mask.show { display: grid; }
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 520px;
  max-height: 88vh; overflow: auto; box-shadow: 0 18px 50px rgba(58, 42, 34, .24);
}
.modal-head { padding: 15px 18px; border-bottom: 1px solid var(--line); font-weight: 600; }
.modal-body { padding: 18px; }
.modal-foot { padding: 13px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; overflow-x: auto; }
  .brand { border-bottom: 0; border-right: 1px solid var(--line); flex: none; }
  .nav { display: flex; gap: 4px; padding: 8px; }
  .nav-item { white-space: nowrap; margin-bottom: 0; }
  .sidebar-foot { border-top: 0; border-left: 1px solid var(--line); flex: none; }
  .content { padding: 14px 12px 20px; }
  .topbar { padding: 0 14px; }
  .flash { margin: 12px 12px 0; }
}
