:root {
    --primary: #8b7bb5;
    --primary-light: #b8aed4;
    --bg: #faf9f7;
    --card: #ffffff;
    --text: #333333;
    --text-muted: #888888;
    --border: #e8e4f0;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(139,123,181,0.1);
}

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

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

h1, h2, h3, h4 { font-family: 'Noto Serif SC', serif; font-weight: 700; }

/* 导航 */
.navbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

.logo {
    font-family: 'Noto Serif SC', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: 1px;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.logo img {
    height: 32px;
    vertical-align: middle;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    white-space: nowrap;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-links a:hover { color: var(--primary); }

.nav-links a.active {
    color: var(--primary);
    font-weight: 600;
}

/* 公告弹窗 */
.notice-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.notice-modal-box {
    background: var(--card);
    border-radius: var(--radius);
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.notice-modal-box h3 {
    color: var(--primary);
    margin-bottom: 16px;
    font-size: 20px;
}

.notice-modal-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.notice-modal-item:last-child { border-bottom: none; }

.notice-modal-item strong {
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
}

.notice-modal-item p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.notice-modal-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
}

.notice-modal-check input {
    width: 16px; height: 16px;
    accent-color: var(--primary);
}

/* Hero */
.hero {
    text-align: center;
    padding: 60px 20px 40px;
}

.hero h1 {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.hero p {
    color: var(--text-muted);
    margin-bottom: 8px;
    font-size: 16px;
}

.hero-slogan {
    color: var(--primary);
    font-size: 14px;
    margin-bottom: 30px;
    opacity: 0.8;
}

.search-box {
    display: flex;
    max-width: 520px;
    margin: 0 auto;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus { border-color: var(--primary); }

.search-box button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 15px;
    transition: opacity 0.2s;
}

.search-box button:hover { opacity: 0.9; }

/* 卡片 */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(139,123,181,0.15);
}

.card h2, .card h3 {
    margin-bottom: 16px;
    color: var(--text);
}

/* 网格 */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

/* 链接列表 */
.link-list {
    list-style: none;
}

.link-list li {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: padding-left 0.2s;
}

.link-list li:hover { padding-left: 4px; }

.link-list li:last-child { border-bottom: none; }

.link-list a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.2s;
}

.link-list a:hover { text-decoration: underline; }

.link-list small {
    color: var(--text-muted);
    font-size: 12px;
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    display: inline-block;
    background: var(--bg);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.tag:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.tags .tag {
    font-size: 12px;
    padding: 4px 10px;
}

/* 统计条 */
.stats-bar {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    padding: 20px;
}

.stats-bar span {
    margin: 0 8px;
}

/* 文章布局 */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
}

.article-main { min-width: 0; }

.meta {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 16px;
}

.meta a {
    color: var(--primary);
    text-decoration: none;
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.meta span { margin-left: 12px; }

.content {
    font-size: 16px;
    line-height: 1.9;
}

.content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid var(--primary-light);
    transition: all 0.2s;
    padding-bottom: 1px;
}

.content a:hover {
    border-bottom: 1px solid var(--primary);
    background: rgba(139,123,181,0.06);
    padding: 0 2px 1px;
    border-radius: 2px;
}

.content a.ext-link::after {
    content: ' ↗';
    font-size: 11px;
    opacity: 0.5;
    color: var(--primary);
}

.content img.article-img {
    max-width: 100%;
    border-radius: 8px;
    margin: 12px 0;
    box-shadow: var(--shadow);
}

/* 信息框 */
.infobox {
    background: linear-gradient(135deg, #f8f6fc, #fff);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
    position: sticky;
    top: 76px;
}

.infobox h4 {
    color: var(--primary);
    margin-bottom: 14px;
    font-size: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
}

.infobox table { width: 100%; font-size: 13px; }

.infobox th {
    text-align: left;
    color: var(--text-muted);
    padding: 8px 0;
    width: 80px;
    font-weight: 400;
    vertical-align: top;
}

.infobox td {
    padding: 8px 0;
    color: var(--text);
}

.infobox td a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px dashed var(--primary-light);
}

.infobox td a:hover {
    border-bottom: 1px solid var(--primary);
}

/* 贡献者 */
.contributors {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.contributor {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    padding: 6px 14px;
    border-radius: 24px;
    font-size: 13px;
    color: var(--text);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.contributor:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.contributor:hover .avatar-sm {
    border: 2px solid #fff;
}

.avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

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

/* 按钮 */
.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-block { width: 100%; padding: 12px; font-size: 16px; }

.btn-ghost {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-ghost:hover {
    background: var(--primary);
    color: #fff;
}

.btn-sm { padding: 4px 12px; font-size: 12px; }

.btn-danger { background: #c62828; }

/* 表单 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* 认证框 */
.auth-box {
    max-width: 400px;
    margin: 60px auto;
}

/* 用户页 */
.user-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

.role-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-top: 6px;
}

.role-0 { background: #e0e0e0; color: #666; }
.role-1 { background: #e3f2fd; color: #1565c0; }
.role-9 { background: #f3e5f5; color: var(--primary); }

.perm-list {
    list-style: none;
}

.perm-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin: 8px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s;
}

.text-muted { color: var(--text-muted); font-size: 14px; }

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13px;
}

.data-table tr:hover {
    background: var(--bg);
}

.badge-ok { color: #2e7d32; background: #e8f5e9; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.badge-warn { color: #ef6c00; background: #fff3e0; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.badge-err { color: #c62828; background: #ffebee; padding: 2px 8px; border-radius: 4px; font-size: 12px; }

/* 后台导航 */
.admin-nav {
    background: var(--primary);
    margin-bottom: 20px;
}

.admin-nav .logo { color: #fff; }

.admin-nav .nav-links a {
    color: rgba(255,255,255,0.8);
    padding: 4px 12px;
    border-radius: 6px;
}

.admin-nav .nav-links a:hover,
.admin-nav .nav-links a.active {
    color: #fff;
    background: rgba(255,255,255,0.15);
}

/* 统计卡片 */
.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

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

.stat-num {
    font-size: 40px;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Noto Serif SC', serif;
}

.stat-label {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* 筛选栏 */
.filter-bar {
    margin-bottom: 16px;
}

.filter-bar a {
    color: var(--text-muted);
    text-decoration: none;
    margin-right: 16px;
    font-size: 14px;
    padding: 4px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.filter-bar a.active {
    background: var(--primary);
    color: #fff;
}

/* 复选框 */
.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    cursor: pointer;
    font-size: 14px;
}

/* 提示 */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-ok { background: #e8f5e9; color: #2e7d32; }
.alert-err { background: #ffebee; color: #c62828; }
.alert-warn { background: #fff3cd; color: #856404; }

.article-img-wrap {
    margin: 16px 0;
    text-align: center;
}

.img-caption {
    display: inline-block;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
    padding: 4px 12px;
    background: var(--bg);
    border-radius: 0 0 8px 8px;
}

/* 响应式 */
@media (max-width: 768px) {
    .grid-2, .grid-4, .article-layout {
        grid-template-columns: 1fr;
    }
    .hero h1 { font-size: 32px; }
    .nav-links { gap: 12px; }
    .nav-links a { font-size: 13px; }
    .notice-modal-box { margin: 20px; }
    .infobox { position: static; }
}
