:root {
    --bg: #f4efe7;
    --paper: rgba(255, 251, 245, 0.92);
    --ink: #1f2a2c;
    --muted: #5f6b6d;
    --line: rgba(31, 42, 44, 0.12);
    --accent: #0f766e;
    --accent-2: #d97706;
    --danger: #b42318;
    --shadow: 0 20px 60px rgba(33, 28, 22, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(217, 119, 6, 0.12), transparent 28%),
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.14), transparent 30%),
        linear-gradient(180deg, #f8f2ea 0%, var(--bg) 100%);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 48px;
}

.wide-shell {
    width: calc(100% - 24px);
}

.auth-shell {
    width: 100%;
    min-height: 100vh;
    padding: 0;
}

.topbar,
.card,
.table-wrap,
.detail-grid,
.login-card,
.launch-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.topbar {
    padding: 24px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.topbar nav {
    display: flex;
    gap: 16px;
    font-weight: 600;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--accent-2);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 12px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

.hero,
.toolbar,
.actions,
.pagination-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.hero {
    margin-bottom: 20px;
}

.hero.compact {
    margin-bottom: 8px;
}

.hero p,
.hint,
.empty,
.meta {
    color: var(--muted);
}

.list-meta {
    margin-bottom: 16px;
}

.table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    min-width: 1180px;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

tr:last-child td {
    border-bottom: 0;
}

.col-icon {
    width: 96px;
    min-width: 96px;
}

.col-title {
    min-width: 240px;
}

.game-icon {
    display: block;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
}

.game-icon-wrap {
    position: relative;
    width: 64px;
    height: 64px;
}

.icon-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(15, 118, 110, 0.08);
    color: var(--muted);
    font-size: 12px;
    border: 1px dashed var(--line);
}

.icon-fallback {
    display: none;
}

.card,
.login-card,
.launch-card,
.detail-grid {
    padding: 24px;
}

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

.detail-item {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--line);
}

.detail-item dt {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
}

.detail-item dd {
    margin: 0;
    word-break: break-word;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 999px;
    border: 0;
    background: linear-gradient(135deg, var(--accent) 0%, #115e59 100%);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.button.secondary {
    background: #ffffff;
    color: var(--ink);
    border: 1px solid var(--line);
}

.button.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.table-actions {
    min-width: 240px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination-wrap {
    margin-top: 18px;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.page-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    font-weight: 700;
}

.page-chip.active {
    background: linear-gradient(135deg, var(--accent) 0%, #115e59 100%);
    color: #fff;
    border-color: transparent;
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-page .login-wrap {
    min-height: 100vh;
}

.login-card {
    width: min(460px, 100%);
}

label {
    display: block;
    margin-bottom: 14px;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="search"],
select {
    width: 100%;
    margin-top: 8px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    font: inherit;
}

.error {
    margin-bottom: 16px;
    color: var(--danger);
    font-weight: 700;
}

.success-message {
    margin-bottom: 16px;
    color: var(--accent);
    font-weight: 700;
}

.edit-card {
    margin-bottom: 20px;
}

.edit-form {
    margin-top: 12px;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(15, 118, 110, 0.1);
    color: var(--accent);
    font-weight: 700;
}

.iframe-wrap {
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: #fff;
}

.iframe-wrap iframe {
    display: block;
    width: 100%;
    height: 80vh;
    border: 0;
}

@media (max-width: 760px) {
    .page-shell {
        width: min(100% - 20px, 1180px);
        padding-top: 20px;
    }

    .wide-shell {
        width: calc(100% - 12px);
    }

    .auth-shell {
        width: 100%;
        padding: 0;
    }

    .topbar {
        padding: 20px;
    }

    table {
        min-width: 980px;
    }
}

.toolbar select,
.toolbar input[type="search"] {
    min-width: 180px;
    width: auto;
}