/* style.css — 陪玩星球全站样式：CSS Variables 双主题 + 响应式（≥1200 宽屏 / 768-1200 平板 / <768 手机） */
:root {
  --primary: #2E7CF6;
  --bg: #f5f7fa; --panel: #ffffff; --text: #1f2329; --text2: #646a73;
  --border: #e5e8ef; --shadow: 0 2px 12px rgba(31,35,41,.06);
  --on: #16a34a; --busy: #f59e0b; --off: #9ca3af;
  --danger: #e5484d; --radius: 12px;
}
html[data-theme="dark"] {
  --bg: #17181c; --panel: #22242a; --text: #e8eaed; --text2: #9aa0a6;
  --border: #34363d; --shadow: 0 2px 12px rgba(0,0,0,.4);
  --primary-dim: rgba(46,124,246,.25);
}
html[data-theme="dark"] img { filter: brightness(.92); }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; transition: background .25s, color .25s; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--text2); font-size: 13px; }
.price { color: var(--primary); font-weight: 700; }
.price.xl { font-size: 28px; }

/* 顶栏 */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--panel); border-bottom: 1px solid var(--border); }
.bar-in { display: flex; align-items: center; gap: 18px; height: 60px; }
.logo { font-size: 19px; display: flex; align-items: center; gap: 6px; font-weight: 800; color: var(--primary); white-space: nowrap; }
.nav { display: flex; gap: 4px; }
.nav > a, .drop > a { padding: 6px 12px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.nav > a:hover, .drop > a:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); }
.drop { position: relative; }
.drop-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 130px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 60; }
.drop:hover .drop-menu { display: block; }
.drop-menu a { display: block; padding: 7px 12px; border-radius: 7px; font-size: 14px; }
.drop-menu a:hover { background: var(--bg); color: var(--primary); }
.search { flex: 1; display: flex; max-width: 300px; margin-left: auto; }
.search input { flex: 1; border: 1px solid var(--border); border-right: 0; border-radius: 8px 0 0 8px; padding: 7px 12px; background: var(--bg); color: var(--text); font-size: 13px; outline: none; }
.search button { border: 0; background: var(--primary); color: #fff; border-radius: 0 8px 8px 0; padding: 0 14px; cursor: pointer; }
.bar-right { display: flex; align-items: center; gap: 12px; }
.icon-btn { background: none; border: 1px solid var(--border); border-radius: 50%; width: 34px; height: 34px; cursor: pointer; font-size: 15px; }
.balance { color: var(--primary); font-weight: 700; font-size: 14px; }
.mini-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; vertical-align: -8px; }
.avatar-txt { display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; font-weight: 700; }

/* 按钮 / 表单 / 标签 */
.btn { display: inline-block; border: 0; border-radius: 9px; padding: 9px 20px; cursor: pointer; font-size: 14px; text-align: center; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.block { display: block; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font-family: inherit; }
.form input, .form select, .form textarea, .row input, .row select, .row textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px;
  background: var(--bg); color: var(--text); font-size: 14px; margin-bottom: 10px; outline: none;
}
.form input:focus, .row textarea:focus { border-color: var(--primary); }
.tag { display: inline-block; font-size: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; color: var(--text2); }
.tag.rank { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, transparent); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.tag.sandbox { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.dot { font-size: 12px; }
.dot::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; background: var(--off); }
.dot.on::before { background: var(--on); }
.dot.on { color: var(--on); }
.dot.busy::before { background: var(--busy); }
.dot.busy { color: var(--busy); }

/* 面包屑 */
.crumb { max-width: 1200px; margin: 12px auto 0; padding: 0 16px; font-size: 13px; color: var(--text2); display: flex; gap: 8px; }
.crumb a:hover { color: var(--primary); }

/* 首页 */
.hero { display: grid; grid-template-columns: 1fr 280px; gap: 16px; margin-top: 16px; }
.banner-slider { position: relative; border-radius: var(--radius); overflow: hidden; height: 260px; box-shadow: var(--shadow); }
.banner-item { display: none; position: absolute; inset: 0; }
.banner-item.on { display: block; animation: fade .5s; }
.banner-item img { width: 100%; height: 100%; object-fit: cover; }
.banner-cap { position: absolute; left: 20px; bottom: 16px; color: #fff; font-size: 20px; font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.banner-dots { position: absolute; right: 16px; bottom: 14px; display: flex; gap: 6px; }
.banner-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; }
.banner-dots i.on { background: #fff; }
@keyframes fade { from { opacity: .3 } to { opacity: 1 } }
.acts { background: var(--panel); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.acts h3 { font-size: 15px; margin-bottom: 10px; }
.act-item { display: flex; gap: 10px; align-items: center; padding: 9px; border-radius: 9px; margin-bottom: 6px; background: var(--bg); }
.act-item:hover { outline: 1px solid var(--primary); }
.act-icon { font-size: 22px; }
.act-item b { font-size: 14px; display: block; }
.act-item i { font-style: normal; font-size: 12px; color: var(--text2); }
.sec { margin-top: 26px; }
.sec-title { font-size: 19px; margin-bottom: 14px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; }
.more { font-size: 13px; color: var(--text2); }
.game-nav { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.game-item { background: var(--panel); border-radius: var(--radius); text-align: center; padding: 16px 8px; box-shadow: var(--shadow); transition: transform .15s; }
.game-item:hover { transform: translateY(-3px); }
.game-item img { width: 52px; height: 52px; border-radius: 12px; }
.game-item span { display: block; margin-top: 8px; font-size: 14px; }
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.p-card { background: var(--panel); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s; }
.p-card:hover { transform: translateY(-3px); }
.p-card a { display: block; padding: 14px; }
.p-top { display: flex; gap: 10px; align-items: center; }
.p-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.p-avatar.lg { width: 72px; height: 72px; }
.p-info b { font-size: 15px; margin-right: 4px; }
.p-info .tag { margin-right: 2px; }
.p-intro { font-size: 13px; color: var(--text2); margin-top: 8px; min-height: 38px; }
.p-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }

/* 列表页 */
.list-layout { display: grid; grid-template-columns: 220px 1fr; gap: 16px; margin: 16px 0 40px; }
.filter-side { background: var(--panel); border-radius: var(--radius); padding: 14px; height: fit-content; box-shadow: var(--shadow); }
.f-group { margin-bottom: 14px; }
.f-group h4 { font-size: 13px; color: var(--text2); margin-bottom: 8px; }
.chip { display: inline-block; font-size: 13px; padding: 4px 11px; border-radius: 14px; background: var(--bg); margin: 0 6px 6px 0; border: 1px solid transparent; cursor: pointer; }
.chip:hover, .chip.on { color: var(--primary); border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.list-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.list-bar select { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; background: var(--panel); color: var(--text); }

/* 详情页 */
.detail { display: grid; grid-template-columns: 340px 1fr; gap: 16px; margin: 16px 0 40px; }
.panel { background: var(--panel); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.panel h2 { font-size: 16px; margin-bottom: 12px; }
.d-head { display: flex; gap: 12px; align-items: center; }
.d-head h1 { font-size: 20px; }
.d-intro { font-size: 14px; color: var(--text2); margin: 12px 0; }
.d-voice { width: 100%; margin-bottom: 10px; }
.d-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.d-photos img { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; }
.d-stats { display: flex; gap: 18px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 13px; color: var(--text2); }
.d-actions { display: flex; gap: 8px; margin-top: 10px; }
.svc-list { display: grid; gap: 8px; }
.svc-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; cursor: pointer; }
.svc-item.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, transparent); }
.svc-name { flex: 1; font-size: 14px; }
.order-form { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.row > label:first-child { width: 64px; font-size: 13px; color: var(--text2); flex-shrink: 0; }
.row select, .row input, .row textarea { margin-bottom: 0; }
.row textarea { flex: 1; }
.inline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text2); }
.sm-note { margin-top: 10px; font-size: 12px; }
.art-list { list-style: none; }
.art-list li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.art-list a:hover { color: var(--primary); }

/* 个人中心 / 工作台 */
.u-layout { display: grid; grid-template-columns: 230px 1fr; gap: 16px; margin: 16px 0 40px; }
.u-side { height: fit-content; }
.u-me { display: flex; gap: 10px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.u-nav a { display: block; padding: 10px 12px; border-radius: 9px; font-size: 14px; cursor: pointer; }
.u-nav a:hover, .u-nav a.on { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card { background: var(--bg); border-radius: 10px; padding: 14px; text-align: center; }
.stat-card b { display: block; font-size: 22px; color: var(--primary); }
.stat-card span { font-size: 12px; color: var(--text2); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 9px 8px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.table th { color: var(--text2); font-weight: 500; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { padding: 6px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; background: var(--bg); }
.tab.on { background: var(--primary); color: #fff; }
.order-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.order-card .oc-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.st { font-size: 12px; padding: 1px 8px; border-radius: 6px; }
.st.pending_pay { background: #fef3c7; color: #92400e; }
.st.pending_accept { background: #dbeafe; color: #1d4ed8; }
.st.ongoing { background: #dcfce7; color: #15803d; }
.st.done { background: var(--bg); color: var(--text2); }
.st.cancelled { background: var(--bg); color: var(--off); }
.st.aftersale { background: #fee2e2; color: #b91c1c; }

/* 聊天 */
.chat-layout { display: grid; grid-template-columns: 260px 1fr; gap: 0; padding: 0; overflow: hidden; height: 620px; }
.chat-side { border-right: 1px solid var(--border); overflow-y: auto; }
.conv-item { padding: 13px 14px; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; gap: 10px; align-items: center; }
.conv-item.on, .conv-item:hover { background: var(--bg); }
.conv-item .badge { background: var(--danger); color: #fff; font-size: 11px; border-radius: 9px; padding: 0 6px; margin-left: auto; }
.chat-main { display: flex; flex-direction: column; }
.chat-head { padding: 13px 16px; border-bottom: 1px solid var(--border); font-weight: 700; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 70%; padding: 9px 13px; border-radius: 12px; font-size: 14px; background: var(--bg); align-self: flex-start; }
.msg.me { background: var(--primary); color: #fff; align-self: flex-end; }
.msg.sys { align-self: center; background: transparent; color: var(--text2); font-size: 12px; }
.msg time { display: block; font-size: 11px; opacity: .6; margin-top: 3px; }
.chat-input { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; border: 1px solid var(--border); border-radius: 9px; padding: 10px 13px; background: var(--bg); color: var(--text); outline: none; }

/* 认证/支付/其他 */
.auth-box { max-width: 400px; margin: 40px auto; }
.pay-box { max-width: 460px; margin: 40px auto; text-align: center; }
.qr-box { margin: 18px auto; padding: 18px; border: 1px solid var(--border); border-radius: 12px; display: inline-block; }
.qr-box img { width: 180px; }
.u-main .form { max-width: 420px; }
.nf-box { text-align: center; padding: 60px 20px; }
.nf-box h1 { font-size: 60px; color: var(--primary); }
.rank-flow { font-size: 13px; }
.game-hero { display: flex; gap: 16px; align-items: center; }
.game-icon { width: 64px; height: 64px; border-radius: 14px; }
.article h1 { font-size: 22px; margin-bottom: 6px; }
.art-content { margin-top: 14px; line-height: 1.9; }

/* 页脚 / 提示 */
.footer { margin-top: 40px; border-top: 1px solid var(--border); padding: 24px 0; color: var(--text2); font-size: 13px; text-align: center; }
.toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.78); color: #fff; padding: 10px 20px; border-radius: 10px; font-size: 14px; display: none; z-index: 99; max-width: 80%; }

/* ============ 商城 ============ */
.g-cover { height: 150px; overflow: hidden; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.g-cover img { width: 100%; height: 100%; object-fit: cover; }
.g-cover.lg { height: 220px; border-radius: 10px; }
.g-ph { font-size: 42px; opacity: .55; }
.g-ph.sm { font-size: 26px; }
.cart-badge { color: var(--primary); font-size: 12px; }
.cart-mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 70; }
.cart-mask.open { display: block; }
.cart-drawer { position: fixed; top: 0; right: -360px; width: 340px; max-width: 90vw; height: 100vh; z-index: 75; border-radius: 0; transition: right .25s; display: flex; flex-direction: column; }
.cart-drawer.open { right: 0; }
.cart-drawer h2 { display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
.cart-item { display: flex; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); }
#cartBox { flex: 1; overflow-y: auto; margin: 10px 0; }
.s-inp { border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; background: var(--panel); color: var(--text); outline: none; font-size: 13px; }

/* ============ 响应式适配 ============ */
@media (max-width: 1199px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .game-nav { grid-template-columns: repeat(4, 1fr); }
  .search { max-width: 200px; }
}
@media (max-width: 767px) {
  .bar-in { height: auto; flex-wrap: wrap; padding: 10px 0; gap: 10px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .search { order: 2; max-width: none; flex: 1; }
  .hero, .list-layout, .detail, .u-layout { grid-template-columns: 1fr; }
  .filter-side { display: none; }
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .game-nav { grid-template-columns: repeat(3, 1fr); }
  .banner-slider { height: 170px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .chat-layout { height: calc(100vh - 160px); grid-template-columns: 1fr; }
  .chat-side { display: none; }
  .chat-layout.expanded .chat-side { display: block; position: absolute; z-index: 5; height: 100%; background: var(--panel); }
  .table { font-size: 12px; }
  .row { flex-direction: column; align-items: stretch; }
  .row > label:first-child { width: auto; }
}
