/* 仪表盘页面样式 */

/* 基础重置 */
.dashboard-layout *,
.dashboard-layout *::before,
.dashboard-layout *::after {
    box-sizing: border-box;
}

/* 整体布局 */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background: #f5f7fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: #333;
}

.dashboard-loading {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 侧边栏样式 */
.sidebar {
    width: 220px;
    background: #fff;
    border-right: 1px solid #eee;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.sidebar-logo img {
    height: 45px;
    width: auto;
}

.sidebar-logo span {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #999;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.sidebar-close:hover {
    color: #333;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.nav-section {
    margin-bottom: 0;
}

.nav-heading {
    padding: 14px 14px 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #999;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    margin: 2px 0;
    color: #555;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border-radius: 8px;
    border: none;
}

.nav-item:hover {
    background: #f5f5f5;
    color: #333;
}

.nav-item.active {
    background: #20a53a;
    color: #fff;
}

.nav-item.active:hover {
    background: #1b8f32;
    color: #fff;
}

.nav-item i {
    width: 20px;
    margin-right: 10px;
    font-size: 1rem;
    text-align: center;
}

.nav-item span {
    font-size: 0.9rem;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid #eee;
    font-size: 0.7rem;
    color: #999;
    text-align: center;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 220px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 顶部栏 */
.top-header {
    background: #20a53a;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
}

.page-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.user-dropdown {
    position: relative;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    display: none;
    overflow: hidden;
}

.user-dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #555;
    text-decoration: none;
    transition: background 0.2s;
    cursor: pointer;
}

.dropdown-item:hover {
    background: #f8f9fa;
}

.dropdown-item i {
    width: 16px;
    color: #999;
}

/* 内容区域 */
.content-area {
    flex: 1;
    padding: 24px;
}

/* 卡片样式 */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.card-body {
    padding: 20px;
}

/* 公告卡片 */
.notice-card {
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.notice-content {
    background: rgba(0, 0, 0, 0.5);
    padding: 30px;
    color: #fff;
}

.notice-badge {
    display: inline-block;
    background: #dc3545;
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.notice-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0 0 8px 0;
}

.notice-date {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
}

/* 订阅卡片 */
.subscribe-empty {
    text-align: center;
    padding: 40px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.subscribe-empty:hover {
    background: #f8f9fa;
}

.subscribe-empty i {
    display: block;
    font-size: 2rem;
    color: #ccc;
    margin-bottom: 10px;
}

.subscribe-empty p {
    color: #999;
    font-size: 0.875rem;
    margin: 0;
}

/* 订阅信息卡片 */
.subscribe-info {
    padding: 20px;
}

.subscribe-plan {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.plan-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.plan-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.plan-status.active {
    background: rgba(32, 165, 58, 0.1);
    color: #20a53a;
}

.plan-status.expired {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.subscribe-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.stat-label {
    font-size: 0.75rem;
    color: #999;
    margin-top: 4px;
}

/* 捷径卡片 */
.shortcuts-list {
    padding: 0;
}

.shortcut-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.shortcut-item:last-child {
    border-bottom: none;
}

.shortcut-item:hover {
    background: #f8f9fa;
}

.shortcut-info {
    flex: 1;
}

.shortcut-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.shortcut-desc {
    font-size: 0.8rem;
    color: #999;
}

.shortcut-icon {
    width: 40px;
    height: 40px;
    background: rgba(32, 165, 58, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #20a53a;
    font-size: 1rem;
}

/* 移动端遮罩 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* 响应式设计 */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-header {
        justify-content: center;
        gap: 20px;
    }
    
    .sidebar-close {
        display: block;
        position: static;
        font-size: 1.3rem;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .content-area {
        padding: 16px;
    }
    
    .subscribe-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .header-btn .btn-text {
        display: none;
    }
    
    .top-header {
        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    .notice-content {
        padding: 20px;
    }
    
    .notice-title {
        font-size: 1rem;
    }
}

/* 加载状态 */
.dashboard-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f5f7fa;
}

.dashboard-loading .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #20a53a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Simple Icons 替代 */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    stroke-width: 0;
    stroke: currentColor;
    fill: currentColor;
}
