:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --danger: #ef4444;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #f9fafb;
    --bg-dark: #111827;
    --border: #e5e7eb;
    --card: #ffffff;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* 页面切换 */
.page {
    display: none;
}

.page.active {
    display: flex;
}

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

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

.login-card {
    background: var(--card);
    padding: 3rem 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
}

.logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.logo p {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* 表单 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.form-footer a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
}

/* 按钮 */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-text {
    background: transparent;
    color: var(--text-light);
}

/* 主应用布局 */
#app {
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
    gap: 0.75rem;
}

.nav-item:hover {
    background: var(--bg);
}

.nav-item.active {
    background: var(--bg);
    color: var(--primary);
    font-weight: 500;
    border-left: 3px solid var(--primary);
}

.nav-item .icon {
    font-size: 1.25rem;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    max-width: 1200px;
}

.content-section {
    display: none;
}

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

.page-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-light);
}

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

.stat-card {
    background: var(--card);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
}

.stat-label {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* 文章列表 */
.posts-list {
    display: grid;
    gap: 1rem;
}

.post-card {
    background: var(--card);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.post-card h3 {
    margin-bottom: 0.5rem;
}

.post-card p {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.post-card .post-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card);
    padding: 2rem;
    border-radius: 1rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* 空状态 */
.empty-state {
    text-align: center;
    color: var(--text-light);
    padding: 3rem;
}

/* 响应式 */
@media (max-width: 768px) {
    #app {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
    }
    
    .main-content {
        padding: 1rem;
    }
}
