:root {
    color-scheme: dark;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    background: #111317;
    color: #f4f5f7;
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #111317;
}

button,
select,
a {
    font: inherit;
}

.portal {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 40px;
}

.portal-header {
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #f1c40f;
    gap: 16px;
}

.portal-header h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
}

.back-link {
    color: #f4f5f7;
    text-decoration: none;
    border: 1px solid #666c75;
    padding: 10px 16px;
    background: #262a30;
}

.portal-actions {
    display: flex;
    gap: 10px;
}

.family-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 28px;
}

.family-link {
    display: flex;
    min-height: 180px;
    align-items: center;
    justify-content: center;
    border: 1px solid #5a6069;
    background: #20242a;
    color: #f4f5f7;
    text-decoration: none;
    font-size: 36px;
    font-weight: 700;
}

.family-link:hover,
.family-link:focus-visible,
.back-link:hover,
.back-link:focus-visible,
.panel-button:hover,
.panel-button:focus-visible {
    border-color: #f1c40f;
    background: #30353d;
    outline: 2px solid #f1c40f;
    outline-offset: 2px;
}

.toolbar {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
    margin-top: 24px;
}

.toolbar-single {
    grid-template-columns: minmax(240px, 420px);
}

.toolbar label {
    align-self: center;
    font-size: 18px;
}

.toolbar select {
    min-height: 48px;
    border: 1px solid #666c75;
    background: #20242a;
    color: #f4f5f7;
    padding: 0 14px;
}

.press-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.panel-button {
    display: flex;
    min-height: 92px;
    align-items: center;
    justify-content: center;
    border: 1px solid #555b64;
    background: #20242a;
    color: #f4f5f7;
    text-decoration: none;
    font-size: 26px;
    font-weight: 700;
    cursor: pointer;
}

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

.press-panel {
    border: 1px solid #555b64;
    background: #1c2025;
    padding: 14px;
}

.press-panel h2 {
    margin: 0 0 12px;
    font-size: 24px;
}

.screen-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.screen-actions .panel-button {
    min-height: 58px;
    font-size: 20px;
}

.offline {
    opacity: 0.55;
}

@media (max-width: 860px) {
    .press-grid,
    .s7-1200-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .portal {
        width: min(100% - 20px, 1180px);
        padding-top: 12px;
    }

    .portal-header h1 {
        font-size: 23px;
    }

    .family-grid,
    .press-grid,
    .s7-1200-grid,
    .toolbar {
        grid-template-columns: 1fr;
    }

    .family-link {
        min-height: 120px;
        font-size: 28px;
    }
}
