/* ==========================================================================
   DP台球 · 运营管理控制台
   无第三方依赖，纯手写样式，随 Laravel public 目录直出
   ========================================================================== */

:root {
    --brand: #12915f;
    --brand-dark: #0b6b46;
    --brand-soft: #e6f5ee;
    --brand-line: #bfe3d2;

    --ink: #0f172a;
    --text: #1f2937;
    --muted: #64748b;
    --faint: #94a3b8;

    --bg: #f4f6f9;
    --surface: #ffffff;
    --line: #e4e9f0;
    --line-soft: #eef2f7;

    --ok: #12915f;
    --ok-bg: #e7f6ef;
    --warn: #b45309;
    --warn-bg: #fdf4e3;
    --danger: #c0392b;
    --danger-bg: #fdecea;
    --info: #1d5fbf;
    --info-bg: #eaf1fd;
    --neutral: #64748b;
    --neutral-bg: #eef1f5;

    --gold: #b08a3e;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, .08);
    --shadow-lg: 0 18px 48px rgba(15, 23, 42, .18);

    --sidebar-w: 226px;
    --topbar-h: 62px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #b6c2d2; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================ 登录页 ============================ */

.login-page {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background:
        radial-gradient(900px 520px at 12% -10%, rgba(18, 145, 95, .18), transparent 60%),
        radial-gradient(760px 460px at 100% 110%, rgba(176, 138, 62, .14), transparent 62%),
        #0d1b17;
    position: relative;
    overflow: hidden;
}

.login-page::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 404px;
    background: #fff;
    border-radius: 18px;
    padding: 38px 36px 32px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .38);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.login-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand) 0%, #0b6b46 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: .5px;
    flex: none;
    box-shadow: 0 6px 16px rgba(18, 145, 95, .32);
}

.login-brand h1 {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: .2px;
}

.login-brand p {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--faint);
}

.login-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    margin: 4px 0 4px;
}

.login-sub {
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 22px;
}

.login-field { margin-bottom: 15px; }

.login-field label {
    display: block;
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 7px;
    font-weight: 500;
}

.login-field input {
    width: 100%;
    height: 44px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcfe;
    outline: none;
    transition: border-color .16s, box-shadow .16s, background .16s;
}

.login-field input:focus {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(18, 145, 95, .12);
}

.login-submit {
    width: 100%;
    height: 44px;
    margin-top: 8px;
    border: none;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    font-size: 14.5px;
    cursor: pointer;
    transition: background .16s, transform .06s;
}

.login-submit:hover { background: var(--brand-dark); }
.login-submit:active { transform: translateY(1px); }
.login-submit:disabled { background: #9fb8ae; cursor: not-allowed; }

.login-error {
    display: none;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 9px;
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 13px;
    line-height: 1.5;
}

.login-error.show { display: block; }

.login-foot {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
    font-size: 12px;
    color: var(--faint);
    line-height: 1.7;
}

/* ============================ 整体布局 ============================ */

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    flex: none;
    background: #101a17;
    color: #cbd5d1;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
}

.sidebar-brand {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    flex: none;
}

.sidebar-brand .logo {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--brand) 0%, #0b6b46 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex: none;
}

.sidebar-brand .name {
    font-size: 14.5px;
    font-weight: 600;
    color: #fff;
    letter-spacing: .3px;
}

.sidebar-brand .name span {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #7b8d87;
    letter-spacing: .6px;
    margin-top: 1px;
}

.nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px 20px;
}

.nav-group-title {
    font-size: 11px;
    letter-spacing: 1.2px;
    color: #5f746d;
    padding: 14px 10px 7px;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 12px;
    border-radius: 9px;
    color: #b6c4bf;
    cursor: pointer;
    font-size: 13.5px;
    position: relative;
    transition: background .14s, color .14s;
    user-select: none;
}

.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.nav-item.active {
    background: rgba(18, 145, 95, .2);
    color: #fff;
    font-weight: 500;
}

.nav-item.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--brand);
}

.nav-item .ico {
    width: 17px;
    height: 17px;
    flex: none;
    opacity: .9;
}

.nav-item .badge-dot {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.sidebar-foot {
    padding: 12px 16px 14px;
    border-top: 1px solid rgba(255, 255, 255, .07);
    font-size: 11.5px;
    color: #61756e;
    line-height: 1.7;
    flex: none;
}

.sidebar-foot b { color: #93a7a0; font-weight: 500; }

.main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 22px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--faint);
    min-width: 0;
}

.crumb b {
    color: var(--ink);
    font-weight: 600;
    font-size: 14.5px;
}

.crumb .sep { color: #cbd5e1; }

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .14s, color .14s, border-color .14s;
}

.icon-btn:hover { background: #f6f8fa; color: var(--ink); border-color: #d3dbe6; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 10px 4px 5px;
    border-radius: 100px;
    cursor: pointer;
    transition: background .14s;
    position: relative;
}

.user-chip:hover { background: #f5f7fa; }

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #12915f, #0b6b46);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 600;
    flex: none;
}

.user-chip .uname {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu {
    position: absolute;
    right: 0;
    top: 46px;
    min-width: 186px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 11px;
    box-shadow: var(--shadow-md);
    padding: 6px;
    display: none;
    z-index: 50;
}

.user-menu.open { display: block; }

.user-menu .meta {
    padding: 8px 10px 10px;
    border-bottom: 1px solid var(--line-soft);
    margin-bottom: 4px;
}

.user-menu .meta .n { font-size: 13px; font-weight: 600; color: var(--ink); }
.user-menu .meta .r { font-size: 11.5px; color: var(--faint); margin-top: 2px; }

.user-menu button {
    width: 100%;
    text-align: left;
    padding: 9px 10px;
    border: none;
    background: transparent;
    border-radius: 7px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
}

.user-menu button:hover { background: #f5f7fa; }
.user-menu button.danger { color: var(--danger); }
.user-menu button.danger:hover { background: var(--danger-bg); }

.content {
    padding: 22px 22px 44px;
    flex: 1;
    min-width: 0;
}

.page-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 19px;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
    letter-spacing: .2px;
}

.page-desc {
    font-size: 13px;
    color: var(--muted);
    margin: 4px 0 0;
}

.page-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ============================ 组件 ============================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background .14s, border-color .14s, color .14s, box-shadow .14s;
}

.btn:hover { background: #f7f9fb; border-color: #d4dce6; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn.primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

.btn.danger {
    background: #fff;
    border-color: #f0c8c3;
    color: var(--danger);
}

.btn.danger:hover { background: var(--danger-bg); border-color: #e5b0a9; }

.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: #eef2f7; color: var(--ink); }

.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.block { width: 100%; }

.btn-link {
    border: none;
    background: none;
    color: var(--brand);
    cursor: pointer;
    padding: 0;
    font-size: 13px;
}

.btn-link:hover { color: var(--brand-dark); text-decoration: underline; }
.btn-link.danger { color: var(--danger); }
.btn-link.danger:hover { color: #9c2d21; }
.btn-link:disabled { color: var(--faint); cursor: not-allowed; text-decoration: none; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-head h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.card-head .sub { font-size: 12.5px; color: var(--faint); }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.card-body { padding: 16px 18px; }
.card-body.tight { padding: 0; }

/* 统计卡 */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 15px 16px 14px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat::after {
    content: "";
    position: absolute;
    right: -26px;
    top: -26px;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: var(--brand-soft);
    opacity: .55;
}

.stat .label {
    font-size: 12.5px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat .value {
    font-size: 25px;
    font-weight: 650;
    color: var(--ink);
    letter-spacing: -.4px;
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.stat .value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }

.stat .foot {
    font-size: 12px;
    color: var(--faint);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat .foot em { font-style: normal; color: var(--brand); font-weight: 600; }
.stat .foot em.warn { color: var(--warn); }

/* 筛选工具条 */

.toolbar {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-soft);
    background: #fcfdfe;
    border-radius: var(--radius) var(--radius) 0 0;
}

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.field.grow { flex: 1; min-width: 190px; }

.input, .select {
    height: 34px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    outline: none;
    font-size: 13px;
    min-width: 132px;
    transition: border-color .14s, box-shadow .14s;
    color: var(--text);
}

.input:focus, .select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(18, 145, 95, .1);
}

.input::placeholder { color: #b0bccb; }

.select {
    appearance: none;
    padding-right: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}

.toolbar .spacer { flex: 1; }

/* 表格 */

.table-wrap { overflow-x: auto; }

table.data {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

table.data thead th {
    background: #f8fafc;
    color: var(--muted);
    font-weight: 500;
    font-size: 12px;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    letter-spacing: .2px;
}

table.data tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--text);
    vertical-align: middle;
}

table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #fafbfd; }

table.data td.nowrap { white-space: nowrap; }
table.data td.num { font-variant-numeric: tabular-nums; text-align: right; }
table.data td.actions { white-space: nowrap; text-align: right; }
table.data td .muted { color: var(--faint); font-size: 12px; }
table.data td.strong { font-weight: 600; color: var(--ink); }

.cell-main {
    font-weight: 500;
    color: var(--ink);
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cell-sub { font-size: 11.5px; color: var(--faint); margin-top: 2px; }

.row-actions { display: inline-flex; gap: 12px; align-items: center; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .2px;
    white-space: nowrap;
}

.badge::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: .9;
}

.badge.ok { color: var(--ok); background: var(--ok-bg); }
.badge.warn { color: var(--warn); background: var(--warn-bg); }
.badge.danger { color: var(--danger); background: var(--danger-bg); }
.badge.info { color: var(--info); background: var(--info-bg); }
.badge.neutral { color: var(--neutral); background: var(--neutral-bg); }

.badge.plain::before { display: none; }

.tag {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 5px;
    background: #f1f4f8;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.money { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.money.neg { color: var(--danger); }

/* 分页 */

.pager {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-top: 1px solid var(--line-soft);
    font-size: 12.5px;
    color: var(--muted);
    flex-wrap: wrap;
}

.pager .info { margin-right: auto; }
.pager .pages { display: flex; gap: 5px; align-items: center; }

.pager button {
    min-width: 30px;
    height: 30px;
    padding: 0 9px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 7px;
    color: var(--text);
    font-size: 12.5px;
    cursor: pointer;
}

.pager button:hover:not(:disabled) { border-color: var(--brand-line); color: var(--brand); }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pager button.cur { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager .ellipsis { color: var(--faint); padding: 0 2px; }

/* 空态 / 骨架 / 加载 */

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

.empty .ico {
    width: 46px;
    height: 46px;
    margin: 0 auto 12px;
    border-radius: 14px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c3cedd;
}

.empty .t { font-size: 14px; color: var(--muted); font-weight: 500; }
.empty .d { font-size: 12.5px; margin-top: 4px; }

.loading-line {
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--brand), transparent);
    background-size: 200% 100%;
    animation: sweep 1.1s linear infinite;
    border-radius: 3px;
}

@keyframes sweep {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.inline-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 0;
    color: var(--faint);
    font-size: 13px;
    gap: 9px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #dfe6ef;
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* 概览页 */

.grid-2 {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 14px;
    align-items: start;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.stack { display: flex; flex-direction: column; gap: 14px; }

.chart-box { padding: 8px 4px 0; }

.chart-legend {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--muted);
    padding: 0 14px 10px;
}

.chart-legend i {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
}

.mini-list { list-style: none; margin: 0; padding: 4px 0; }

.mini-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 13px;
}

.mini-list li:last-child { border-bottom: none; }
.mini-list .t { min-width: 0; flex: 1; }
.mini-list .t b { font-weight: 500; color: var(--ink); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list .t span { font-size: 11.5px; color: var(--faint); }
.mini-list .go { color: var(--faint); font-size: 12px; }

.quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px 18px 18px;
}

.quick {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 13px;
    background: #fcfdfe;
    cursor: pointer;
    transition: border-color .14s, background .14s, transform .06s;
}

.quick:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.quick:active { transform: translateY(1px); }
.quick b { display: block; font-size: 13px; color: var(--ink); font-weight: 500; }
.quick span { font-size: 11.5px; color: var(--faint); }

/* 弹窗 */

.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .46);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 200;
    animation: fade .14s ease-out;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
    width: 100%;
    max-width: 470px;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    animation: pop .16s ease-out;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal.wide { max-width: 640px; }

@keyframes pop {
    from { opacity: 0; transform: translateY(8px) scale(.985); }
    to { opacity: 1; transform: none; }
}

.modal-head {
    padding: 18px 20px 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.modal-head h3 { margin: 0; font-size: 15.5px; font-weight: 600; color: var(--ink); }
.modal-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.modal-head .x { margin-left: auto; }

.modal-body {
    padding: 4px 20px 18px;
    overflow-y: auto;
    font-size: 13px;
    color: var(--text);
}

.modal-body .field { margin-bottom: 13px; }
.modal-body .field:last-child { margin-bottom: 0; }
.modal-body .input, .modal-body .select { width: 100%; min-width: 0; }

.modal-body textarea {
    width: 100%;
    min-height: 76px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: none;
    resize: vertical;
    font-size: 13px;
    line-height: 1.6;
}

.modal-body textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(18, 145, 95, .1);
}

.modal-foot {
    padding: 14px 20px;
    border-top: 1px solid var(--line-soft);
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    flex-wrap: wrap;
}

.kv {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 8px 12px;
    font-size: 13px;
    margin-bottom: 14px;
}

.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); word-break: break-all; }

.callout {
    border-radius: 9px;
    padding: 10px 12px;
    font-size: 12.5px;
    line-height: 1.65;
    background: var(--info-bg);
    color: var(--info);
    margin-bottom: 14px;
}

.callout.warn { background: var(--warn-bg); color: var(--warn); }
.callout.danger { background: var(--danger-bg); color: var(--danger); }

/* Toast */

.toast-wrap {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 9px;
    pointer-events: none;
}

.toast {
    min-width: 246px;
    max-width: 380px;
    background: #fff;
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    padding: 11px 14px;
    font-size: 13px;
    color: var(--text);
    display: flex;
    gap: 9px;
    align-items: flex-start;
    animation: slideIn .18s ease-out;
    pointer-events: auto;
    line-height: 1.55;
}

.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
.toast .ico { flex: none; margin-top: 1px; }
.toast .msg { flex: 1; word-break: break-word; }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: none; }
}

/* 移动端 */

.mobile-toggle { display: none; }

.sidebar-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 55;
}

@media (max-width: 1180px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: none; }
    .main { margin-left: 0; }
    .mobile-toggle { display: inline-flex; }
    .sidebar-mask.open { display: block; }
    .content { padding: 16px 14px 36px; }
    .topbar { padding: 0 14px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat .value { font-size: 21px; }
    .grid-3 { grid-template-columns: 1fr; }
    .page-actions { margin-left: 0; width: 100%; }
    .login-card { padding: 30px 24px 26px; }
    .cell-main { max-width: 180px; }
}

@media (max-width: 520px) {
    .stat-grid { grid-template-columns: 1fr; }
    .quick-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   赛事编辑器（右侧抽屉）
   长表单专用：比赛事弹窗更宽，可滚动，底部操作区常驻
   ========================================================================== */

.editor-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .46);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: flex-end;
    z-index: 190;
    animation: fade .14s ease-out;
}

.editor {
    width: 900px;
    max-width: 100%;
    height: 100%;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    box-shadow: -12px 0 40px rgba(15, 23, 42, .16);
    animation: slideIn .2s cubic-bezier(.22, .61, .36, 1);
}

@keyframes slideIn {
    from { transform: translateX(28px); opacity: .6; }
    to { transform: none; opacity: 1; }
}

.editor-head {
    padding: 16px 22px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-shrink: 0;
}

.editor-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-head p {
    margin: 4px 0 0;
    font-size: 12.5px;
    color: var(--muted);
}

.editor-head .x { margin-left: auto; flex-shrink: 0; }

.editor-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 22px 8px;
}

.editor-foot {
    padding: 13px 22px;
    background: #fff;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
}

.editor-foot .tip {
    margin-right: auto;
    font-size: 12px;
    color: var(--faint);
}

/* ---------- 分区卡片 ---------- */

.sec {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px 6px;
    margin-bottom: 13px;
    box-shadow: var(--shadow-sm);
}

.sec-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 13px;
}

.sec-head h4 {
    margin: 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
}

.sec-head .sub {
    font-size: 12px;
    color: var(--faint);
}

.sec-head .right {
    margin-left: auto;
    display: flex;
    gap: 7px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0 14px;
}

.fld { margin-bottom: 12px; min-width: 0; }

.fld > label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 5px;
    font-weight: 500;
}

.fld > label .req { color: var(--danger); margin-left: 2px; }

.fld .input, .fld .select {
    width: 100%;
    min-width: 0;
    height: 34px;
}

.fld textarea {
    width: 100%;
    min-height: 74px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    outline: none;
    resize: vertical;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
    background: #fff;
}

.fld textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(18, 145, 95, .1);
}

.fld .hint {
    font-size: 11.5px;
    color: var(--faint);
    margin-top: 4px;
    line-height: 1.5;
}

.fld.err .input, .fld.err .select, .fld.err textarea { border-color: var(--danger); }

/* ---------- 奖金行 ---------- */

.prize-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.prize-row .input { flex: 1; }
.prize-row .input.amount { max-width: 150px; }
.prize-row .income-unit { font-size: 12px; color: var(--faint); }

/* ---------- 场次卡片 ---------- */

.sess-item {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 13px 15px 4px;
    margin-bottom: 11px;
    background: #fbfcfd;
    transition: opacity .15s ease;
}

.sess-item.dropped {
    opacity: .5;
    background: #f7f8fa;
}

.sess-item.dropped input,
.sess-item.dropped select,
.sess-item.dropped textarea {
    pointer-events: none;
    background: #f1f3f6;
}

.sess-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 11px;
}

.sess-idx {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 11.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sess-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.sess-meta {
    font-size: 11.5px;
    color: var(--faint);
}

.sess-head .right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sess-head .btn-link { font-size: 12px; }

/* ---------- 失败提示 ---------- */

.form-error {
    display: none;
    margin: 0 0 12px;
    padding: 9px 12px;
    border-radius: 9px;
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 12.5px;
}

.form-error.show { display: block; }

@media (max-width: 960px) {
    .editor { width: 100%; }
    .editor-body { padding: 14px 14px 6px; }
    .editor-head, .editor-foot { padding-left: 14px; padding-right: 14px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* 编辑器细节补充 */
.fld.span2 { grid-column: 1 / -1; }

details.sess-more { margin-top: 2px; }

details.sess-more > summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--brand);
    margin-bottom: 11px;
    list-style: none;
    outline: none;
    user-select: none;
}

details.sess-more > summary::-webkit-details-marker { display: none; }
details.sess-more > summary::before { content: '▸ '; }
details.sess-more[open] > summary::before { content: '▾ '; }
details.sess-more[open] > summary { margin-bottom: 13px; }

.prize-empty {
    font-size: 12.5px;
    color: var(--faint);
    padding: 6px 0 12px;
}
