/* AI找房 - 深色科技风主题 */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #060c18;
  --bg2: #0a1424;
  --panel: rgba(255,255,255,.045);
  --panel2: rgba(255,255,255,.07);
  --line: rgba(122,196,255,.18);
  --line2: rgba(34,211,238,.35);
  --cyan: #22d3ee;
  --cyan2: #67e8f9;
  --teal: #2dd4bf;
  --ink: #e8f4ff;
  --muted: #7f97b8;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --purple: #a78bfa;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 15% -10%, #10233f 0%, transparent 60%),
              radial-gradient(1000px 500px at 90% 0%, #0d2b34 0%, transparent 55%),
              linear-gradient(180deg, #060c18, #080f1e 60%, #060a14);
  color: var(--ink); min-height: 100vh; padding-bottom: 88px;
}
a { color: var(--cyan); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(34,211,238,.25); border-radius: 8px; }

/* 顶栏 */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 12px 20px; position: sticky; top: 0; z-index: 30;
  background: linear-gradient(180deg, rgba(6,12,24,.96), rgba(6,12,24,.72));
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 0 0 1px var(--line2), 0 0 18px rgba(34,211,238,.35); }
.brand h1 { font-size: 19px; letter-spacing: 2px; background: linear-gradient(90deg,#eafcff,#22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand p { font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.userbox { display: flex; align-items: center; gap: 10px; }
.userbox .avatar { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line2); }
select, input, textarea {
  font-family: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: rgba(255,255,255,.05); color: var(--ink); outline: none;
}
select:focus, input:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34,211,238,.14); }
select option { background: #0b1626; color: var(--ink); }
input::placeholder, textarea::placeholder { color: #5b7699; }
.badge { background: rgba(34,211,238,.14); color: var(--cyan2); padding: 5px 11px; border-radius: 20px; font-size: 12px; border: 1px solid var(--line2); }

main { max-width: 1180px; margin: 0 auto; padding: 16px 20px 20px; }

/* 搜索条 */
.searchbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.searchbar .city { display: flex; align-items: center; gap: 4px; color: var(--cyan2); font-size: 14px; white-space: nowrap; }
.searchbar .box { flex: 1; position: relative; }
.searchbar input { width: 100%; padding: 12px 14px; border-radius: 12px; }
.searchbar button { padding: 12px 22px; border-radius: 12px; border: none; cursor: pointer;
  background: linear-gradient(135deg,#22d3ee,#0891b2); color: #04202a; font-weight: 700; }
.searchbar button:hover { filter: brightness(1.1); }

/* 九宫格 */
.grid9 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 18px; }
.grid9 .item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 4px; border-radius: 14px; cursor: pointer; transition: .15s; }
.grid9 .item:hover { background: var(--panel); transform: translateY(-2px); }
.grid9 .ic { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: linear-gradient(150deg, rgba(34,211,238,.18), rgba(167,139,250,.12)); border: 1px solid var(--line2); box-shadow: inset 0 0 18px rgba(34,211,238,.12); }
.grid9 .t { font-size: 12px; color: #c7dcf2; }
@media (max-width: 560px) { .grid9 { grid-template-columns: repeat(5, 1fr); } .grid9 .ic { width: 40px; height: 40px; font-size: 20px; } .grid9 .t { font-size: 11px; } }

/* 头条 */
.news { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 18px; }
.news .h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.news .h b { color: var(--cyan2); font-size: 14px; letter-spacing: 1px; }
.news .h span { font-size: 11px; color: var(--muted); }
.news .n { display: flex; gap: 8px; padding: 6px 0; font-size: 13px; color: #bcd3ea; cursor: default; }
.news .n i { color: var(--cyan); font-style: normal; }
.news .n em { color: var(--muted); font-style: normal; font-size: 12px; }

/* 工具卡 */
.tools { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; margin-bottom: 18px; }
@media (max-width: 760px) { .tools { grid-template-columns: 1fr 1fr; } }
.tool { position: relative; overflow: hidden; border-radius: 16px; padding: 16px; min-height: 104px; cursor: pointer;
  background: linear-gradient(150deg, rgba(34,211,238,.14), rgba(10,20,36,.6)); border: 1px solid var(--line2); }
.tool:hover { box-shadow: 0 0 22px rgba(34,211,238,.22); }
.tool .k { font-size: 11px; letter-spacing: 2px; color: var(--cyan2); opacity: .8; }
.tool .n { font-size: 17px; font-weight: 700; margin-top: 6px; }
.tool .d { font-size: 12px; color: var(--muted); margin-top: 6px; }
.tool .big { position: absolute; right: 10px; bottom: 4px; font-size: 46px; opacity: .35; }

/* 省心租房 banner */
.banner { border-radius: 18px; padding: 20px 22px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(120deg, rgba(45,212,191,.22), rgba(34,211,238,.10) 45%, rgba(167,139,250,.16));
  border: 1px solid var(--line2); }
.banner h3 { font-size: 22px; letter-spacing: 2px; }
.banner p { color: #bcd3ea; font-size: 13px; margin-top: 6px; }
.banner .go { padding: 9px 18px; border-radius: 12px; background: linear-gradient(135deg,#22d3ee,#0891b2); color: #04202a; font-weight: 700; font-size: 13px; border: none; cursor: pointer; }

/* 段落标题 + tabs */
.sec { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 12px; }
.sec h2 { font-size: 17px; }
.sec h2 b { color: var(--cyan); }
.chips { display: flex; gap: 8px; }
.chips button { background: var(--panel); border: 1px solid var(--line); color: var(--muted); padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 13px; }
.chips button.on { color: #04202a; background: linear-gradient(135deg,#22d3ee,#2dd4bf); border-color: transparent; font-weight: 700; }

/* 房源卡 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; transition: .18s; }
.card:hover { border-color: var(--line2); box-shadow: 0 10px 30px rgba(0,0,0,.35), 0 0 20px rgba(34,211,238,.12); transform: translateY(-3px); }
.card img { width: 100%; height: 156px; object-fit: cover; display: block; background: #0d1a2c; }
.card .body { padding: 12px 14px 14px; }
.card h3 { font-size: 15px; margin-bottom: 6px; }
.card .rent { color: var(--cyan2); font-weight: 700; font-size: 19px; }
.card .rent.sale { color: #ffd166; }
.card .rent small { color: var(--muted); font-weight: 400; font-size: 12px; }
.card .meta { color: var(--muted); font-size: 12px; margin-top: 7px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; background: rgba(34,211,238,.13); color: var(--cyan2); border: 1px solid rgba(34,211,238,.25); }
.tag.gray { background: rgba(148,163,184,.14); color: #a7bcd6; border-color: rgba(148,163,184,.22); }
.tag.green { background: rgba(52,211,153,.14); color: var(--ok); border-color: rgba(52,211,153,.3); }
.tag.amber { background: rgba(251,191,36,.14); color: var(--warn); border-color: rgba(251,191,36,.3); }
.tag.red { background: rgba(248,113,113,.14); color: var(--danger); border-color: rgba(248,113,113,.3); }
.tag.purple { background: rgba(167,139,250,.16); color: var(--purple); border-color: rgba(167,139,250,.3); }

/* 面板/表格/表单 */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 16px; }
.panel h2 { font-size: 16px; margin-bottom: 14px; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label, .label { font-size: 12px; color: var(--muted); }
.field.full { grid-column: 1 / -1; }
button.primary { background: linear-gradient(135deg,#22d3ee,#0891b2); color: #04202a; border: none; padding: 11px 20px; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer; }
button.primary:hover { filter: brightness(1.1); }
button.ghost { background: rgba(34,211,238,.08); color: var(--cyan2); border: 1px solid var(--line2); padding: 9px 16px; border-radius: 10px; cursor: pointer; font-size: 13px; }
button.ghost:hover { background: rgba(34,211,238,.16); }
button.mini { padding: 6px 12px; font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; background: rgba(255,255,255,.03); }
tbody tr:hover { background: rgba(34,211,238,.05); }
.scorebar { height: 6px; background: rgba(255,255,255,.09); border-radius: 4px; overflow: hidden; margin-top: 5px; }
.scorebar > i { display: block; height: 100%; background: linear-gradient(90deg,#22d3ee,#a78bfa); }
.quota { display: flex; align-items: center; gap: 20px; background: rgba(34,211,238,.08); border: 1px solid var(--line2); padding: 14px 18px; border-radius: 14px; margin-bottom: 14px; }
.quota b { font-size: 22px; color: var(--cyan2); }
.statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.stat .n { font-size: 25px; font-weight: 700; color: var(--cyan2); }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 4px; }
.empty { text-align: center; color: var(--muted); padding: 40px; font-size: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.timeline { border-left: 2px solid var(--line); margin-left: 8px; padding-left: 14px; }
.timeline .item { margin-bottom: 12px; font-size: 13px; }
.timeline .item .t { color: var(--muted); font-size: 11px; }
.mic.rec { background: rgba(248,113,113,.25); color: #fff; border-color: var(--danger); }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(3,7,15,.72); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 60; }
.modal.hidden { display: none; }
.modal-body { background: linear-gradient(180deg,#0c1728,#0a1220); border: 1px solid var(--line2); border-radius: 18px; max-width: 760px; width: 100%; max-height: 88vh; overflow: auto; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.gallery img { width: 100%; height: 120px; object-fit: cover; border-radius: 10px; }
.toast { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); background: rgba(8,20,34,.96); color: var(--ink); border: 1px solid var(--line2); padding: 12px 20px; border-radius: 12px; font-size: 14px; z-index: 99; max-width: 90vw; box-shadow: 0 0 24px rgba(34,211,238,.2); }
.toast.hidden { display: none; }

/* 底部导航 */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: space-around; align-items: center;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(6,12,24,.6), rgba(6,12,24,.98));
  backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.bottomnav button { background: none; border: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; cursor: pointer; padding: 6px 10px; }
.bottomnav button .i { font-size: 19px; }
.bottomnav button.on { color: var(--cyan2); }
.bottomnav .fab { width: 56px; height: 56px; border-radius: 50%; margin-top: -26px; background: linear-gradient(135deg,#22d3ee,#2dd4bf); color: #04202a; font-size: 12px; font-weight: 700; box-shadow: 0 0 22px rgba(34,211,238,.5); }
.bottomnav .fab .i { font-size: 22px; }
.backbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.backbar button { background: var(--panel); border: 1px solid var(--line); color: var(--cyan2); border-radius: 10px; padding: 7px 14px; cursor: pointer; font-size: 13px; }
.themebtn { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; width: 34px; height: 34px; cursor: pointer; font-size: 15px; }

/* 管理后台顶部页签 */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 20px 4px; max-width: 1180px; margin: 0 auto; }
.tabs button { background: var(--panel); border: 1px solid var(--line); color: var(--muted); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-size: 13px; }
.tabs button:hover { border-color: var(--line2); color: var(--cyan2); }
.tabs button.active { background: linear-gradient(135deg, #22d3ee, #0891b2); color: #04202a; border-color: transparent; font-weight: 700; }
html.light .tabs button.active { background: linear-gradient(135deg, #1f8fff, #12b5a5); color: #fff; }
.adminmode main { padding-top: 8px; }

/* ---------- 亮色主题（默认） ---------- */
html.light {
  --bg: #eef3f9; --bg2: #f7fafd; --panel: #ffffff; --panel2: #f4f8fc;
  --line: #e3e9f2; --line2: #cfe6f5; --cyan: #1f8fff; --cyan2: #0b7ddb;
  --teal: #12b5a5; --ink: #1c2b3f; --muted: #6b7c93; --ok: #0f9d6e; --warn: #c47f00; --danger: #e5484d; --purple: #6d4df0;
}
html.light body {
  background: radial-gradient(1200px 600px at 15% -10%, #dcecff 0%, transparent 60%),
              radial-gradient(1000px 500px at 90% 0%, #d8f4f0 0%, transparent 55%),
              linear-gradient(180deg, #eef3f9, #f5f8fc 60%, #eef3f9);
  color: var(--ink);
}
html.light .topbar { background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(255,255,255,.85)); border-bottom-color: var(--line); }
html.light .brand h1 { background: linear-gradient(90deg, #0b7ddb, #12b5a5); -webkit-background-clip: text; background-clip: text; color: transparent; }
html.light .brand p, html.light .muted, html.light .hint { color: var(--muted); }
html.light select, html.light input, html.light textarea { background: #f7fafd; color: var(--ink); }
html.light .badge { background: rgba(31,143,255,.10); color: #0b7ddb; }
html.light .card, html.light .panel, html.light .news, html.light .reccard, html.light .stat { background: #fff; box-shadow: 0 6px 20px rgba(28,43,63,.06); }
html.light .card:hover { box-shadow: 0 12px 30px rgba(28,43,63,.12); }
html.light .news .n { color: #40536b; }
html.light .tool { background: linear-gradient(150deg, #e8f4ff, #ffffff); }
html.light .grid9 .ic { background: linear-gradient(150deg, #e4f2ff, #f0eaff); }
html.light .grid9 .t { color: #33475f; }
html.light .banner { background: linear-gradient(120deg, #e2f7f3, #e6f2ff 50%, #efe9ff); }
html.light .bottomnav { background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.98)); border-top-color: var(--line); }
html.light .modal { background: rgba(230,238,247,.72); }
html.light .modal-body { background: #fff; border-color: var(--line); box-shadow: 0 20px 60px rgba(28,43,63,.18); }
html.light th { background: rgba(28,43,63,.03); }
html.light tbody tr:hover { background: rgba(31,143,255,.05); }
html.light .scorebar { background: rgba(28,43,63,.08); }
html.light .msg .bubble { background: #f4f8fc; }
html.light .msg.user .bubble { background: linear-gradient(135deg, #dcf0ff, #dffaf5); }
html.light .quota { background: #eaf5ff; }
html.light .toast { background: #fff; color: var(--ink); }
html.light .relaxbar { color: #e2683f; }
html.light ::-webkit-scrollbar-thumb { background: rgba(28,43,63,.18); }
html.light .card img { background: #eef3f9; }

/* ---------- 移动端适配 ---------- */
@media (max-width: 560px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .brand img { width: 32px; height: 32px; border-radius: 10px; }
  .brand h1 { font-size: 16px; letter-spacing: 1px; }
  .brand p { display: none; }
  .userbox { gap: 6px; }
  .userbox .badge { display: none; }
  .userbox select { max-width: 116px; padding: 7px 8px; font-size: 13px; }
  .themebtn { width: 30px; height: 30px; font-size: 13px; }
  .userbox .avatar { width: 30px; height: 30px; }
  main { padding: 12px 12px 20px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card img { height: 118px; }
  .searchbar button { padding: 12px 14px; }
  .recgrid { grid-template-columns: 1fr 1fr; }
  .statgrid { grid-template-columns: 1fr 1fr; }
  .panel, .card, .reccard, .news { border-radius: 14px; }
  table { font-size: 12px; }
  th, td { padding: 7px 6px; }
  .panel { overflow-x: auto; }
  th, td { white-space: nowrap; }
  .tabs { padding: 10px 12px 4px; }
  .tabs button { padding: 7px 10px; font-size: 12px; }
}

/* AI 对话 */.chatlog { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; min-height: 80px; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg .ava { width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto; border: 1px solid var(--line2); }
.msg .bubble { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; font-size: 14px; max-width: 78%; line-height: 1.6; }
.msg.user { flex-direction: row-reverse; }
.msg.user .bubble { background: linear-gradient(135deg, rgba(34,211,238,.22), rgba(45,212,191,.14)); border-color: var(--line2); }
.qchips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.qchips button { background: var(--panel); border: 1px solid var(--line); color: var(--muted); padding: 6px 12px; border-radius: 20px; cursor: pointer; font-size: 12px; }
.qchips button:hover { color: var(--cyan2); border-color: var(--line2); }
.typing { color: var(--muted); font-size: 13px; }

/* 我的匹配 推荐卡片 */
.reccard { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 14px; }
.rechead { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.recbody { display: flex; gap: 12px; align-items: center; }
.recava { width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line2); flex: 0 0 auto; }
.recgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.recgrid .k { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.recfoot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.relaxbar { display: flex; align-items: center; justify-content: center; gap: 8px; color: #ff8a6b; font-size: 13px; margin-bottom: 14px; cursor: pointer; }

/* 跟进标签选择（按钮弹出感） */
.tagpick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.tagbtn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 10px; border-radius: 14px; border: 1px solid var(--line2); background: var(--panel); color: var(--ink); cursor: pointer; transition: .12s; }
.tagbtn .big { font-size: 19px; font-weight: 700; color: var(--cyan2); }
.tagbtn.alt .big { color: var(--muted); }
.tagbtn .sub { font-size: 11px; color: var(--muted); }
.tagbtn:hover { border-color: var(--cyan); box-shadow: 0 0 16px rgba(34,211,238,.25); }
.tagbtn:active { transform: scale(0.95); }
