/* 大隐文化管理后台 - 样式表 */

/* ============ 基础样式 ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* ============ 页面切换 ============ */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* ============ 登录页面 ============ */
#login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#login-page.active {
    display: flex;
}

.login-container, .register-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
}

/* ============ 主应用布局 ============ */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ============ 侧边栏 ============ */
.sidebar {
    width: 220px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.logo {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo h2 {
    font-size: 18px;
}

.menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.menu-item {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s;
    color: rgba(255, 255, 255, 0.7);
}

.menu-item:hover, .menu-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.menu-item .icon {
    margin-right: 10px;
    font-size: 18px;
}

.user-info {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info span {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============ 主内容区 ============ */
.main-content {
    flex: 1;
    margin-left: 220px;
    padding: 30px;
    background: #f5f5f5;
    min-height: 100vh;
}

.content-page {
    display: none;
}

.content-page.active {
    display: block;
}

.content-page h1 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

/* ============ 统计卡片 ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-card h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
}

/* ============ 区块 ============ */
.section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.section h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

/* ============ 日历组件 ============ */
.calendar-widget {
    max-width: 400px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendar-header button {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.calendar-header span {
    font-size: 16px;
    font-weight: 500;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    padding: 10px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.calendar-day:hover {
    background: #f0f0f0;
}

.calendar-day.header {
    font-weight: bold;
    color: #666;
    background: none;
}

.calendar-day.today {
    background: #667eea;
    color: white;
}

.calendar-day.selected {
    background: #764ba2;
    color: white;
}

.calendar-day.other-month {
    color: #ccc;
}

/* ============ 待办列表 ============ */
.todo-list-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.todo-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s;
}

.todo-item:hover {
    background: #f9f9f9;
}

.todo-item:last-child {
    border-bottom: none;
}

.todo-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    margin-right: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.todo-checkbox.checked {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.todo-content {
    flex: 1;
}

.todo-title {
    font-size: 14px;
    color: #333;
}

.todo-item.completed .todo-title {
    text-decoration: line-through;
    color: #999;
}

.todo-date {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.todo-priority {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.todo-priority.high {
    background: #ffebee;
    color: #f44336;
}

.todo-priority.medium {
    background: #fff3e0;
    color: #ff9800;
}

.todo-priority.low {
    background: #e8f5e9;
    color: #4caf50;
}

/* ============ 表格 ============ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.search-bar select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    min-width: 120px;
}

.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f9f9f9;
    font-weight: 500;
    color: #666;
    font-size: 14px;
}

.data-table td {
    font-size: 14px;
}

.data-table tr:hover {
    background: #f9f9f9;
}

.table-actions {
    display: flex;
    gap: 10px;
}

.btn-action {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-edit {
    background: #667eea;
    color: white;
}

.btn-delete {
    background: #f44336;
    color: white;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.status-badge.active {
    background: #e8f5e9;
    color: #4caf50;
}

.status-badge.pending {
    background: #fff3e0;
    color: #ff9800;
}

.status-badge.inactive {
    background: #ffebee;
    color: #f44336;
}

/* ============ 分页 ============ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 15px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
}

.pagination button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============ 快速跳转 ============ */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: #333;
    transition: transform 0.3s, box-shadow 0.3s;
}

.link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.link-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

/* ============ 待办筛选 ============ */
.todo-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 8px 20px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn.active, .filter-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ============ 模态框 ============ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-secondary {
    flex: 1;
    padding: 12px;
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
}

.btn-danger {
    background: #f44336;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    flex: 1;
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar .logo h2, .menu-item span, .user-info span {
        display: none;
    }
    
    .main-content {
        margin-left: 60px;
    }
}
