/* ============================================================
 * Mrym College 食堂大数据分析与智能决策平台 — 主样式
 * ============================================================ */

:root {
  --brand: #7c3aed;
  --brand-2: #a855f7;
  --brand-dark: #5b21b6;
  --accent: #06b6d4;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --bg: #f5f5fa;
  --card: #ffffff;
  --line: #e6e8f0;
  --t1: #1c1f33;
  --t2: #5b6079;
  --t3: #9298b0;
  --shadow: 0 2px 12px rgba(28, 31, 51, .06);
  --shadow-lg: 0 12px 32px rgba(28, 31, 51, .13);
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background:
    radial-gradient(1100px 560px at 88% -8%, rgba(124, 58, 237, .09), transparent 60%),
    radial-gradient(900px 520px at -8% 108%, rgba(6, 182, 212, .08), transparent 55%),
    var(--bg);
  color: var(--t1);
  font-size: 14px;
}
.hidden { display: none !important; }
b { color: var(--t1); }

/* ---------------- 登录页（全屏视频 · 玻璃拟态） ---------------- */
.login-wrap {
  position: relative; min-height: 100vh; display: flex; align-items: center;
  overflow: hidden; color: #fff;
  background: #0a0c18 url('../assets/login-bg-poster.jpg') center/cover no-repeat;
}
.login-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: saturate(1.05);
}
.login-shade {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(7, 9, 20, .9) 0%, rgba(7, 9, 20, .55) 46%, rgba(7, 9, 20, .74) 100%);
}
.login-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; justify-content: center; align-items: center; padding: 22px 42px;
}
.lt-brand { display: flex; align-items: center; gap: 22px; font-weight: 800; font-size: 46px; letter-spacing: 3px; text-shadow: 0 4px 24px rgba(0,0,0,.55); }
.lt-brand img { width: 100px; height: 100px; border-radius: 24px; background: #fff; object-fit: cover; box-shadow: 0 10px 34px rgba(0,0,0,.45); }
.login-hero { position: relative; z-index: 2; flex: 1.15; padding: 190px 64px 64px 72px; }
.hero-kicker { font-size: 13px; letter-spacing: 4px; opacity: .75; margin-bottom: 18px; }
.login-hero h1 {
  font-size: clamp(30px, 3.6vw, 48px); line-height: 1.28; font-weight: 800; letter-spacing: 1px;
  text-shadow: 0 4px 24px rgba(0,0,0,.4);
}
.hero-sub { margin-top: 18px; font-size: 15px; opacity: .85; letter-spacing: 1.5px; }
.hero-chips { margin-top: 54px; display: flex; flex-wrap: wrap; gap: 12px; max-width: 580px; }
.hero-chips span {
  border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.09);
  backdrop-filter: blur(10px); padding: 11px 18px; border-radius: 14px; font-size: 13px;
  transition: .2s;
}
.hero-chips span:hover { background: rgba(255,255,255,.18); transform: translateY(-2px); }

.login-right {
  position: relative; z-index: 2; flex: 1;
  display: flex; align-items: center; justify-content: center; padding: 170px 48px 64px;
}
.login-card {
  width: 100%; max-width: 430px;
  background: rgba(13, 16, 32, .6);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 22px;
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
  padding: 32px 34px; color: #eef0fa;
}
.login-tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.ltab {
  flex: 1; padding: 10px; border: none; background: rgba(255,255,255,.06);
  font-size: 15px; color: rgba(255,255,255,.7); cursor: pointer; border-radius: 10px; font-weight: 600;
  transition: .2s;
}
.ltab:hover { color: #fff; }
.ltab.active { background: rgba(255,255,255,.16); color: #fff; }
.login-card .lform label { display: block; margin: 14px 0 6px; color: rgba(255,255,255,.65); font-size: 13px; }
.login-card .lform input {
  width: 100%; padding: 11px 14px; border: 1.5px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.07); border-radius: 10px; color: #fff; font-size: 14px;
  outline: none; transition: border .2s, background .2s;
}
.login-card .lform input::placeholder { color: rgba(255,255,255,.38); }
.login-card .lform input:focus { border-color: var(--brand-2); background: rgba(255,255,255,.11); }
.login-card .seg { background: rgba(255,255,255,.08); border-radius: 10px; padding: 4px; }
.login-card .seg-btn {
  flex: 1; border: none; background: transparent; padding: 8px 4px; cursor: pointer;
  border-radius: 8px; color: rgba(255,255,255,.65); font-size: 12.5px; white-space: nowrap; transition: .15s;
}
.login-card .seg-btn.active { background: rgba(255,255,255,.18); color: #fff; font-weight: 600; }
.login-card .demo-accounts {
  margin-top: 16px; font-size: 12px; color: rgba(255,255,255,.6);
  background: rgba(255,255,255,.06); border-radius: 10px; padding: 10px 12px; line-height: 1.7;
}
.login-card .demo-accounts b { color: rgba(255,255,255,.85); }
/* 默认收起的测试账号区块：确保 hidden 一定生效 */
.login-card .demo-accounts[hidden] { display: none !important; }
.login-card .chip {
  padding: 6px 14px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.06); cursor: pointer; font-size: 13px; color: rgba(255,255,255,.75); user-select: none;
}
.login-card .chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* ---------------- 布局 ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; color: #cdd1e8; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; flex-shrink: 0;
  background: linear-gradient(180deg, #131022 0%, #1d1836 60%, #241a44 100%);
}
.side-brand {
  display: flex; align-items: center; gap: 12px; padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.side-logo { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background: #fff; }
.side-school { color: #fff; font-weight: 700; font-size: 15px; }
.side-title { font-size: 11px; color: #a79ecf; margin-top: 2px; }
.side-menu { flex: 1; padding: 14px 12px; overflow-y: auto; }
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px;
  cursor: pointer; color: #cdd1e8; margin-bottom: 4px; font-size: 14px; transition: .15s;
  border: none; background: transparent; width: 100%; text-align: left;
}
.menu-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.menu-item.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 600;
  box-shadow: 0 6px 18px rgba(124, 58, 237, .45);
}
.side-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.side-user { font-size: 12px; color: #a79ecf; margin-bottom: 10px; line-height: 1.6; }
.side-user b { color: #fff; }
.btn-ghost {
  width: 100%; padding: 9px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2);
  background: transparent; color: #cdd1e8; cursor: pointer; font-size: 13px;
}
.btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; }

/* 移动端底部导航（仅窄屏显示） */
.bottom-nav { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; background: rgba(255, 255, 255, .78); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 20;
}
.topbar h2 { font-size: 18px; }
.topbar-right { display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--t2); }
.page-body { padding: 24px 28px; flex: 1; }

/* ---------------- 通用组件 ---------------- */
.btn-primary, .btn-line, .btn-mini, .btn-danger-mini {
  border: none; cursor: pointer; border-radius: 10px; font-size: 14px; transition: .15s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  padding: 11px 20px; font-weight: 600; box-shadow: 0 4px 14px rgba(79, 70, 229, .35);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-line {
  background: #fff; border: 1.5px solid var(--line); color: var(--t2); padding: 10px 18px;
}
.btn-line:hover { border-color: var(--brand); color: var(--brand); }
.btn-mini { background: #eef0ff; color: var(--brand); padding: 6px 12px; font-size: 12px; font-weight: 600; }
.btn-mini:hover { background: var(--brand); color: #fff; }
.btn-danger-mini { background: #fee2e2; color: var(--danger); padding: 6px 12px; font-size: 12px; }
.btn-danger-mini:hover { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; cursor: pointer; font-size: 13px; color: var(--t2); user-select: none;
}
.chip.on { background: #f1e9ff; border-color: var(--brand); color: var(--brand); font-weight: 600; }

.grid { display: grid; gap: 16px; }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-23 { grid-template-columns: 2fr 1fr; }
@media (max-width: 1100px) { .grid-2, .grid-23 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.7);
  padding: 20px 22px;
}
.card h3 { font-size: 15px; margin-bottom: 14px; color: var(--t1); }
.card .sub { font-size: 12px; color: var(--t3); font-weight: 400; margin-left: 8px; }

.grid-kpi .card { position: relative; overflow: hidden; }
.grid-kpi .card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.kpi-num { font-size: 26px; font-weight: 700; margin-top: 4px; }
.kpi-label { font-size: 12px; color: var(--t3); }
.kpi-delta { font-size: 12px; margin-top: 6px; }
.up { color: var(--success); } .down { color: var(--danger); }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
}
.b-blue { background: #e0f2fe; color: #0284c7; }
.b-green { background: #dcfce7; color: #16a34a; }
.b-orange { background: #fef3c7; color: #d97706; }
.b-red { background: #fee2e2; color: #dc2626; }
.b-gray { background: #eef0f6; color: var(--t2); }
.b-purple { background: #ede9fe; color: #7c3aed; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; padding: 10px 12px; color: var(--t3); font-weight: 600;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid #f0f1f7; color: var(--t2); }
.table tr:hover td { background: #f8f9fe; }
.table td:first-child { color: var(--t1); }

.stars { color: #f59e0b; font-size: 13px; letter-spacing: 2px; }
.stars .off { color: #d8dae6; }

.search-input {
  padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  width: 240px; font-size: 13px; outline: none;
}
.search-input:focus { border-color: var(--brand); }

/* 菜品卡片 */
.dish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.dish-card {
  background: var(--card); border-radius: 12px; padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px; transition: .15s; border: 1px solid transparent;
}
.dish-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.dish-name { font-weight: 700; font-size: 14.5px; }
.dish-meta { font-size: 12px; color: var(--t3); }
.dish-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.dish-price { color: var(--danger); font-weight: 700; font-size: 16px; }
.dish-price::before { content: '¥'; font-size: 12px; }

/* 校园地图 */
.campus-map { background: linear-gradient(160deg, #eef1fb, #e3ecf7); border-radius: 14px; position: relative; height: 340px; overflow: hidden; }
.map-spot { position: absolute; transform: translate(-50%, -50%); text-align: center; cursor: pointer; z-index: 2; }
.map-dot {
  width: 18px; height: 18px; border-radius: 50%; background: var(--brand);
  border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.2); margin: 0 auto 4px;
}
.map-spot.me .map-dot { background: var(--danger); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(220,38,38,.4)} 70%{box-shadow:0 0 0 12px rgba(220,38,38,0)} 100%{box-shadow:0 0 0 0 rgba(220,38,38,0)} }
.map-label {
  background: rgba(255,255,255,.92); padding: 3px 10px; border-radius: 999px;
  font-size: 11px; color: var(--t1); white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.map-building { position: absolute; background: rgba(148, 163, 184, .18); border: 1px dashed rgba(100,116,139,.4); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #64748b; }

/* 推荐/评价 */
.reason-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.reason-chips .badge { margin: 0; }

.review-item { border-bottom: 1px solid #f0f1f7; padding: 12px 0; display: flex; gap: 12px; }
.review-item:last-child { border-bottom: none; }
.review-body { flex: 1; }
.review-meta { font-size: 12px; color: var(--t3); margin-top: 3px; }
.review-text { margin-top: 6px; color: var(--t2); line-height: 1.6; }

/* AI */
.ai-chat { display: flex; flex-direction: column; height: 520px; }
.ai-msgs { flex: 1; overflow-y: auto; padding: 6px 2px; }
.ai-bubble { max-width: 86%; padding: 12px 16px; border-radius: 14px; margin-bottom: 12px; line-height: 1.75; font-size: 13.5px; }
.ai-bubble.user { background: var(--brand); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.ai-bubble.bot { background: #f1f2f8; color: var(--t1); border-bottom-left-radius: 4px; }
.ai-bubble h4 { margin: 8px 0 4px; font-size: 13.5px; }
.ai-bubble ul { padding-left: 18px; }
.ai-input-row { display: flex; gap: 10px; margin-top: 12px; }
.ai-input-row textarea {
  flex: 1; resize: none; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 14px;
  font-size: 13.5px; font-family: inherit; outline: none; height: 46px;
}
.ai-input-row textarea:focus { border-color: var(--brand); }
.ai-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ai-loading { color: var(--t3); font-size: 13px; padding: 8px; }
.typing::after { content: '▍'; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }
.ai-report { line-height: 1.9; font-size: 13.5px; }
.ai-report h4 { margin: 10px 0 4px; color: var(--brand-dark); }

/* 弹窗 & toast */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 22, 40, .5); z-index: 100;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: 16px; padding: 26px 28px; width: min(480px, 92vw);
  box-shadow: var(--shadow-lg); max-height: 86vh; overflow-y: auto;
}
.modal h3 { margin-bottom: 16px; }
.modal label { display: block; margin: 12px 0 6px; color: var(--t2); font-size: 13px; }
.modal input, .modal select {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 14px; outline: none;
}
.modal input:focus, .modal select:focus { border-color: var(--brand); }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  background: #1e2235; color: #fff; padding: 11px 22px; border-radius: 999px;
  font-size: 13px; z-index: 200; box-shadow: var(--shadow-lg); animation: slideDown .25s;
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--success); }
@keyframes slideDown { from { opacity: 0; transform: translate(-50%, -8px); } }

/* 空状态 */
.empty { text-align: center; color: var(--t3); padding: 40px 0; }
.empty .icon { font-size: 40px; margin-bottom: 10px; }

.map-locate-btn {
  position: absolute; right: 12px; top: 12px; z-index: 5;
  background: #fff; border: 1.5px solid var(--brand); color: var(--brand);
  border-radius: 999px; padding: 8px 16px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; box-shadow: 0 3px 10px rgba(30,34,53,.15);
}
.map-locate-btn:hover { background: var(--brand); color: #fff; }
.map-locate-btn:disabled { opacity: .6; cursor: wait; }

/* 实时动态 */
.online-pill {
  background: #ecfdf5; color: #047857; border-radius: 999px; padding: 4px 12px;
  font-size: 12px; white-space: nowrap;
}
.online-pill b { color: #047857; }
.feed-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 0;
  border-bottom: 1px dashed #eef0f6; font-size: 12.5px;
}
.feed-item:last-child { border-bottom: none; }
.feed-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #10b981; flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .15); animation: feedPulse 2s infinite;
}
@keyframes feedPulse { 50% { opacity: .35; } }
.feed-main { flex: 1; color: var(--t2); line-height: 1.5; }
.feed-main b { color: var(--t1); }
.feed-time { color: var(--t3); font-size: 11px; white-space: nowrap; }

/* 响应式 */
/* ---------------- App 下载入口 ---------------- */
.dl-card {
  position: fixed; left: 36px; bottom: 34px; z-index: 6;
  display: flex; align-items: center; gap: 14px;
  padding: 13px 20px 13px 13px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 18px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .38);
}
.dl-card img {
  width: 106px; height: 106px; border-radius: 12px; background: #fff;
  display: block; box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}
.dl-meta { display: flex; flex-direction: column; gap: 4px; color: #fff; }
.dl-meta b { font-size: 15px; letter-spacing: .5px; }
.dl-meta span { font-size: 12px; opacity: .72; }
.dl-meta em {
  font-style: normal; font-size: 11px; color: #d9c9ff;
  background: rgba(124, 58, 237, .35); padding: 3px 10px;
  border-radius: 99px; width: fit-content;
}
.dl-btn { display: none; }

@media (max-width: 900px) {
  .login-hero { display: none; }
  .login-top { padding: 18px 16px; }
  .lt-brand { gap: 12px; font-size: 26px; letter-spacing: 1px; }
  .lt-brand img { width: 58px; height: 58px; border-radius: 15px; }
  .login-right { padding: 118px 18px 32px; }
  .sidebar { width: 200px; }
  .page-body { padding: 16px; }
  .dl-card { display: none; }
  .dl-btn {
    display: flex; align-items: center; gap: 12px;
    margin-top: 14px; padding: 13px 16px;
    background: rgba(124, 58, 237, .2);
    border: 1.5px dashed rgba(167, 139, 250, .6);
    border-radius: 14px; text-decoration: none;
  }
  .dl-btn:active { background: rgba(124, 58, 237, .35); }
  .dl-ico { font-size: 24px; }
  .dl-txt { display: flex; flex-direction: column; gap: 2px; }
  .dl-txt b { font-size: 14px; color: #fff; }
  .dl-txt i { font-style: normal; font-size: 11.5px; color: rgba(255, 255, 255, .55); }
}

/* 手机端专项优化 */
@media (max-width: 768px) {
  /* 布局骨架：侧边栏 → 底部导航 */
  .app { flex-direction: column; }
  .sidebar { display: none; }
  .main { padding-bottom: 78px; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: linear-gradient(180deg, #1d1836, #131022);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .3);
  }
  .bn-item {
    flex: 1; border: none; background: transparent; color: #cdd1e8;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 7px 0 5px; font-size: 10.5px; cursor: pointer; border-radius: 12px;
  }
  .bn-item .bn-ico { font-size: 19px; line-height: 1; }
  .bn-item.active { color: #fff; background: linear-gradient(135deg, rgba(124,58,237,.9), rgba(168,85,247,.9)); font-weight: 600; }
  .bn-item.bn-logout { color: #8f96c2; max-width: 64px; }

  /* 顶栏与内容 */
  .topbar { padding: 12px 14px; }
  .topbar h2 { font-size: 15.5px; }
  .topbar-right { font-size: 12px; gap: 8px; }
  .page-body { padding: 14px 12px 20px; }
  .grid { gap: 12px; }
  .grid-kpi { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 15px 14px; }
  .card h3 { font-size: 14px; }
  .kpi-num { font-size: 21px; }

  /* 校园地图 */
  .campus-map { height: 300px; }
  .map-building { font-size: 10px; }
  .map-label { font-size: 10px; padding: 2px 8px; }
  .map-dot { width: 14px; height: 14px; border-width: 2px; }
  .map-locate-btn { right: 8px; top: 8px; padding: 6px 12px; font-size: 11px; }

  /* 菜品卡片 */
  .dish-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .dish-card { padding: 12px; }
  .dish-price { font-size: 14px; }

  /* 表格可横向滑动 */
  .card { overflow-x: auto; }
  .table { font-size: 12px; min-width: 460px; }
  .table th, .table td { padding: 8px 9px; }

  /* AI 页 */
  .ai-chat { height: calc(100vh - 240px); min-height: 360px; }
  .ai-input-row textarea { height: 40px; }
  .ai-bubble { max-width: 94%; font-size: 13px; }

  /* 弹窗 / 搜索 / 按钮 */
  .modal { width: 94vw; padding: 20px 16px; }
  .search-input { width: 100%; }
  .btn-primary { padding: 10px 16px; }
  .toast { max-width: 88vw; text-align: center; }
}

/* ---------------- 访客与设备 ---------------- */
.privacy-note { margin: 12px 0 0; font-size: 11px; line-height: 1.7; color: rgba(255, 255, 255, .45); }
.visitor-gate { max-width: 460px; margin: 40px auto; }
.visitor-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.visitor-head h3 { margin: 0; }
.visitor-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bar-row { display: flex; align-items: center; gap: 10px; margin: 9px 0; font-size: 12.5px; }
.bar-name { width: 88px; color: var(--t2); flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 8px; background: #eef0f6; border-radius: 99px; overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #6366f1, #38bdf8); }
.bar-val { width: 36px; text-align: right; color: var(--t1); font-weight: 600; }
.tip-line { font-size: 12.5px; color: var(--t2); line-height: 1.85; }
.tip-line + .tip-line { margin-top: 8px; }
.vis-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.vis-detail-head h3 { margin: 0; }
.vis-group { margin-top: 16px; padding-top: 14px; border-top: 1px solid #f0f1f7; }
.vis-group h4 { font-size: 13px; color: var(--brand); margin-bottom: 10px; }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.kv-item { display: flex; gap: 8px; font-size: 12.5px; min-width: 0; }
.kv-item span { color: var(--t3); flex-shrink: 0; width: 86px; }
.kv-item b { color: var(--t1); font-weight: 500; word-break: break-all; }
.modal.wide { width: min(780px, 94vw); }

/* ---------------- 权限引导 / 头像 / AI 解读 ---------------- */
.perm-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid #eceef6; border-radius: 12px; padding: 12px 14px; margin-top: 10px;
}
.perm-row.done { background: #f4fbf6; border-color: #cdebd7; }
.perm-ico { font-size: 24px; flex-shrink: 0; }
.perm-txt { flex: 1; min-width: 0; }
.perm-txt b { font-size: 13.5px; color: var(--t1); display: block; }
.perm-txt i { font-style: normal; font-size: 11.5px; color: var(--t3); display: block; margin-top: 2px; }
.perm-btn { padding: 8px 14px; font-size: 12.5px; white-space: nowrap; }
.side-av {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, .25); display: block;
}
.side-av-txt {
  background: linear-gradient(135deg, #7c3aed, #4f46e5); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600;
}
.side-user { display: flex; align-items: center; gap: 10px; }
.side-uinfo { min-width: 0; font-size: 12px; color: #cdd1e8; line-height: 1.5; }
.side-uinfo b { color: #fff; font-size: 13px; }
.pf-card { display: flex; align-items: center; gap: 18px; }
.pf-avatar { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.pf-avatar-txt {
  background: linear-gradient(135deg, #7c3aed, #4f46e5); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 600;
}
.pf-info { flex: 1; min-width: 0; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ai-report {
  background: #f6f7fd; border-radius: 12px; padding: 12px 14px;
  font-size: 13px; line-height: 1.9; color: var(--t1);
}

@media (max-width: 900px) {
  .kv-grid { grid-template-columns: 1fr; }
  .visitor-gate { margin: 16px 0; }
  .bar-name { width: 64px; }
  .modal.wide { width: 94vw; }
  .perm-row { flex-wrap: wrap; }
  .perm-btn { flex: 1; }
  .pf-card { flex-direction: column; text-align: center; }
  .pf-info .btn-row { justify-content: center; }
}
