* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f5f7fb;
    color: #1f2937;
    font-family: Arial, "Microsoft YaHei", sans-serif;
}

a {
    color: #2563eb;
    text-decoration: none;
}

.wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px;
}

.install-wrap {
    max-width: 620px;
}

.topbar,
.panel,
.room-card,
.round-box,
.table-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

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

.brand {
    font-size: 20px;
    font-weight: 700;
}

.muted {
    color: #6b7280;
    font-size: 13px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 18px;
}

.panel,
.table-card {
    padding: 18px;
}

.panel h2,
.panel h3,
.table-card h3 {
    margin: 0 0 14px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-head h2 {
    margin: 0;
}

.room-list {
    display: grid;
    gap: 12px;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    color: #4b5563;
    font-size: 13px;
}

.pager .button,
.pager-disabled {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 13px;
}

.pager-disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #e5e7eb;
    color: #9ca3af;
}

.room-card {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.room-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.room-title {
    font-weight: 700;
}

.room-summary,
.room-result {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    color: #4b5563;
    font-size: 13px;
    line-height: 1.6;
}

.room-result {
    display: block;
    color: #1f2937;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    white-space: nowrap;
}

.badge.done {
    background: #ecfdf5;
    color: #047857;
}

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: #4b5563;
    font-size: 13px;
}

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

.metric {
    min-height: 78px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.metric strong {
    display: block;
    margin-top: 6px;
    font-size: 22px;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.inline-actions .button {
    min-height: 32px;
    padding: 5px 8px;
    font-size: 12px;
}

.search-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.search-bar input[type="text"] {
    width: min(280px, 100%);
}

.mini-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mini-form input,
.mini-form select,
.mini-form button {
    min-height: 32px;
    padding: 5px 8px;
    font-size: 12px;
}

.mini-form input[type="number"] {
    width: 86px;
}

form {
    margin: 0;
}

.form-grid {
    display: grid;
    gap: 10px;
}

label {
    display: grid;
    gap: 5px;
    color: #374151;
    font-size: 13px;
}

.check-line {
    display: flex;
    align-items: center;
}

.check-line input {
    min-height: auto;
}

.install-actions {
    margin-top: 16px;
}

input,
select,
button {
    min-height: 38px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 10px;
    font: inherit;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    padding: 8px 12px;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
}

button.secondary,
.button.secondary {
    background: #111827;
}

button.danger {
    background: #dc2626;
}

button:disabled,
.button.disabled {
    cursor: not-allowed;
    background: #d1d5db;
    color: #6b7280;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(17, 24, 39, 0.52);
}

.modal-backdrop.show {
    display: flex;
}

.confirm-modal {
    width: min(420px, 100%);
    padding: 20px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
}

.confirm-modal h3 {
    margin: 0 0 10px;
}

.confirm-modal p {
    margin: 0;
    color: #4b5563;
    line-height: 1.6;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.notice {
    padding: 10px 12px;
    margin-bottom: 14px;
    border-radius: 8px;
    background: #ecfdf5;
    color: #047857;
}

.notice.error {
    background: #fef2f2;
    color: #b91c1c;
}

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

.round-box {
    padding: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.round-box.active {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16);
}

.round-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.round-box h4 {
    margin: 0;
}

.round-box .muted {
    margin-top: 10px;
}

.round-filter-link {
    font-size: 12px;
    font-weight: 700;
}

.choice-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.choice-row label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
}

.choice-row input {
    min-height: auto;
    margin-right: 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 9px 8px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    font-size: 13px;
}

th {
    color: #4b5563;
    font-weight: 700;
}

.stack {
    display: grid;
    gap: 18px;
}

.empty {
    padding: 22px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #6b7280;
    text-align: center;
}

@media (max-width: 900px) {
    .grid,
    .rounds,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .topbar,
    .room-head {
        align-items: flex-start;
        flex-direction: column;
    }
}
