/* ================= oo电竞 · 设计系统 ================= */
:root {
  --bg: #070b14;
  --bg2: #0c1322;
  --surface: #121a2b;
  --surface2: #182236;
  --line: rgba(255, 255, 255, .07);
  --line2: rgba(255, 255, 255, .12);
  --txt: #e8eefc;
  --txt2: #9aa8c4;
  --txt3: #6b7896;
  --cyan: #22d3ee;
  --cyan-d: #0e7490;
  --violet: #8b5cf6;
  --gold: #fbbf24;
  --green: #34d399;
  --red: #f87171;
  --orange: #fb923c;
  --grad: linear-gradient(135deg, #22d3ee 0%, #8b5cf6 100%);
  --grad-soft: linear-gradient(135deg, rgba(34, 211, 238, .16), rgba(139, 92, 246, .16));
  --r: 16px;
  --r-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overscroll-behavior-y: none;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(700px 400px at 12% -6%, rgba(34, 211, 238, .16), transparent 60%),
    radial-gradient(600px 420px at 96% 4%, rgba(139, 92, 246, .18), transparent 62%),
    linear-gradient(180deg, #070b14 0%, #080d18 55%, #070b14 100%);
}
a { color: var(--cyan); text-decoration: none; }
img { max-width: 100%; display: block; }
::-webkit-scrollbar { width: 0; height: 0; }

/* ---------- 布局 ---------- */
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: 84px; position: relative; }
.wrap { padding: 14px 16px; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; backdrop-filter: blur(14px);
  background: rgba(7, 11, 20, .78); border-bottom: 1px solid var(--line);
}
.topbar .logo { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .5px; font-size: 17px; }
.logo-dot {
  width: 26px; height: 26px; border-radius: 9px; background: var(--grad);
  display: grid; place-items: center; font-size: 13px; font-weight: 900; color: #04121a;
  box-shadow: 0 0 16px rgba(34, 211, 238, .5);
}
.topbar .spacer { flex: 1; }
.tb-btn {
  border: 1px solid var(--line2); background: var(--surface); color: var(--txt2);
  padding: 6px 11px; border-radius: 999px; font-size: 12px; cursor: pointer;
}
.tb-btn.on { color: var(--cyan); border-color: rgba(34, 211, 238, .45); background: rgba(34, 211, 238, .1); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  max-width: 560px; margin: 0 auto; display: flex;
  background: rgba(10, 15, 26, .96); backdrop-filter: blur(18px);
  border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
}
.tabbar .tab {
  flex: 1; text-align: center; padding: 6px 2px; color: var(--txt3); font-size: 11px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px; transition: .18s;
}
.tabbar .tab .ic { font-size: 19px; line-height: 1; filter: grayscale(.5) opacity(.75); }
.tabbar .tab.active { color: var(--cyan); }
.tabbar .tab.active .ic { filter: none; transform: translateY(-1px); }
.tabbar .tab.mid .ic {
  width: 42px; height: 42px; margin-top: -16px; border-radius: 50%; background: var(--grad);
  display: grid; place-items: center; font-size: 20px; color: #04121a;
  box-shadow: 0 6px 20px rgba(34, 211, 238, .45); filter: none;
}

/* ---------- 通用组件 ---------- */
.card {
  background: linear-gradient(180deg, rgba(24, 34, 54, .92), rgba(18, 26, 43, .92));
  border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; background: var(--surface); }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 4px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--txt2); }
.dim { color: var(--txt3); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.bold { font-weight: 700; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }
.mt { margin-top: 10px; } .mt2 { margin-top: 18px; } .mb { margin-bottom: 10px; }
.hidden { display: none !important; }

h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: .3px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
.sec-title { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 10px; }
.sec-title .t { font-size: 16px; font-weight: 800; }
.sec-title .more { font-size: 12px; color: var(--txt3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 16px; border-radius: 12px; border: 1px solid var(--line2);
  background: var(--surface2); color: var(--txt); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: .15s; font-family: inherit;
}
.btn:active { transform: scale(.975); }
.btn.block { width: 100%; }
.btn.primary { background: var(--grad); border: none; color: #04121a; font-weight: 800; box-shadow: 0 6px 20px rgba(34, 211, 238, .3); }
.btn.ghost { background: transparent; }
.btn.gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); border: none; color: #2b1a02; font-weight: 800; }
.btn.danger { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .35); color: #fca5a5; }
.btn.sm { padding: 7px 12px; font-size: 12.5px; border-radius: 10px; }
.btn[disabled] { opacity: .45; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; border: 1px solid var(--line2); color: var(--txt2); background: rgba(255, 255, 255, .03);
}
.tag.cy { color: var(--cyan); border-color: rgba(34, 211, 238, .4); background: rgba(34, 211, 238, .1); }
.tag.vi { color: #c4b5fd; border-color: rgba(139, 92, 246, .4); background: rgba(139, 92, 246, .12); }
.tag.go { color: var(--gold); border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .1); }
.tag.gr { color: var(--green); border-color: rgba(52, 211, 153, .4); background: rgba(52, 211, 153, .1); }
.tag.rd { color: var(--red); border-color: rgba(248, 113, 113, .4); background: rgba(248, 113, 113, .1); }

input, textarea, select {
  width: 100%; padding: 12px 13px; border-radius: 12px; border: 1px solid var(--line2);
  background: #0d1524; color: var(--txt); font-size: 14px; font-family: inherit; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: rgba(34, 211, 238, .5); box-shadow: 0 0 0 3px rgba(34, 211, 238, .1); }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12px; color: var(--txt2); margin-bottom: 6px; }
textarea { min-height: 84px; resize: vertical; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg .opt {
  padding: 9px 14px; border-radius: 11px; border: 1px solid var(--line2); background: var(--surface);
  font-size: 13px; color: var(--txt2); cursor: pointer; transition: .15s;
}
.seg .opt.on { background: var(--grad-soft); border-color: rgba(34, 211, 238, .5); color: var(--cyan); font-weight: 700; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; }
.chip {
  flex: 0 0 auto; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line2);
  background: var(--surface); font-size: 12.5px; color: var(--txt2); cursor: pointer; white-space: nowrap;
}
.chip.on { background: var(--grad-soft); border-color: rgba(34, 211, 238, .5); color: var(--cyan); }

.avatar {
  width: 42px; height: 42px; border-radius: 13px; background: var(--grad-soft);
  border: 1px solid var(--line2); display: grid; place-items: center; font-size: 18px; flex: 0 0 auto;
}
.avatar.lg { width: 62px; height: 62px; border-radius: 20px; font-size: 26px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 11px; text-align: center; }
.stat .v { font-size: 17px; font-weight: 800; color: var(--cyan); }
.stat .k { font-size: 11px; color: var(--txt3); margin-top: 2px; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick .q {
  background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 13px 6px;
  text-align: center; cursor: pointer; transition: .15s;
}
.quick .q:active { transform: scale(.96); }
.quick .q .ic { font-size: 22px; }
.quick .q .t { font-size: 12px; margin-top: 5px; color: var(--txt2); }

.hero {
  border-radius: 20px; padding: 18px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(34, 211, 238, .16), rgba(139, 92, 246, .2));
  border: 1px solid rgba(34, 211, 238, .22);
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(34, 211, 238, .35), transparent 65%); border-radius: 50%;
}
.hero .amt { font-size: 28px; font-weight: 900; letter-spacing: .5px; }

.order-card { position: relative; }
.order-card .price { color: var(--gold); font-size: 19px; font-weight: 900; }
.order-card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.status-line {
  border-left: 2px solid var(--line2); margin-left: 6px; padding-left: 14px; position: relative;
}
.status-line .st { position: relative; padding-bottom: 12px; font-size: 13px; color: var(--txt2); }
.status-line .st::before {
  content: ""; position: absolute; left: -21px; top: 5px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface2); border: 2px solid var(--line2);
}
.status-line .st.on { color: var(--txt); }
.status-line .st.on::before { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 10px rgba(34, 211, 238, .7); }

.bubble { max-width: 78%; padding: 10px 13px; border-radius: 14px; font-size: 14px; margin-bottom: 9px; word-break: break-word; }
.bubble.me { margin-left: auto; background: var(--grad); color: #04121a; border-bottom-right-radius: 4px; }
.bubble.other { background: var(--surface2); border-bottom-left-radius: 4px; }
.bubble.sys { background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .3); color: #fcd34d; font-size: 12.5px; margin: 8px auto; max-width: 92%; text-align: center; }
.chat-input { position: fixed; bottom: 0; left: 0; right: 0; max-width: 560px; margin: 0 auto; padding: 10px 12px calc(10px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))); background: rgba(10, 15, 26, .97); border-top: 1px solid var(--line); display: flex; gap: 8px; }

.stars { display: flex; gap: 6px; font-size: 30px; }
.stars i { font-style: normal; cursor: pointer; color: #35405c; transition: .12s; }
.stars i.on { color: var(--gold); text-shadow: 0 0 12px rgba(251, 191, 36, .6); }

.empty { text-align: center; padding: 46px 20px; color: var(--txt3); }
.empty .ic { font-size: 40px; margin-bottom: 10px; opacity: .6; }

.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 20px); z-index: 200;
  background: rgba(20, 28, 45, .97); border: 1px solid var(--line2); color: var(--txt);
  padding: 11px 18px; border-radius: 12px; font-size: 13.5px; opacity: 0; transition: .25s;
  box-shadow: var(--shadow); max-width: 82vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.modal-bg {
  position: fixed; inset: 0; background: rgba(3, 6, 12, .72); z-index: 150;
  display: grid; place-items: center; padding: 20px; backdrop-filter: blur(4px);
}
.modal {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line2);
  border-radius: 20px; padding: 18px; box-shadow: var(--shadow); animation: pop .2s ease;
  max-height: 86vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.loading { text-align: center; padding: 40px; color: var(--txt3); }
.spin {
  width: 26px; height: 26px; border: 3px solid rgba(255, 255, 255, .15); border-top-color: var(--cyan);
  border-radius: 50%; animation: sp .7s linear infinite; margin: 0 auto 10px;
}
@keyframes sp { to { transform: rotate(360deg); } }

.notice {
  background: rgba(34, 211, 238, .07); border: 1px solid rgba(34, 211, 238, .2);
  border-radius: 12px; padding: 10px 12px; font-size: 12.5px; color: #a5f3fc; line-height: 1.6;
}
.notice.warn { background: rgba(251, 191, 36, .08); border-color: rgba(251, 191, 36, .25); color: #fde68a; }
.notice.danger { background: rgba(248, 113, 113, .08); border-color: rgba(248, 113, 113, .25); color: #fecaca; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.tabs .tb { padding: 10px 14px; font-size: 13.5px; color: var(--txt2); cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs .tb.on { color: var(--cyan); border-bottom-color: var(--cyan); font-weight: 700; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tbl th, table.tbl td { padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--line); }
table.tbl th { color: var(--txt3); font-weight: 600; font-size: 11.5px; }
.scroll-x { overflow-x: auto; }

/* ================= iOS / 全屏 App 模式适配(1.1.5 新增) ================= */
/* 顶部刘海/灵动岛、底部 Home 横条留白,从主屏幕图标启动时不顶格、不被遮挡 */
html { height: -webkit-fill-available; }
body { min-height: 100vh; min-height: 100dvh; }
#app { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(84px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))); }
.topbar { padding-top: calc(12px + var(--safe-top, env(safe-area-inset-top, 0px))); }
.tabbar { padding-bottom: calc(6px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))); }
.chat-input { padding-bottom: calc(10px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))); }
.toast { bottom: calc(100px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))); }
/* 从主屏幕图标启动:顶部更沉浸 */
html.app-mode .topbar { background: rgba(7, 11, 20, .92); }
/* iOS:输入框字号低于 16px 会被系统自动放大整页,这里统一抬到 16px */
@supports (-webkit-touch-callout: none) {
  input, textarea, select { font-size: 16px; }
}
/* 去掉双击缩放与点击延迟 */
a, button, input, select, textarea, .tab, .opt, .tb-btn { touch-action: manipulation; }
/* 弹层底部留白(安全区) */
.modal, .sheet { padding-bottom: var(--safe-bottom, env(safe-area-inset-bottom, 0px)); }

/* ================= 客服中心 ================= */
.tabbar .tab { position: relative; }
.cs-dot {
  position: absolute; top: 1px; left: 50%; margin-left: 5px;
  background: var(--red); color: #fff; font-style: normal; font-weight: 700;
  font-size: 10px; line-height: 15px; min-width: 15px; height: 15px;
  border-radius: 999px; padding: 0 4px; text-align: center; box-shadow: 0 0 0 2px var(--bg);
}
.cs-inputbar {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 560px; margin: 0 auto;
  padding: 8px 12px calc(10px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
  background: rgba(10, 15, 26, .97); border-top: 1px solid var(--line); z-index: 30;
}
.cs-inrow { display: flex; gap: 8px; }
.cs-inrow input {
  flex: 1; background: var(--surface2); border: 1px solid var(--line2);
  border-radius: 12px; padding: 11px 12px; color: var(--txt); outline: none; min-width: 0;
}
.cs-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; max-height: 90px; overflow-y: auto; }
.cs-quick .tag { cursor: pointer; }
.cs-tip { font-size: 12px; padding: 7px 10px; border-radius: 10px; margin-bottom: 8px; line-height: 1.5; }
.cs-tip.warn { background: rgba(251, 191, 36, .12); color: var(--gold); border: 1px solid rgba(251, 191, 36, .3); }
.cs-tip.danger { background: rgba(248, 113, 113, .12); color: var(--red); border: 1px solid rgba(248, 113, 113, .32); }
.cs-acts { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; }
.tiny-btn { padding: 5px 11px !important; font-size: 12px !important; }
.bubble.other { background: var(--surface2); }
