:root {
  --primary: #165DFF;
  --primary-light: #E8F3FF;
  --primary-dark: #0E42B3;
  --warning: #FF7D00;
  --warning-light: #FFF7E8;
  --success: #00B42A;
  --success-light: #E8FFEA;
  --danger: #F53F3F;
  --danger-light: #FFECE8;
  --text-1: #1D2129;
  --text-2: #4E5969;
  --text-3: #86909C;
  --bg-page: #F2F3F5;
  --bg-card: #FFFFFF;
  --border: #E5E6EB;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg-page); color: var(--text-1); font-size: 14px; line-height: 1.6;
}
a { text-decoration: none; color: inherit; }

/* ===== 登录页 ===== */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #165DFF 0%, #0E42B3 50%, #002B80 100%);
}
.login-box {
  background: #fff; border-radius: 16px; padding: 40px;
  width: 400px; max-width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.login-box .logo-area { text-align: center; margin-bottom: 30px; }
.login-box .logo-area .title { font-size: 20px; font-weight: 700; color: var(--primary); }
.login-box .logo-area .sub { font-size: 13px; color: var(--text-3); margin-top: 6px; }
.login-box .form-item { margin-bottom: 16px; }
.login-box .form-item label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.login-box .form-item input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; outline: none; transition: border-color .15s;
}
.login-box .form-item input:focus { border-color: var(--primary); }
.login-box .btn-login {
  width: 100%; padding: 12px; background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius-sm); font-size: 15px;
  cursor: pointer; transition: background .15s; margin-top: 8px;
}
.login-box .btn-login:hover { background: var(--primary-dark); }
.login-box .tip {
  margin-top: 20px; padding: 12px; background: var(--primary-light);
  border-radius: var(--radius-sm); font-size: 12px; color: var(--primary); line-height: 1.8;
}
.login-error { color: var(--danger); font-size: 13px; margin-top: 8px; display: none; }

/* ===== 顶部导航栏 ===== */
.top-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 56px;
  background: #fff; border-bottom: 1px solid var(--border); z-index: 1000;
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}
.top-bar .brand { font-weight: 700; font-size: 16px; color: var(--primary); }
.top-bar .user-area { display: flex; align-items: center; gap: 16px; }
.top-bar .user-area .user-info { font-size: 13px; color: var(--text-2); }
.top-bar .user-area a { font-size: 13px; color: var(--text-2); cursor: pointer; }
.top-bar .user-area a:hover { color: var(--primary); }

/* ===== 管理员端布局 ===== */
.admin-layout { display: flex; padding-top: 56px; min-height: 100vh; }
.admin-sidebar {
  width: 220px; background: #fff; border-right: 1px solid var(--border);
  position: fixed; top: 56px; bottom: 0; left: 0; overflow-y: auto; z-index: 100;
}
.admin-sidebar .logo {
  padding: 20px 16px; font-weight: 700; font-size: 15px;
  color: var(--primary); border-bottom: 1px solid var(--border); line-height: 1.4;
}
.admin-sidebar nav { padding: 8px 0; }
.admin-sidebar nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px; color: var(--text-2); text-decoration: none;
  font-size: 14px; transition: all .15s; cursor: pointer;
}
.admin-sidebar nav a:hover { background: var(--primary-light); color: var(--primary); }
.admin-sidebar nav a.active { background: var(--primary-light); color: var(--primary); font-weight: 500; border-right: 3px solid var(--primary); }
.admin-sidebar nav a .badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 11px; padding: 1px 6px; border-radius: 10px;
}
.admin-main { flex: 1; margin-left: 220px; padding: 24px; }
.page-title { font-size: 20px; font-weight: 600; margin-bottom: 20px; }

/* ===== 卡片 ===== */
.card { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

/* ===== 统计卡片 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat-card .num { font-size: 28px; font-weight: 700; color: var(--text-1); }
.stat-card .label { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.stat-card.primary .num { color: var(--primary); }
.stat-card.warning .num { color: var(--warning); }
.stat-card.success .num { color: var(--success); }
.stat-card.danger .num { color: var(--danger); }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #F7F8FA; font-weight: 500; color: var(--text-2); font-size: 13px; }
tr:hover td { background: #F7F8FA; }

/* ===== 标签 ===== */
.tag { display: inline-block; padding: 2px 10px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.tag-success { background: var(--success-light); color: var(--success); }
.tag-warning { background: var(--warning-light); color: var(--warning); }
.tag-danger { background: var(--danger-light); color: var(--danger); }
.tag-primary { background: var(--primary-light); color: var(--primary); }
.tag-info { background: #E8F7FF; color: #0FC6C2; }
.tag-secondary { background: #F2F3F5; color: var(--text-3); }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  font-size: 14px; cursor: pointer; transition: all .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-sm { padding: 4px 12px; font-size: 13px; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #009a24; color: #fff; }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-group { display: flex; gap: 8px; }

/* ===== 表单 ===== */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.form-item label .req { color: var(--danger); margin-left: 2px; }
.form-item input, .form-item select, .form-item textarea {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; outline: none; transition: border-color .15s; font-family: inherit;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--primary); }
.form-item textarea { resize: vertical; min-height: 80px; }

/* ===== 筛选栏 ===== */
.filter-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar select, .filter-bar input {
  padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; outline: none;
}

/* ===== 上传区 ===== */
.upload-box {
  border: 2px dashed var(--border); border-radius: var(--radius-sm);
  padding: 24px; text-align: center; color: var(--text-3); font-size: 13px;
  cursor: pointer; transition: all .15s;
}
.upload-box:hover { border-color: var(--primary); color: var(--primary); }
.upload-box.uploaded { border-style: solid; border-color: var(--success); color: var(--success); background: var(--success-light); }

/* ===== 开关 ===== */
.switch { position: relative; width: 44px; height: 24px; background: #C9CDD4; border-radius: 12px; cursor: pointer; transition: background .2s; display: inline-block; }
.switch.on { background: var(--primary); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: transform .2s; }
.switch.on::after { transform: translateX(20px); }

/* ===== 提示条 ===== */
.alert { padding: 10px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13px; }
.alert-warning { background: var(--warning-light); color: var(--warning); }
.alert-info { background: var(--primary-light); color: var(--primary); }
.alert-success { background: var(--success-light); color: var(--success); }

/* ===== Toast提示 ===== */
.toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.75); color: #fff; padding: 10px 24px;
  border-radius: 8px; font-size: 14px; z-index: 9999;
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.toast.show { opacity: 1; }

/* ===== 客户端H5布局 ===== */
.client-overlay { display: none; padding-top: 56px; min-height: 100vh; background: var(--bg-page); }
.client-overlay.active { display: block; }
.client-container {
  max-width: 900px; margin: 0 auto; background: #fff; min-height: calc(100vh - 56px);
  box-shadow: 0 0 20px rgba(0,0,0,0.08);
}
.client-header {
  background: linear-gradient(135deg, #165DFF 0%, #0E42B3 100%);
  color: #fff; padding: 32px 28px;
}
.client-header .brand { font-size: 22px; font-weight: 700; }
.client-header .sub { font-size: 13px; opacity: 0.8; margin-top: 6px; }
.client-content { padding: 20px; }

.my-info-card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.my-info-card .row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.my-info-card .row .k { color: var(--text-3); }
.my-info-card .row .v { color: var(--text-1); font-weight: 500; }

.booking-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.booking-item {
  background: #fff; border-radius: var(--radius); padding: 20px 16px;
  box-shadow: var(--shadow); cursor: pointer; transition: transform .15s; text-align: center;
}
.booking-item:hover { transform: translateY(-2px); }
.booking-item .icon { font-size: 32px; margin-bottom: 8px; }
.booking-item .name { font-size: 14px; font-weight: 500; }
.booking-item .price { font-size: 12px; color: var(--warning); margin-top: 4px; }
.booking-item .free { font-size: 12px; color: var(--success); margin-top: 4px; }

.notice-entry {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-radius: var(--radius); padding: 16px 20px;
  box-shadow: var(--shadow); margin-bottom: 12px; cursor: pointer; transition: background .15s;
}
.notice-entry:hover { background: #F7F8FA; }
.notice-entry .left { display: flex; align-items: center; gap: 10px; }
.notice-entry .dot { width: 8px; height: 8px; background: var(--danger); border-radius: 50%; }
.notice-entry .arrow { color: var(--text-3); }

.section-title { font-size: 16px; font-weight: 600; margin: 24px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ''; width: 3px; height: 18px; background: var(--primary); border-radius: 2px; }

.contact-card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.contact-card .row { display: flex; padding: 10px 0; border-bottom: 1px solid #F2F3F5; font-size: 14px; }
.contact-card .row:last-child { border-bottom: none; }
.contact-card .row .k { width: 100px; color: var(--text-3); }

.qrcode-row { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.qrcode-box { flex: 1; min-width: 140px; background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); text-align: center; }
.qrcode-box .placeholder {
  width: 110px; height: 110px; background: #F2F3F5; border-radius: 8px;
  margin: 0 auto 10px; display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 12px;
}
.qrcode-box .label { font-size: 13px; color: var(--text-2); }

.news-item { background: #fff; border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); margin-bottom: 10px; }
.news-item .title { font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.news-item .date { font-size: 12px; color: var(--text-3); }

.time-slots { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.time-slot {
  padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; cursor: pointer; transition: all .15s;
}
.time-slot:hover { border-color: var(--primary); }
.time-slot.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.time-slot.disabled { color: var(--text-3); background: #F2F3F5; cursor: not-allowed; }

.booking-status-tabs { display: flex; background: #fff; border-radius: var(--radius); padding: 4px; margin-bottom: 16px; }
.booking-status-tabs button {
  flex: 1; padding: 10px; border: none; background: transparent;
  border-radius: 8px; cursor: pointer; font-size: 14px; transition: all .15s;
}
.booking-status-tabs button.active { background: var(--primary); color: #fff; }

.booking-card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 12px; }
.booking-card .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.booking-card .room { font-size: 16px; font-weight: 600; }
.booking-card .info { font-size: 13px; color: var(--text-2); line-height: 1.9; }

.back-bar { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: rgba(255,255,255,0.1); cursor: pointer; }
.back-bar span { color: #fff; font-size: 16px; }

/* ===== 分页 ===== */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 20px; }
.pagination a, .pagination span {
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 4px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
}
.pagination a:hover, .pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 5000; display: none;
  align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: #fff; border-radius: var(--radius); padding: 24px;
  width: 500px; max-width: 90%; max-height: 80vh; overflow-y: auto;
}
.modal-title { font-size: 18px; font-weight: 600; margin-bottom: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ===== 移动端适配 ===== */
.mobile-menu-btn {
  display: none; position: fixed; top: 64px; left: 12px; z-index: 200;
  width: 40px; height: 40px; background: #fff; border-radius: 8px;
  box-shadow: var(--shadow); border: none; cursor: pointer;
  font-size: 18px; align-items: center; justify-content: center;
}
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform .2s; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; padding: 16px; }
  .mobile-menu-btn { display: flex; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .booking-grid { grid-template-columns: repeat(2, 1fr); }
  .client-container { box-shadow: none; }
  .client-content { padding: 16px; }
}
