:root {
    color: #202628;
    background: #f4f6f5;
    font-family: "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
    letter-spacing: 0;
}

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

html,
body {
    min-width: 0;
    min-height: 100%;
    margin: 0;
}

body {
    overflow-x: hidden;
}

button {
    font: inherit;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 224px 1fr;
    min-height: 100vh;
    min-width: 0;
    background: #f4f6f5;
}

.dashboard-sidebar {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 24px 14px 16px;
    color: #d7dedb;
    background: #202729;
}

.brand-area {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    column-gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 0 10px 26px;
    border-bottom: 1px solid #384143;
}

.brand-logo {
    display: flex;
    width: 58px;
    height: 38px;
    align-items: center;
    justify-content: center;
    padding: 4px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #d9e1de;
    border-radius: 6px;
}

.brand-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.brand-copy strong,
.brand-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-copy strong {
    color: #ffffff;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.3;
}

.brand-copy span {
    color: #9da9a5;
    font-size: 12px;
    line-height: 1.4;
}

[data-dashboard-nav] {
    display: grid;
    gap: 6px;
    padding: 20px 0;
}

.dashboard-nav-button,
[data-dashboard-nav] a {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    overflow: hidden;
    color: #c5cfca;
    text-align: left;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: 5px;
}

.dashboard-nav-icon {
    display: inline-grid;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: #93a19c;
    font-size: 17px;
    line-height: 18px;
    text-align: center;
}

.dashboard-nav-button:hover,
[data-dashboard-nav] a:hover {
    color: #ffffff;
    background: #2d3837;
}

.dashboard-nav-button:focus-visible,
[data-dashboard-nav] a:focus-visible {
    color: #ffffff;
    background: #2d3837;
    outline: 2px solid #f0c66e;
    outline-offset: 2px;
}

.dashboard-nav-button.is-active,
[data-dashboard-nav] a[aria-current="page"] {
    color: #ffffff;
    background: #24725a;
}

.dashboard-nav-button.is-active .dashboard-nav-icon,
[data-dashboard-nav] a[aria-current="page"] .dashboard-nav-icon {
    color: #d7f1dd;
}

.service-status {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-top: auto;
    padding: 16px 10px 0;
    overflow: hidden;
    color: #aeb9b5;
    font-size: 12px;
    border-top: 1px solid #384143;
    white-space: nowrap;
}

.service-status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    background: #54ad77;
    border-radius: 50%;
}

.dashboard-main {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    min-height: 100vh;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-width: 0;
    padding: 18px 28px;
    background: #ffffff;
    border-bottom: 1px solid #dce2df;
}

.dashboard-header > div:first-child {
    min-width: 0;
}

.dashboard-header h1,
.dashboard-header p {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-header h1 {
    color: #202628;
    font-size: 18px;
    font-weight: 650;
    line-height: 1.35;
}

.dashboard-header p {
    margin-top: 4px;
    color: #68736f;
    font-size: 13px;
    line-height: 1.4;
}

.dashboard-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.dashboard-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    height: 34px;
    padding: 0 11px;
    color: #394341;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    background: #ffffff;
    border: 1px solid #cfd7d3;
    border-radius: 5px;
}

.dashboard-actions button::before {
    margin-right: 6px;
    color: #65716d;
    font-size: 16px;
    line-height: 1;
}

#refresh-button::before {
    content: "↻";
}

#fullscreen-button::before {
    content: "□";
}

#external-button::before {
    content: "↗";
}

.dashboard-actions button:hover {
    color: #1f5f4d;
    border-color: #5a9c7c;
}

.dashboard-actions button:focus-visible {
    color: #1f5f4d;
    border-color: #5a9c7c;
    outline: 2px solid #1f5f4d;
    outline-offset: 2px;
}

.dashboard-actions button:disabled {
    color: #9ca6a2;
    cursor: not-allowed;
    background: #f4f6f5;
    border-color: #dce2df;
}

.dashboard-content {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #e9eeeb;
}

#dashboard-frame {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    background: #ffffff;
    border: 0;
}

#loading-state,
#error-state {
    position: absolute;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    inset: 0;
    padding: 24px;
    font-size: 14px;
    text-align: center;
}

#loading-state {
    color: #53605b;
    background: rgba(244, 246, 245, 0.94);
}

#error-state {
    color: #8d332b;
    background: rgba(255, 247, 245, 0.96);
}

#loading-state[hidden],
#error-state[hidden] {
    display: none;
}

@media (max-width: 800px) {
    .dashboard-layout {
        grid-template-columns: 72px 1fr;
    }

    .dashboard-sidebar {
        align-items: center;
        padding: 18px 9px 14px;
    }

    .brand-area {
        display: flex;
        justify-content: center;
        width: 100%;
        padding: 0 0 20px;
        border-bottom: 0;
    }

    .brand-logo {
        width: 52px;
        height: 38px;
        padding: 4px;
    }

    .brand-copy {
        display: none;
    }

    .service-status > span:last-child {
        display: none;
    }

    [data-dashboard-nav] {
        width: 100%;
        padding-top: 14px;
    }

    .dashboard-nav-button,
    [data-dashboard-nav] a {
        justify-content: center;
        height: 42px;
        min-height: 42px;
        padding: 0;
        gap: 0;
    }

    .dashboard-nav-icon {
        font-size: 18px;
    }

    .dashboard-nav-label {
        display: none;
    }

    .service-status {
        justify-content: center;
        width: 100%;
        padding: 14px 0 0;
    }

    .dashboard-header {
        align-items: flex-start;
        gap: 12px;
        padding: 14px 16px;
    }

    .dashboard-header h1 {
        font-size: 16px;
    }

    .dashboard-header p {
        font-size: 12px;
    }

    .dashboard-actions {
        gap: 6px;
    }

    .dashboard-actions button {
        min-width: 34px;
        width: 34px;
        padding: 0;
        font-size: 0;
    }

    .dashboard-actions button::before {
        margin-right: 0;
        font-size: 17px;
    }
}
