/* ==========================================================
   玩吧小游戏 - 前台样式
   ========================================================== */
:root {
    --bg: #0e1120;
    --bg-soft: #151a2e;
    --panel: #1a2036;
    --panel-2: #212843;
    --line: rgba(255, 255, 255, .08);
    --text: #eef1f9;
    --muted: #98a2bd;
    --primary: #ff6b1a;
    --primary-2: #ff3d68;
    --cyan: #35d0ff;
    --radius: 14px;
    --shadow: 0 18px 40px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    background: radial-gradient(1200px 600px at 15% -10%, rgba(255, 107, 26, .16), transparent 60%),
                radial-gradient(900px 500px at 90% 0%, rgba(53, 208, 255, .12), transparent 55%),
                var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
input, button, textarea { font-family: inherit; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ---------------- 顶栏 ---------------- */
.hdr {
    position: sticky; top: 0; z-index: 60;
    background: rgba(14, 17, 32, .82);
    backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--line);
}
.hdr-in { display: flex; align-items: center; gap: 18px; height: 68px; }

.logo { display: flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 800; letter-spacing: .5px; flex-shrink: 0; }
.logo-mark {
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    font-size: 17px; box-shadow: 0 6px 18px rgba(255, 61, 104, .35);
}
.logo em { font-style: normal; background: linear-gradient(90deg, #ffb347, #ff5f6d); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
    white-space: nowrap; padding: 7px 12px; border-radius: 9px; color: var(--muted);
    font-size: 13.5px; transition: .18s;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav a.on { color: #fff; background: linear-gradient(135deg, rgba(255, 107, 26, .9), rgba(255, 61, 104, .9)); box-shadow: 0 6px 16px rgba(255, 61, 104, .25); }

.search { display: flex; align-items: center; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; height: 38px; flex-shrink: 0; }
.search input { width: 150px; background: none; border: 0; outline: none; color: var(--text); padding: 0 12px; font-size: 13px; }
.search input::placeholder { color: #6b7492; }
.search button { height: 100%; padding: 0 14px; border: 0; cursor: pointer; background: rgba(255, 255, 255, .08); color: var(--text); font-size: 13px; }
.search button:hover { background: var(--primary); }

.hdr-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.avatar {
    width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(135deg, #3b4a7a, #2a3355); font-size: 13px; font-weight: 700; color: #cfd8f5;
}
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); }
.user-chip span { font-size: 13px; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 38px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
    font-size: 13.5px; font-weight: 600; cursor: pointer; transition: .18s; white-space: nowrap;
}
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 8px 22px rgba(255, 61, 104, .3); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(255, 61, 104, .4); }
.btn.ghost { border-color: var(--line); color: #dfe5f7; background: rgba(255, 255, 255, .04); }
.btn.ghost:hover { background: rgba(255, 255, 255, .1); }
.btn.lg { height: 46px; padding: 0 30px; font-size: 15px; border-radius: 12px; }
.btn.sm { height: 32px; padding: 0 13px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }

/* ---------------- 公告 ---------------- */
.notice { display: flex; align-items: center; gap: 10px; margin: 22px 0 4px; padding: 10px 16px; border-radius: 12px; background: rgba(255, 107, 26, .09); border: 1px solid rgba(255, 107, 26, .22); color: #ffcfae; font-size: 13px; }
.notice b { color: var(--primary); }

/* ---------------- 首页 Hero ---------------- */
.hero { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; margin: 20px 0 8px; }
.hero-main {
    position: relative; overflow: hidden; border-radius: 20px; padding: 34px 34px 30px;
    background: linear-gradient(120deg, #2a1730 0%, #1c2140 55%, #182a3f 100%);
    border: 1px solid var(--line); min-height: 250px; display: flex; flex-direction: column; justify-content: center;
}
.hero-main::after {
    content: ""; position: absolute; right: -70px; top: -70px; width: 260px; height: 260px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 61, 104, .45), transparent 65%); filter: blur(6px);
}
.hero-kicker { font-size: 12px; letter-spacing: 3px; color: var(--cyan); font-weight: 700; margin-bottom: 10px; }
.hero-main h1 { margin: 0 0 10px; font-size: 34px; line-height: 1.25; letter-spacing: .5px; }
.hero-main h1 span { background: linear-gradient(90deg, #ffb347, #ff5f6d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-main p { margin: 0 0 22px; color: #b7c0d8; max-width: 420px; font-size: 13.5px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-side { display: grid; grid-template-rows: 1fr 1fr; gap: 16px; }
.hero-tile {
    border-radius: 18px; border: 1px solid var(--line); padding: 18px 20px; display: flex; align-items: center; gap: 14px;
    background: linear-gradient(120deg, rgba(53, 208, 255, .12), rgba(26, 32, 54, .9));
    transition: .2s;
}
.hero-tile:nth-child(2) { background: linear-gradient(120deg, rgba(255, 107, 26, .14), rgba(26, 32, 54, .9)); }
.hero-tile:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .2); }
.hero-tile .ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; background: rgba(255, 255, 255, .08); }
.hero-tile h4 { margin: 0; font-size: 15px; }
.hero-tile p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

/* ---------------- 区块 ---------------- */
.sec { margin-top: 34px; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.sec-head h2 { margin: 0; font-size: 19px; letter-spacing: .3px; display: flex; align-items: center; gap: 9px; }
.sec-head h2::before { content: ""; width: 4px; height: 17px; border-radius: 3px; background: linear-gradient(180deg, var(--primary), var(--primary-2)); }
.sec-head p { margin: 3px 0 0 13px; color: var(--muted); font-size: 12.5px; }
.sec-more { color: var(--muted); font-size: 13px; }
.sec-more:hover { color: var(--primary); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(166px, 1fr)); gap: 16px; }

/* ---------------- 游戏卡片 ---------------- */
.card {
    display: block; border-radius: var(--radius); overflow: hidden; background: var(--panel);
    border: 1px solid var(--line); transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(255, 107, 26, .4); }
.card-cover { position: relative; aspect-ratio: 1 / 1; background: #0b0e18; overflow: hidden; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card:hover .card-cover img { transform: scale(1.06); }
.badge { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 7px; font-size: 10.5px; font-weight: 800; letter-spacing: .6px; }
.badge-hot { background: linear-gradient(135deg, #ff8a3d, #ff3d68); color: #fff; box-shadow: 0 4px 12px rgba(255, 61, 104, .45); }
.card-plays {
    position: absolute; bottom: 8px; right: 8px; padding: 2px 8px; border-radius: 7px; font-size: 11px;
    background: rgba(0, 0, 0, .6); color: #fff; backdrop-filter: blur(4px);
}
.card-body { padding: 10px 12px 12px; }
.card-body h3 { margin: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-body span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------------- 横向推荐 ---------------- */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.rail::-webkit-scrollbar { height: 6px; }
.rail::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 6px; }
.feat { position: relative; border-radius: 16px; overflow: hidden; height: 168px; border: 1px solid var(--line); }
.feat img { width: 100%; height: 100%; object-fit: cover; }
.feat-info {
    position: absolute; inset: auto 0 0 0; padding: 26px 16px 14px;
    background: linear-gradient(180deg, transparent, rgba(6, 8, 16, .92));
}
.feat-info h3 { margin: 0; font-size: 15px; }
.feat-info p { margin: 2px 0 0; font-size: 12px; color: #b9c2da; display: flex; gap: 10px; }

/* ---------------- 详情页 ---------------- */
.detail { display: grid; grid-template-columns: 260px 1fr; gap: 26px; margin: 28px 0 0; }
.detail-cover { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); aspect-ratio: 1/1; background: #0b0e18; }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-info h1 { margin: 4px 0 10px; font-size: 27px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tag { padding: 4px 11px; border-radius: 8px; font-size: 12px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); color: #c9d2e8; }
.tag.orange { background: rgba(255, 107, 26, .14); border-color: rgba(255, 107, 26, .3); color: #ffb083; }
.detail-intro { color: #b3bcd4; font-size: 13.5px; max-width: 640px; margin-bottom: 20px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.stat-row { display: flex; gap: 22px; margin-top: 20px; font-size: 12.5px; color: var(--muted); }
.stat-row b { color: #fff; font-size: 15px; margin-right: 4px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; margin-top: 26px; }
.panel h2 { margin: 0 0 12px; font-size: 16px; }
.panel p { color: #b3bcd4; font-size: 13.5px; margin: 0 0 10px; }
.panel ul { margin: 0; padding-left: 18px; color: #b3bcd4; font-size: 13.5px; }

/* ---------------- 播放页 ---------------- */
body.play-body { background: #06070d; overflow: hidden; }
.play-top {
    height: 54px; display: flex; align-items: center; gap: 14px; padding: 0 16px;
    background: #0d1020; border-bottom: 1px solid var(--line); position: relative; z-index: 5;
}
.play-top .t { font-size: 14px; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play-stage { position: relative; width: 100%; height: calc(100vh - 54px); background: #000; }
.play-stage iframe { width: 100%; height: 100%; border: 0; display: block; }
.watermark {
    position: absolute; right: 14px; bottom: 12px; z-index: 4; pointer-events: none;
    font-size: 12px; color: rgba(255, 255, 255, .16); letter-spacing: 1px; user-select: none;
}
.play-tip { position: absolute; inset: 0; display: grid; place-items: center; color: #8b93ad; text-align: center; padding: 24px; }

/* ---------------- 用户中心 ---------------- */
.auth-wrap { max-width: 420px; margin: 60px auto; }
.auth-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 32px 30px; box-shadow: var(--shadow); }
.auth-card h1 { margin: 0 0 6px; font-size: 21px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
.field input {
    width: 100%; height: 42px; border-radius: 10px; border: 1px solid var(--line);
    background: rgba(255, 255, 255, .05); color: var(--text); padding: 0 14px; font-size: 14px; outline: none; transition: .18s;
}
.field input:focus { border-color: rgba(255, 107, 26, .7); box-shadow: 0 0 0 3px rgba(255, 107, 26, .13); }
.auth-foot { margin-top: 18px; text-align: center; font-size: 13px; color: var(--muted); }
.auth-foot a { color: var(--primary); }

.uc-head { display: flex; align-items: center; gap: 16px; margin: 30px 0 24px; }
.uc-head .avatar { width: 60px; height: 60px; font-size: 22px; }
.uc-head h1 { margin: 0; font-size: 22px; }
.uc-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs a { padding: 10px 16px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.on { color: #fff; border-color: var(--primary); }

/* ---------------- 提示 ---------------- */
.flash { padding: 12px 16px; border-radius: 11px; font-size: 13px; margin-bottom: 16px; }
.flash.error { background: rgba(255, 77, 79, .12); border: 1px solid rgba(255, 77, 79, .35); color: #ffa39e; }
.flash.success { background: rgba(82, 196, 26, .12); border: 1px solid rgba(82, 196, 26, .32); color: #b7eb8f; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-ico { font-size: 42px; margin-bottom: 10px; opacity: .8; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 34px 0 10px; flex-wrap: wrap; }
.pg { min-width: 36px; height: 36px; padding: 0 12px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--panel); border: 1px solid var(--line); color: #c7cfe4; font-size: 13px; }
.pg:hover { border-color: rgba(255, 107, 26, .5); color: #fff; }
.pg.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-color: transparent; color: #fff; font-weight: 700; }
.pg-dot { color: var(--muted); padding: 0 2px; }

/* ---------------- 页脚 ---------------- */
.foot { margin-top: 60px; border-top: 1px solid var(--line); padding: 26px 0 34px; color: var(--muted); font-size: 12.5px; }
.foot-in { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot a:hover { color: #fff; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1024px) {
    .hero { grid-template-columns: 1fr; }
    .hero-side { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
    .detail { grid-template-columns: 200px 1fr; }
}
@media (max-width: 820px) {
    .hdr-in { height: auto; flex-wrap: wrap; padding: 10px 0; gap: 10px; }
    .nav { order: 3; width: 100%; flex: 1 0 100%; }
    .search { flex: 1; }
    .search input { width: 100%; }
    .detail { grid-template-columns: 1fr; }
    .detail-cover { max-width: 260px; }
    .hero-main { padding: 26px 22px; }
    .hero-main h1 { font-size: 26px; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
    .hero-side { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
    .detail-info h1 { font-size: 21px; }
    .play-top { height: 48px; }
    .play-stage { height: calc(100vh - 48px); }
}
