/* ============================================
   绘画画廊 - 样式表（简化版）
   ============================================ */

:root {
    --primary: #6C5CE7;
    --primary-dark: #5A4BD1;
    --accent: #FD79A8;
    --bg: #f5f6fa;
    --card: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    --text-muted: #b2bec3;
    --border: #e0e0e0;
    --shadow: 0 2px 12px rgba(0,0,0,0.07);
    --shadow-hover: 0 8px 25px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary); text-decoration: none; transition: .2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }

/* --- 导航 --- */
.navbar {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.nav-brand { font-size: 1.3rem; font-weight: 700; color: var(--primary) !important; display: flex; align-items: center; gap: 6px; }
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; }
.nav-links a {
    padding: 7px 15px;
    border-radius: 20px;
    color: var(--text);
    font-weight: 500;
    font-size: .9rem;
    transition: .2s;
}
.nav-links a:hover { background: #f0f0ff; color: var(--primary); }
.nav-links .btn-nav { background: var(--primary); color: #fff !important; }
.nav-links .btn-nav:hover { background: var(--primary-dark); }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text); }

/* --- 主内容 --- */
.main-content { flex: 1; max-width: 1200px; width: 100%; margin: 0 auto; padding: 24px 20px; }

/* --- 卡片 --- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); overflow: hidden; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 1.05rem; }
.card-body { padding: 20px; }

/* --- 表单 --- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; margin-bottom: 5px; font-weight: 600; font-size: .9rem; }
.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 11px 15px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: .2s;
    background: #fff;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108,92,231,0.1);
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-hint { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }

/* --- 按钮 --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    padding: 10px 22px; border: none; border-radius: 25px;
    font-size: .9rem; font-weight: 600; cursor: pointer;
    transition: .2s; font-family: inherit; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(108,92,231,0.3); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-block { width: 100%; }

/* --- 画廊网格 --- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.artwork-card {
    border-radius: var(--radius); overflow: hidden;
    background: var(--card); box-shadow: var(--shadow);
    transition: .3s; cursor: pointer; display: block; color: inherit;
}
.artwork-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); color: inherit; }
.artwork-card-image {
    position: relative; width: 100%; padding-top: 75%;
    overflow: hidden; background: #eee;
}
.artwork-card-image img {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .4s;
}
.artwork-card:hover .artwork-card-image img { transform: scale(1.04); }
.artwork-card-body { padding: 12px 14px; }
.artwork-card-title { font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artwork-card-author { font-size: .8rem; color: var(--text-light); margin-top: 2px; }
.artwork-card-stats { display: flex; gap: 14px; margin-top: 6px; font-size: .8rem; color: var(--text-light); }

/* --- 作品详情 --- */
.artwork-detail { display: grid; grid-template-columns: 1fr 350px; gap: 24px; }
.artwork-image-wrap {
    background: #1a1a2e; border-radius: var(--radius); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    min-height: 350px; cursor: zoom-in;
}
.artwork-image-wrap img { max-width: 100%; max-height: 70vh; object-fit: contain; }
.artwork-info-side { display: flex; flex-direction: column; gap: 16px; }
.artwork-title { font-size: 1.6rem; font-weight: 700; }
.artwork-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: .85rem; color: var(--text-light); }
.author-mini {
    display: flex; align-items: center; gap: 10px;
    padding: 14px; background: #f8f9ff; border-radius: var(--radius-sm);
}
.author-mini h4 { font-size: .95rem; }
.author-mini p { font-size: .8rem; color: var(--text-light); }
.like-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border: 2px solid var(--border);
    border-radius: 25px; background: #fff;
    cursor: pointer; font-size: .95rem; transition: .2s; font-family: inherit;
}
.like-btn.liked { background: #ffe0e6; border-color: var(--accent); color: var(--accent); }
.like-btn:hover { border-color: var(--accent); }
.artwork-desc { line-height: 1.8; white-space: pre-wrap; word-break: break-word; }

/* --- 评论 --- */
.comment-section { margin-top: 30px; }
.comment-form { display: flex; gap: 10px; margin-bottom: 20px; }
.comment-form textarea {
    flex: 1; min-height: 55px; padding: 10px 12px;
    border: 2px solid var(--border); border-radius: var(--radius-sm);
    font-family: inherit; font-size: .9rem; resize: vertical;
}
.comment-form textarea:focus { outline: none; border-color: var(--primary); }
.comment-list { display: flex; flex-direction: column; gap: 12px; }
.comment-item {
    display: flex; gap: 10px; padding: 14px;
    background: #fff; border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.comment-avatar { font-size: 2rem; flex-shrink: 0; }
.comment-content { flex: 1; }
.comment-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.comment-author { font-weight: 600; font-size: .85rem; }
.comment-time { font-size: .75rem; color: var(--text-muted); }
.comment-text { font-size: .9rem; line-height: 1.6; }

/* --- 个人主页 --- */
.profile-header {
    display: flex; align-items: center; gap: 20px;
    padding: 28px; background: linear-gradient(135deg, #6C5CE7, #A29BFE);
    border-radius: var(--radius); color: #fff; margin-bottom: 24px;
}
.profile-avatar { font-size: 4rem; }
.profile-stats { display: flex; gap: 18px; margin-top: 6px; font-size: .85rem; opacity: .9; }

/* --- 提示 --- */
.alert { padding: 12px 18px; border-radius: var(--radius-sm); margin-bottom: 18px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* --- 空状态 --- */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: 12px; opacity: .5; }
.empty-state h3 { margin-bottom: 6px; color: var(--text-light); }

/* --- 分页 --- */
.pagination { display: flex; justify-content: center; gap: 5px; margin-top: 30px; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; border-radius: 18px;
    font-weight: 500; font-size: .85rem;
    border: 2px solid var(--border); color: var(--text); background: #fff;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* --- 搜索条 --- */
.search-bar { display: flex; gap: 8px; margin-bottom: 20px; }
.search-bar input { flex: 1; border-radius: 25px; padding: 11px 18px; }

/* --- 灯箱 --- */
.lightbox {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.92); z-index: 9999;
    cursor: pointer; align-items: center; justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 92vw; max-height: 92vh; object-fit: contain; border-radius: 4px; }
.lightbox-close { position: absolute; top: 16px; right: 28px; color: #fff; font-size: 2.2rem; cursor: pointer; }

/* --- 页脚 --- */
.footer { background: #2d3436; color: #b2bec3; text-align: center; padding: 20px; margin-top: auto; font-size: .85rem; }

/* --- 表格 --- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table th { background: #f8f9fa; padding: 12px 14px; text-align: left; font-weight: 600; font-size: .85rem; }
.data-table td { padding: 10px 14px; border-top: 1px solid var(--border); }
.data-table .thumb-preview { width: 45px; height: 45px; object-fit: cover; border-radius: 5px; }

/* --- 响应式 --- */
@media (max-width: 768px) {
    .nav-links { display: none; position: absolute; top: 60px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 12px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
    .nav-links.active { display: flex; }
    .nav-toggle { display: block; }
    .artwork-detail { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .profile-header { flex-direction: column; text-align: center; }
}

/* 头像相关 */
.profile-avatar-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255,255,255,0.4);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.comment-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}