/* 
 * SMSI Monitor - 通用组件样式
 * 所有页面共用的组件（导航栏、按钮、卡片等）
 */

/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ==================== 导航栏 ==================== */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.navbar-brand .icon {
    width: 28px;
    height: 28px;
    background: var(--text-primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-card);
}

.navbar-brand .icon svg {
    width: 16px;
    height: 16px;
}

.navbar-nav {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: 32px;
}

.nav-link {
    padding: 8px 16px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13px;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
}

.nav-link.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
    font-weight: 600;
}

.navbar-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-left: auto;
}

/* ==================== 主题切换按钮 ==================== */
.theme-toggle {
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.theme-toggle:hover {
    background: var(--bg-light);
    border-color: var(--border-hover);
}

/* 太阳图标（亮色主题时显示） */
.theme-toggle::before {
    content: '';
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Cline x1='12' y1='1' x2='12' y2='3'/%3E%3Cline x1='12' y1='21' x2='12' y2='23'/%3E%3Cline x1='4.22' y1='4.22' x2='5.64' y2='5.64'/%3E%3Cline x1='18.36' y1='18.36' x2='19.78' y2='19.78'/%3E%3Cline x1='1' y1='12' x2='3' y2='12'/%3E%3Cline x1='21' y1='12' x2='23' y2='12'/%3E%3Cline x1='4.22' y1='19.78' x2='5.64' y2='18.36'/%3E%3Cline x1='18.36' y1='5.64' x2='19.78' y2='4.22'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* 月亮图标（暗色主题时显示） */
[data-theme="dark"] .theme-toggle::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b0b0b0' stroke-width='2'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E");
}

/* ==================== 按钮样式 ==================== */
.btn-lang {
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-lang:hover {
    background: var(--bg-light);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-logout {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-logout svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.btn-logout:hover {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--bg-card);
}

/* ==================== 容器 ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 24px 24px 24px;
}

/* ==================== 汉堡菜单 ==================== */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text-primary);
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 57px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-menu.active {
    display: block;
}

.mobile-menu a {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    border-left: 3px solid transparent;
    transition: all 0.3s;
}

.mobile-menu a:hover {
    background: var(--bg-light);
    color: var(--text-primary);
    border-left-color: var(--border-color);
}

.mobile-menu a.active {
    background: var(--bg-light);
    color: var(--text-primary);
    border-left-color: var(--text-primary);
    font-weight: 600;
}

/* ==================== 滚动条样式 ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #606060;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #707070;
}

/* ==================== 移动端响应式 ==================== */
@media (max-width: 768px) {
    .navbar {
        padding: 6px 12px;
    }

    .navbar-container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        justify-content: space-between;
    }

    .navbar-brand {
        font-size: 14px;
        gap: 8px;
        margin-left: 0;
    }

    .navbar-brand .icon {
        width: 24px;
        height: 24px;
    }

    .navbar-brand .icon svg {
        width: 14px;
        height: 14px;
    }

    .navbar-nav {
        display: none;
    }

    .menu-toggle {
        display: block;
        order: -1;
        margin-right: 8px;
    }

    .navbar-actions {
        margin-left: auto;
        gap: 6px;
        margin-right: 0;
    }

    .theme-toggle,
    .btn-lang,
    .btn-logout {
        width: 32px;
        height: 32px;
    }

    .btn-logout svg {
        width: 16px;
        height: 16px;
    }

    .container {
        padding: 10px;
    }
}
