/* 会员端 H5 —— 暖米白风（与律师工作台统一：米白底 / 深灰蓝 / 陶土橙） */
:root {
  --primary: #C8724D;
  --primary-deep: #A85A38;
  --primary-soft: #F4E5D8;
  --primary-line: #E2C0A2;
  --grad: linear-gradient(135deg, #55636F 0%, #3E4B57 100%);
  --ink: #2D3748;
  --muted: #7C8694;
  --border: #E6DED0;
  --border-strong: #D4C9B6;
  --bg: #F6F1E9;
  --danger: #C05A45;
  --ok: #5C7A4A;
  --radius: 10px;
  --radius-lg: 14px;
  --sans: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.75;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 15px; }
h1, h2, h3, .card-title, .topbar-title, .hero h2, .detail-head h2, .auth-logo h1, .profile-head .name {
  font-family: var(--sans); letter-spacing: 0.5px; font-weight: 700;
}

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--grad); color: #fff;
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
}
.topbar-title {
  font-size: 17px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.topbar-title::before {
  content: "法"; flex: none;
  width: 22px; height: 22px; line-height: 22px; text-align: center;
  background: #fff; color: var(--primary);
  font-size: 12px; font-weight: 800; border-radius: 6px;
}
.icon-btn { background: none; border: none; color: #fff; position: relative; padding: 4px; display: flex; }
.bell { width: 20px; height: 20px; display: block; }
.dot {
  position: absolute; top: 2px; right: 0; width: 8px; height: 8px;
  background: #FF7A45; border-radius: 50%; border: 1.5px solid #fff;
}

/* 视图容器 */
.view { padding: 16px 14px 88px; max-width: 640px; margin: 0 auto; }
.view.no-tab { padding-bottom: 28px; }

/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: #fff; border-top: 1px solid var(--border);
  display: flex; padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.tabbar a {
  flex: 1; text-align: center; color: var(--muted); text-decoration: none;
  font-size: 11px; display: flex; flex-direction: column;
  align-items: center; gap: 3px; padding: 6px 0 4px;
}
.tabbar a.active { color: var(--primary); font-weight: 700; }
.tabbar a.active .tab-ico { background: var(--primary-soft); }
.tab-ico {
  width: 34px; height: 26px; padding: 3px 7px; display: block; border-radius: 8px;
  transition: background 0.15s;
}

/* 卡片 */
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(30, 111, 224, 0.05);
}
.card-title {
  font-size: 15.5px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  line-height: 1.3;
}
.card-title::before {
  content: ""; width: 4px; height: 15px; border-radius: 2px;
  background: var(--primary); flex: none;
}
.section-label {
  font-size: 12px; color: var(--muted); letter-spacing: 2px;
  margin: 18px 2px 10px; display: flex; align-items: center; gap: 10px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* 品牌横幅 */
.hero {
  background: var(--grad); color: #fff;
  border-radius: var(--radius-lg);
  padding: 22px 18px; margin-bottom: 14px;
}
.hero h2 { font-size: 19px; margin-bottom: 8px; }
.hero p { font-size: 13px; opacity: 0.92; }
.hero .gold { color: #CFE2FF; font-weight: 700; }

/* 标签 */
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
  padding: 2px 10px; border-radius: 999px; font-weight: 600;
  border: 1px solid transparent; white-space: nowrap;
}
.badge.gold { background: var(--primary-soft); border-color: var(--primary-line); color: var(--primary-deep); }
.badge.blue { background: var(--primary); border-color: var(--primary); color: #fff; }
.badge.green { background: #E9F7EF; border-color: #B7E2C7; color: var(--ok); }
.badge.red { background: #FDEEEE; border-color: #F3C2C2; color: var(--danger); }
.badge.gray { background: #F2F4F7; border-color: var(--border); color: var(--muted); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: var(--radius);
  padding: 12px 18px; font-size: 15px; font-weight: 600; letter-spacing: 1px;
  background: var(--primary); color: #fff; width: 100%;
  box-shadow: 0 2px 6px rgba(30, 111, 224, 0.22);
}
.btn:active { background: var(--primary-deep); }
.btn.gold {
  background: var(--grad); border: none; color: #fff;
  box-shadow: 0 3px 10px rgba(30, 111, 224, 0.3);
}
.btn.gold:active { opacity: 0.9; }
.btn.ghost {
  background: var(--primary-soft); color: var(--primary-deep);
  border: 1px solid var(--primary-line); box-shadow: none;
}
.btn.danger { background: #fff; border: 1px solid var(--danger); color: var(--danger); box-shadow: none; }
.btn.sm { width: auto; padding: 8px 16px; font-size: 13px; letter-spacing: 0.5px; }
.btn:disabled { opacity: 0.45; box-shadow: none; }

/* 表单 */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field label .req { color: var(--danger); }
.input, .textarea, .select {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 11px 12px; background: #fff; color: var(--ink); outline: none;
  transition: border-color 0.15s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 15px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: #fff; font-size: 13px; color: var(--ink);
}
.chip.active {
  background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600;
}
.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 2px; font-size: 14px;
}
.switch { position: relative; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; transition: 0.2s;
}
.switch .slider::before {
  content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* 咨询列表 */
.cons-item {
  display: block; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 10px;
  text-decoration: none; color: var(--ink);
  box-shadow: 0 1px 3px rgba(30, 111, 224, 0.05);
}
.cons-item:active { background: var(--primary-soft); }
.cons-item .row1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.cons-item .title { font-weight: 700; font-size: 15px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cons-item .preview { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cons-item .meta { margin-top: 8px; display: flex; gap: 12px; color: var(--muted); font-size: 12px; }

/* 对话流 */
.thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.msg {
  max-width: 100%; padding: 13px 15px; border-radius: var(--radius);
  font-size: 14px; word-break: break-word;
  background: #fff; border: 1px solid var(--border);
}
.msg-body { white-space: pre-wrap; }
.msg.member { background: var(--primary-soft); border-color: var(--primary-line); }
.msg.lawyer {
  background: #fff; border-color: var(--border);
  box-shadow: 0 1px 3px rgba(30, 111, 224, 0.08);
}
.msg .who {
  font-size: 11px; margin-bottom: 6px; font-weight: 700;
  color: var(--primary);
}
.msg.member .who { color: var(--primary-deep); }
.msg .time { font-size: 11px; color: var(--muted); margin-top: 8px; }
.msg-attach { margin-top: 8px; }
.msg-attach a {
  display: inline-block; font-size: 12px; background: var(--primary-soft);
  border: 1px solid var(--primary-line); color: var(--primary-deep);
  padding: 3px 11px; border-radius: 999px; text-decoration: none; margin: 2px 4px 2px 0;
}

/* 服务卡片 */
.svc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.svc-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 12px 16px; text-align: center;
  box-shadow: 0 1px 3px rgba(30, 111, 224, 0.05);
}
.svc-card:active { background: var(--primary-soft); }
.svc-card .ico {
  width: 42px; height: 42px; line-height: 42px; margin: 0 auto 9px;
  background: var(--primary-soft); color: var(--primary-deep);
  font-size: 18px; font-weight: 700; text-align: center; border-radius: 12px;
}
.svc-card .name { font-weight: 700; color: var(--ink); font-size: 15px; }
.svc-card .desc { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* 提示条 */
.notice {
  background: var(--primary-soft); border: 1px solid var(--primary-line);
  border-radius: 8px; padding: 11px 13px; font-size: 12.5px;
  color: var(--primary-deep); margin: 10px 0; line-height: 1.8;
}
.notice.blue { background: var(--primary); border-color: var(--primary); color: #fff; }

/* toast */
.toast {
  position: fixed; left: 50%; top: 18%; transform: translateX(-50%); z-index: 99;
  background: rgba(31, 41, 55, 0.94); color: #fff; padding: 11px 18px;
  border-radius: 999px; font-size: 14px; max-width: 82%; text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

/* 通知列表 */
.noti {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px; margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(30, 111, 224, 0.05);
}
.noti.unread { border-color: var(--primary-line); background: var(--primary-soft); }
.noti .t { font-weight: 700; font-size: 14px; }
.noti .b { color: var(--muted); font-size: 13px; margin-top: 3px; }
.noti .d { color: var(--muted); font-size: 11px; margin-top: 5px; }

/* 我的 */
.profile-head {
  background: var(--grad); color: #fff;
  border-radius: var(--radius-lg);
  padding: 24px 18px; margin-bottom: 12px;
}
.profile-head .name { font-size: 21px; font-weight: 700; }
.profile-head .sub { font-size: 13px; opacity: 0.85; margin-top: 4px; }
.menu-list {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 1px 3px rgba(30, 111, 224, 0.05);
}
.menu-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 16px; border-bottom: 1px solid var(--border);
  text-decoration: none; color: var(--ink); font-size: 14.5px;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--primary-soft); }
.menu-item .arrow { color: var(--muted); }

/* 空状态 */
.empty {
  text-align: center; color: var(--muted); padding: 34px 12px; font-size: 14px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius); background: #fff;
}

/* 登录页 */
.auth-wrap { max-width: 400px; margin: 3vh auto 0; padding: 0 18px 24px; }
.auth-logo { text-align: center; margin-bottom: 16px; }
.auth-logo .logo {
  width: 54px; height: 54px; margin: 0 auto 8px;
  background: var(--grad); color: #fff;
  font-size: 24px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border-radius: 15px;
  box-shadow: 0 6px 16px rgba(30, 111, 224, 0.3);
}
.auth-logo h1 { font-size: 19px; color: var(--ink); }
.auth-logo p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.auth-tabs {
  display: flex; background: var(--primary-soft); border: 1px solid var(--primary-line);
  border-radius: 999px; margin-bottom: 14px; padding: 4px;
}
.auth-tabs button {
  flex: 1; border: none; background: none; padding: 10px;
  font-size: 14px; color: var(--primary-deep); font-weight: 600; border-radius: 999px;
}
.auth-tabs button.active {
  background: #fff; color: var(--primary); font-weight: 700;
  box-shadow: 0 1px 4px rgba(30, 111, 224, 0.18);
}

/* 详情头 */
.detail-head {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(30, 111, 224, 0.05);
}
.detail-head h2 { font-size: 17px; color: var(--ink); margin: 8px 0; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* 附件上传 */
.upload-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.upload-tag {
  background: var(--primary-soft); color: var(--primary-deep); border: 1px solid var(--primary-line);
  border-radius: 999px; padding: 5px 12px; font-size: 12px;
  display: inline-flex; gap: 6px; align-items: center;
}
.upload-tag .x { cursor: pointer; font-weight: 700; }

.footer-disclaimer {
  color: var(--muted); font-size: 11.5px; line-height: 1.9;
  padding: 18px 6px 6px; text-align: justify;
  border-top: 1px solid var(--border); margin-top: 14px;
}
.flex-row { display: flex; gap: 10px; }
.flex-row > * { flex: 1; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mb8 { margin-bottom: 8px; }
.right { text-align: right; }
.center { text-align: center; }

/* 访客提问 */
.notice-bar { background: var(--primary-soft); border: 1px solid var(--primary-line); color: var(--primary-deep); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.reply-box { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.consult-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
