* { box-sizing: border-box; }
body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(250, 204, 21, 0.18), transparent 24%),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.16), transparent 26%),
        linear-gradient(180deg, #f7f3ea 0%, #eef4f7 100%);
    color: #182028;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: #0f5f9a; text-decoration: none; }
pre, .mono { font-family: Consolas, "Courier New", monospace; }
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 28px;
    border-bottom: 1px solid rgba(24, 32, 40, 0.08);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}
.brand { color: #111827; font-size: 18px; font-weight: 800; }
.topbar nav { display: flex; gap: 16px; flex-wrap: wrap; }
.topbar nav a { color: #334155; font-size: 14px; }
.wrap { max-width: 1220px; margin: 0 auto; padding: 28px; }
.admin .wrap {
    width: min(1680px, calc(100vw - 48px));
    max-width: none;
}
.hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    align-items: stretch;
    margin-bottom: 24px;
}
.hero-copy, .hero-card, .panel, .info-card, .stats div, .code-panel {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(24, 32, 40, 0.08);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}
.hero-copy { padding: 28px; }
.hero-copy h1 {
    margin: 0 0 14px;
    font-size: 40px;
    line-height: 1.08;
    max-width: 11ch;
}
.hero-copy p, .section-head p, .info-card p, .panel p {
    color: #526072;
    line-height: 1.75;
}
.eyebrow {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #fff3c4;
    color: #7c4a03;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 14px;
}
.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}
.button, button {
    border: 0;
    border-radius: 7px;
    padding: 11px 14px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}
.button { display: inline-flex; align-items: center; justify-content: center; }
.primary, button { background: #c2541a; color: #fff; }
.secondary, .ghost { background: #edf4f7; color: #23404b; }
.hero-card {
    padding: 22px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.metric {
    min-height: 120px;
    border-radius: 8px;
    padding: 16px;
    background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
    border: 1px solid rgba(194, 84, 26, 0.12);
}
.metric span, .stats span, dt {
    display: block;
    color: #64748b;
    font-size: 13px;
}
.metric strong, .stats strong {
    display: block;
    margin-top: 8px;
    font-size: 32px;
}
.band { margin-top: 24px; }
.section-head { margin-bottom: 14px; }
.section-head h2, .panel h1, .panel h2, .info-card h3 {
    margin: 0 0 8px;
}
.code-panel, .panel, .info-card { padding: 22px; }
.code-panel pre, .code-block {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    color: #d7f9ff;
    background: #10212b;
    border-radius: 8px;
    padding: 16px;
    line-height: 1.7;
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 18px;
}
.info-card dl {
    margin: 14px 0 0;
    display: grid;
    gap: 10px;
}
.info-card dl div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(24, 32, 40, 0.08);
}
.panel { padding: 22px; }
.narrow { max-width: 560px; margin: 40px auto; }
.split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}
.split-wide {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 18px;
}
.form { display: grid; gap: 14px; }
.form label {
    display: grid;
    gap: 8px;
    color: #344256;
    font-weight: 700;
}
.form input, .form textarea, .form select {
    width: 100%;
    border: 1px solid #d7dee6;
    border-radius: 7px;
    padding: 11px 12px;
    background: #fff;
    color: #16202b;
    font: inherit;
}
.form textarea { resize: vertical; }
.check {
    display: flex !important;
    align-items: center;
    gap: 10px;
}
.check input {
    width: auto;
    margin: 0;
}
.alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #b6e2c4;
    background: #edfdf2;
    color: #166534;
}
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}
.stats div { padding: 20px; }
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}
.table-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}
.table-scroll table {
    min-width: 980px;
    margin-top: 0;
}
th, td {
    padding: 11px 8px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(24, 32, 40, 0.08);
}
th {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}
.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.toolbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.toolbar h1 { margin: 0 0 8px; }
.toolbar p { margin: 0; }
.filter-bar, .batch-bar {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.filter-bar label, .batch-bar label {
    display: grid;
    gap: 8px;
    color: #344256;
    font-weight: 700;
}
.filter-bar input, .filter-bar select, .batch-bar select {
    min-width: 160px;
    border: 1px solid #d7dee6;
    border-radius: 7px;
    padding: 11px 12px;
    background: #fff;
    color: #16202b;
    font: inherit;
}
.filter-grow {
    flex: 1 1 280px;
}
.filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.batch-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: end;
}
.th-filter {
    min-width: 132px;
}
.th-filter span {
    display: block;
    margin-bottom: 8px;
}
.th-filter select,
.th-filter input {
    width: 100%;
    min-width: 0;
    border: 1px solid #d7dee6;
    border-radius: 7px;
    padding: 8px 10px;
    background: #fff;
    color: #16202b;
    font: inherit;
}
.status-text {
    font-weight: 800;
}
.status-active {
    color: #15803d;
}
.status-disabled {
    color: #dc2626;
}
.cell-wrap {
    max-width: 220px;
    white-space: normal;
    word-break: break-word;
}
.copy-cell {
    cursor: pointer;
    transition: color 0.18s ease, background-color 0.18s ease;
}
.copy-cell:hover {
    color: #0f5f9a;
}
.copy-cell.copied {
    color: #15803d;
    font-weight: 700;
}
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 20;
}
.modal-panel {
    width: min(640px, 100%);
    max-height: min(86vh, 920px);
    overflow: auto;
    background: #fff;
    border-radius: 8px;
    border: 1px solid rgba(24, 32, 40, 0.08);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    padding: 22px;
}
.log-item + .log-item {
    margin-top: 14px;
}
.modal-head, .modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.modal-head { margin-bottom: 16px; }
.modal-head h2 { margin: 0; }
.modal-actions { justify-content: flex-end; }
.inline-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 14px;
    align-items: end;
}
.switch-field {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 45px;
}
.switch-field input {
    width: 18px;
    height: 18px;
    margin: 0;
}
@media (max-width: 1280px) {
    .wrap {
        max-width: none;
        padding: 22px;
    }
    .admin .wrap {
        width: calc(100vw - 36px);
    }
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .table-scroll table {
        min-width: 900px;
    }
}
@media (max-width: 1080px) {
    .split-wide {
        grid-template-columns: 1fr;
    }
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .toolbar-actions {
        width: 100%;
    }
    .toolbar-actions .button,
    .filter-actions .button,
    .filter-actions button,
    .batch-actions .button,
    .batch-actions button,
    .modal-actions .button,
    .modal-actions button {
        width: 100%;
    }
    .table-scroll table {
        min-width: 820px;
    }
}
@media (max-width: 860px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px 18px;
    }
    .wrap,
    .admin .wrap {
        width: auto;
        padding: 18px;
    }
    .hero, .split-wide, .stats, .inline-field {
        grid-template-columns: 1fr;
    }
    .hero-copy h1 {
        font-size: 30px;
        max-width: none;
    }
    .toolbar, .modal-head, .modal-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .toolbar-actions, .filter-bar, .batch-bar, .filter-actions, .batch-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .hero-card {
        grid-template-columns: repeat(2, 1fr);
    }
    .table-scroll table {
        min-width: 760px;
    }
}
