﻿/* === 力学考研加油站 — Apple Light 风格 === */
/* iOS HIG: Deference + Clarity + Depth. SF Pro, Liquid Glass, systemBlue accent. */

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

:root {
    /* Apple semantic palette — Light Mode */
    --bg: #FFFFFF;
    --bg-secondary: #F2F2F7;
    --bg-card: rgba(255, 255, 255, 0.72);
    --bg-card-hover: rgba(255, 255, 255, 0.88);
    --text: #000000;
    --text-dim: rgba(0, 0, 0, 0.55);
    --text-muted: rgba(0, 0, 0, 0.35);
    --text-light: rgba(0, 0, 0, 0.25);
    --accent: #007AFF;
    --accent-light: #409CFF;
    --accent-sage: #34C759;
    --accent-moss: #30B350;
    --gradient-hero: linear-gradient(180deg, #F2F2F7 0%, #FFFFFF 100%);
    --gradient-btn: linear-gradient(180deg, #007AFF, #0066D6);
    --border: 1px solid rgba(0, 0, 0, 0.08);
    --border-glow: 1px solid rgba(0, 122, 255, 0.2);
    --shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 8px 32px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04);
    --radius: 20px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --transition: 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
    --header-h: 54px;
    --bottom-bar-h: 56px;

    /* Typography — Apple system font stack */
    --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
}

/* === Body === */
body {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.5;
    color: var(--text);
    background: #FFFFFF;
    min-height: 100vh;
    padding-bottom: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Links === */
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:visited { color: var(--accent); }
a:hover { color: var(--accent-light); }

/* === Header — Liquid Glass === */
.site-header {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    padding: 0 20px;
    height: var(--header-h);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .logo {
    font-family: var(--font-display);
    color: var(--text);
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: -0.3px;
}

/* Hamburger button */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    font-family: var(--font-body);
    min-width: 44px;
    min-height: 44px;
}
.hamburger-btn:active { opacity: 0.5; }

/* Desktop nav */
.header-nav { display: flex; gap: 4px; align-items: center; }
.header-nav a {
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    transition: all var(--transition);
    font-family: var(--font-body);
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 10px;
}
.header-nav a:hover { background: rgba(0, 0, 0, 0.04); }
.header-nav a.active {
    color: var(--accent);
    font-weight: 600;
    background: rgba(0, 122, 255, 0.08);
}
.header-nav a.active::after {
    display: none;
}
.user-badge {
    font-size: 13px;
    background: rgba(0, 122, 255, 0.08);
    color: var(--accent);
    padding: 4px 14px;
    border-radius: 20px;
    white-space: nowrap;
    font-weight: 500;
}

/* === Side drawer overlay === */
.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

/* === Side drawer — Liquid Glass === */
.side-drawer {
    position: fixed;
    top: 8px; right: -284px;
    width: 270px;
    height: calc(100% - 16px);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    z-index: 200;
    padding: 16px 12px;
    transition: right 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-radius: 24px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.06);
}
.side-drawer.open { right: 8px; }
.side-drawer .drawer-close {
    align-self: flex-end;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    font-family: var(--font-body);
    min-width: 44px;
    min-height: 44px;
}
.side-drawer a {
    display: block;
    padding: 12px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 17px;
    border-radius: 12px;
    transition: all var(--transition);
}
.side-drawer a:hover, .side-drawer a.active {
    background: rgba(0, 122, 255, 0.08);
    color: var(--accent);
}
.side-drawer .drawer-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 8px 0;
}
.side-drawer .drawer-user {
    padding: 12px 16px;
    color: var(--accent);
    font-size: 15px;
    font-weight: 600;
}

/* === Bottom tab bar (mobile only) === */
.bottom-tabs {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottom-bar-h);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 101;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.04);
}
.bottom-tabs a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    font-family: var(--font-body);
    flex: 1;
    height: 100%;
    min-height: 44px;
    transition: color var(--transition);
}
.bottom-tabs a .bt-icon { font-size: 22px; line-height: 1; }
.bottom-tabs a.active { color: var(--accent); }
.bottom-tabs a:active { opacity: 0.5; transition: opacity 0.1s; }

/* Center tab — protrudes above the bar */
.bottom-tabs .bt-center {
    position: relative;
    flex: 1.2;
}
.bt-center-circle {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0, 122, 255, 0.35);
    border: 3px solid rgba(255, 255, 255, 0.9);
    transition: transform 0.2s, box-shadow 0.2s;
}
.bt-center-circle:active {
    transform: translateX(-50%) scale(0.92);
}
.bt-center-text {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 1px;
}

/* === Main & Footer === */
.site-main { max-width: 860px; margin: 0 auto; padding: 24px 20px; min-height: 80vh; }
.site-footer {
    text-align: center;
    padding: 22px;
    color: var(--text-muted);
    font-size: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    font-family: var(--font-body);
}

/* === Hero === */
.home-hero {
    background: var(--bg-card);
    border: var(--border);
    color: var(--text);
    padding: 32px 24px 24px;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.home-hero h1 {
    font-family: var(--font-display);
    font-size: 24px;
    margin-bottom: 4px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text);
}
.home-hero .subtitle { color: var(--text-dim); margin-bottom: 14px; font-size: 13px; }
.countdown {
    display: inline-flex; align-items: baseline; gap: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 8px 22px;
    border-radius: 30px;
    font-size: 14px;
    margin-bottom: 16px;
}
.countdown strong {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 800;
}
.timeline { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; font-size: 12px; }
.timeline-item {
    background: #FFFFFF;
    padding: 8px 14px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    font-family: var(--font-body);
}
.timeline-item span { display: block; font-weight: 600; font-size: 13px; color: var(--accent); }

/* === Section Titles === */
.home-section { margin-bottom: 28px; }
.home-section h2 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 14px;
    padding-left: 12px;
    border-left: 4px solid var(--accent);
    color: var(--text);
    letter-spacing: -0.3px;
}

/* === Cards === */
.card {
    background: var(--bg-card);
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    border: var(--border);
    box-shadow: var(--shadow-card);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    border-color: rgba(0, 122, 255, 0.25);
}
.card:active { transform: scale(0.985); }
.post-title {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    display: block;
    margin-bottom: 6px;
    transition: color var(--transition);
}
.post-title:hover { color: var(--accent); }
.post-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* === Tags === */
.tag {
    background: rgba(0, 122, 255, 0.1);
    color: var(--accent);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid rgba(0, 122, 255, 0.15);
    font-family: var(--font-body);
}
.empty { color: var(--text-muted); text-align: center; padding: 40px; font-size: 14px; }

/* === Quick Entry Cards === */
.quick-entries {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}
.quick-entry {
    background: var(--bg-card);
    border: var(--border);
    border-radius: var(--radius);
    padding: 18px 12px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-card);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.quick-entry:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); border-color: rgba(0, 122, 255, 0.3); }
.quick-entry:active { transform: scale(0.96); }
.quick-icon { font-size: 28px; }
.quick-num { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--accent); }
.quick-label { font-size: 12px; color: var(--text-muted); }

/* === Paper Grid === */
.paper-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}
.paper-grid-card {
    background: var(--bg-card);
    border: var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-card);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.paper-grid-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    border-color: rgba(0, 122, 255, 0.25);
}
.pg-subject {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(0, 122, 255, 0.08);
    padding: 2px 10px;
    border-radius: 20px;
    align-self: flex-start;
    font-family: var(--font-body);
}
.pg-title { font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--text); }
.pg-meta { font-size: 11px; color: var(--text-muted); }
.section-more {
    display: inline-block;
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    margin-top: 6px;
    transition: color var(--transition);
    font-weight: 500;
}
.section-more:hover { color: var(--accent-light); }

/* === Tag Cloud === */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.cloud-tag {
    background: rgba(0, 122, 255, 0.06);
    color: var(--text-dim);
    padding: 6px 16px;
    border-radius: 24px;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid rgba(0, 122, 255, 0.18);
    transition: all var(--transition);
}
.cloud-tag:hover { background: rgba(0, 122, 255, 0.12); border-color: rgba(0, 122, 255, 0.3); color: var(--accent); transform: translateY(-1px); }
.cloud-tag small { color: var(--text-muted); font-size: 11px; }
.cloud-tag-more { background: transparent; border-style: dashed; }

/* === Forum === */

/* Section header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.section-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.3px;
}

/* --- Rankings carousel --- */
.ranking-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: var(--border);
    box-shadow: var(--shadow-card);
    padding: 18px 20px;
    margin-bottom: 24px;
}
.ranking-carousel {
    position: relative;
    overflow: hidden;
    min-height: 150px;
}
.ranking-card {
    display: none;
    animation: fadeSlideIn 0.4s ease;
}
.ranking-card.active { display: block; }
.ranking-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
}
.ranking-badge.politics { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.ranking-badge.english { background: linear-gradient(135deg, #3498db, #2980b9); }
.ranking-badge.math { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.ranking-list { list-style: none; padding: 0; }
.ranking-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 15px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.ranking-list li:last-child { border-bottom: none; }
.rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px; height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    flex-shrink: 0;
}
.ranking-list li:nth-child(2) .rank-num { background: #8e8e93; }
.ranking-list li:nth-child(3) .rank-num { background: #b8860b; }
.rank-hot { font-size: 14px; }

/* Carousel dots */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}
.carousel-dots .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(0,0,0,0.15);
    cursor: pointer;
    transition: all 0.3s;
}
.carousel-dots .dot.active {
    background: var(--accent);
    width: 24px;
    border-radius: 4px;
}

/* --- Articles carousel --- */
.articles-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: var(--border);
    box-shadow: var(--shadow-card);
    padding: 18px 20px;
    margin-bottom: 24px;
}
.articles-carousel-wrap {
    overflow: hidden;
}
.articles-carousel {
    position: relative;
}
.articles-page {
    display: none;
    flex-direction: column;
    gap: 6px;
}
.articles-page.active { display: flex; }
.article-card-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
}
.article-card-link:hover {
    background: rgba(0,122,255,0.06);
    color: var(--accent);
}
.article-card-title {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 12px;
}
.article-card-date {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* --- Stream toolbar --- */
.stream-toolbar {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 0;
}
.stream-toolbar-second {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}
.subject-filter {
    padding: 8px 10px;
    border: var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg-card);
    color: var(--text);
    font-family: var(--font-body);
    max-width: 140px;
}
.subject-filter:focus { outline: none; border-color: var(--accent); }
.new-post-btn {
    white-space: nowrap;
    padding: 9px 18px;
    font-size: 14px;
    flex-shrink: 0;
}

/* --- Waterfall grid --- */
.waterfall-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.waterfall-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    border: var(--border);
    box-shadow: var(--shadow-card);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.waterfall-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}
.waterfall-card:active { transform: scale(0.97); }
.wf-img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--bg-secondary);
}
.wf-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.wf-img-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f0fe, #f0e6f6);
    color: var(--accent);
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-display);
    text-align: center;
    padding: 20px;
    word-break: break-all;
}
.wf-info {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.wf-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text);
    word-break: break-all;
}
.wf-meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* Load more */
.load-more-wrap {
    text-align: center;
    padding: 24px 0;
}
.load-more-btn {
    padding: 10px 32px;
}
.loading-indicator {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    font-size: 13px;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    40% { transform: scale(0.95); }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
@keyframes starPop {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.4) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

/* ==================== MINI AVATAR + CARD ACTIONS ==================== */
.mini-avatar {
    width: 20px; height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.06);
}
.wf-img-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.wf-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 10px;
}
.wf-author {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    font-size: 12px;
    color: var(--text-dim);
    overflow: hidden;
}
.wf-author span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.heart-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #ccc;
    padding: 4px;
    font-family: var(--font-body);
    line-height: 1;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s, transform 0.2s;
}
.heart-btn.liked { color: #FF3B30; }
.heart-btn.animate { animation: heartBeat 0.45s ease; }
.heart-btn .like-count {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 1px;
    font-family: var(--font-body);
}
.heart-btn.liked .like-count { color: #FF3B30; }
.heart-btn:active { transform: scale(0.9); }

/* ==================== POST DETAIL FIXED TOP BAR ==================== */
.post-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 48px;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 0 16px;
    z-index: 99;
}
.post-top-bar .top-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.post-top-bar .top-bar-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.post-top-bar .top-bar-nick {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.post-top-bar .top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.follow-btn {
    padding: 5px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font-family: var(--font-body);
    white-space: nowrap;
    transition: all 0.2s;
}
.follow-btn.following {
    background: var(--accent);
    color: #fff;
}
.share-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    color: var(--text-dim);
    -webkit-tap-highlight-color: transparent;
}

/* ==================== POST DETAIL FIXED BOTTOM ACTION BAR ==================== */
.post-action-bar {
    position: fixed;
    bottom: var(--bottom-bar-h);
    left: 0; right: 0;
    height: 52px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
    z-index: 102;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.post-action-bar .action-comment-input {
    flex: 0 0 auto;
    max-width: 170px;
    margin-right: auto;
    height: 38px;
    border-radius: 19px;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.post-action-bar .action-comment-input:active {
    background: rgba(0,0,0,0.08);
}
.post-action-bar .action-comment-input span {
    font-size: 14px;
    color: var(--text-light);
    font-family: var(--font-body);
    white-space: nowrap;
}
.post-action-bar .action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    color: #999;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    font-family: var(--font-body);
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
}
.post-action-bar .action-btn .action-icon {
    font-size: 22px;
    line-height: 1;
}
.post-action-bar .action-btn span[id$="Label"] {
    font-size: 14px;
    color: inherit;
}
.post-action-bar .action-btn:active { transform: scale(0.9); }
.post-action-bar .action-btn.liked { color: #FF3B30; }
.post-action-bar .action-btn.favorited { color: #FFB800; }
.post-action-bar .action-btn.animate-heart { animation: heartBeat 0.45s ease; }
.post-action-bar .action-btn.animate-star { animation: starPop 0.45s ease; }

/* ==================== POST DETAIL PAGE BODY PADDING ==================== */
body.post-detail-page {
    padding-top: 48px;
    padding-bottom: 108px;
}

/* --- Desktop: hide post-detail fixed bars --- */
@media (min-width: 769px) {
    .post-top-bar, .post-action-bar { display: none; }
    body.post-detail-page { padding-top: 0; padding-bottom: 0; }
}

/* --- Post Editor --- */
.post-editor { max-width: 680px; }
.editor-section {
    margin-bottom: 20px;
}
.editor-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.editor-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.editor-divider {
    border: none;
    border-top: 1px solid rgba(0,0,0,0.06);
    margin: 0 0 16px;
}
.title-input-ghost {
    width: 100%;
    font-size: 20px;
    font-weight: 600;
    font-family: var(--font-display);
    border: none;
    outline: none;
    background: transparent;
    padding: 8px 0;
    color: var(--text);
    line-height: 1.4;
}
.title-input-ghost::placeholder {
    color: var(--text-light);
}
.content-area-ghost {
    width: 100%;
    box-sizing: border-box;
    font-size: 16px;
    font-family: var(--font-body);
    border: none;
    outline: none;
    background: transparent;
    padding: 0 36px 0 0;
    color: var(--text);
    line-height: 1.8;
    resize: none;
}
.content-area-ghost::placeholder {
    color: var(--text-light);
}
.category-select {
    padding: 8px 14px;
    font-size: 14px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    appearance: auto;
}
.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}
.editor-toolbar #uploadStatus {
    font-size: 12px;
    color: var(--text-muted);
}

/* Cover upload */
.cover-upload-area {
    border: 2px dashed rgba(0,122,255,0.25);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s;
    position: relative;
}
.cover-upload-area:hover { border-color: var(--accent); }
.cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 13px;
    gap: 6px;
}
.cover-plus {
    font-size: 36px;
    color: var(--accent);
    font-weight: 300;
}
.cover-preview {
    position: relative;
}
.cover-preview img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
}
.cover-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Post Detail (unified flow, no card separation) === */
.post-body {
    padding: 0 4px 8px;
}
.post-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.3;
}
.post-tag {
    display: inline-block;
    font-size: 11px;
    color: var(--accent);
    background: rgba(0,122,255,0.08);
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 500;
}
.post-text {
    word-break: break-word;
    line-height: 1.9;
    font-size: 16px;
    color: var(--text);
    margin-bottom: 12px;
}
.post-text a { color: var(--accent); }
.post-text p { margin-bottom: 8px; }
.post-text img {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 8px;
    display: block;
    margin: 8px 0;
}
.post-meta-bottom {
    display: flex;
    gap: 14px;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    flex-wrap: wrap;
}

/* === Section Divider === */
.section-divider {
    border: none;
    border-top: 1px solid rgba(0,0,0,0.08);
    margin: 20px 0 16px;
}
.comments-heading {
    font-size: 16px;
    font-weight: 600;
    padding: 0 4px;
    margin-bottom: 14px;
    color: var(--text);
}
.login-prompt {
    text-align: center;
    padding: 12px 0 20px;
    font-size: 14px;
    color: var(--text-muted);
}
.login-prompt a { color: var(--accent); font-weight: 500; }

/* === Reply Composer (avatar + pill input + image icon) === */
.reply-composer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 4px;
    margin-bottom: 16px;
}
.reply-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}
.reply-form {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}
.reply-pill {
    flex: 1;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 22px;
    padding: 0 6px 0 18px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.reply-pill:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,122,255,0.08);
}
.reply-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    padding: 10px 0;
    background: transparent;
    color: var(--text);
    font-family: var(--font-body);
    min-width: 0;
}
.reply-input::placeholder { color: var(--text-light); }
.reply-img-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.reply-img-btn:hover { background: rgba(0,0,0,0.05); }
.reply-img-btn.has-img svg { stroke: var(--accent); }
.reply-img-btn.has-img { background: rgba(0,122,255,0.08); }
.reply-submit {
    flex-shrink: 0;
    padding: 8px 18px;
    background: var(--gradient-btn);
    color: #fff;
    border: none;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-body);
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0,122,255,0.2);
    transition: transform 0.15s;
}
.reply-submit:active { transform: scale(0.95); }

/* === Reply Items === */
.reply-item {
    display: flex;
    gap: 10px;
    padding: 12px 4px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.reply-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    margin-top: 2px;
}
.reply-item-body { flex: 1; min-width: 0; }
.reply-item-meta {
    font-size: 13px;
    color: var(--text-dim);
    display: flex;
    gap: 8px;
    align-items: baseline;
    margin-bottom: 3px;
    flex-wrap: nowrap;
}
.reply-item-meta strong { color: var(--text); font-size: 14px; white-space: nowrap; flex-shrink: 0; }
.reply-item-time { white-space: nowrap; flex-shrink: 0; }
.reply-item-text {
    font-size: 15px;
    line-height: 1.6;
    word-break: break-word;
    color: var(--text);
}
.reply-item-img {
    margin-top: 8px;
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    object-fit: cover;
    cursor: pointer;
    display: block;
}

/* Child reply (reply-to-comment) — thread block */
.reply-thread {
    /* margin-left set inline by depth */
}
.reply-child {
    border-left: 2px solid rgba(0,0,0,0.08);
    padding-left: 10px;
}
.reply-to-name {
    color: var(--accent);
    font-size: 12px;
    font-weight: 400;
}
.reply-trigger-btn {
    border: none;
    background: none;
    font-size: 12px;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    flex-shrink: 0;
}
.reply-trigger-btn:hover { color: var(--accent); }
.reply-replying-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px 8px;
    font-size: 12px;
    color: var(--text-dim);
}
.reply-hint-cancel {
    border: none;
    background: none;
    font-size: 16px;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.reply-hint-cancel:hover { color: #e74c3c; }
.reply-item-time { color: var(--text-dim); font-size: 12px; }

@media (max-width: 768px) {
    .reply-child { padding-left: 6px; }
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 9px 22px;
    background: var(--gradient-btn);
    color: #FFF;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    font-family: var(--font-body);
    box-shadow: 0 4px 14px rgba(0, 122, 255, 0.2);
    transition: transform var(--transition), box-shadow var(--transition);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0, 122, 255, 0.3); color: #FFF; }
.btn:active { transform: scale(0.97); }
a.btn:visited { color: #FFF; }
a.btn-outline:visited { color: var(--accent); }
.btn-danger { background: linear-gradient(140deg, #C65353, #A84040); box-shadow: 0 4px 14px rgba(198, 83, 83, 0.2); }
.btn-danger:hover { box-shadow: 0 6px 20px rgba(198, 83, 83, 0.3); }
.btn-sm { padding: 5px 14px; font-size: 12px; border-radius: 10px; }
.btn-outline {
    background: transparent;
    border: 1px solid rgba(0, 122, 255, 0.25);
    box-shadow: none;
    color: var(--accent);
}
.btn-outline:hover { background: rgba(0, 122, 255, 0.06); box-shadow: none; }
.btn-block { display: block; width: 100%; text-align: center; }

/* === Forms === */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-dim);
    font-family: var(--font-body);
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0, 122, 255, 0.2);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text);
    font-family: var(--font-body);
    transition: border-color var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.06);
}

/* === Table wrapper for horizontal scroll === */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -20px;
    padding: 0 20px;
}

/* === Tables === */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 13px;
    border: var(--border);
    box-shadow: var(--shadow-card);
}
.data-table th, .data-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid rgba(0, 122, 255, 0.1); }
.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-dim);
    white-space: nowrap;
    font-family: var(--font-body);
}
.data-table tr:hover td { background: rgba(0, 122, 255, 0.03); }

/* === School detail page === */
.school-header { margin-bottom: 16px; }
.school-header h2 { margin-bottom: 8px; }
.school-tags {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    font-size: 13px; color: var(--text-light);
}
.school-links {
    display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap;
}
.school-link-item {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 8px;
    background: var(--bg-card); border: 1px solid var(--border);
    font-size: 13px; color: var(--accent); font-weight: 500;
    text-decoration: none; transition: background 0.2s;
}
.school-link-item:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.sl-icon { font-size: 16px; }
.score-up { color: #d32f2f; font-weight: 600; }
.score-down { color: #2e7d32; font-weight: 600; }

/* === Search bar === */
.search-bar { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.search-bar input, .search-bar select {
    flex: 1;
    min-width: 120px;
    padding: 10px 14px;
    border: 1px solid rgba(0, 122, 255, 0.2);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text);
    font-family: var(--font-body);
}
.search-bar input:focus, .search-bar select:focus { outline: none; border-color: var(--accent); }
.search-bar select { background: var(--bg-secondary); }
.search-bar select option { background: var(--bg); color: var(--text); }

/* === Pagination === */
.pagination { display: flex; justify-content: center; gap: 8px; margin: 24px 0; flex-wrap: wrap; }
.pagination a {
    padding: 8px 16px;
    background: var(--bg-card);
    border: var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-dim);
    font-size: 14px;
    box-shadow: var(--shadow-card);
    transition: all var(--transition);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination strong {
    padding: 8px 16px;
    background: var(--gradient-btn);
    color: #FFF;
    border-radius: var(--radius-sm);
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
}

/* === Flash messages === */
.flash { padding: 12px 18px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 14px; }
.flash-success { background: rgba(34, 197, 94, 0.1); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.2); }
.flash-error { background: rgba(198, 83, 83, 0.1); color: #A84040; border: 1px solid rgba(198, 83, 83, 0.25); }

/* === Admin === */
.admin-layout { display: flex; gap: 20px; }
.admin-sidebar {
    min-width: 150px;
    background: var(--bg-card);
    padding: 18px;
    border-radius: var(--radius);
    height: fit-content;
    border: var(--border);
    box-shadow: var(--shadow-card);
}
.admin-sidebar a {
    display: block;
    padding: 8px 0;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid rgba(0, 122, 255, 0.08);
    transition: color var(--transition);
}
.admin-sidebar a:hover { color: var(--accent); }
.admin-content { flex: 1; min-width: 0; }

/* === Login page === */
.login-page { max-width: 400px; margin: 60px auto; text-align: center; }
.login-page h2 { margin-bottom: 14px; color: var(--text); font-family: var(--font-display); }

/* === Tag filters === */
.tag-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.filter-tag {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    background: var(--bg-card);
    color: var(--text-dim);
    border: var(--border);
    transition: all var(--transition);
}
.filter-tag:hover { border-color: var(--accent); color: var(--accent); }
.filter-tag.active { background: var(--gradient-btn); color: #FFF; border-color: transparent; box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2); }
.filter-tag.clear { color: #C65353; border-color: rgba(198, 83, 83, 0.3); font-size: 12px; }
.filter-tag.clear:hover { background: rgba(198, 83, 83, 0.06); }

/* === School tags === */
.tag-985 { background: rgba(0, 122, 255, 0.12); color: var(--accent); font-size: 10px; padding: 1px 8px; }
.tag-211 { background: rgba(0, 122, 255, 0.12); color: var(--accent-light); font-size: 10px; padding: 1px 8px; }
.tag-double { background: rgba(0, 122, 255, 0.1); color: var(--accent-light); font-size: 10px; padding: 1px 8px; }
.tag-phd { background: rgba(0, 122, 255, 0.08); color: var(--accent-light); font-size: 10px; padding: 1px 8px; }
.tag-zx { background: rgba(198, 83, 83, 0.08); color: #A84040; font-size: 10px; padding: 1px 8px; }
.tag-row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* === Major pages === */
.major-group { margin-bottom: 30px; }
.discipline-title { font-family: var(--font-display); font-size: 18px; margin-bottom: 8px; color: var(--text); }
.code-tag { font-size: 12px; color: var(--text-muted); font-weight: normal; }
.section-desc { color: var(--text-muted); font-size: 14px; margin-bottom: 18px; }
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.major-stats { display: flex; gap: 14px; margin-bottom: 24px; }
.stat-card {
    background: var(--bg-card);
    padding: 18px 24px;
    border-radius: var(--radius);
    text-align: center;
    flex: 1;
    border: var(--border);
    box-shadow: var(--shadow-card);
}
.stat-num { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--accent); display: block; }
.stat-label { font-size: 12px; color: var(--text-muted); }
.subject-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.subject-tag {
    background: rgba(0, 122, 255, 0.06);
    color: var(--accent);
    padding: 5px 14px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    border: 1px solid rgba(0, 122, 255, 0.15);
    transition: all var(--transition);
    font-size: 13px;
}
.subject-tag small { color: var(--text-muted); font-size: 11px; }
.tag-cell { white-space: nowrap; }
.enroll-cell { font-size: 12px; max-width: 200px; word-break: break-all; }

/* === Papers pages === */
.papers-layout { display: flex; gap: 20px; }
.papers-sidebar { min-width: 160px; max-width: 200px; }
.papers-sidebar h4 { margin-bottom: 12px; font-size: 15px; color: var(--text-dim); font-family: var(--font-display); }
.subject-nav { list-style: none; padding: 0; }
.subject-nav li { margin-bottom: 2px; }
.subject-nav a {
    display: block;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-dim);
    text-decoration: none;
    transition: all var(--transition);
}
.subject-nav a small { color: var(--text-muted); font-size: 10px; }
.subject-nav a:hover { background: rgba(0, 122, 255, 0.06); color: var(--text); }
.subject-nav a.active { background: var(--gradient-btn); color: #FFF; box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2); }
.subject-nav a.active small { color: rgba(255, 255, 255, 0.7); }
.subject-group { font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 10px 8px 4px; }
.subject-item { padding-left: 8px; }
.papers-main { flex: 1; min-width: 0; }

.paper-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    border: var(--border);
    box-shadow: var(--shadow-card);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.paper-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); border-color: rgba(0, 122, 255, 0.25); }
.paper-info { flex: 1; min-width: 0; padding-right: 14px; }
.paper-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
    transition: color var(--transition);
    word-break: break-word;
}
.paper-title:hover { color: var(--accent); }
.paper-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.paper-year {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-light);
    text-shadow: 0 0 12px rgba(129, 140, 248, 0.3);
    font-variant-numeric: tabular-nums;
}
.paper-meta-detail { font-size: 13px; color: var(--text-muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; }
.paper-detail {
    background: var(--bg-card);
    padding: 28px;
    border-radius: var(--radius);
    border: var(--border);
    box-shadow: var(--shadow-card);
}
.paper-detail h2 { font-family: var(--font-display); margin-bottom: 14px; color: var(--text); font-size: 20px; word-break: break-word; }


/* === Resource cards === */
.resource-card a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; transition: color var(--transition); }
.resource-card a:hover { color: var(--accent); }

/* ==================== 择校模块 ==================== */

/* Direction exam badges */
.exam-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.04);
    font-size: 13px;
    color: var(--text-dim);
}
.exam-badge-highlight {
    background: rgba(0, 122, 255, 0.08);
    color: var(--accent);
    font-weight: 600;
}
.exam-grid { display: flex; gap: 8px; flex-wrap: wrap; }

/* Line chart (SVG, replaces old bar chart) */
.line-chart-canvas {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: var(--border);
    overflow: hidden;
}
.line-chart-canvas svg { display: block; }

/* Transposed rate table — row headers */
.transposed-table td:first-child {
    font-weight: 600;
    color: var(--text-dim);
    white-space: nowrap;
    position: sticky;
    left: 0;
    background: var(--bg-card);
}
.transposed-table th {
    white-space: nowrap;
}
/* Old trend bar chart (keep for other pages) */
.trend-chart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 140px;
    padding: 8px 4px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: var(--border);
}
.trend-bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 36px; }
.trend-bar {
    width: 100%;
    max-width: 40px;
    background: linear-gradient(180deg, var(--accent), var(--accent-light));
    border-radius: 6px 6px 0 0;
    min-height: 6px;
    transition: height 0.5s ease;
}
.trend-bar-green {
    background: linear-gradient(180deg, var(--accent-sage), var(--accent-moss));
}
.trend-year { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.trend-val { font-size: 11px; font-weight: 600; color: var(--text-dim); margin-top: 2px; }

/* ==================== MOBILE (max-width: 768px) ==================== */
@media (max-width: 768px) {
    body {
        padding-bottom: var(--bottom-bar-h);
        font-size: 15px;
    }

    /* --- Header --- */
    .site-header { display: none; }
    .site-header .logo { font-size: 17px; }
    .header-nav { display: none; }
    .hamburger-btn { display: none; }

    /* --- Drawer --- */
    .drawer-overlay { display: none; }
    .side-drawer { display: none; }

    /* --- Bottom tabs --- */
    .bottom-tabs { display: flex; }

    /* --- Main --- */
    .site-main { padding: 12px 14px; max-width: 100%; }

    /* --- Hero --- */
    .home-hero { padding: 24px 16px 20px; border-radius: 20px; }
    .home-hero h1 { font-size: 20px; }
    .countdown { padding: 6px 16px; font-size: 13px; }
    .countdown strong { font-size: 26px; }
    .timeline-item { font-size: 11px; padding: 5px 10px; }
    .timeline-item span { font-size: 13px; }

    /* --- Quick entries --- */
    .quick-entries { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .quick-entry { padding: 16px 10px; }

    /* --- Paper grid --- */
    .paper-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .paper-grid-card { padding: 14px; }

    /* --- Papers layout (sidebar → top) --- */
    .papers-layout { flex-direction: column; gap: 14px; }
    .papers-sidebar { max-width: none; min-width: 0; }
    .papers-sidebar h4 { margin-bottom: 8px; font-size: 14px; }
    .subject-nav { display: flex; flex-wrap: wrap; gap: 4px; }
    .subject-nav li { margin-bottom: 0; }
    .subject-nav .subject-group { display: none; }
    .subject-nav .subject-item { padding-left: 0; }
    .subject-nav a { font-size: 12px; padding: 4px 10px; }

    /* --- Paper card --- */
    .paper-card { padding: 12px 14px; flex-direction: column; align-items: stretch; gap: 10px; }
    .paper-info { padding-right: 0; }
    .paper-card .btn-sm { align-self: flex-end; }
    .paper-title { font-size: 14px; }
    .paper-meta { font-size: 11px; gap: 6px; }
    .paper-detail { padding: 18px; }
    .paper-meta-detail { font-size: 12px; }

    /* --- Search bar --- */
    .search-bar { gap: 6px; }
    .search-bar input, .search-bar select { font-size: 13px; padding: 10px 12px; }

    /* --- Tag filters --- */
    .tag-filters { gap: 5px; font-size: 11px; }

    /* --- Forum --- */
    .ranking-section, .articles-section { padding: 14px 16px; }
    .ranking-list li { font-size: 14px; }
    .article-card-title { font-size: 13px; }
    .waterfall-grid { gap: 8px; }
    .wf-title { font-size: 13px; }
    .wf-info { padding: 8px 10px; }
    .stream-toolbar { flex-wrap: wrap; gap: 8px; }
    .subject-filter { flex: 1; min-width: 100px; }
    .new-post-btn { flex-shrink: 0; }
    .cover-placeholder { padding: 30px; }
    .cover-plus { font-size: 28px; }

    /* --- Post detail --- */
    .post-detail { padding: 18px; }
    .post-detail h1 { font-size: 18px; }
    .post-content { font-size: 15px; line-height: 1.75; }

    /* --- Forms --- */
    .form-group input, .form-group select, .form-group textarea { font-size: 16px; padding: 12px; }

    /* --- Login --- */
    .login-page { max-width: 100%; margin: 30px 0; padding: 0 8px; }

    /* --- Admin --- */
    .admin-layout { flex-direction: column; gap: 14px; }
    .admin-sidebar { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px; min-width: 0; padding: 12px; border-radius: var(--radius); }
    .admin-sidebar a { border-bottom: none; padding: 5px 10px; font-size: 13px; }

    /* --- Tables --- */
    .table-wrap { margin: 0 -14px; padding: 0 14px; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 8px 10px; white-space: nowrap; }

    /* --- Major pages --- */
    .major-stats { flex-wrap: wrap; gap: 8px; }
    .stat-card { flex: 1 1 40%; padding: 14px; }
    .stat-num { font-size: 22px; }
    .enroll-cell { max-width: 120px; }

    /* --- Pagination --- */
    .pagination a, .pagination strong { padding: 6px 12px; font-size: 13px; }

    /* --- Footer --- */
    .site-footer { padding: 16px; font-size: 11px; }
}

/* ==================== SCHOOL DETAIL TABS ==================== */
.school-tabs {
    display: flex;
    gap: 4px;
    margin: 20px 0 16px;
    padding: 4px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    flex: 1 0 auto;
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.tab-btn.active {
    background: var(--accent);
    color: #fff;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ==================== TREND CHART ==================== */
.trend-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
}

.trend-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.trend-type {
    font-size: 11px;
    font-weight: 400;
    padding: 2px 8px;
    background: var(--accent-sage);
    color: #fff;
    border-radius: 10px;
}

.trend-dir {
    font-size: 11px;
    color: var(--text-muted);
}

.trend-bars {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    gap: 12px;
    height: 150px;
    padding: 0 8px;
}

.trend-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
    justify-content: flex-end;
}

.trend-bar-val {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.trend-bar {
    width: 100%;
    max-width: 60px;
    min-height: 4px;
    background: linear-gradient(to top, var(--accent), var(--accent-light));
    border-radius: 6px 6px 0 0;
    transition: height 0.5s ease;
}

.trend-bar-year {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ==================== SCHOOL SELECTION MODULE ==================== */

/* --- Hero entry cards (AI + search) --- */
.schools-hero { gap: 12px; }
.hero-entry:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.hero-entry:active { transform: scale(0.98); }

/* --- Subject quick-access grid --- */
.subj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.subj-card { transition: box-shadow 0.2s, transform 0.15s; }
.subj-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.subj-card:active { transform: scale(0.98); }

/* --- Target school card --- */
.target-card { transition: box-shadow 0.2s; }
.target-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.target-btn { transition: background 0.2s; cursor: pointer; }
.target-btn:hover { background: rgba(0,122,255,0.12) !important; }

/* --- Hot school ranking --- */
.hot-rank-item { transition: box-shadow 0.15s, transform 0.15s; }
.hot-rank-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.hot-rank-item:active { transform: scale(0.99); }

/* --- Degree type tabs (学硕/专硕) --- */
.degree-tab { transition: all 0.2s; }
.degree-tab:hover { color: var(--accent) !important; }

/* --- Detail page tabs --- */
.detail-tabs { display: flex; gap: 0; background: var(--bg-card); border: var(--border); border-radius: var(--radius-md); overflow: hidden; }
.detail-tab { flex: 1; text-align: center; padding: 10px 6px; cursor: pointer; font-size: 13px; color: var(--text-dim); transition: all 0.2s; user-select: none; }
.detail-tab:hover { color: var(--accent); }
.detail-tab.active { background: var(--accent); color: #fff; font-weight: 600; }
.tab-panel { display: none; }

/* --- College filter selects --- */
.filter-select {
    padding: 6px 10px; border: var(--border); border-radius: 6px;
    background: var(--bg-card); color: var(--text); font-size: 13px;
    flex: 1; min-width: 100px;
}

/* ==================== MULTI-IMAGE UPLOAD ==================== */
.multi-upload-area {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}
.upload-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.upload-thumb-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-color, #e0e0e0);
    cursor: grab;
    transition: transform 0.15s, border-color 0.15s;
}
.upload-thumb-item:active { cursor: grabbing; }
.upload-thumb-item.is-cover { border-color: var(--accent, #007AFF); }
.upload-thumb-item.drag-over { border-color: var(--accent, #007AFF); transform: scale(1.05); }
.upload-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.thumb-cover-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: var(--accent, #007AFF);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    pointer-events: none;
    z-index: 2;
}
.thumb-remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    padding: 0;
}
.thumb-remove-btn:hover { background: rgba(255,0,0,0.7); }
.upload-add-btn {
    width: 100px;
    height: 100px;
    border: 2px dashed var(--border-color, #ccc);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted, #888);
    font-size: 12px;
    gap: 4px;
    transition: border-color 0.2s, color 0.2s;
}
.upload-add-btn:hover { border-color: var(--accent, #007AFF); color: var(--accent, #007AFF); }
.upload-add-btn .cover-plus { font-size: 28px; font-weight: 300; }

/* ==================== EMOJI PICKER ==================== */
.textarea-wrapper {
    position: relative;
}
.textarea-wrapper textarea {
    width: 100%;
    box-sizing: border-box;
}
.emoji-toggle-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--bg-card, #fff);
    border: var(--border, 1px solid #e0e0e0);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s;
    z-index: 2;
}
.emoji-toggle-btn:hover { background: #f0f0f0; }
.emoji-picker {
    position: absolute;
    bottom: 44px;
    right: 0;
    width: 345px;
    max-height: 360px;
    overflow-y: auto;
    overflow-x: hidden;
    touch-action: pan-y;
    overscroll-behavior: contain;
    background: var(--bg-card, #fff);
    border: var(--border, 1px solid #e0e0e0);
    border-radius: var(--radius, 10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    z-index: 100;
}
.emoji-item {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.1s;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    touch-action: manipulation;
}
.emoji-item:hover { background: #f0f0f0; transform: scale(1.15); }

/* ==================== POST GALLERY (full-width edge-to-edge carousel) ==================== */
.post-gallery {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    overflow: hidden;
    margin-bottom: 10px;
    background: var(--bg-card);
    -webkit-tap-highlight-color: transparent;
}
.post-gallery--single {
    cursor: pointer;
}
.post-gallery--single img {
    max-width: 100%;
    max-height: 75vh;
    display: block;
    margin: 0 auto;
}
.gallery-track {
    display: flex;
    transition: transform 0.35s ease;
}
.gallery-slide {
    min-width: 100%;
    flex-shrink: 0;
}
.gallery-slide {
    min-width: 100%;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}
.gallery-slide img {
    max-width: 100%;
    max-height: 75vh;
    display: block;
    cursor: pointer;
}
.gallery-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 5;
}
.gallery-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0,0,0,0.25);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.gallery-dot.active {
    background: #FF3B30;
    transform: scale(1.3);
}

/* ==================== LIGHTBOX (fullscreen image viewer) ==================== */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}
.lightbox-close {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
    line-height: 1;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }
.lightbox-img-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.lightbox-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-select: none;
}
.lightbox-dots {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}
.lightbox-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transition: background 0.2s, transform 0.2s;
}
.lightbox-dot.active {
    background: #fff;
    transform: scale(1.3);
}
.lightbox-counter {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    z-index: 10;
    background: rgba(0,0,0,0.4);
    padding: 4px 14px;
    border-radius: 12px;
}

/* ==================== HASHTAGS ==================== */
.hashtags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color, #e8e8e8);
}
.hashtag-pill {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 16px;
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s, transform 0.15s;
}
.hashtag-pill:hover { opacity: 0.85; transform: scale(1.04); color: #fff; }

/* Inline hashtag links in post content */
a.hashtag-link {
    color: #4c6ef5;
    text-decoration: none;
    font-weight: 700;
}
a.hashtag-link:hover { text-decoration: underline; }

/* ==================== STREAM SEARCH ==================== */
.stream-search {
    display: flex;
    gap: 6px;
    flex: 1;
    min-width: 180px;
}
.search-input {
    flex: 1;
    padding: 6px 12px;
    border: var(--border, 1px solid #e0e0e0);
    border-radius: 8px;
    font-size: 13px;
    background: var(--bg-card, #fff);
    color: var(--text);
    min-width: 0;
}
.search-input:focus { outline: none; border-color: var(--accent, #007AFF); }
.search-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}
.active-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ==================== SMALL PHONE (max-width: 400px) ==================== */
@media (max-width: 400px) {
    .home-hero h1 { font-size: 18px; }
    .countdown strong { font-size: 24px; }
    .quick-entries { gap: 6px; }
    .quick-icon { font-size: 24px; }
    .quick-num { font-size: 20px; }
    .paper-grid { grid-template-columns: repeat(2, 1fr); }
    .forum-cats { grid-template-columns: repeat(2, 1fr); }
    .bottom-tabs a { font-size: 9px; }
    .bottom-tabs a .bt-icon { font-size: 18px; }
    .bt-center-circle { width: 44px; height: 44px; bottom: 10px; }
    .bt-center-text { font-size: 11px; }
    .timeline-item { padding: 4px 8px; font-size: 10px; }
    .timeline-item span { font-size: 12px; }
}

/* ==================== 高分学长学姐答疑 / 私聊 ==================== */

/* -- Mentor cards -- */
.mentor-grid {display:grid;grid-template-columns:repeat(2,1fr);gap:12px;}
.mentor-card {background:var(--bg-card);border:var(--border);border-radius:var(--radius-md);padding:14px 16px;}
.mentor-top {display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:8px;}
.mentor-info {display:flex;align-items:center;gap:8px;flex:1;min-width:0;}
.mentor-avatar {width:36px;height:36px;border-radius:50%;object-fit:cover;flex-shrink:0;}
.mentor-name {font-size:14px;font-weight:600;}
.online-badge {display:inline-block;font-size:11px;padding:1px 7px;border-radius:10px;font-weight:500;margin-left:6px;}
.online-badge.online {background:#d4edda;color:#27ae60;}
.online-badge.offline {background:#eee;color:#999;}
.mentor-chat-btn {flex-shrink:0;font-size:13px;padding:5px 14px;border-radius:16px;background:var(--accent);color:#fff;border:none;cursor:pointer;font-weight:500;}
.mentor-school {font-size:12px;color:var(--text-dim);margin-bottom:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.mentor-subject {font-size:13px;color:var(--text);}
.mentor-score {color:var(--accent);font-weight:700;font-size:15px;}

/* -- Modal -- */
.modal-overlay {display:none;position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.45);z-index:1000;align-items:center;justify-content:center;}
.modal-overlay.open {display:flex;}
.modal-content {background:var(--bg-card);border-radius:var(--radius);padding:24px;width:90%;max-width:400px;max-height:85vh;overflow-y:auto;box-shadow:0 8px 32px rgba(0,0,0,0.18);}
.qr-modal {text-align:center;}
.pricing-modal {text-align:center;}
.modal-content h3 {font-size:17px;font-weight:600;}
.modal-content label {display:block;font-size:13px;color:var(--text-dim);margin-bottom:4px;}
.form-input {width:100%;padding:10px 12px;border:1px solid var(--border);border-radius:10px;font-size:14px;outline:none;box-sizing:border-box;margin-bottom:10px;font-family:inherit;}
.form-input:focus {border-color:var(--accent);}

/* -- Buttons -- */
.btn-outline-sm {background:transparent;border:1px solid var(--accent);color:var(--accent);border-radius:16px;cursor:pointer;font-weight:500;}
.btn-outline-sm:hover {background:rgba(0,122,255,0.05);}

@media (max-width: 768px) {
    .mentor-grid {grid-template-columns:1fr;}
}

/* ==================== 个人中心 /mine ==================== */

.mine-page {
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 80px;
}

.mine-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    background: var(--bg-card, #fff);
    border-bottom: 1px solid var(--border-color, #eee);
}

.mine-avatar-wrap { flex-shrink: 0; }
.mine-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}

.mine-info { flex: 1; min-width: 0; }
.mine-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.mine-nickname { font-size: 18px; font-weight: 700; }
.mine-level {
    font-size: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.mine-level-bar-wrap { display: flex; align-items: center; gap: 8px; }
.mine-level-bar {
    flex: 1;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    max-width: 140px;
}
.mine-level-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
    transition: width 0.3s;
}
.mine-level-text { font-size: 11px; color: #999; white-space: nowrap; }

.mine-space-link {
    font-size: 14px;
    color: var(--accent, #007AFF);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Stats row */
.mine-stats {
    display: flex;
    justify-content: space-around;
    padding: 16px 0;
    background: var(--bg-card, #fff);
    border-bottom: 1px solid var(--border-color, #eee);
}
.mine-stat {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mine-stat b { font-size: 20px; font-weight: 700; }
.mine-stat span { font-size: 12px; color: #999; }

/* Points bar */
.mine-points-bar {
    display: block;
    padding: 14px 16px;
    background: var(--bg-card, #fff);
    border-bottom: 1px solid var(--border-color, #eee);
}
.mine-points-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 500;
}
.mine-points-icon { font-size: 18px; }

/* Function grid */
.mine-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--border-color, #eee);
    margin: 12px 0;
}
.mine-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 12px;
    background: var(--bg-card, #fff);
    text-decoration: none;
    color: inherit;
    font-size: 14px;
    transition: background 0.15s;
}
.mine-grid-item:hover { background: #f8f8f8; }
.mine-grid-icon { font-size: 28px; }

/* Section */
.mine-section {
    background: var(--bg-card, #fff);
    margin-top: 12px;
    border-top: 1px solid var(--border-color, #eee);
    border-bottom: 1px solid var(--border-color, #eee);
}
.mine-section-title {
    padding: 12px 16px 4px;
    font-size: 13px;
    color: #999;
}
.mine-link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    font-size: 15px;
    border-bottom: 1px solid var(--border-color, #f0f0f0);
}
.mine-link-item:last-child { border-bottom: none; }

/* Modal */
.mine-modal-content { max-width: 500px; }
.mine-modal-body { max-height: 60vh; overflow-y: auto; }
.mine-modal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.mine-modal-item:last-child { border-bottom: none; }


/* ==================== 个人设置 /mine/settings ==================== */

.settings-page {
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 80px;
}

.settings-section {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color, #eee);
    background: var(--bg-card, #fff);
}
.settings-label {
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
}
.settings-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
    background: var(--bg-card, #fff);
    color: var(--text, #333);
}
.settings-input:focus { border-color: var(--accent, #007AFF); }
.settings-textarea {
    min-height: 80px;
    resize: vertical;
}
.settings-avatar-row {
    display: flex;
    align-items: center;
    gap: 16px;
}
.settings-avatar-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}
.settings-privacy-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}
.settings-privacy-row + .settings-privacy-row {
    border-top: 1px solid #f5f5f5;
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ccc;
    border-radius: 26px;
    transition: 0.25s;
}
.toggle-slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.25s;
}
.toggle-switch input:checked + .toggle-slider { background: #4c6ef5; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }


/* ==================== 个人空间 /space ==================== */

.space-page {
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 80px;
}

.space-header {
    text-align: center;
    padding: 32px 16px 20px;
    background: var(--bg-card, #fff);
    border-bottom: 1px solid var(--border-color, #eee);
}
.space-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
}
.space-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.space-level {
    font-size: 13px;
    color: #667eea;
    margin-bottom: 10px;
}
.space-bio {
    font-size: 14px;
    color: #555;
    max-width: 300px;
    margin: 0 auto 8px;
    line-height: 1.5;
}
.space-school {
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
}
.space-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 12px;
}
.space-stat {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.space-stat b { font-size: 18px; }
.space-stat span { font-size: 12px; color: #999; }

.space-follow-btn {
    padding: 8px 28px;
    border-radius: 20px;
    font-size: 14px;
    border: 1px solid var(--accent, #007AFF);
    background: var(--accent, #007AFF);
    color: #fff;
    cursor: pointer;
    font-weight: 500;
}
.space-follow-btn.following {
    background: #fff;
    color: var(--accent, #007AFF);
}

/* Tabs */
.space-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    background: var(--bg-card, #fff);
    position: sticky;
    top: 0;
    z-index: 10;
}
.space-tab {
    flex: 1;
    text-align: center;
    padding: 14px 0;
    font-size: 15px;
    cursor: pointer;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.space-tab.active {
    color: var(--accent, #007AFF);
    border-bottom-color: var(--accent, #007AFF);
    font-weight: 600;
}

.space-content { padding: 12px 8px; }

/* Article list in space */
.article-list { display: flex; flex-direction: column; gap: 8px; }
.article-list-item {
    display: block;
    padding: 16px;
    background: var(--bg-card, #fff);
    border-radius: var(--radius, 8px);
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.article-list-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.article-list-meta { font-size: 13px; color: #666; margin-bottom: 6px; }

/* Pagination */
.pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
}
.pagination-bar button {
    padding: 6px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
}
.pagination-bar button:disabled { opacity: 0.4; cursor: default; }
.pagination-bar span { font-size: 13px; color: #666; }


/* ==================== 响应式 ==================== */

@media (max-width: 400px) {
    .mine-panel { padding: 14px 12px; }
    .mine-avatar { width: 44px; height: 44px; }
    .mine-nickname { font-size: 16px; }
    .mine-stats { padding: 12px 0; }
    .mine-grid-item { padding: 18px 8px; font-size: 13px; }
    .mine-grid-icon { font-size: 24px; }
    .space-avatar { width: 64px; height: 64px; }
    .space-stats { gap: 24px; }
}
