* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f6f7fb;
  color: #2b2b3a;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 70px;
}
a { text-decoration: none; color: inherit; }
input, textarea, select { font-family: inherit; }

/* 顶部导航 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: #fff;
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
}
.topbar .title { font-size: 17px; font-weight: 600; }
.topbar .link { font-size: 13px; color: #7c5cff; }

/* 渐变主按钮 */
.btn-main {
  display: block; width: 100%;
  padding: 14px;
  border: none; border-radius: 12px;
  background: linear-gradient(135deg, #7c5cff 0%, #4a9eff 100%);
  color: #fff; font-size: 16px; font-weight: 600; letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(124,92,255,.28);
}
.btn-main:active { opacity: .85; }
.btn-main:disabled { opacity: .5; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: #8a8a9a; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px 14px;
  border: 1px solid #e8e8f0; border-radius: 10px;
  background: #fafafe; font-size: 15px; outline: none;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: #7c5cff; }
.form-group textarea { resize: vertical; min-height: 120px; }
.form-group small { display: block; color: #b0b0c0; font-size: 12px; margin-top: 4px; }

/* 媒体类型选择 */
.media-types { display: flex; gap: 10px; }
.media-type {
  flex: 1; text-align: center; padding: 12px 0;
  border: 1px solid #e8e8f0; border-radius: 10px;
  background: #fafafe; font-size: 13px; color: #6a6a7a; cursor: pointer;
}
.media-type.active { border-color: #7c5cff; color: #7c5cff; background: #f3efff; }

/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: #fff;
  display: flex;
  border-top: 1px solid #f0f0f5;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 30;
}
.tabbar a {
  flex: 1; text-align: center; padding: 9px 0 7px;
  font-size: 11px; color: #9a9aaa;
}
.tabbar a .ico { display: block; font-size: 20px; line-height: 1.2; margin-bottom: 2px; }
.tabbar a.active { color: #7c5cff; }

/* 卡片 */
.card { background: #fff; border-radius: 14px; padding: 18px; margin: 12px 14px; box-shadow: 0 2px 10px rgba(0,0,0,.03); }
.card h2 { font-size: 16px; margin-bottom: 4px; }
.card .sub { font-size: 12px; color: #9a9aaa; margin-bottom: 14px; }

/* 个人中心 */
.profile {
  background: linear-gradient(135deg, #7c5cff 0%, #4a9eff 100%);
  padding: 34px 20px 26px; color: #fff; text-align: center;
}
.profile .avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; margin: 0 auto 10px;
}
.profile .name { font-size: 18px; font-weight: 600; }
.profile .slogan { font-size: 12px; opacity: .85; margin-top: 4px; }
.profile .al.big { font-size: 34px; font-weight: 700; letter-spacing: 4px; }
.balance-row { margin-top: 14px; display: inline-flex; align-items: center; gap: 10px; background: rgba(255,255,255,.18); border-radius: 20px; padding: 6px 16px; }
.balance-row .bl-label { font-size: 12px; opacity: .9; }
.balance-row .bl-value { font-size: 18px; font-weight: 700; }

/* 公告 */
.notice-item { padding: 12px 0; border-bottom: 1px solid #f5f5fa; }
.notice-item:last-child { border-bottom: none; }
.notice-item .ni-title { font-size: 14px; font-weight: 600; color: #7c5cff; }
.notice-item .ni-content { font-size: 13px; color: #4a4a5a; margin-top: 4px; line-height: 1.6; }
.notice-item .ni-time { font-size: 11px; color: #b0b0c0; margin-top: 4px; }
.notice-bar {
  background: #fff8ec; color: #a06a10;
  padding: 10px 14px; font-size: 13px;
  border-bottom: 1px solid #f5ead0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notice-bar a { color: #7c5cff; }

/* 六宫格 */
.grid6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid6 .item {
  background: #fff; border-radius: 12px; padding: 18px 6px;
  text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.03);
}
.grid6 .item .gi { font-size: 26px; display: block; margin-bottom: 6px; }
.grid6 .item .gt { font-size: 13px; color: #4a4a5a; }

/* 信箱 */
.mail-tabs { display: flex; background: #fff; border-bottom: 1px solid #f0f0f5; }
.mail-tabs .mt { flex: 1; text-align: center; padding: 13px 0; font-size: 15px; color: #9a9aaa; position: relative; }
.mail-tabs .mt.active { color: #2b2b3a; font-weight: 600; }
.mail-tabs .mt.active::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 28px; height: 3px; border-radius: 3px; background: #7c5cff;
}
.empty { text-align: center; padding: 60px 0; color: #b0b0c0; }
.empty .ei { font-size: 56px; display: block; margin-bottom: 12px; }
.empty .et { font-size: 14px; }

/* 信件列表 */
.letter-item { display: flex; align-items: center; padding: 14px 0; border-bottom: 1px solid #f5f5fa; }
.letter-item:last-child { border-bottom: none; }
.letter-item .li-ico { width: 40px; height: 40px; border-radius: 10px; background: #f3efff; color: #7c5cff; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-right: 12px; }
.letter-item .li-body { flex: 1; min-width: 0; }
.letter-item .li-title { font-size: 14px; font-weight: 500; }
.letter-item .li-desc { font-size: 12px; color: #9a9aaa; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.letter-item .li-status { font-size: 12px; }
.letter-item .li-status.pending { color: #f0a020; }
.letter-item .li-status.sent { color: #34c759; }
.letter-item .li-status.cancelled { color: #b0b0c0; }
.letter-item .li-status.failed { color: #ff3b30; }

/* 开关 */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; border-radius: 26px; background: #e0e0ea; transition: .2s;
}
.switch .slider::before {
  content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  left: 3px; top: 3px; background: #fff; transition: .2s;
}
.switch input:checked + .slider { background: #7c5cff; }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* 提示 */
.msg { padding: 12px; border-radius: 10px; font-size: 13px; margin: 12px 14px; display: none; }
.msg.ok { display: block; background: #eafaf0; color: #1f9d55; }
.msg.err { display: block; background: #fdecec; color: #d64545; }

/* 登录页 */
.auth-wrap { padding: 60px 30px 0; }
.auth-logo { text-align: center; margin-bottom: 30px; }
.auth-logo .al { font-size: 30px; font-weight: 700; background: linear-gradient(135deg,#7c5cff,#4a9eff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.auth-logo .as { font-size: 12px; color: #9a9aaa; margin-top: 6px; }
.auth-tabs { display: flex; margin-bottom: 20px; }
.auth-tabs .at { flex: 1; text-align: center; padding: 10px 0; font-size: 15px; color: #9a9aaa; border-bottom: 2px solid transparent; }
.auth-tabs .at.active { color: #7c5cff; border-bottom-color: #7c5cff; font-weight: 600; }

/* 信箱操作按钮 */
.li-actions { margin-top: 8px; display: flex; gap: 8px; }
.btn-mini { display: inline-block; padding: 4px 12px; font-size: 12px; border-radius: 6px; border: 1px solid #d8d8e0; background: #fff; color: #555; cursor: pointer; text-decoration: none; }
.btn-mini.danger { color: #d64545; border-color: #f0c4c4; }
.btn-mini.danger:hover { background: #fdecec; }
.li-review { display: inline-block; margin-top: 4px; font-size: 11px; color: #e6a23c; background: #fff7e6; padding: 1px 6px; border-radius: 4px; }
.li-review.rejected { color: #d64545; background: #fdecec; }

/* ===== 在线客服 ===== */
.page-head { display: flex; align-items: center; padding: 14px 16px; background: #fff; border-bottom: 1px solid #f0f0f5; position: sticky; top: 0; z-index: 10; }
.page-head .ph-back { font-size: 13px; color: #7c5cff; text-decoration: none; }
.page-head .ph-title { flex: 1; text-align: center; font-size: 16px; font-weight: 600; }
.chat-status { font-size: 11px; color: #34c759; }

/* ===== 微信风格在线客服 ===== */
.kefu-page { padding-bottom: 0; background: #ededed; }
.wx-head { display: flex; align-items: center; padding: 12px 14px; background: #ededed; position: sticky; top: 0; z-index: 20; }
.wx-head .wx-back { font-size: 22px; color: #181818; text-decoration: none; width: 28px; line-height: 1; }
.wx-head .wx-title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; color: #111; }
.wx-head .wx-side { width: 28px; }
.wx-head .wx-online { font-size: 13px; color: #07c160; width: 28px; text-align: right; }

.wx-newbar { background: #ededed; padding: 0 16px 10px; }
.wx-newbar button { width: 100%; border: none; border-radius: 8px; background: #fff; color: #07c160; font-size: 15px; font-weight: 600; padding: 11px 0; cursor: pointer; }
.wx-newbar button:active { background: #f2f2f2; }

.wx-list { background: #fff; min-height: 100%; }
.wx-empty { padding: 70px 20px; text-align: center; color: #9a9aaa; font-size: 14px; background: #fff; }
.wx-session { display: flex; align-items: center; padding: 12px 16px; cursor: pointer; background: #fff; }
.wx-session:active { background: #f5f5f5; }
.wx-session + .wx-session { border-top: 1px solid #f0f0f0; }
.wx-session.closed { opacity: .55; }
.wx-s-avatar { width: 46px; height: 46px; border-radius: 6px; background: #07c160; color: #fff; font-size: 20px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wx-s-body { flex: 1; min-width: 0; margin-left: 12px; }
.wx-s-name { font-size: 16px; color: #111; }
.wx-s-sub { font-size: 13px; color: #9a9aaa; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-s-right { text-align: right; flex-shrink: 0; margin-left: 8px; display: flex; flex-direction: column; align-items: flex-end; }
.wx-s-time { font-size: 12px; color: #b0b0b0; }
.kf-badge { min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; border-radius: 9px; background: #fa5151; color: #fff; font-size: 11px; text-align: center; margin-top: 4px; }
.wx-s-arrow { font-size: 15px; color: #c8c8c8; margin-top: 4px; }

.wx-chat-body { overflow-y: auto; padding: 16px 12px; background: #ededed; height: calc(100vh - 104px); }
.msg-row { display: flex; align-items: flex-end; margin-bottom: 18px; }
.msg-row.mine { flex-direction: row-reverse; }
.msg-avatar { width: 38px; height: 38px; border-radius: 50%; background: #a6a6a6; color: #fff; font-size: 16px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.msg-row.mine .msg-avatar { background: #ff9c2e; }
.msg-main { max-width: 72%; margin: 0 10px; display: flex; flex-direction: column; }
.msg-row.mine .msg-main { align-items: flex-end; }
.msg-row.theirs .msg-main { align-items: flex-start; }
.msg-bubble { padding: 10px 14px; border-radius: 8px; font-size: 15px; line-height: 1.5; word-break: break-word; }
.msg-img { display: block; max-width: 180px; max-height: 220px; border-radius: 6px; cursor: zoom-in; }
.msg-row.mine .msg-bubble { background: #95ec69; color: #111; border-top-right-radius: 2px; }
.msg-row.theirs .msg-bubble { background: #fff; color: #111; border-top-left-radius: 2px; }
.msg-time { font-size: 11px; color: #b0b0b0; margin-top: 4px; }
.wx-chat-input { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #f7f7f7; border-top: 1px solid #e0e0e0; }
.wx-chat-input input { flex: 1; border: none; border-radius: 6px; background: #fff; padding: 10px 14px; font-size: 15px; outline: none; }
.wx-chat-input button { border: none; border-radius: 6px; background: #07c160; color: #fff; padding: 10px 18px; font-size: 15px; cursor: pointer; }
.wx-chat-input button:active { background: #06ad56; }
.wx-chat-input .wx-img-btn { background: #fff; color: #07c160; font-size: 20px; padding: 4px 10px; border: 1px solid #e0e0e0; }

