/* ============ CSS Variables ============ */
:root {
    /* Modern color palette */
    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-primary-light: #eef2ff;
    --color-primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    --color-secondary: #64748b;
    --color-success: #10b981;
    --color-success-light: #d1fae5;
    --color-warning: #f59e0b;
    --color-warning-light: #fef3c7;
    --color-danger: #ef4444;
    --color-danger-light: #fee2e2;

    /* Background system */
    --color-bg: #f8fafc;
    --color-bg-secondary: #f1f5f9;
    --color-card: #ffffff;
    --color-card-hover: #fafbfc;

    /* Text system */
    --color-text: #0f172a;
    --color-text-secondary: #64748b;
    --color-text-muted: #94a3b8;

    /* Border & divider */
    --color-border: #e2e8f0;
    --color-border-light: #f1f5f9;

    /* Elevation system */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.1), 0 4px 8px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 50px rgba(15, 23, 42, 0.12), 0 8px 16px rgba(15, 23, 42, 0.06);

    /* Animated shadow for hover */
    --shadow-hover: 0 8px 25px rgba(79, 70, 229, 0.12), 0 4px 10px rgba(15, 23, 42, 0.06);
    --shadow-card-hover: 0 12px 35px rgba(15, 23, 42, 0.1), 0 6px 12px rgba(15, 23, 42, 0.05);

    /* Radius system */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;

    /* Layout */
    --max-width: 1240px;
    --header-height: 64px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============ Reset & Base ============ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    font-size: 15px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============ Container ============ */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ============ Header ============ */
.site-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--color-border-light);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: box-shadow var(--transition-base);
}

.site-header.scrolled {
    box-shadow: var(--shadow-sm);
}

.site-header .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-logo {
    font-size: 22px;
    font-weight: 800;
    background: var(--color-primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: transform var(--transition-bounce);
}

.site-logo:hover {
    transform: scale(1.05);
}

.main-nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.main-nav a {
    position: relative;
    padding: 8px 16px;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
    font-size: 14px;
    font-weight: 500;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 1px;
    transition: transform var(--transition-base);
}

.main-nav a:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    transform: translateX(-50%) scaleX(1);
}

.main-nav a.active {
    color: var(--color-primary);
    background: var(--color-primary-light);
}

/* ============ Header User ============ */
.header-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 6px;
    border: 2px solid var(--color-border);
    transition: border-color var(--transition-base);
}

.header-avatar:hover {
    border-color: var(--color-primary);
}

.user-link {
    color: var(--color-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

.user-link:hover {
    background: var(--color-bg-secondary);
}

.notif-link {
    position: relative;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--transition-fast);
}

.notif-link:hover {
    color: var(--color-primary);
}

.notif-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: var(--color-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: var(--radius-full);
    line-height: 1.4;
    min-width: 16px;
    text-align: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ============ Footer ============ */
.site-footer {
    background: var(--color-card);
    border-top: 1px solid var(--color-border-light);
    padding: 32px 0;
    margin-top: 60px;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 14px;
}

.site-footer a {
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

.site-footer a:hover {
    color: var(--color-primary);
}

.footer-sub {
    font-size: 12px;
    margin-top: 6px;
    color: var(--color-text-muted);
}

/* ============ Hero Section ============ */
.hero {
    background: var(--color-primary-gradient);
    color: #fff;
    padding: 64px 40px;
    border-radius: var(--radius-xl);
    margin: 32px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3);
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.hero > * {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 38px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.hero-sub {
    opacity: 0.92;
    margin-bottom: 24px;
    font-size: 17px;
    font-weight: 400;
}

.hero-stats {
    margin-bottom: 32px;
    display: flex;
    justify-content: center;
    gap: 40px;
}

.hero-stats .stat {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.hero-stats strong {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero-stats span:last-child {
    font-size: 14px;
    opacity: 0.85;
}

.hero .btn {
    background: #fff;
    color: var(--color-primary);
    font-weight: 600;
    padding: 14px 36px;
    font-size: 16px;
}

.hero .btn:hover {
    background: rgba(255,255,255,0.95);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* ============ Home Grid ============ */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.home-section {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    border: 1px solid var(--color-border-light);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.home-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.home-section:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-4px);
    border-color: var(--color-border);
}

.home-section:hover::before {
    opacity: 1;
}

.home-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border-light);
}

.home-section h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

.more-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-primary);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

.more-link:hover {
    background: var(--color-primary-light);
    text-decoration: none;
}

/* ============ Post List ============ */
.post-list {
    list-style: none;
}

.post-list-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    transition: all var(--transition-fast);
}

.post-list-item:last-child {
    border-bottom: none;
}

.post-list-item:hover {
    background: rgba(79, 70, 229, 0.02);
    margin: 0 -12px;
    padding: 14px 12px;
    border-radius: var(--radius-sm);
}

.pin-tag {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.lock-tag {
    background: var(--color-gray-100, #f1f5f9);
    color: var(--color-text-muted);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.cat-tag {
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.post-list-title {
    color: var(--color-text);
    flex: 1;
    min-width: 120px;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.post-list-title:hover {
    color: var(--color-primary);
}

.post-list-meta {
    font-size: 12px;
    color: var(--color-text-muted);
    width: 100%;
    display: flex;
    gap: 4px;
}

.empty-tip {
    color: var(--color-text-muted);
    padding: 32px 0;
    font-size: 14px;
    text-align: center;
}

/* ============ V Badges ============ */
.v-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
    letter-spacing: 0.02em;
}

.v-red {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    color: #991b1b;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.15);
}

.v-yellow {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.15);
}

.v-blue {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
}

.verified-badge,
.admin-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
}

.verified-badge {
    background: var(--color-success-light);
    color: #065f46;
}

.admin-badge {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.pending-badge {
    background: var(--color-warning-light);
    color: #92400e;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
}

.banned-badge {
    background: var(--color-danger-light);
    color: #991b1b;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
}

/* ============ Buttons ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: translateY(1px) scale(0.98);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-primary {
    background: var(--color-primary-gradient);
    color: #fff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.btn-secondary {
    background: var(--color-bg-secondary);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-border);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
}

.btn-link {
    background: transparent;
    color: var(--color-primary);
    padding: 4px 10px;
    box-shadow: none;
}

.btn-link:hover {
    background: var(--color-primary-light);
    transform: none;
    box-shadow: none;
}

/* ============ Forms ============ */
.form {
    max-width: 480px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 15px;
    background: var(--color-card);
    color: var(--color-text);
    transition: all var(--transition-base);
    font-family: var(--font-family);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--color-text-muted);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.form-group small {
    display: block;
    color: var(--color-text-muted);
    font-size: 12px;
    margin-top: 6px;
}

/* Auth pages */
.auth-page {
    padding: 60px 20px;
}

.auth-box {
    background: var(--color-card);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border-light);
    max-width: 460px;
    margin: 0 auto;
}

.auth-box h1 {
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.auth-switch {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.auth-switch a {
    font-weight: 600;
}

/* ============ Alerts ============ */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    border: 1px solid transparent;
    font-size: 14px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert.error {
    background: var(--color-danger-light);
    color: #991b1b;
    border-color: #fca5a5;
}

.alert.success {
    background: var(--color-success-light);
    color: #065f46;
    border-color: #6ee7b7;
}

.alert.warning {
    background: var(--color-warning-light);
    color: #92400e;
    border-color: #fcd34d;
}

.alert.info {
    background: var(--color-primary-light);
    color: #1e40af;
    border-color: #bfdbfe;
}

/* ============ Pagination ============ */
.pagination ul {
    list-style: none;
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 32px 0;
}

.pagination a {
    display: block;
    padding: 8px 14px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition-base);
    min-width: 38px;
    text-align: center;
}

.pagination a:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-light);
}

.pagination li.active a {
    background: var(--color-primary-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

/* ============ Post Cards ============ */
.post-card {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid var(--color-border-light);
    transition: all var(--transition-base);
    cursor: pointer;
}

.post-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-3px);
    border-color: var(--color-border);
}

.post-card h3 {
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 700;
}

.post-card h3 a {
    color: var(--color-text);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.post-card h3 a:hover {
    color: var(--color-primary);
}

.post-excerpt {
    color: var(--color-text-secondary);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 12px;
}

.post-meta {
    font-size: 12px;
    color: var(--color-text-muted);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Post Detail */
.post-detail {
    background: var(--color-card);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-light);
    margin-bottom: 24px;
}

.post-detail h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.post-detail .post-meta {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 13px;
}

.post-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border-light);
}

/* ============ Comments ============ */
.comment {
    background: var(--color-card);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    margin-bottom: 14px;
    border: 1px solid var(--color-border-light);
    transition: all var(--transition-base);
}

.comment:hover {
    border-color: var(--color-border);
    box-shadow: var(--shadow-xs);
}

.comment.comment-child {
    margin-left: 40px;
    background: var(--color-bg-secondary);
}

.comment-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
}

.comment-body {
    font-size: 15px;
    line-height: 1.7;
    color: var(--color-text);
}

.comment-meta {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 12px;
    display: flex;
    gap: 12px;
}

.comment-reply-btn {
    color: var(--color-primary);
    cursor: pointer;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 500;
    transition: color var(--transition-fast);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.comment-reply-btn:hover {
    background: var(--color-primary-light);
}

.reply-form {
    margin-top: 14px;
    display: none;
}

.reply-form.active {
    display: block;
    animation: slideIn 0.2s ease-out;
}

.reply-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--color-border);
    font-family: var(--font-family);
    font-size: 14px;
    transition: all var(--transition-base);
}

.reply-form textarea:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

/* ============ Section Headers ============ */
.section-head {
    margin-bottom: 32px;
    padding: 24px 0;
}

.section-head h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.section-desc {
    color: var(--color-text-secondary);
    font-size: 16px;
}

.section-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--color-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
    flex-wrap: wrap;
    gap: 16px;
}

.category-filter {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.category-filter a {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-bg-secondary);
    transition: all var(--transition-base);
    text-decoration: none;
}

.category-filter a:hover {
    color: var(--color-primary);
    background: var(--color-primary-light);
}

.category-filter a.active {
    background: var(--color-primary-gradient);
    color: #fff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.section-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.muted-tip {
    color: var(--color-text-muted);
    font-size: 14px;
}

/* ============ Profile ============ */
.profile-page {
    padding: 32px 0;
}

.profile-header {
    display: flex;
    gap: 32px;
    background: var(--color-card);
    border-radius: var(--radius-xl);
    padding: 36px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-light);
    margin-bottom: 28px;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: var(--color-primary-gradient);
    opacity: 0.1;
}

.profile-avatar {
    position: relative;
    z-index: 1;
}

.profile-avatar img {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-bounce);
}

.profile-avatar img:hover {
    transform: scale(1.05);
}

.profile-info {
    position: relative;
    z-index: 1;
    flex: 1;
}

.profile-info h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.profile-bio {
    color: var(--color-text-secondary);
    font-size: 15px;
    margin: 10px 0 16px;
    line-height: 1.6;
}

.profile-meta {
    font-size: 13px;
    color: var(--color-text-muted);
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.profile-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.profile-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.profile-posts h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-border-light);
}

/* ============ Section Grid / Card Links ============ */
.page-title {
    font-size: 28px;
    font-weight: 800;
    margin: 24px 0;
    letter-spacing: -0.02em;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.card-link {
    display: block;
    background: var(--color-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all var(--transition-base);
    color: var(--color-text);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.card-link:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-4px);
    border-color: var(--color-border);
    text-decoration: none;
}

.card-link h3 {
    color: var(--color-primary);
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.card-link p {
    color: var(--color-text-secondary);
    font-size: 14px;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* ============ Badges ============ */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.badge.success {
    background: var(--color-success-light);
    color: #065f46;
}

.badge.warning {
    background: var(--color-warning-light);
    color: #92400e;
}

.badge.danger {
    background: var(--color-danger-light);
    color: #991b1b;
}

.badge.muted {
    background: var(--color-bg-secondary);
    color: var(--color-text-muted);
}

/* ============ Markdown Editor ============ */
.md-editor {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-card);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base);
}

.md-editor:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12), var(--shadow-sm);
}

.md-editor textarea {
    border: none;
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.8;
    resize: vertical;
    min-height: 320px;
    outline: none;
    background: #fafbfc;
    color: var(--color-text);
}

.md-editor textarea::placeholder {
    color: var(--color-text-muted);
}

.md-editor .md-preview {
    padding: 20px;
    overflow-y: auto;
    max-height: 600px;
    border-left: 1.5px solid var(--color-border-light);
    background: #fff;
}

.md-editor.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    grid-template-columns: 1fr 1fr;
    border-radius: 0;
    border: none;
}

.md-editor.fullscreen textarea {
    min-height: 100vh;
}

.md-toolbar {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border-light);
    flex-wrap: wrap;
    grid-column: 1 / -1;
}

.md-toolbar button {
    padding: 6px 12px;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
    font-weight: 500;
}

.md-toolbar button:hover {
    background: var(--color-card);
    color: var(--color-primary);
    box-shadow: var(--shadow-xs);
}

/* ============ Utilities ============ */
.constructing {
    text-align: center;
    padding: 80px 20px;
    color: var(--color-text-muted);
}

.constructing h2 {
    font-size: 28px;
    margin-bottom: 12px;
    color: var(--color-text);
    font-weight: 700;
}

/* ============ Announcements (公告) ============ */
.home-announcements {
    margin-bottom: 32px;
}

.ann-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.ann-card {
    display: block;
    background: var(--color-card);
    border: 1px solid var(--color-border-light);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: all var(--transition-base);
    color: var(--color-text);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.ann-card::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    background: var(--color-primary-gradient);
    opacity: 0.04;
    border-radius: 50%;
    transition: transform var(--transition-base);
}

.ann-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-3px);
    text-decoration: none;
    color: var(--color-text);
}

.ann-card:hover::after {
    transform: scale(1.5);
}

.ann-card-head {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ann-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.ann-card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--color-text);
    line-height: 1.4;
    position: relative;
    z-index: 1;
}

.ann-card-excerpt {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ann-card-meta {
    font-size: 12px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.ann-author-avatar-sm {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
}

.ann-sep {
    color: var(--color-border);
}

/* Announcement type colors */
.ann-info {
    border-left-color: #3b82f6;
}
.ann-info .ann-type-badge {
    background: #dbeafe;
    color: #1e40af;
}

.ann-success {
    border-left-color: #10b981;
}
.ann-success .ann-type-badge {
    background: var(--color-success-light);
    color: #065f46;
}

.ann-warning {
    border-left-color: #f59e0b;
}
.ann-warning .ann-type-badge {
    background: var(--color-warning-light);
    color: #92400e;
}

.ann-danger {
    border-left-color: #ef4444;
}
.ann-danger .ann-type-badge {
    background: var(--color-danger-light);
    color: #991b1b;
}

.ann-maintenance {
    border-left-color: #8b5cf6;
}
.ann-maintenance .ann-type-badge {
    background: #ede9fe;
    color: #5b21b6;
}

/* Announcement detail page */
.ann-detail {
    background: var(--color-card);
    border-radius: var(--radius-xl);
    padding: 36px 40px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-light);
    margin: 24px 0;
}

.ann-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.ann-detail-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.ann-detail-title {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-bottom: 16px;
    color: var(--color-text);
}

.ann-detail-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-text-secondary);
    font-size: 14px;
    flex-wrap: wrap;
}

.ann-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
}

.ann-expiry {
    color: var(--color-warning);
    font-weight: 500;
}

.ann-detail-content {
    font-size: 16px;
    line-height: 1.85;
    color: var(--color-text);
}

@media (max-width: 768px) {
    .ann-detail {
        padding: 24px 20px;
    }

    .ann-detail-title {
        font-size: 24px;
    }

    .ann-list {
        grid-template-columns: 1fr;
    }
}

/* ============ Scrollbar ============ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* ============ Selection ============ */
::selection {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* ============ Responsive ============ */

/* Large desktop screens (横屏大屏优化) */
@media (min-width: 1440px) {
    :root {
        --max-width: 1320px;
    }

    .container {
        padding: 0 32px;
    }

    .hero {
        padding: 72px 48px;
    }

    .hero h1 {
        font-size: 42px;
    }

    .home-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px;
    }
}

/* Desktop & tablet landscape (横屏适配) */
@media (min-width: 1024px) and (max-width: 1439px) {
    .home-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }

    .hero {
        padding: 48px 28px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .home-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* Mobile landscape (手机横屏) */
@media (max-width: 900px) and (orientation: landscape) {
    .site-header {
        height: 56px;
        padding: 8px 0;
    }

    .site-header .container {
        flex-direction: row;
        gap: 16px;
        flex-wrap: nowrap;
    }

    .main-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .hero {
        padding: 32px 24px;
        margin: 16px 0;
    }

    .hero h1 {
        font-size: 24px;
    }

    .hero-stats {
        gap: 24px;
        margin-bottom: 20px;
    }

    .hero-stats strong {
        font-size: 24px;
    }

    .home-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .home-section {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .md-editor {
        grid-template-columns: 1fr;
    }

    .md-editor .md-preview {
        border-left: none;
        border-top: 1px solid var(--color-border-light);
        max-height: 300px;
    }

    .site-header {
        height: auto;
        padding: 12px 0;
    }

    .site-header .container {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 16px;
    }

    .site-logo {
        font-size: 20px;
    }

    .main-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .main-nav a {
        padding: 6px 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    .header-user {
        gap: 8px;
        margin-left: auto;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 28px 20px;
    }

    .profile-info h1 {
        justify-content: center;
    }

    .profile-meta {
        justify-content: center;
    }

    .profile-actions {
        justify-content: center;
    }

    .home-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .hero {
        padding: 36px 20px;
        margin: 16px 0;
    }

    .hero h1 {
        font-size: 26px;
    }

    .hero-sub {
        font-size: 15px;
    }

    .hero-stats {
        gap: 28px;
    }

    .section-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .post-detail {
        padding: 24px 20px;
    }

    .auth-box {
        padding: 32px 24px;
    }

    .card-link {
        padding: 24px;
    }

    .section-head h1 {
        font-size: 26px;
    }
}

/* Small phones portrait (小屏竖屏) */
@media (max-width: 480px) {
    .container {
        padding: 0 14px;
    }

    .hero {
        padding: 28px 16px;
    }

    .hero h1 {
        font-size: 22px;
    }

    .hero-sub {
        font-size: 14px;
    }

    .hero-stats {
        gap: 20px;
        flex-wrap: wrap;
    }

    .hero-stats strong {
        font-size: 22px;
    }

    .home-section {
        padding: 18px;
    }

    .home-section h2 {
        font-size: 16px;
    }

    .btn {
        width: 100%;
    }

    .btn-sm {
        width: auto;
    }

    .section-actions .btn,
    .header-user .btn,
    .post-actions .btn,
    .profile-actions .btn {
        width: auto;
    }

    .pagination ul {
        flex-wrap: wrap;
    }

    .post-detail {
        padding: 20px 16px;
    }

    .post-detail h1 {
        font-size: 22px;
    }

    .auth-box {
        padding: 24px 18px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .main-nav a {
        padding: 6px 10px;
        font-size: 12px;
    }

    .hero h1 {
        font-size: 20px;
    }
}