/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-header {
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.login-header h2 {
    color: #333;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #666;
    font-size: 0.9rem;
}

.login-form {
    margin-bottom: 1rem;
}

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

.form-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.form-group input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
}

.login-btn i {
    margin-right: 0.5rem;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 0.75rem;
    border-radius: 5px;
    margin-top: 1rem;
    border: 1px solid #fcc;
}

/* 管理后台主界面 */
.admin-panel {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-header {
    background: white;
    padding: 0 2rem;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.menu-toggle {
    font-size: 1.2rem;
    margin-right: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.menu-toggle:hover {
    background: #f0f0f0;
}

.header-left h1 {
    color: #333;
    font-size: 1.5rem;
}

.header-left h1 i {
    color: #667eea;
    margin-right: 0.5rem;
}

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

.admin-info {
    color: #666;
    font-size: 0.9rem;
}

.admin-info i {
    color: #667eea;
    margin-right: 0.25rem;
}

.logout-btn {
    padding: 0.5rem 1rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 0.9rem;
}

.logout-btn:hover {
    background: #c82333;
}

.logout-btn i {
    margin-right: 0.25rem;
}

/* 主体区域 */
.admin-main {
    flex: 1;
    display: flex;
}

.admin-sidebar {
    width: 250px;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.admin-sidebar.collapsed {
    transform: translateX(-100%);
}

.nav-menu {
    list-style: none;
    padding: 1rem 0;
}

.nav-item {
    padding: 1rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #f8f9fa;
    border-left-color: #667eea;
}

.nav-item.active {
    background: #e8f0fe;
    border-left-color: #667eea;
    color: #667eea;
}

.nav-item i {
    width: 20px;
    margin-right: 1rem;
    text-align: center;
}

/* 内容区域 */
.admin-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.content-page {
    display: none;
}

.content-page.active {
    display: block;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.page-header h2 {
    color: #333;
    font-size: 1.8rem;
}

.page-header h2 i {
    color: #667eea;
    margin-right: 0.5rem;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.period-select {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
}

.refresh-btn {
    padding: 0.5rem 1rem;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.refresh-btn:hover {
    background: #218838;
}

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

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

.stat-card.users {
    border-left: 4px solid #007bff;
}

.stat-card.spots {
    border-left: 4px solid #28a745;
}

.stat-card.checkins {
    border-left: 4px solid #ffc107;
}

.stat-card.earnings {
    border-left: 4px solid #dc3545;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.5rem;
    color: white;
}

.stat-card.users .stat-icon {
    background: #007bff;
}

.stat-card.spots .stat-icon {
    background: #28a745;
}

.stat-card.checkins .stat-icon {
    background: #ffc107;
}

.stat-card.earnings .stat-icon {
    background: #dc3545;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.stat-growth {
    color: #28a745;
    font-size: 0.8rem;
    font-weight: bold;
}

/* 仪表板网格 */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.card-header h3 {
    color: #333;
    font-size: 1.2rem;
}

.card-header h3 i {
    color: #667eea;
    margin-right: 0.5rem;
}

.card-content {
    padding: 0;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 1px solid #e9ecef;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

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

/* 待处理事项 */
.pending-tasks {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 1.5rem;
}

.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background 0.3s ease;
    cursor: pointer;
}

.task-item:hover {
    background: #e9ecef;
}

.task-item i {
    font-size: 1.5rem;
    margin-right: 1rem;
    color: #667eea;
}

.task-item span:nth-child(2) {
    flex: 1;
    font-weight: 500;
}

.task-count {
    background: #dc3545;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.task-count.zero {
    background: #28a745;
}

/* 加载占位符 */
.loading-placeholder {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.loading-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #667eea;
}

.loading-placeholder p {
    font-size: 1.1rem;
}

/* 加载遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
}

.loading-spinner i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .admin-header {
        padding: 0 1rem;
    }
    
    .header-left h1 {
        display: none;
    }
    
    .admin-content {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .tasks-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .admin-sidebar.collapsed {
        transform: translateX(0);
        position: fixed;
        top: 70px;
        left: 0;
        height: calc(100vh - 70px);
        z-index: 999;
    }
    
    .admin-content {
        margin-left: 0;
    }
}

/* 数据表格样式 */
.data-table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    margin: 1.5rem 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.data-table th {
    font-weight: 600;
    white-space: nowrap;
}

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

.data-table .loading-row {
    text-align: center;
    color: #666;
    padding: 2rem;
}

/* 用户信息样式 */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* 景点信息样式 */
.spot-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.spot-cover {
    width: 50px;
    height: 35px;
    border-radius: 5px;
    object-fit: cover;
}

.spot-title {
    font-weight: 500;
}

/* 状态标识样式 */
.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.warning {
    background: #fff3cd;
    color: #856404;
}

.status-badge.success {
    background: #d4edda;
    color: #155724;
}

.status-badge.danger {
    background: #f8d7da;
    color: #721c24;
}

/* 操作按钮样式 */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* 搜索和筛选样式 */
.search-input,
.filter-select {
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-input:focus,
.filter-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.search-input {
    min-width: 250px;
}

.filter-select {
    min-width: 120px;
}

/* 评论内容样式 */
.comment-content {
    max-width: 200px;
    word-break: break-word;
    line-height: 1.4;
}

/* 分页样式 */
.pagination-container {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.pagination {
    display: flex;
    gap: 0.5rem;
}

.pagination button {
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 配置页面样式 */
.config-container {
    display: grid;
    gap: 2rem;
    max-width: 800px;
}

.config-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.config-section h3 {
    margin-bottom: 1.5rem;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

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

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

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* 手机端适配 */
@media (max-width: 768px) {
    .data-table-container {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 600px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .search-input {
        min-width: 150px;
    }
    
    .user-info,
    .spot-info {
        flex-direction: column;
        gap: 0.4rem;
        text-align: center;
    }
}