:root {
  --brand: #e8b04b;
  --brand-soft: #f7eccd;
  --bg: #f6f4ef;
  --card: #ffffff;
  --text: #2a2723;
  --muted: #8c857b;
  --line: #ece7df;
  --danger: #d9534f;
  --ok: #3a9d6e;
  --shadow: 0 6px 22px rgba(60, 50, 30, 0.08);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* 通用容器 */
.wrap { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; }
.container { padding: 16px; }
.card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.section-title {
  font-size: 17px;
  font-weight: 700;
  margin: 4px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  width: 4px;
  height: 16px;
  background: var(--brand);
  border-radius: 4px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 600;
  background: var(--brand);
  color: #2a2723;
  transition: opacity .15s;
}
.btn:active { opacity: .85; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; border: 1px solid var(--brand); color: var(--brand); }
.btn.grey { background: #efeae2; color: var(--text); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.sm { padding: 7px 12px; font-size: 13px; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  background: #faf8f4;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--text);
  outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--brand); }
.field textarea { min-height: 80px; resize: vertical; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 顶部品牌条 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
}
.topbar .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--brand-soft); object-fit: cover; }
.topbar .title { font-weight: 700; font-size: 16px; }
.topbar .sub { font-size: 12px; color: var(--muted); }

/* 师资头部 */
.hero {
  position: relative;
  padding: 28px 16px 20px;
  background: linear-gradient(135deg, var(--brand-soft), #fff);
  text-align: center;
}
.hero .avatar {
  width: 88px; height: 88px; border-radius: 50%;
  margin: 0 auto 12px; object-fit: cover;
  border: 3px solid #fff; box-shadow: var(--shadow);
  background: #eee;
}
.hero .name { font-size: 22px; font-weight: 800; }
.hero .title { color: var(--muted); margin-top: 2px; }
.hero .tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.hero .tag {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: #fff; color: var(--brand); border: 1px solid var(--brand-soft);
}
.meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.meta-grid .item { background: #fff; border-radius: 12px; padding: 10px 4px; text-align: center; box-shadow: var(--shadow); }
.meta-grid .item b { display: block; font-size: 16px; color: var(--brand); }
.meta-grid .item span { font-size: 12px; color: var(--muted); }

/* 画廊 */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gallery .gitem { border-radius: 12px; overflow: hidden; background: #eee; position: relative; aspect-ratio: 1/1; }
.gallery .gitem img, .gallery .gitem video { width: 100%; height: 100%; object-fit: cover; }
.gallery .gitem .cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
  color: #fff; font-size: 12px; padding: 14px 8px 6px;
}
.gallery .gitem .badge {
  position: absolute; top: 6px; left: 6px; font-size: 11px;
  background: var(--brand); color: #2a2723; padding: 2px 8px; border-radius: 999px;
}

/* 空状态 */
.empty { text-align: center; color: var(--muted); padding: 28px 10px; font-size: 14px; }
.empty::before { content: '🖼'; display: block; font-size: 30px; margin-bottom: 8px; opacity: .5; }

/* AI 悬浮入口 */
.ai-fab {
  position: fixed; right: 16px; bottom: 84px;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--brand); color: #2a2723;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  z-index: 40; border: none;
}
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; gap: 10px; padding: 10px 16px;
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line);
  max-width: 480px; margin: 0 auto; z-index: 30;
}
.bottom-bar .btn { flex: 1; }

/* AI 聊天面板 */
.chat-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  z-index: 50; display: none; align-items: flex-end;
}
.chat-mask.open { display: flex; }
.chat-panel {
  width: 100%; max-width: 480px; margin: 0 auto;
  height: 78vh; background: var(--bg);
  border-radius: 18px 18px 0 0; display: flex; flex-direction: column;
}
.chat-head { padding: 14px 16px; background: var(--brand); color: #2a2723; font-weight: 700; display: flex; justify-content: space-between; align-items: center; border-radius: 18px 18px 0 0; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px; }
.chat-msg { margin-bottom: 12px; max-width: 82%; }
.chat-msg.ai { background: #fff; border-radius: 14px 14px 14px 2px; padding: 10px 12px; box-shadow: var(--shadow); }
.chat-msg.me { margin-left: auto; background: var(--brand); color: #2a2723; border-radius: 14px 14px 2px 14px; padding: 10px 12px; }
.chat-foot { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
.chat-foot input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; outline: none; }
.chat-form-card { background: #fff; border-radius: 12px; padding: 12px; margin-top: 10px; box-shadow: var(--shadow); }

/* 登录 */
.login-box { max-width: 360px; margin: 8vh auto 0; padding: 0 20px; }
.login-logo { text-align: center; margin-bottom: 18px; }
.login-logo .mark { font-size: 30px; font-weight: 800; color: var(--brand); }

/* 后台布局 */
.admin-wrap { max-width: 980px; margin: 0 auto; padding: 0 0 40px; }
.tabs { display: flex; overflow-x: auto; gap: 4px; padding: 10px 12px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.tabs .tab { white-space: nowrap; padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); }
.tabs .tab.active { background: var(--brand); color: #2a2723; font-weight: 700; }
.panel { display: none; }
.panel.active { display: block; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.list-item { background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow); }
.list-item .li-title { font-weight: 600; }
.list-item .li-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.badge-pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: #8a6d1e; }
.muted { color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-grid .s { background: #fff; border-radius: 12px; padding: 12px; text-align: center; box-shadow: var(--shadow); }
.stat-grid .s b { display: block; font-size: 20px; color: var(--brand); }
.stat-grid .s span { font-size: 12px; color: var(--muted); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; border-radius: 12px; overflow: hidden; }
.table th, .table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.table th { background: #faf8f4; color: var(--muted); font-weight: 600; }
.toast {
  position: fixed; left: 50%; top: 20%; transform: translateX(-50%);
  background: rgba(40,36,30,.92); color: #fff; padding: 10px 18px; border-radius: 10px;
  z-index: 99; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: 1; }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 60; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-mask.open { display: flex; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 460px; max-height: 86vh; overflow-y: auto; padding: 18px; }
.modal h3 { margin: 0 0 14px; }
.close-x { background: none; border: none; font-size: 20px; color: var(--muted); }
.cover-img { width: 100%; border-radius: 12px; object-fit: cover; max-height: 200px; background: #eee; }
.qr-box { text-align: center; }
.qr-box img { width: 160px; height: 160px; margin: 0 auto 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }

/* ===== 机构总名片主页 ===== */
.org-hero {
  position: relative;
  padding: 34px 16px 22px;
  background: linear-gradient(135deg, var(--brand-soft), #fff);
  text-align: center;
}
.org-hero .org-logo {
  width: 76px; height: 76px; border-radius: 18px; margin: 0 auto 12px;
  object-fit: cover; background: #fff; border: 3px solid #fff; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 800; color: var(--brand);
}
.org-hero .org-name { font-size: 23px; font-weight: 800; }
.org-hero .org-slogan { color: var(--muted); margin-top: 4px; font-size: 13px; }
.org-hero .org-slogan.slogan-empty { color: #b3aca2; font-size: 12px; }
.picker-sel:disabled { color: #b3aca2; background: #f7f7f8; }
.org-cover { width: 100%; border-radius: 12px; object-fit: cover; max-height: 190px; background: #eee; margin-bottom: 10px; }

/* 选授课老师下拉 */
.picker-card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 14px; }
.picker-card .picker-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.picker-sel {
  width: 100%; border: 1px solid var(--brand); background: var(--brand-soft);
  color: var(--text); border-radius: 10px; padding: 11px 12px; font-size: 15px; font-weight: 600;
  outline: none; -webkit-appearance: none; appearance: none;
}

/* 师资团队 */
.teacher-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.teacher-item {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow);
  padding: 14px 10px; text-align: center; transition: transform .12s; cursor: pointer;
}
.teacher-item:active { transform: scale(.97); }
.teacher-item .t-av {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 8px; object-fit: cover;
  background: var(--brand-soft); display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--brand); border: 2px solid #fff; box-shadow: var(--shadow);
}
.teacher-item .t-name { font-weight: 700; font-size: 15px; }
.teacher-item .t-title { font-size: 12px; color: var(--muted); margin-top: 2px; }
.teacher-item .t-tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 8px; }
.teacher-item .t-tags span { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--brand-soft); color: #8a6d1e; }

/* 校区定位 */
.loc-row { display: flex; align-items: flex-start; gap: 10px; }
.loc-row .loc-ico { font-size: 20px; line-height: 1.4; }
.loc-row .loc-text { flex: 1; }
.loc-map-btn { margin-top: 10px; }

/* AI 工具按钮（语音 / 上传） */
.chat-tool {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: #faf8f4; font-size: 17px; display: flex; align-items: center; justify-content: center; flex: none;
}
.chat-tool.rec { background: var(--danger); color: #fff; border-color: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.chat-thumb { max-width: 130px; border-radius: 10px; margin-top: 6px; display: block; }
.chat-tip { font-size: 12px; color: var(--muted); margin-top: 6px; }
