* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background: linear-gradient(135deg, #ffffff 0%, #faf8f5 50%, #ffffff 100%);
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 80%, rgba(211, 47, 47, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(197, 158, 92, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(211, 47, 47, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 20px 16px;
    position: relative;
    z-index: 1;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    height: 44px;
    padding: 0 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.7);
    color: #555;
    border: 1px solid rgba(211, 47, 47, 0.2);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(211, 47, 47, 0.3);
}

.btn-lg {
    width: 100%;
    height: 52px;
    padding: 0 32px;
    font-size: 16px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.form-label .required {
    color: #D32F2F;
    margin-left: 2px;
}

.form-control {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 1px solid rgba(211, 47, 47, 0.15);
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
    background: rgba(255, 255, 255, 0.8);
    color: #333;
    backdrop-filter: blur(10px);
}

.form-control:focus {
    border-color: rgba(211, 47, 47, 0.5);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.15);
    background: rgba(255, 255, 255, 0.95);
}

.form-control::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px rgba(255, 255, 255, 0.9) inset;
    -webkit-text-fill-color: #333;
    transition: background-color 5000s ease-in-out 0s;
}

textarea.form-control {
    height: auto;
    min-height: 80px;
    padding: 12px 16px;
    resize: vertical;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(211, 47, 47, 0.1);
    box-shadow: 0 8px 32px rgba(211, 47, 47, 0.08);
    padding: 24px 20px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(211, 47, 47, 0.4), rgba(197, 158, 92, 0.3), transparent);
}

.card-header {
    text-align: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: 13px;
    color: #888;
}

.logo {
    text-align: center;
    margin-bottom: 24px;
}

.logo-image {
    width: 80px;
    height: auto;
    margin: 0 auto 12px;
    display: block;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.15);
}

.logo-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-desc {
    font-size: 13px;
    color: #999;
    margin-top: 4px;
}

.links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
}

.link {
    font-size: 13px;
    color: #999;
    text-decoration: none;
    transition: color 0.3s ease;
}

.link:hover {
    color: #D32F2F;
}

.error-msg {
    color: #D32F2F;
    font-size: 12px;
    margin-top: 6px;
    display: block;
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: #333;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    border: 1px solid rgba(211, 47, 47, 0.15);
    box-shadow: 0 10px 40px rgba(211, 47, 47, 0.15);
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.toast.success {
    background: rgba(34, 197, 94, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.toast.error {
    background: rgba(211, 47, 47, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.toast.warning {
    background: rgba(197, 158, 92, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1500;
    align-items: center;
    justify-content: center;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(211, 47, 47, 0.1);
    border-top: 3px solid #D32F2F;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-pending {
    background: rgba(197, 158, 92, 0.15);
    color: #b45309;
    border: 1px solid rgba(197, 158, 92, 0.25);
}

.badge-approved {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.badge-rejected {
    background: rgba(211, 47, 47, 0.15);
    color: #dc2626;
    border: 1px solid rgba(211, 47, 47, 0.25);
}

.text-center { text-align: center; }
.text-primary { color: #D32F2F; }
.text-success { color: #16a34a; }
.text-danger { color: #dc2626; }
.text-gray { color: #999; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 24px; }

.d-flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

.file-upload-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    border: 1px dashed rgba(211, 47, 47, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    color: #888;
    font-size: 13px;
}

.file-upload-label:hover {
    border-color: rgba(211, 47, 47, 0.5);
    background: rgba(211, 47, 47, 0.05);
    color: #D32F2F;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.file-name-display {
    margin-top: 6px;
    font-size: 12px;
    color: #666;
    word-break: break-all;
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(211, 47, 47, 0.1);
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.header-back {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(211, 47, 47, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #D32F2F;
    font-size: 18px;
}

.header-back:hover {
    background: rgba(211, 47, 47, 0.15);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 14px;
    color: #888;
}

.info-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    max-width: 60%;
    text-align: right;
    word-break: break-all;
}

.status-section {
    text-align: center;
    padding: 20px;
}

.status-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.status-icon.pending {
    background: rgba(197, 158, 92, 0.15);
    color: #b45309;
}

.status-icon.approved {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.status-icon.rejected {
    background: rgba(211, 47, 47, 0.15);
    color: #dc2626;
}

.status-text {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.status-desc {
    font-size: 13px;
    color: #888;
}

/* 移动端默认样式 (max-width: 767px) */
@media (max-width: 767px) {
    .container {
        max-width: 100%;
        padding: 16px 12px;
    }
    
    .card {
        padding: 20px 16px;
        border-radius: 14px;
    }
    
    .card-title {
        font-size: 18px;
    }
    
    .btn {
        height: 44px;
        font-size: 14px;
    }
    
    .btn-lg {
        height: 48px;
    }
    
    .form-control {
        height: 44px;
    }
}

/* 平板样式 (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        max-width: 720px;
        padding: 24px 20px;
    }
    
    .card {
        padding: 28px 24px;
    }
    
    .form-row {
        flex-direction: row;
        gap: 16px;
    }
    
    .form-row .form-group {
        flex: 1;
    }
}

/* PC端样式 (min-width: 1024px) */
@media (min-width: 1024px) {
    body {
        font-size: 15px;
    }
    
    .container {
        max-width: 960px;
        padding: 30px 28px;
    }
    
    .card {
        padding: 32px;
        border-radius: 20px;
    }
    
    .card-title {
        font-size: 22px;
    }
    
    .form-row {
        flex-direction: row;
        gap: 20px;
    }
    
    .form-row .form-group {
        flex: 1;
    }
    
    .btn {
        height: 46px;
        font-size: 15px;
    }
    
    .btn-lg {
        height: 52px;
        font-size: 17px;
    }
    
    .form-control {
        height: 46px;
        font-size: 15px;
    }
    
    .header-title {
        font-size: 20px;
    }
    
    .logo-image {
        width: 100px;
    }
    
    .logo-title {
        font-size: 22px;
    }
}

/* 大屏PC端 (min-width: 1440px) */
@media (min-width: 1440px) {
    .container {
        max-width: 1200px;
        padding: 40px 32px;
    }
    
    body {
        font-size: 16px;
    }
    
    .card {
        padding: 40px;
    }
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        padding: 12px 16px;
    }
    
    .card {
        padding: 16px;
    }
    
    .logo-image {
        width: 60px;
    }
    
    .logo {
        margin-bottom: 16px;
    }
    
    .card-header {
        margin-bottom: 12px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
        color: #e0e0e0;
    }
    
    .card {
        background: rgba(42, 42, 42, 0.7);
        border-color: rgba(211, 47, 47, 0.2);
    }
    
    .form-control {
        background: rgba(50, 50, 50, 0.8);
        color: #e0e0e0;
        border-color: rgba(211, 47, 47, 0.2);
    }
    
    .form-control:focus {
        background: rgba(60, 60, 60, 0.9);
    }
    
    .form-control::placeholder {
        color: rgba(255, 255, 255, 0.3);
    }
    
    .card-title, .header-title {
        color: #e0e0e0;
    }
    
    .card-subtitle, .form-label {
        color: #aaa;
    }
    
    .info-label {
        color: #888;
    }
    
    .info-value {
        color: #e0e0e0;
    }
    
    .badge-pending {
        background: rgba(197, 158, 92, 0.2);
        color: #fbbf24;
    }
    
    .badge-approved {
        background: rgba(34, 197, 94, 0.2);
        color: #4ade80;
    }
    
    .badge-rejected {
        background: rgba(211, 47, 47, 0.2);
        color: #f87171;
    }
    
    .btn-secondary {
        background: rgba(60, 60, 60, 0.7);
        color: #ccc;
        border-color: rgba(211, 47, 47, 0.3);
    }
    
    .btn-secondary:hover {
        background: rgba(70, 70, 70, 0.9);
    }
}

/* 基于设备class的样式优化 */
body.device-mobile .container {
    max-width: 100%;
    padding: 16px 12px;
}

body.device-mobile .card {
    padding: 20px 16px;
    border-radius: 14px;
}

body.device-mobile .form-row {
    flex-direction: column;
}

body.device-tablet .container {
    max-width: 720px;
}

body.device-pc .container {
    max-width: 960px;
}

body.device-pc .form-row {
    flex-direction: row;
    gap: 20px;
}

body.device-pc .form-row .form-group {
    flex: 1;
}

body.device-pc .card {
    padding: 32px;
    border-radius: 20px;
}

body.device-pc .card-title {
    font-size: 22px;
}

body.device-pc .btn {
    height: 46px;
    font-size: 15px;
}

body.device-pc .form-control {
    height: 46px;
    font-size: 15px;
}

body.device-pc .logo-image {
    width: 100px;
}

body.device-pc .logo-title {
    font-size: 22px;
}

/* 触摸设备优化 */
body.device-mobile .btn,
body.device-mobile .form-control,
body.device-mobile .select-wrapper select {
    min-height: 44px;
}

/* 防止移动端字体自动缩放 */
body {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* 安全区域适配（刘海屏等） */
@supports (padding: max(0px)) {
    body.device-mobile {
        padding-top: max(0px, env(safe-area-inset-top));
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
}

/* 底部导航样式 */
.bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(211, 47, 47, 0.08);
    padding: 8px 0;
    justify-content: space-around;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(211, 47, 47, 0.08);
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    cursor: pointer;
    color: #999;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 60px;
}

.bottom-nav-item:hover {
    color: #D32F2F;
}

.bottom-nav-item.active {
    color: #D32F2F;
}

.bottom-nav-icon {
    font-size: 20px;
}

.bottom-nav-text {
    font-size: 11px;
}

/* 移动端底部导航 */
body.device-mobile .bottom-nav {
    padding: 6px 0;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
}

body.device-mobile .bottom-nav-item {
    padding: 6px 12px;
    min-width: 50px;
}

body.device-mobile .bottom-nav-icon {
    font-size: 18px;
}

body.device-mobile .bottom-nav-text {
    font-size: 10px;
}

/* PC端和平板端隐藏底部导航 */
body.device-pc .bottom-nav,
body.device-tablet .bottom-nav {
    display: none;
}

/* PC端布局适配 - 为底部导航预留空间 */
body.device-mobile .container {
    padding-bottom: 80px;
}

/* ============ 顶部导航 Header ============ */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(211, 47, 47, 0.1);
    z-index: 100;
    padding: 0 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(211, 47, 47, 0.08);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    color: #D32F2F;
    transition: all 0.3s ease;
}

.menu-btn:hover {
    background: rgba(211, 47, 47, 0.15);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-logo i {
    -webkit-text-fill-color: initial;
    color: #D32F2F;
    font-size: 20px;
}

.header-logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
}

.sidebar-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 8px;
}

.header-right {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.user-detail {
    display: none;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.user-role {
    font-size: 12px;
    color: #999;
}

/* ============ 侧边栏 Sidebar ============ */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 240px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(211, 47, 47, 0.1);
    z-index: 90;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 4px 0 20px rgba(211, 47, 47, 0.08);
}

.sidebar.show {
    transform: translateX(0);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(211, 47, 47, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.sidebar-logo i {
    color: #D32F2F;
    font-size: 24px;
}

.sidebar-menu {
    padding: 12px 0;
}

.menu-group {
    padding: 12px 20px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar .menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar .menu-item:hover {
    background: rgba(211, 47, 47, 0.06);
    color: #D32F2F;
}

.sidebar .menu-item.active {
    background: rgba(211, 47, 47, 0.08);
    color: #D32F2F;
    font-weight: 600;
    border-left-color: #D32F2F;
}

.sidebar .menu-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* 侧边栏遮罩层 */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 85;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* ============ 主内容区布局 ============ */
.main-wrapper {
    padding-top: 60px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

body.device-pc .main-wrapper {
    margin-left: 240px;
    padding-top: 60px;
}

body.device-pc .sidebar {
    transform: translateX(0);
    transition: transform 0.3s ease;
}

body.device-pc .sidebar-overlay {
    display: none !important;
}

/* 侧边栏折叠状态（仅PC端生效）- 放在后面确保优先级 */
.sidebar-toggle {
    cursor: pointer;
    user-select: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.sidebar-toggle:hover {
    background: rgba(211, 47, 47, 0.08);
}

.sidebar-toggle .toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

body.sidebar-collapsed .sidebar-toggle .toggle-icon {
    transform: rotate(180deg);
}

/* 移动端和平板端隐藏折叠切换按钮 */
@media (max-width: 1023px) {
    .sidebar-toggle {
        display: none;
    }
}

/* ============ 响应式适配 ============ */
/* 移动端 */
@media (max-width: 767px) {
    .app-header {
        padding: 0 12px;
    }
    
    .header-logo {
        font-size: 15px;
    }
    
    .user-detail {
        display: none;
    }
    
    .sidebar {
        width: 260px;
    }
    
    body.device-pc .main-wrapper,
    body.device-tablet .main-wrapper {
        margin-left: 0;
    }
    
    body.device-pc .sidebar {
        transform: translateX(-100%);
    }
    
    body.device-pc .sidebar.show {
        transform: translateX(0);
    }
}

/* 平板端 */
@media (min-width: 768px) and (max-width: 1023px) {
    .user-detail {
        display: block;
    }
    
    .sidebar {
        width: 240px;
    }
    
    body.device-tablet .main-wrapper {
        margin-left: 0;
    }
    
    body.device-tablet .sidebar {
        transform: translateX(-100%);
    }
    
    body.device-tablet .sidebar.show {
        transform: translateX(0);
    }
}

/* PC端 */
@media (min-width: 1024px) {
    .user-detail {
        display: block;
    }
    
    .app-header {
        padding: 0 24px;
    }
    
    .header-logo {
        font-size: 17px;
    }
    
    .sidebar {
        width: 240px;
    }
    
    body.device-pc .main-wrapper {
        margin-left: 240px;
    }
    
    .main-wrapper .container {
        max-width: 1000px;
    }
}

/* 大屏PC端 */
@media (min-width: 1440px) {
    .sidebar {
        width: 260px;
    }
    
    body.device-pc .main-wrapper {
        margin-left: 260px;
    }
    
    .main-wrapper .container {
        max-width: 1200px;
    }
}

/* 深色模式 - 侧边栏和header */
@media (prefers-color-scheme: dark) {
    .app-header {
        background: rgba(30, 30, 30, 0.95);
        border-color: rgba(211, 47, 47, 0.15);
    }
    
    .menu-btn {
        background: rgba(211, 47, 47, 0.15);
        color: #f87171;
    }
    
    .user-name {
        color: #e0e0e0;
    }
    
    .user-role {
        color: #888;
    }
    
    .sidebar {
        background: rgba(30, 30, 30, 0.98);
        border-color: rgba(211, 47, 47, 0.15);
    }
    
    .sidebar-header {
        border-color: rgba(211, 47, 47, 0.15);
    }
    
    .sidebar-logo {
        color: #e0e0e0;
    }
    
    .sidebar .menu-item {
        color: #aaa;
    }
    
    .sidebar .menu-item:hover {
        background: rgba(211, 47, 47, 0.1);
        color: #f87171;
    }
    
    .sidebar .menu-item.active {
        background: rgba(211, 47, 47, 0.15);
        color: #f87171;
    }
    
    .menu-group {
        color: #888;
    }
}

/* ============ 侧边栏折叠状态 - 高优先级 ============ */
@media (min-width: 1024px) {
    body.sidebar-collapsed .sidebar {
        transform: translateX(-100%) !important;
    }

    body.sidebar-collapsed .main-wrapper {
        margin-left: 0 !important;
    }
}
