* { box-sizing: border-box; }

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

.top,
.topbar,
.header {
    background: #0f172a;
    color: #fff;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.top.has-alt-switcher,
.topbar.has-alt-switcher,
.header.has-alt-switcher {
    align-items: flex-start;
    padding-bottom: 0;
}

.top-title { font-weight: 700; }
.topbar-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.top-meta { color: #cbd5e1; font-size: 13px; margin-left: 8px; }
.topbar-main .top-meta {
    margin-left: 0;
    font-size: 12px;
    line-height: 1.4;
    word-break: break-word;
}
.header h1 { font-size: 20px; }

.top-actions,
.nav-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.top-actions .btn,
.top-actions .btn-muted,
.top-actions .btn.gray,
.top-actions .logout-btn,
.user-info.top-actions .logout-btn {
    color: #fff;
    text-decoration: none;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.top-actions .btn-muted,
.top-actions .btn.gray,
.user-info.top-actions .logout-btn[style] {
    background: #64748b !important;
}

.top-actions .btn.danger,
.user-info.top-actions .logout-btn:not([style]) {
    background: #dc2626;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    padding: 7px 10px;
    border-radius: 8px;
    background: #64748b;
    font-size: 13px;
    transition: opacity .2s;
}

.nav-links a:hover { opacity: .92; }

.btn {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover { opacity: .92; }
.btn.gray { background: #64748b; }
.btn.danger { background: #dc2626; }

.card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

input,
select,
textarea {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
}

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

th,
td {
    border: 1px solid #e5e7eb;
    padding: 8px;
    font-size: 13px;
}

th { background: #f8fafc; }

@media (max-width: 768px) {
    .top,
    .topbar,
    .header {
        padding: 10px 12px;
    }
}

@media (max-width: 420px) {
    .top-title { font-size: 15px; }
    .top-meta { display: block; margin: 4px 0 0; font-size: 12px; }
    .header h1 { font-size: 16px; }
    .top-actions { gap: 6px; }

    .top-actions,
    .nav-links {
        width: 100%;
    }

    .top-actions .btn,
    .nav-links a {
        flex: 1 1 auto;
        min-width: 0;
        text-align: center;
        padding: 6px 8px;
        font-size: 12px;
    }
}

.topbar .top-meta.hub-name {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
}

@media (max-width: 360px) {
    .top-title { font-size: 14px; }
    .top-meta { font-size: 11px; }
    .header h1 { font-size: 14px; }
    .top-actions { gap: 5px; }

    .top,
    .topbar,
    .header {
        padding: 8px 10px;
    }

    .top-actions .btn,
    .nav-links a {
        padding: 5px 6px;
        font-size: 10px;
        border-radius: 6px;
    }
}

.alt-switcher-bar {
    background: linear-gradient(180deg, #1e293b 0%, #172033 100%);
    color: #e2e8f0;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid #334155;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .12);
}

.alt-switcher-in-header {
    flex: 0 0 100%;
    width: 100%;
    order: 99;
    margin: 10px 0 0;
    padding: 10px 0 12px;
    background: transparent;
    border-top: 1px solid rgba(148, 163, 184, .22);
    border-bottom: 0;
    box-shadow: none;
    justify-content: flex-start;
}

.alt-switcher-in-header .alt-actions {
    display: none;
}

.alt-switcher-bar .alt-label {
    color: #94a3b8;
    white-space: nowrap;
}

.alt-switcher-bar select {
    min-width: 220px;
    max-width: 420px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #475569;
    background: #0f172a;
    color: #f8fafc;
    font-size: 13px;
}

.alt-switcher-bar .alt-refresh-btn {
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.alt-switcher-bar .alt-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

.alt-switcher-bar .alt-actions a {
    color: #fff;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    background: #2563eb;
    font-size: 12px;
}

.alt-switcher-bar .alt-actions a.alt-muted {
    background: #64748b;
}

@media (max-width: 420px) {
    .alt-switcher-bar {
        padding: 8px 10px;
        gap: 8px;
    }
    .alt-switcher-bar select {
        width: 100%;
        min-width: 0;
        max-width: none;
    }
    .alt-switcher-bar .alt-actions {
        width: 100%;
        margin-left: 0;
    }
    .alt-switcher-bar .alt-actions a {
        flex: 1 1 auto;
        text-align: center;
    }
}
