/* ======================================
   小游戏中心 - 全局样式
   深色 + 渐变 + 玻璃拟态
   ====================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-dark: #0a0a1a;
    --bg-card: rgba(255, 255, 255, 0.06);
    --bg-card-hover: rgba(255, 255, 255, 0.1);
    --border-glass: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --btn-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --btn-danger: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

html, body {
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    background: var(--bg-dark);
    overflow-x: hidden;
}

/* 背景装饰 */
.bg-decor {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--bg-dark);
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: #667eea;
    top: -150px;
    left: -150px;
    animation: float 12s ease-in-out infinite;
}

.orb-2 {
    width: 450px;
    height: 450px;
    background: #f093fb;
    bottom: -150px;
    right: -100px;
    animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(40px, -30px); }
}

.grid-lines {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

/* 容器 */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}

/* Hero 头部 */
.hero {
    text-align: center;
    padding: 40px 20px 30px;
}

.badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.hero-title .icon {
    -webkit-text-fill-color: initial;
    margin-right: 8px;
}

.hero-sub {
    font-size: 15px;
    color: var(--text-secondary);
}

/* 游戏列表 */
.game-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 20px;
}

@media (min-width: 600px) {
    .game-list { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

.game-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.25s ease;
    backdrop-filter: blur(14px);
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    border-radius: 18px;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.3);
    background: var(--bg-card-hover);
}

.game-card .game-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.game-card .game-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-card .fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--accent-gradient);
}

.game-card .game-info {
    text-align: center;
    z-index: 1;
}

.game-card .game-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
    word-break: break-all;
}

.game-card .game-desc {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-width: 140px;
}

.game-card .play-arrow {
    position: absolute;
    right: 12px;
    bottom: 10px;
    font-size: 12px;
    color: var(--text-muted);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.game-card:hover .play-arrow { opacity: 1; }

/* 空状态 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state .admin-link {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 24px;
    border-radius: 24px;
    background: var(--btn-primary);
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-glass);
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.footer a:hover { color: var(--text-secondary); }

/* ==============================
   后台管理样式
   ============================== */

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-glass);
}

.admin-title {
    font-size: 20px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-nav {
    display: flex;
    gap: 10px;
}

.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    backdrop-filter: blur(14px);
}

.admin-card h2 {
    font-size: 17px;
    margin-bottom: 18px;
    color: var(--text-primary);
    font-weight: 600;
}

/* 登录框 */
.login-box {
    max-width: 380px;
    margin: 80px auto 0;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 36px 28px;
    backdrop-filter: blur(18px);
    text-align: center;
}

.login-title {
    font-size: 22px;
    margin-bottom: 24px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-footer {
    margin-top: 20px;
}

.login-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
}

/* 表单 */
.form-group {
    margin-bottom: 16px;
    flex: 1;
    min-width: 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.form-group .req {
    color: #f45c43;
}

.form-input {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.form-input:focus {
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
    color: white;
}

.btn-primary {
    background: var(--btn-primary);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-danger {
    background: var(--btn-danger);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(235, 51, 73, 0.4);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.btn-block {
    display: block;
    width: 100%;
    padding: 12px;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 6px;
}

/* 提示条 */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background: rgba(40, 167, 69, 0.15);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #28a745;
}

.alert-error {
    background: rgba(235, 51, 73, 0.15);
    border: 1px solid rgba(235, 51, 73, 0.3);
    color: #f45c43;
}

/* 表格 */
.admin-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table th,
.admin-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
    white-space: nowrap;
}

.admin-table thead th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table a {
    color: var(--text-secondary);
    text-decoration: none;
    max-width: 200px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-table a:hover { color: var(--text-primary); }

.mini-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}

.mini-icon-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent-gradient);
    font-weight: 700;
    font-size: 14px;
}

.ellipsis {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

/* 响应式 */
@media (max-width: 480px) {
    .hero-title { font-size: 32px; }
    .game-list { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .game-card { padding: 16px 8px; }
    .admin-header { flex-direction: column; gap: 12px; text-align: center; }
    .admin-card { padding: 18px; }
}

/* ==============================
   前端登录页样式
   ============================== */
.site-login-box {
    max-width: 360px;
}

/* ==============================
   二维码分享弹窗
   ============================== */
.qr-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.qr-modal-box {
    position: relative;
    width: 100%;
    max-width: 340px;
    background: rgba(20, 20, 35, 0.95);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 28px 22px 22px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: qr-pop 0.25s ease;
}

@keyframes qr-pop {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.qr-close {
    position: absolute;
    top: 10px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}
.qr-close:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }

.qr-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    word-break: break-all;
    padding: 0 20px;
}

.qr-image-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
    background: #fff;
    padding: 12px;
    border-radius: 14px;
    width: 264px;
    margin-left: auto;
    margin-right: auto;
}

.qr-image-wrap img {
    display: block;
    width: 240px;
    height: 240px;
    border-radius: 6px;
}

.qr-url {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 14px;
    word-break: break-all;
    max-height: 48px;
    overflow: auto;
    padding: 0 4px;
}

.qr-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 10px;
}

.qr-actions .btn {
    flex: 1;
    min-width: 100px;
    text-decoration: none;
}

.qr-tip {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

