/* ============ 后台管理样式 ============ */
:root {
  --ink: #1b2a24; --green: #2f5145; --gold: #b08d57; --gold-light: #c8a97c;
  --paper: #f7f4ed; --cream: #fbf9f4; --text: #3a3f3b; --muted: #8a8f8a;
  --line: #e8e4db; --white: #fff; --danger: #c0503f; --ok: #3e8a63;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--cream); color: var(--text); -webkit-font-smoothing: antialiased; }
button, input, select { font-family: inherit; }
a { text-decoration: none; color: inherit; }
[hidden] { display: none !important; }

/* 加载 */
.app-loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--cream); z-index: 999; gap: 16px; }
.loader-mark { width: 60px; height: 60px; display: grid; place-items: center; background: var(--ink); color: var(--gold-light); font-family: "Songti SC", serif; font-size: 30px; border-radius: 4px; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .6; transform: scale(.96); } }
.app-loading p { color: var(--muted); font-size: 14px; }

/* ============ 登录 ============ */
.login-view { min-height: 100vh; display: grid; place-items: center; position: relative; padding: 24px; }
.login-bg { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(16,32,26,.94), rgba(27,42,36,.86)), url("assets/hero.png") center/cover; }
.login-card { position: relative; width: min(100%, 440px); background: var(--white); border-radius: 6px; box-shadow: 0 30px 80px rgba(0,0,0,.35); padding: 44px 40px 30px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.login-brand-mark { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; display: block; background: #fff; }
.login-brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.login-brand strong { display: block; font-family: "Songti SC", serif; font-size: 20px; color: var(--ink); letter-spacing: 2px; }
.login-brand em { font-style: normal; font-size: 10px; letter-spacing: 1.5px; color: var(--gold); }
.login-card h1 { font-family: "Songti SC", serif; font-size: 28px; color: var(--ink); margin-bottom: 6px; }
.login-sub { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.btn-wb { width: 100%; padding: 13px; background: var(--white); border: 1px solid var(--line); border-radius: 3px; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: .2s; }
.btn-wb:hover { border-color: var(--gold); background: #faf8f3; }
.btn-wb:disabled { opacity: .6; cursor: not-allowed; }
.wb-mark { color: var(--gold); font-size: 16px; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: 12px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.field input { width: 100%; padding: 13px 14px; border: 1px solid #ddd9d0; border-radius: 3px; font-size: 14px; outline: none; background: #faf9f6; transition: border-color .2s, box-shadow .2s; }
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176,141,87,.12); }
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; }
.code-btn { white-space: nowrap; padding: 0 14px; border: 1px solid var(--gold); color: var(--gold); background: transparent; border-radius: 3px; font-size: 13px; cursor: pointer; }
.code-btn:hover { background: var(--gold); color: #fff; }
.code-btn:disabled { opacity: .5; cursor: not-allowed; }
.login-msg { min-height: 20px; font-size: 13px; color: var(--danger); margin: 4px 0 8px; }
.login-msg.ok { color: var(--ok); }
.btn-login { width: 100%; padding: 14px; background: var(--ink); color: #fff; border: 0; border-radius: 3px; font-size: 15px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background .2s; }
.btn-login:hover { background: var(--green); }
.btn-login:disabled { opacity: .6; cursor: not-allowed; }
.btn-login i { font-style: normal; }
.login-foot { display: flex; justify-content: space-between; margin-top: 22px; font-size: 12px; color: var(--muted); }
.login-foot a:hover { color: var(--gold); }

/* ============ 后台框架 ============ */
.app-view { min-height: 100vh; display: flex; }
.sidebar { width: 240px; flex: none; background: var(--ink); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-brand-mark { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none; background: #fff; }
.side-brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.side-brand strong { display: block; font-family: "Songti SC", serif; font-size: 17px; letter-spacing: 1px; }
.side-brand em { font-style: normal; font-size: 10px; color: var(--gold-light); letter-spacing: 1px; }
.side-nav { padding: 20px 12px; flex: 1; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: rgba(255,255,255,.7); border-radius: 4px; font-size: 14px; margin-bottom: 4px; transition: .2s; }
.side-nav a span { font-size: 17px; width: 20px; text-align: center; }
.side-nav a b { margin-left: auto; background: var(--gold); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 10px; font-weight: 600; }
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.active { background: var(--green); color: #fff; }
.side-bottom { padding: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.side-user { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.side-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gold); display: grid; place-items: center; font-size: 14px; flex: none; }
.side-user strong { display: block; font-size: 13px; }
.side-user em { font-style: normal; font-size: 11px; color: rgba(255,255,255,.5); display: block; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-logout { width: 100%; padding: 9px; background: transparent; border: 1px solid rgba(255,255,255,.25); color: rgba(255,255,255,.8); border-radius: 3px; cursor: pointer; font-size: 13px; }
.btn-logout:hover { background: rgba(255,255,255,.1); }

.main { flex: 1; min-width: 0; }
.main-top { display: flex; justify-content: space-between; align-items: center; padding: 26px 34px; background: var(--white); border-bottom: 1px solid var(--line); }
.main-top h1 { font-family: "Songti SC", serif; font-size: 24px; color: var(--ink); }
.main-top p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.btn-refresh { padding: 9px 16px; background: var(--cream); border: 1px solid var(--line); border-radius: 3px; color: var(--green); cursor: pointer; font-size: 13px; }
.btn-refresh:hover { border-color: var(--gold); }
.panel { padding: 30px 34px; }

/* 统计卡片 */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }
.stat-card { background: var(--white); border: 1px solid var(--line); border-radius: 5px; padding: 22px; display: flex; align-items: center; gap: 16px; }
.stat-ico { width: 52px; height: 52px; border-radius: 6px; display: grid; place-items: center; font-size: 24px; flex: none; }
.stat-ico.c1 { background: #eef2ef; color: var(--green); }
.stat-ico.c2 { background: #fbf1e4; color: #c98a3c; }
.stat-ico.c3 { background: #eaf1f6; color: #4a7fa5; }
.stat-ico.c4 { background: #eaf4ee; color: var(--ok); }
.stat-card span { display: block; font-size: 13px; color: var(--muted); }
.stat-card strong { display: block; font-family: "Songti SC", serif; font-size: 30px; color: var(--ink); line-height: 1.2; }
.dash-box { background: var(--white); border: 1px solid var(--line); border-radius: 5px; }
.dash-box-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dash-box-head h3 { font-size: 16px; color: var(--ink); }
.link-btn { background: none; border: 0; color: var(--gold); cursor: pointer; font-size: 13px; }
.recent-list { padding: 6px 22px; }
.recent-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.recent-item:last-child { border-bottom: 0; }
.recent-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--paper); color: var(--green); display: grid; place-items: center; font-size: 14px; flex: none; }
.recent-info { flex: 1; min-width: 0; }
.recent-info strong { font-size: 14px; color: var(--ink); }
.recent-info span { font-size: 12px; color: var(--muted); margin-left: 10px; }
.recent-info p { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.recent-time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.empty-tip { padding: 40px; text-align: center; color: var(--muted); font-size: 14px; }

/* 工具栏 */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.search-box input { width: 280px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 3px; font-size: 13px; outline: none; background: var(--white); }
.search-box input:focus { border-color: var(--gold); }
.filter-box { display: flex; gap: 6px; }
.filter-btn { padding: 8px 16px; background: var(--white); border: 1px solid var(--line); border-radius: 3px; color: var(--text); font-size: 13px; cursor: pointer; }
.filter-btn:hover { border-color: var(--gold); }
.filter-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* 表格 */
.table-wrap { background: var(--white); border: 1px solid var(--line); border-radius: 5px; overflow-x: auto; }
.leads-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.leads-table th { text-align: left; padding: 13px 14px; background: #faf8f3; color: var(--ink); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
.leads-table td { padding: 13px 14px; font-size: 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.leads-table tr:last-child td { border-bottom: 0; }
.leads-table tr:hover td { background: #fdfcf9; }
.cell-name { font-weight: 600; color: var(--ink); }
.cell-msg { max-width: 180px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 12px; font-size: 12px; white-space: nowrap; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-new { background: #fbf1e4; color: #c98a3c; }
.st-contacted { background: #eaf1f6; color: #4a7fa5; }
.st-won { background: #eaf4ee; color: var(--ok); }
.status-select { border: 1px solid var(--line); border-radius: 3px; padding: 4px 6px; font-size: 12px; color: var(--text); background: var(--white); cursor: pointer; }
.btn-del { background: none; border: 0; color: var(--danger); cursor: pointer; font-size: 13px; padding: 4px 6px; }
.btn-del:hover { text-decoration: underline; }
.table-foot { padding: 14px 4px; font-size: 12px; color: var(--muted); }
.empty-state { padding: 60px 20px; text-align: center; }
.empty-state div { font-size: 50px; color: #d8d4ca; }
.empty-state p { font-size: 16px; color: var(--ink); margin: 10px 0 4px; }
.empty-state span { font-size: 13px; color: var(--muted); }

/* 弹窗 & Toast */
.modal-mask { position: fixed; inset: 0; background: rgba(16,32,26,.5); display: grid; place-items: center; z-index: 500; padding: 20px; }
.modal { background: var(--white); border-radius: 6px; padding: 28px; width: min(100%, 380px); box-shadow: var(--shadow-lg, 0 20px 60px rgba(0,0,0,.25)); }
.modal h3 { font-size: 18px; color: var(--ink); margin-bottom: 10px; }
.modal p { font-size: 14px; color: var(--muted); line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.modal-actions button { padding: 9px 18px; border-radius: 3px; cursor: pointer; font-size: 13px; border: 1px solid var(--line); }
.btn-cancel { background: var(--white); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger) !important; }
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 24px; border-radius: 4px; font-size: 14px; opacity: 0; pointer-events: none; transition: .3s; z-index: 600; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }

/* ============ 精选酒店管理 ============ */
.hotel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.hotel-toolbar-left { display: flex; align-items: center; gap: 14px; }
.hotel-select { border: 1px solid var(--line); border-radius: 3px; padding: 8px 12px; font-size: 13px; color: var(--text); background: var(--white); cursor: pointer; }
.hotel-count { font-size: 12px; color: var(--muted); }
.btn-add { background: var(--green); color: #fff; border: 0; border-radius: 3px; padding: 10px 18px; font-size: 13px; cursor: pointer; transition: opacity .2s; }
.btn-add:hover { opacity: .88; }
.hotel-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.ha-card { background: var(--white); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; transition: box-shadow .25s; }
.ha-card:hover { box-shadow: var(--shadow, 0 8px 24px rgba(0,0,0,.06)); }
.ha-img { width: 100%; height: 150px; object-fit: cover; display: block; background: var(--paper); }
.ha-body { padding: 14px 16px; }
.ha-cat { display: inline-block; font-size: 11px; color: var(--gold); background: #f7f1e6; padding: 2px 8px; border-radius: 10px; margin-bottom: 6px; }
.ha-title { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.ha-meta { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; justify-content: space-between; }
.ha-price { color: var(--gold); font-weight: 600; }
.ha-desc { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ha-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ha-foot button { border: 0; background: none; cursor: pointer; font-size: 12px; padding: 4px 8px; border-radius: 3px; }
.ha-edit { color: var(--green); }
.ha-edit:hover { background: #eef4f1; }
.ha-del { color: var(--danger); }
.ha-del:hover { background: #fbedeb; }
.ha-hidden { opacity: .55; }
.ha-off { font-size: 11px; color: var(--muted); margin-left: auto; }

/* 酒店编辑弹窗 */
.hotel-modal { width: min(100%, 660px); padding: 0; max-height: 92vh; display: flex; flex-direction: column; }
.hm-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.hm-head h3 { margin: 0; }
.hm-close { border: 0; background: none; font-size: 24px; color: var(--muted); cursor: pointer; line-height: 1; }
.hm-body { padding: 20px 24px; overflow-y: auto; }
.hm-row { display: flex; gap: 14px; margin-bottom: 14px; }
.hm-field { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hm-field label { font-size: 12px; color: var(--text); font-weight: 600; }
.hm-field label b { color: var(--danger); }
.hm-field input, .hm-field textarea, .hm-field select { border: 1px solid var(--line); border-radius: 3px; padding: 9px 11px; font-size: 13px; color: var(--text); background: var(--white); width: 100%; resize: vertical; }
.hm-field input:focus, .hm-field textarea:focus { outline: none; border-color: var(--gold); }
.hm-inline { flex: 1.4; flex-direction: row; gap: 10px; }
.hm-inline > div { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.hm-star-field { flex: 0 0 120px; }
.hm-upload { display: flex; gap: 16px; align-items: flex-start; }
.hm-preview { width: 140px; height: 100px; border: 1px dashed var(--line); border-radius: 3px; background: var(--paper); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.hm-preview span { font-size: 12px; color: var(--muted); }
.hm-preview img { width: 100%; height: 100%; object-fit: cover; }
.hm-upload-actions { flex: 1; }
.btn-upload { border: 1px solid var(--gold); background: #fbf6ed; color: var(--green); border-radius: 3px; padding: 9px 16px; font-size: 13px; cursor: pointer; }
.btn-upload:hover { background: #f5ecd9; }
.hm-upload-actions p { font-size: 11px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.btn-remove-img { margin-top: 6px; border: 0; background: none; color: var(--danger); font-size: 12px; cursor: pointer; padding: 0; }
.hm-row-last { margin-bottom: 0; }
.hm-switch-field { flex: 0 0 180px; justify-content: flex-end; }
.hm-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 400 !important; cursor: pointer; }
.hm-switch input { display: none; }
.hm-switch > span { width: 38px; height: 21px; background: #ccc; border-radius: 12px; position: relative; transition: .2s; }
.hm-switch > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; background: #fff; border-radius: 50%; transition: .2s; }
.hm-switch input:checked + span { background: var(--green); }
.hm-switch input:checked + span::after { left: 20px; }
.hm-msg { font-size: 12px; color: var(--danger); min-height: 16px; margin-top: 10px; }
.hm-msg.ok { color: var(--ok); }
.hm-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); }
.hm-foot button { padding: 10px 22px; border-radius: 3px; cursor: pointer; font-size: 13px; }
.btn-primary { background: var(--green); color: #fff; border: 1px solid var(--green); }

@media (max-width: 900px) {
  .sidebar { width: 68px; }
  .side-brand span:last-child, .side-nav a:not(.active) span + *, .side-nav a b, .side-user div, .btn-logout { display: none; }
  .side-nav a { justify-content: center; }
  .side-nav a span { width: auto; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .main-top, .panel { padding-left: 18px; padding-right: 18px; }
}
