/* 公共样式 */
* { margin:0; padding:0; box-sizing:border-box; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif; }
body { background:#f0f2f5; min-height:100vh; }

/* ============================================
   强制修复侧边栏和遮罩层级（防止点不出来）
   ============================================ */
#drawerOverlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,0.4) !important;
    z-index: 9998 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s !important;
}
#drawerOverlay.show {
    opacity: 1 !important;
    visibility: visible !important;
}

#drawer {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 260px !important;
    height: 100% !important;
    background: #fff !important;
    z-index: 9999 !important; /* 最高层级 */
    transform: translateX(-100%) !important;
    transition: transform 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 4px 0 20px rgba(0,0,0,0.08) !important;
}
#drawer.show {
    transform: translateX(0) !important;
}

.drawer-header { padding:20px; border-bottom:1px solid #f0f0f0; display:flex; align-items:center; gap:12px; }
.drawer-header img { width:44px; height:44px; border-radius:50%; }
.drawer-header .info .name { font-size:15px; font-weight:600; color:#1a1a1a; }
.drawer-header .info .balance { font-size:12px; color:#888; margin-top:2px; }
.drawer-menu { flex:1; padding:12px 0; overflow-y:auto; }
.drawer-menu a { display:flex; align-items:center; gap:12px; padding:12px 20px; color:#333; text-decoration:none; font-size:14px; }
.drawer-menu a:hover { background:#f5f5f5; }
.drawer-menu a.active { background:#e3f2fd; color:#1565c0; font-weight:500; }
.drawer-menu a .icon { width:18px; height:18px; flex-shrink:0; }
.drawer-menu .divider { height:1px; background:#f0f0f0; margin:8px 0; }

/* 导航栏 */
.navbar { background:#fff; box-shadow:0 1px 4px rgba(0,0,0,0.06); padding:0 20px; height:60px; display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; z-index:100; }
.navbar .left { display:flex; align-items:center; gap:14px; }
.navbar .right { display:flex; align-items:center; gap:12px; }
.brand { display:flex; align-items:center; gap:8px; font-size:17px; font-weight:600; color:#1a1a1a; }
.brand img { width:30px; height:30px; border-radius:50%; }
.balance-tag { background:#e3f2fd; color:#1565c0; font-size:13px; font-weight:600; padding:6px 12px; border-radius:20px; }

/* 汉堡按钮 */
.hamburger { width:32px; height:32px; display:flex; flex-direction:column; justify-content:center; gap:5px; cursor:pointer; padding:4px; border-radius:6px; }
.hamburger:hover { background:#f0f0f0; }
.hamburger span { display:block; height:2px; background:#333; border-radius:2px; transition:0.3s; }
.hamburger span:nth-child(2) { width:75%; }
.hamburger.active span:nth-child(1) { transform:translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity:0; }
.hamburger.active span:nth-child(3) { transform:translateY(-7px) rotate(-45deg); }

/* 用户下拉菜单 */
.user-menu { position:relative; }
.user-menu .avatar-btn { display:flex; align-items:center; gap:8px; padding:4px 10px 4px 4px; border-radius:30px; background:#f5f5f5; cursor:pointer; }
.user-menu .avatar-btn:hover { background:#eaeaea; }
.user-menu .avatar-btn img { width:32px; height:32px; border-radius:50%; }
.user-menu .avatar-btn .uname { font-size:13px; color:#333; max-width:100px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.user-menu .avatar-btn svg { width:14px; height:14px; color:#999; }
.user-dropdown { position:absolute; top:calc(100% + 8px); right:0; width:260px; background:#fff; border-radius:12px; box-shadow:0 8px 30px rgba(0,0,0,0.12); z-index:500; display:none; overflow:hidden; }
.user-dropdown.show { display:block; }
.user-dropdown .dd-header { padding:16px; background:linear-gradient(135deg,#1976d2,#1565c0); color:#fff; }
.user-dropdown .dd-header .name { font-size:15px; font-weight:600; margin-bottom:4px; }
.user-dropdown .dd-header .balance { font-size:13px; opacity:0.9; }
.user-dropdown .dd-menu { padding:6px 0; }
.user-dropdown .dd-menu a { display:flex; align-items:center; gap:10px; padding:10px 16px; color:#333; text-decoration:none; font-size:14px; border:none; background:none; width:100%; text-align:left; cursor:pointer; }
.user-dropdown .dd-menu a:hover { background:#f5f5f5; }
.user-dropdown .dd-menu a .dicon { width:16px; height:16px; color:#666; }
.user-dropdown .dd-divider { height:1px; background:#f0f0f0; margin:4px 0; }
.user-dropdown .dd-menu a.danger { color:#d32f2f; }
.user-dropdown .dd-menu a.danger .dicon { color:#d32f2f; }

/* 容器和通用组件 */
.container { max-width:1200px; margin:0 auto; padding:24px 20px 60px; }
.page-title { font-size:20px; font-weight:600; color:#1a1a1a; margin-bottom:16px; }
.panel { background:#fff; border-radius:12px; box-shadow:0 2px 8px rgba(0,0,0,0.04); padding:22px; margin-bottom:20px; }
.panel h3 { font-size:15px; font-weight:600; margin-bottom:14px; }

.btn { padding:10px 24px; font-size:14px; font-weight:500; color:#fff; background:#333; border:none; border-radius:8px; cursor:pointer; text-decoration:none; display:inline-block; }
.btn:hover { background:#1a1a1a; }
.btn:disabled { opacity:0.6; cursor:not-allowed; }
.btn-sm { padding:5px 12px; font-size:12px; border-radius:6px; }
.btn-outline { background:transparent; color:#333; border:1px solid #ccc; }
.btn-outline:hover { background:#f5f5f5; }
.btn-primary { background:#1976d2; color:#fff; }
.btn-primary:hover { background:#1565c0; }
.btn-danger { background:#d32f2f; color:#fff; }
.btn-danger:hover { background:#b71c1c; }
.btn-success { background:#2e7d32; color:#fff; }
.btn-success:hover { background:#1b5e20; }
.btn-warning { background:#ff9800; color:#fff; }
.btn-warning:hover { background:#f57c00; }

.form-group { margin-bottom:16px; }
.form-group label { display:block; font-size:13px; color:#666; margin-bottom:6px; font-weight:500; }
.form-group input, .form-group select { width:100%; padding:10px 14px; font-size:14px; border:1px solid #ddd; border-radius:8px; background:#fafafa; outline:none; }
.form-group input:focus, .form-group select:focus { border-color:#333; background:#fff; }

.message { font-size:13px; margin-top:12px; min-height:18px; color:#d32f2f; }
.message.success { color:#2e7d32; }
.empty { text-align:center; color:#bbb; padding:30px 0; font-size:14px; }

.switch { position:relative; display:inline-block; width:42px; height:24px; vertical-align:middle; }
.switch input { opacity:0; width:0; height:0; }
.slider { position:absolute; cursor:pointer; top:0; left:0; right:0; bottom:0; background-color:#ccc; transition:.3s; border-radius:24px; }
.slider:before { position:absolute; content:""; height:18px; width:18px; left:3px; bottom:3px; background-color:white; transition:.3s; border-radius:50%; }
.switch input:checked + .slider { background-color:#1976d2; }
.switch input:checked + .slider:before { transform:translateX(18px); }

/* 会员开通按钮跳动动画 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@media (max-width:700px) {
    .container { padding:16px 12px 40px; }
    .user-menu .avatar-btn .uname { display:none; }
    .user-dropdown { width:220px; }
}
/* ============ 通知铃铛 ============ */
.notify-wrap {
    position: relative;
    display: inline-block;
}
.notify-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f5f5f5;
    cursor: pointer;
    color: #333;
    transition: background 0.15s;
}
.notify-bell:hover { background: #eaeaea; }
.notify-bell svg { width: 18px; height: 18px; }
.notify-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #d32f2f;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(211,47,47,0.35);
}
.notify-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-height: 440px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 600;
    overflow: hidden;
    display: none;
    flex-direction: column;
}
.notify-panel.show { display: flex; }
.notify-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}
.notify-header a {
    font-size: 12px;
    color: #1976d2;
    text-decoration: none;
    font-weight: 400;
}
.notify-list {
    flex: 1;
    overflow-y: auto;
    max-height: 380px;
}
.notify-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.15s;
}
.notify-item:hover { background: #fafafa; }
.notify-item.unread { background: #f0f7ff; }
.notify-item .n-title { font-size: 13px; font-weight: 600; color: #1a1a1a; margin-bottom: 4px; }
.notify-item .n-content { font-size: 12px; color: #666; line-height: 1.5; }
.notify-item .n-time { font-size: 11px; color: #aaa; margin-top: 4px; }
.notify-empty { text-align: center; padding: 30px; color: #bbb; font-size: 13px; }

/* 通知面板 - 手机适配 */
@media (max-width: 600px) {
    .notify-panel {
        position: fixed;
        top: 60px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        max-height: 70vh;
        z-index: 1000;
    }
    .notify-list {
        max-height: calc(70vh - 50px);
    }
}

@media (max-width: 700px) {
    .user-menu .avatar-btn .uname { display: none; }
    .balance-tag { font-size: 12px; padding: 4px 8px; }
    .notify-bell { width: 30px; height: 30px; }
    .notify-bell svg { width: 16px; height: 16px; }
}
