/* ═══ 侧边栏 + 顶栏 + 整体布局 ═══ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --red: #c0392b;
    --red-dark: #a93226;
    --bg: #f0eeeb;
    --sidebar-bg: #ffffff;
    --text: #1a1a1a;
    --text-muted: #7a7a7a;
    --text-label: #999;
    --border: #e0ddd8;
    --card-bg: #ffffff;
    --nav-active: #c0392b;
}

body {
    font-family: 'Karla', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

/* ─── SIDEBAR ─── */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    height: 100vh;
    border-right: 1px solid var(--border);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 10;
}

.sidebar-logo {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
}

.logo-img {
    height: 28px;
    width: auto;
    display: block;
}

nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 24px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s;
    position: relative;
    text-decoration: none;
}

.nav-item:hover {
    color: var(--text);
}

.nav-item.active {
    color: var(--nav-active);
    border-left: 3px solid var(--nav-active);
    padding-left: 21px;
}

.nav-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active svg {
    opacity: 1;
}

.sidebar-bottom {
    padding: 20px 0;
    border-top: 1px solid var(--border);
}

/* ─── TOPBAR ─── */
.topbar {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    height: 64px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 36px;
    gap: 16px;
    z-index: 9;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px 14px;
    width: 220px;
}

.search-bar svg {
    color: var(--text-muted);
    width: 14px;
    height: 14px;
}

.search-bar input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    width: 100%;
}

.search-bar input::placeholder {
    color: var(--text-label);
}

.topbar-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
}

.topbar-icon:hover {
    color: var(--text);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 3px;
    background: #2c2c2c;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar svg {
    color: #aaa;
}

/* ─── MAIN CONTAINER ─── */
#main-content {
    margin-left: 260px;
    margin-top: 64px;
    flex: 1;
    overflow-y: auto;
    height: calc(100vh - 64px);
}

/* 滚动条 */
#main-content::-webkit-scrollbar {
    width: 6px;
}

#main-content::-webkit-scrollbar-track {
    background: transparent;
}

#main-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* ─── Notification Bell ─── */
.topbar-notif {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
}
.topbar-notif:hover { color: var(--text); }

.notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ─── Notification Panel ─── */
.notif-panel {
    position: fixed;
    top: 56px;
    right: 60px;
    width: 340px;
    max-height: 420px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    z-index: 50;
    display: flex;
    flex-direction: column;
}

.notif-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.notif-panel-header h3 {
    font-family: 'EB Garamond', serif;
    font-size: 16px;
    font-weight: 400;
    margin: 0;
}

.notif-mark-all {
    font-family: 'Karla', sans-serif;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
}
.notif-mark-all:hover { color: var(--red); }

.notif-list {
    overflow-y: auto;
    flex: 1;
}

.notif-item {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: #fdf5f5; border-left: 2px solid var(--red); padding-left: 16px; }
.notif-item.unread:hover { background: #fde8e8; }

.notif-item-text {
    font-size: 12.5px;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 4px;
}

.notif-item-time {
    font-size: 10px;
    color: var(--text-label);
}

.notif-empty {
    padding: 28px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-label);
}

/* ─── User Menu ─── */
.topbar-user {
    position: relative;
}

.user-menu {
    position: fixed;
    top: 56px;
    right: 20px;
    width: 180px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    z-index: 50;
}

.user-menu-user {
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.user-menu-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    font-family: 'Karla', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}
.user-menu-item:hover { background: var(--bg); color: var(--text); }
.user-menu-item.danger { color: var(--red); }
.user-menu-item.danger:hover { background: #fde8e8; }