/* 基础样式 */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --sidebar-width: 250px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
}

/* 登录页面 */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--dark-color);
}

.login-note {
    margin-top: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* 应用布局 */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark-color);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo h2 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.nav-menu {
    list-style: none;
    padding: 20px 0;
    margin: 0;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
    gap: 10px;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* 移除侧边栏的退出登录按钮样式 */
.nav-menu li.logout {
    display: none;
}

/* 侧边栏页脚 */
.sidebar-footer {
    padding: 20px;
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    position: absolute;
    bottom: 0;
    width: 100%;
    background: var(--dark-color);
}

/* 主要内容区 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 顶部导航 */
.topbar {
    background: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left h1 {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 用户信息和下拉菜单 */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.user-dropdown {
    position: relative;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: 1px solid #e0e0e0;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    color: #333;
    font-size: 14px;
    border: none;
}

.user-profile:hover {
    background: #f5f5f5;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.dropdown-arrow {
    font-size: 12px;
    transition: transform 0.3s;
    margin-left: 5px;
}

.user-profile.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* 下拉菜单 */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-top: 10px;
    display: none;
    z-index: 1000;
    overflow: hidden;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu.show {
    display: block;
    animation: slideDown 0.3s;
}

.dropdown-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

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

.user-details {
    flex: 1;
}

.user-details strong {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
    color: #333;
}

.user-details small {
    color: #666;
    font-size: 12px;
}

.dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.3s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
}

.dropdown-item:hover {
    background: #f8f9fa;
}

.dropdown-item i {
    width: 20px;
    color: #666;
    text-align: center;
}

.dropdown-item.logout {
    color: #e74c3c;
}

.dropdown-item.logout i {
    color: #e74c3c;
}

.dropdown-item.logout:hover {
    background: #fdf2f2;
}

/* 内容区域 */
.content {
    padding: 30px;
    flex: 1;
}

/* 页脚 */
.footer {
    background: #f8f9fa;
    padding: 15px 30px;
    border-top: 1px solid #dee2e6;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), #667eea);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.stat-info h3 {
    font-size: 28px;
    margin-bottom: 5px;
    color: var(--dark-color);
}

.stat-info p {
    color: #666;
    font-size: 14px;
}

/* 内容区域 */
.content-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.content-section h2 {
    margin-bottom: 20px;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
}

/* 表格 */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--dark-color);
    white-space: nowrap;
}

.data-table tr:hover {
    background: #f9f9f9;
}

.data-table tr.selected {
    background-color: #e3f2fd;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    background: #2980b9;
    border-color: #2980b9;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
    border-color: #545b62;
}

.btn-edit {
    background: var(--secondary-color);
    color: white;
    border: 1px solid var(--secondary-color);
}

.btn-edit:hover {
    background: #27ae60;
    border-color: #229954;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: 1px solid var(--danger-color);
}

.btn-danger:hover {
    background: #c0392b;
    border-color: #b03a2e;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* 徽章 */
.badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.badge-vip {
    background: #f1c40f;
    color: #333;
}

.badge-views {
    background: #e74c3c;
    color: white;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-text {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
    line-height: 1.4;
}

.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

/* 筛选区域 */
.filter-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.filter-form .form-group {
    margin-bottom: 0;
}

.filter-form .form-row {
    align-items: flex-end;
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-header h1 {
    color: var(--dark-color);
    font-size: 1.8rem;
    margin: 0;
}

/* 缩略图 */
.thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow: hidden;
}

.modal-content {
    background: white;
    margin: 5% auto;
    width: 90%;
    max-width: 600px;
    border-radius: 10px;
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    color: var(--dark-color);
    font-size: 1.3rem;
}

.close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    text-align: right;
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 密码表单 */
.password-form {
    padding: 10px 0;
}

.password-form .form-group {
    margin-bottom: 1.5rem;
}

.password-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.password-form input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.password-form input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 空状态提示 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #dee2e6;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #495057;
}

.empty-state p {
    margin-bottom: 20px;
    color: #6c757d;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 120px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        z-index: 1001;
    }
    
    .sidebar .logo h2 span {
        display: none;
    }
    
    .sidebar .nav-menu li a span {
        display: none;
    }
    
    .main-content {
        margin-left: 60px;
    }
    
    .topbar {
        padding: 12px 20px;
    }
    
    .topbar-left h1 {
        font-size: 1.3rem;
    }
    
    .user-profile .username {
        display: none;
    }
    
    .dropdown-menu {
        position: fixed;
        top: auto;
        right: 20px;
        left: 20px;
        width: auto;
        max-width: 280px;
        margin-top: 10px;
    }
    
    .content {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        min-width: 100%;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        top: auto;
        z-index: 1001;
    }
    
    .main-content {
        margin-left: 0;
        margin-bottom: 60px;
    }
    
    .sidebar .nav-menu {
        display: flex;
        padding: 0;
    }
    
    .sidebar .nav-menu li {
        flex: 1;
    }
    
    .sidebar .nav-menu li a {
        flex-direction: column;
        padding: 10px;
        text-align: center;
        font-size: 12px;
    }
    
    .sidebar .nav-menu li a i {
        font-size: 18px;
        margin-bottom: 5px;
    }
    
    .sidebar .logo,
    .sidebar-footer {
        display: none;
    }
    
    .topbar {
        position: relative;
    }
    
    .content {
        padding: 15px;
    }
}