* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f4f6f8;
    color: #1f2937;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    font-size: 14px;
}

a {
    color: #1d4ed8;
    text-decoration: none;
}

input,
button {
    font: inherit;
}

input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 10px;
    background: #fff;
}

textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 10px;
    background: #fff;
    resize: vertical;
    font: inherit;
}

button {
    border: 0;
    border-radius: 6px;
    padding: 8px 12px;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
}

button.danger {
    background: #dc2626;
}

button:hover {
    filter: brightness(0.95);
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-panel {
    width: min(420px, calc(100vw - 32px));
    background: #fff;
    border: 1px solid #dbe3ea;
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

.login-panel h1 {
    margin: 0 0 8px;
    font-size: 22px;
}

.login-panel p {
    margin: 0 0 20px;
    color: #64748b;
}

.login-announcement {
    display: grid;
    gap: 6px;
    margin-bottom: 16px;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 10px 12px;
    background: #eff6ff;
    color: #1f2937;
    line-height: 1.6;
}

.login-announcement strong {
    color: #1e3a8a;
}

.login-announcement span {
    white-space: normal;
    word-break: break-word;
}

.login-panel label {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
    font-weight: 600;
}

.login-panel button {
    width: 100%;
    margin-top: 8px;
}

.topbar {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px;
    background: #fff;
    border-bottom: 1px solid #dbe3ea;
}

.topbar strong {
    margin-right: 12px;
}

.topbar span {
    color: #64748b;
}

.topbar nav {
    display: flex;
    gap: 12px;
    align-items: center;
}

.container {
    width: min(1280px, calc(100vw - 32px));
    margin: 24px auto;
}

.panel {
    background: #fff;
    border: 1px solid #dbe3ea;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 18px;
}

.panel h2 {
    margin: 0 0 16px;
    font-size: 18px;
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
    gap: 12px;
    align-items: end;
}

.grid-form label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

.settings-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px;
    align-items: start;
}

.settings-form label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

.settings-form textarea,
.settings-form button,
.settings-form .checkbox-line {
    grid-column: 1 / -1;
}

.settings-form .checkbox-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-form .checkbox-line input {
    width: auto;
}

.alert {
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

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

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

th,
td {
    border-bottom: 1px solid #e2e8f0;
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

th {
    color: #475569;
    font-weight: 700;
    background: #f8fafc;
}

small {
    display: block;
    margin-top: 4px;
    color: #64748b;
}

.actions {
    min-width: 360px;
}

.actions form {
    display: inline-flex;
    gap: 6px;
    margin: 0 6px 6px 0;
    vertical-align: top;
}

.actions input {
    width: 96px;
}

@media (max-width: 860px) {
    .topbar {
        height: auto;
        padding: 14px 16px;
        align-items: flex-start;
        flex-direction: column;
    }

    .grid-form {
        grid-template-columns: 1fr;
    }
}
