* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #f6f7fb;
    color: #222;
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 230px;
    background: #0f172a;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
}

.brand {
    padding: 16px 12px;
    font-size: 16px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.user {
    padding: 12px 12px;
    font-size: 13px;
    color: #94a3b8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.menu-item {
    display: block;
    padding: 10px 12px;
    background: #0f172a;
    /* Level 1 BG */
    color: #e2e8f0;
    text-decoration: none;
    border: 1px solid transparent;
    /* Placeholder for hover border */
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    /* Separator */
    margin: 2px 4px;
    border-radius: 6px;
    transition: all 0.2s;
}

.menu-item:hover,
.menu-item.is-active {
    background: #dcfce7 !important;
    color: #ef4444 !important;
    border: 1px solid #dcfce7 !important;
}

.menu-title {
    padding: 10px 12px;
    background: #0f172a;
    /* Level 1 BG */
    font-size: 14px;
    opacity: 0.9;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin: 2px 4px;
    border-radius: 6px;
    transition: all 0.2s;
}

.menu-title:hover {
    background: #10b981 !important;
    color: #fff !important;
    border: 1px solid #d1fae5 !important;
}

.submenu a {
    display: block;
    padding: 8px 16px 8px 28px;
    /* Level 2 Indent: 12px + 16px = 28px */
    background: #1e293b;
    /* Level 2 BG */
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    border: 1px solid transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin: 2px 4px;
    border-radius: 6px;
    transition: all 0.2s;
}

.submenu a:hover,
.submenu a.is-active {
    background: #dcfce7 !important;
    color: #ef4444 !important;
    border: 1px solid #dcfce7 !important;
}

/* .submenu a.is-active removed here, merged above */



.submenu-title {
    padding: 8px 24px 8px 28px;
    /* Level 2 Indent */
    background: #1e293b;
    /* Level 2 BG */
    font-size: 13px;
    color: #94a3b8;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin: 2px 4px;
    border-radius: 6px;
    transition: all 0.2s;
}

.submenu-title:hover {
    background: #10b981 !important;
    color: #fff !important;
    border: 1px solid #d1fae5 !important;
}

.submenu-title.is-open {
    color: #e2e8f0;
}

.submenu-items {
    display: none;
}

.submenu-items a {
    padding-left: 44px;
    /* Level 3 Indent: 28px + 16px = 44px */
    background: #334155;
    /* Level 3 BG */
    display: block;
    /* Ensure block model for borders */
    border: 1px solid transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin: 2px 4px;
    border-radius: 6px;
    transition: all 0.2s;
}

.submenu-items a:hover,
.submenu-items a.is-active {
    background: #dcfce7 !important;
    color: #ef4444 !important;
    border: 1px solid #dcfce7 !important;
}

/* .submenu-items a.is-active removed here, merged above */

.logout {
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.logout a {
    color: #e2e8f0;
    text-decoration: none;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.topbar .title {
    font-size: 16px;
    font-weight: 600;
}

.content {
    padding: 16px;
}

/* 登录页 */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef2ff, #f8fafc);
}

.login-card {
    width: 380px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, .08);
    padding: 22px;
}

.login-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    text-align: center;
}

.form-item {
    margin-bottom: 12px;
}

.form-item label {
    display: block;
    font-size: 13px;
    color: #374151;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    height: 38px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0 10px;
    font-size: 14px;
}

.form-row {
    display: flex;
    gap: 10px;
}

.captcha-img {
    height: 38px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
}

.btn {
    width: 100%;
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: #0ea5e9;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.btn:hover {
    background: #0284c7;
}

.error {
    margin-bottom: 10px;
    color: #b91c1c;
    font-size: 13px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    padding: 8px 10px;
    border-radius: 6px;
}