* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft YaHei", Arial, sans-serif; color: #1f2937; background: #f4f6f8; padding-bottom: 48px; }
.topbar { position: fixed; top: 0; left: 0; right: 0; height: 64px; background: #0f766e; color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; z-index: 3; }
.topbar strong { display: block; font-size: 18px; }
.topbar span { font-size: 13px; opacity: .86; }
.logout { color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.55); padding: 7px 14px; border-radius: 6px; }
.sidebar { position: fixed; top: 64px; bottom: 48px; left: 0; width: 188px; background: #fff; border-right: 1px solid #dde3ea; padding: 14px; overflow-y: auto; }
.sidebar a { display: block; color: #374151; text-decoration: none; padding: 11px 12px; border-radius: 6px; margin-bottom: 6px; }
.sidebar a.active, .sidebar a:hover { background: #d9f3ef; color: #0f766e; font-weight: 700; }
.nav-group { margin-bottom: 12px; }
.nav-title { color: #64748b; font-size: 12px; font-weight: 700; padding: 8px 10px 5px; }
.main { margin-left: 188px; padding: 88px 24px 28px; }
h1 { margin: 0 0 18px; font-size: 24px; }
h2 { margin: 0 0 14px; font-size: 18px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 14px; margin-bottom: 16px; }
.card, .panel { background: #fff; border: 1px solid #dde3ea; border-radius: 8px; padding: 16px; }
.card span { display: block; color: #64748b; font-size: 13px; margin-bottom: 8px; }
.card strong { font-size: 25px; color: #0f766e; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; background: #fff; border: 1px solid #dde3ea; border-radius: 8px; padding: 14px; margin-bottom: 16px; }
label { font-size: 13px; color: #475569; }
input, select { display: block; height: 36px; min-width: 150px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 0 10px; background: #fff; margin-top: 5px; }
button, .button { height: 36px; border: 0; border-radius: 6px; padding: 0 15px; background: #0f766e; color: #fff; text-decoration: none; display: inline-flex; align-items: center; cursor: pointer; }
.secondary { background: #334155; }
.danger { background: #b91c1c; color: #fff; border: 0; border-radius: 6px; cursor: pointer; }
.mini { height: 28px; padding: 0 9px; font-size: 12px; margin-right: 6px; }
.actions { display: flex; gap: 6px; align-items: center; }
.actions form { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border-bottom: 1px solid #e2e8f0; padding: 10px; text-align: left; white-space: nowrap; }
th { background: #f8fafc; color: #334155; }
.fixed-user { position: fixed; bottom: 0; left: 0; right: 0; height: 48px; background: #111827; color: #fff; display: flex; align-items: center; justify-content: center; z-index: 4; font-size: 14px; }
.login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #0f766e, #164e63); padding: 20px; }
.login-card { width: min(420px, 100%); background: #fff; border-radius: 8px; padding: 28px; box-shadow: 0 20px 55px rgba(0,0,0,.24); }
.login-card h1 { color: #0f766e; }
.login-card input { width: 100%; }
.login-card button { width: 100%; justify-content: center; margin-top: 14px; }
.hint { background: #f1f5f9; border-radius: 6px; padding: 10px; font-size: 13px; line-height: 1.8; }
.demo-account { width: 100%; height: 32px; justify-content: flex-start; margin-top: 7px; background: #e0f2f1; color: #0f766e; border: 1px solid #99d5cf; }
.error { background: #fee2e2; color: #991b1b; padding: 9px 10px; border-radius: 6px; }
.empty { color: #64748b; }
@media (max-width: 900px) {
    .sidebar { position: static; width: auto; margin-top: 64px; display: flex; gap: 8px; overflow-x: auto; border-right: 0; border-bottom: 1px solid #dde3ea; }
    .sidebar a { white-space: nowrap; }
    .main { margin-left: 0; padding-top: 18px; }
    .cards, .grid-2 { grid-template-columns: 1fr; }
}
.config-buttons { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 20px; }
.config-btn { position: relative; display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid #dde3ea; border-radius: 12px; padding: 16px 42px 16px 16px; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; text-decoration: none; color: inherit; }
.config-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,118,110,.14); border-color: #0f766e; }
.config-btn.active { border-color: #0f766e; box-shadow: 0 0 0 2px rgba(15,118,110,.18); }
.cb-ico { font-size: 28px; line-height: 1; }
.cb-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cb-tt { font-size: 15px; font-weight: 700; color: #1f2937; }
.cb-sub { font-size: 12px; color: #64748b; }
.cb-full { position: absolute; top: 10px; right: 10px; color: #94a3b8; text-decoration: none; font-size: 14px; line-height: 1; }
.cb-full:hover { color: #0f766e; }
#config-content .panel:first-child { margin-top: 0; }

/* ===== 扁平化分页 ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 16px 0 4px;
    font-size: 13px;
    --pg-accent: var(--app-accent, #0f766e);
    --pg-accent-soft: var(--app-accent-soft, #e0f2f1);
    --pg-border: #e2e8f0;
    --pg-text: #475569;
    --pg-muted: #94a3b8;
}
.pagination .page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    background: #fff;
    color: var(--pg-text);
    border: 1px solid var(--pg-border);
    text-decoration: none;
    line-height: 1;
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.pagination .page-btn:hover {
    background: var(--pg-accent-soft);
    color: var(--pg-accent);
    border-color: var(--pg-accent);
}
.pagination .page-btn.is-current {
    background: var(--pg-accent);
    color: #fff;
    border-color: var(--pg-accent);
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(15, 118, 110, .25);
}
.pagination .page-btn.is-disabled {
    color: var(--pg-muted);
    background: #f8fafc;
    border-color: var(--pg-border);
    cursor: not-allowed;
    pointer-events: none;
    opacity: .65;
}
.pagination .page-nums {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.pagination .page-ellipsis {
    color: var(--pg-muted);
    padding: 0 2px;
    user-select: none;
}
.pagination .page-info {
    color: var(--pg-muted);
    font-size: 12px;
    margin-left: 6px;
}

/* ===== 下拉分页 ===== */
.pagination.pagination-select { gap: 10px; }
.pagination-select .page-select {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}
.pagination-select .page-select-label {
    color: var(--pg-muted);
    font-size: 12px;
}
.pagination-select .page-jump {
    display: inline-block;
    height: 34px;
    min-width: 92px;
    width: auto;
    padding: 0 10px;
    margin: 0;
    border: 1px solid var(--pg-border);
    border-radius: 8px;
    background: #fff;
    color: var(--pg-text);
    font-size: 13px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}
.pagination-select .page-jump:hover,
.pagination-select .page-jump:focus {
    border-color: var(--pg-accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--pg-accent-soft);
}
.pagination-select .page-btn {
    padding: 0 12px;
}
.pagination-select .page-btn[aria-disabled="true"] {
    color: var(--pg-muted);
    background: #f8fafc;
    border-color: var(--pg-border);
    cursor: not-allowed;
    opacity: .65;
    pointer-events: none;
}

/* ===== 移动端分页 ===== */
@media (max-width: 640px) {
    .pagination { gap: 5px; }
    .pagination .page-btn { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 7px; }
    /* 数字分页：窄屏下隐藏首/末页与省略号，保留核心页码，避免溢出 */
    .pagination-numeric .page-btn.is-disabled,
    .pagination-numeric .page-ellipsis {
        display: none;
    }
    .pagination .page-info { width: 100%; text-align: center; margin: 2px 0 0; order: 99; }
    /* 下拉分页：窄屏下更紧凑 */
    .pagination.pagination-select { gap: 6px; }
    .pagination-select .page-jump { min-width: 80px; }
}
