/* 全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif; background: #f5f7fa; color: #333; line-height: 1.6; }
a { text-decoration: none; color: inherit; }

/* 头部 */
.header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; padding: 20px 0; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
.header h1 { font-size: 24px; font-weight: 600; }
.header .nav a { color: #fff; margin-left: 20px; opacity: 0.9; transition: opacity 0.3s; }
.header .nav a:hover { opacity: 1; }

/* 主容器 */
.container { max-width: 1200px; margin: 20px auto; padding: 0 20px; display: flex; gap: 20px; }

/* 左侧分类 */
.sidebar { width: 200px; flex-shrink: 0; }
.sidebar .menu { background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); overflow: hidden; }
.sidebar .menu a { display: block; padding: 12px 20px; transition: all 0.3s; border-left: 3px solid transparent; }
.sidebar .menu a:hover, .sidebar .menu a.active { background: #f0f4ff; border-left-color: #667eea; color: #667eea; font-weight: 500; }
.sidebar .menu .menu-title { padding: 12px 20px; color: #999; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }

/* 右侧内容 */
.main-content { flex: 1; min-width: 0; }
.article-card { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; }
.article-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.article-card .article-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.article-card .title { font-size: 18px; font-weight: 600; color: #1a1a1a; flex: 1; }
.article-card .category { display: inline-block; padding: 4px 12px; background: #f0f4ff; color: #667eea; border-radius: 20px; font-size: 12px; font-weight: 500; margin-right: 10px; white-space: nowrap; }
.article-card .summary { color: #666; font-size: 14px; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-card .meta { display: flex; justify-content: space-between; align-items: center; color: #999; font-size: 12px; }
.article-card .content { color: #333; font-size: 15px; line-height: 1.8; margin: 10px 0; }
.article-card .expand-btn { color: #667eea; font-size: 13px; font-weight: 500; }

/* 详情页 */
.article-detail { background: #fff; border-radius: 8px; padding: 30px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.article-detail h1 { font-size: 26px; margin-bottom: 15px; color: #1a1a1a; }
.article-detail .detail-meta { color: #999; font-size: 13px; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #eee; }
.article-detail .detail-content { font-size: 16px; line-height: 1.8; color: #333; }
.back-btn { display: inline-block; margin-bottom: 20px; color: #667eea; font-size: 14px; font-weight: 500; }

/* 后台样式 */
.admin-header { background: #2d3748; color: #fff; padding: 15px 0; }
.admin-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
.admin-inner h1 { font-size: 20px; }
.admin-inner .logout { color: #fff; background: rgba(255,255,255,0.1); padding: 8px 20px; border-radius: 6px; transition: background 0.3s; }
.admin-inner .logout:hover { background: rgba(255,255,255,0.2); }

.admin-content { max-width: 1200px; margin: 20px auto; padding: 0 20px; }
.admin-tabs { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 2px solid #e2e8f0; padding-bottom: 10px; }
.admin-tabs a { padding: 10px 20px; color: #666; font-weight: 500; border-radius: 6px 6px 0 0; transition: all 0.3s; }
.admin-tabs a.active, .admin-tabs a:hover { background: #667eea; color: #fff; }

.admin-card { background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); padding: 25px; margin-bottom: 20px; }
.admin-card h2 { font-size: 18px; margin-bottom: 20px; color: #2d3748; padding-bottom: 15px; border-bottom: 1px solid #e2e8f0; }

.btn { padding: 8px 20px; border: none; border-radius: 6px; font-size: 14px; cursor: pointer; font-weight: 500; transition: all 0.3s; }
.btn-primary { background: #667eea; color: #fff; }
.btn-primary:hover { background: #5568d3; }
.btn-danger { background: #e53e3e; color: #fff; }
.btn-danger:hover { background: #c53030; }
.btn-success { background: #48bb78; color: #fff; }
.btn-success:hover { background: #38a169; }
.btn-small { padding: 6px 14px; font-size: 12px; }
.btn-secondary { background: #e2e8f0; color: #4a5568; }
.btn-secondary:hover { background: #cbd5e0; }

table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 12px; text-align: left; border-bottom: 1px solid #e2e8f0; }
table th { background: #f7fafc; font-weight: 600; color: #4a5568; font-size: 13px; }
table td { font-size: 14px; }
.table-actions { display: flex; gap: 8px; }

form label { display: block; font-weight: 500; margin-bottom: 6px; color: #4a5568; }
form input, form select, form textarea { width: 100%; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 14px; transition: border-color 0.3s; }
form input:focus, form select:focus, form textarea:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,0.1); }
form textarea { min-height: 150px; resize: vertical; }
.form-group { margin-bottom: 15px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.login-container { max-width: 400px; margin: 100px auto; background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.login-container h2 { text-align: center; margin-bottom: 30px; color: #2d3748; }
.login-container .btn { width: 100%; padding: 12px; font-size: 16px; }
.error-msg { color: #e53e3e; font-size: 13px; margin-top: 10px; text-align: center; }

.tag { display: inline-block; padding: 2px 10px; background: #f0f4ff; color: #667eea; border-radius: 12px; font-size: 12px; }

/* 拖拽排序 */
.draggable { cursor: move; }
.draggable:hover { background: #f7fafc; }

/* 消息提示 */
.toast { position: fixed; top: 20px; right: 20px; padding: 12px 24px; border-radius: 8px; color: #fff; font-size: 14px; z-index: 9999; animation: slideIn 0.3s ease; }
.toast-success { background: #48bb78; }
.toast-error { background: #e53e3e; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-state .icon { font-size: 48px; margin-bottom: 15px; }
.empty-state p { font-size: 16px; }

/* 响应式 */
@media (max-width: 768px) {
    .container { flex-direction: column; }
    .sidebar { width: 100%; }
    .sidebar .menu { display: flex; overflow-x: auto; }
    .sidebar .menu a { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; padding: 12px 16px; }
    .sidebar .menu a.active { border-bottom-color: #667eea; }
    .form-row { grid-template-columns: 1fr; }
}
