:root {
    --bg: #f8f9ff;
    --surface: #ffffff;
    --surface-low: #eef4ff;
    --surface-mid: #e5eeff;
    --ink: #121c28;
    --muted: #5f6673;
    --line: #d8c3ad;
    --primary: #f59e0b;
    --primary-dark: #855300;
    --primary-soft: #ffddb8;
    --paper: #ede3b8;
    --blue: #d8e3fb;
    --danger: #ffdad6;
    --shadow: 0 4px 20px rgba(245, 158, 11, .08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
svg { width: 22px; height: 22px; fill: currentColor; flex: 0 0 auto; }
button, input, textarea, select { font: inherit; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 256px;
    padding: 24px 20px;
    background: var(--surface);
    box-shadow: 2px 0 14px rgba(18, 28, 40, .06);
    display: flex;
    flex-direction: column;
    gap: 24px;
    z-index: 10;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-dark);
    font: 800 30px/1.1 Georgia, "Noto Serif SC", serif;
}
.brand svg { width: 30px; height: 30px; }
.mentor {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: var(--surface-low);
}
.mentor p { margin: 2px 0 0; font-size: 13px; color: #3c475a; }
.desktop-nav { display: grid; gap: 10px; margin-top: 10px; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 8px;
    color: #382012;
    font-weight: 700;
}
.nav-link.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
}
.premium {
    margin-top: auto;
    display: block;
    text-align: center;
    padding: 13px 16px;
    border-radius: 8px;
    background: var(--primary);
    color: #2a1700;
    font-weight: 800;
}
.mobile-header, .mobile-nav { display: none; }
.app-shell {
    width: min(1180px, calc(100% - 316px));
    margin-left: 296px;
    padding: 40px 24px 64px;
}
.page-head h1, .campus-hero h1, .profile-card h1, .forum-head h1, .classbar h1 {
    margin: 0;
    font: 800 34px/1.2 Georgia, "Noto Serif SC", serif;
    letter-spacing: 0;
}
.page-head p, .campus-hero p, .classbar p { margin: 8px 0 0; color: #3d3127; font-size: 17px; }
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
}
.dashboard {
    display: grid;
    grid-template-columns: 1.6fr .8fr;
    gap: 16px;
    margin-top: 32px;
}
.study-card {
    min-height: 230px;
    grid-row: span 2;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: radial-gradient(circle at 90% 8%, rgba(245,158,11,.12), transparent 30%), var(--surface);
}
.study-card h2, .section-title h2 { margin: 0; font-size: 24px; }
.study-card p { margin: 6px 0 0; color: #3d3127; font-weight: 700; }
.progress-row { display: flex; align-items: center; gap: 32px; }
.progress-row strong { display: block; font-size: 38px; font-weight: 900; }
.progress-row em {
    display: inline-block;
    margin-top: 10px;
    padding: 7px 14px;
    border-radius: 99px;
    background: #fff0d7;
    color: var(--primary-dark);
    font-style: normal;
    font-weight: 800;
}
.ring {
    --deg: calc(var(--progress) * 3.6deg);
    position: relative;
    width: 104px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: conic-gradient(var(--primary) var(--deg), var(--surface-mid) 0);
    display: grid;
    place-items: center;
}
.ring::before {
    content: "";
    position: absolute;
    width: 76px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--surface);
}
.ring span { position: relative; z-index: 1; color: var(--primary-dark); font-size: 22px; font-weight: 900; }
.stat { padding: 24px; display: grid; align-content: center; min-height: 107px; }
.stat span, .profile-stats span { color: #534434; font-weight: 800; }
.stat strong { margin: 8px 0 0; font-size: 38px; font-weight: 900; }
.stat p { margin: 6px 0 0; color: var(--primary-dark); }
.section-title {
    display: flex;
    align-items: center;
    margin: 36px 0 16px;
}
.section-title.split { justify-content: space-between; }
.section-title a { color: var(--primary-dark); font-weight: 800; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.quick-card {
    min-height: 110px;
    padding: 20px;
    display: grid;
    place-items: center;
    gap: 10px;
    font-weight: 800;
}
.icon-bubble, .paper-icon, .room-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--primary-dark);
    background: var(--primary-soft);
}
.quick-card.danger .icon-bubble { background: var(--danger); color: #93000a; }
.quick-card.paper .icon-bubble { background: var(--paper); }
.quick-card.blue .icon-bubble { background: var(--blue); color: #3c475a; }
.paper-list { overflow: hidden; }
.paper-item {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 20px;
    border-bottom: 1px solid #eadfd3;
}
.paper-item:last-child { border-bottom: 0; }
.paper-item h3 { margin: 0; font-size: 19px; }
.paper-item p { display: flex; gap: 10px; margin: 10px 0 0; color: #534434; }
.paper-item p span {
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--surface-mid);
    font-size: 14px;
}
.paper-item.locked { opacity: .7; }
.btn {
    border: 0;
    border-radius: 8px;
    padding: 10px 18px;
    background: var(--primary);
    color: #2a1700;
    font-weight: 900;
    cursor: pointer;
}
.btn.soft { background: #fff5df; color: var(--primary-dark); border: 1px solid var(--primary-dark); }
.forum-head, .classbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px;
    margin-bottom: 22px;
}
.round-action {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--primary);
    font-size: 24px;
    font-weight: 900;
}
.composer { padding: 18px; margin-bottom: 24px; }
.composer textarea {
    width: calc(100% - 64px);
    min-height: 84px;
    margin-left: 12px;
    padding: 16px;
    border: 0;
    border-radius: 8px;
    background: var(--surface-low);
    resize: vertical;
    vertical-align: top;
}
.composer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--surface-mid);
}
.composer-actions button:not(.btn) { border: 0; background: transparent; color: var(--primary-dark); font-weight: 800; }
.feed { display: grid; gap: 24px; }
.post { padding: 20px; }
.post-author { display: flex; align-items: center; gap: 12px; }
.post-author span { display: block; color: var(--muted); font-size: 14px; }
.post p { font-size: 17px; line-height: 1.75; }
.post-visual {
    min-height: 230px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.post-visual img {
    width: 100%;
    height: 230px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #d8c3ad;
}
.post-meta { display: flex; align-items: center; gap: 24px; margin-top: 16px; color: var(--primary-dark); font-weight: 800; }
.post-meta span { display: inline-flex; align-items: center; gap: 6px; }
.post-meta em { margin-left: auto; padding: 5px 10px; border-radius: 99px; background: var(--paper); font-style: normal; }
.premium-post { border-color: var(--primary); background: linear-gradient(120deg, #fff, #fff8eb); }
.locked-box {
    min-height: 180px;
    display: grid;
    place-items: center;
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: var(--surface-mid);
    padding: 24px;
}
.locked-box svg { width: 42px; height: 42px; color: #756854; }
.campus-hero {
    min-height: 190px;
    display: flex;
    align-items: center;
    margin-bottom: 28px;
    border-radius: 18px;
    padding: 34px;
    background:
        linear-gradient(90deg, rgba(248,249,255,.96), rgba(248,249,255,.58)),
        url("../img/campus.png") center / cover,
        radial-gradient(circle at 82% 30%, #ffddb8, transparent 26%),
        linear-gradient(135deg, #ede3b8, #d8e3fb);
    border: 1px solid var(--line);
}
.eyebrow {
    display: inline-block;
    margin-bottom: 18px;
    padding: 9px 18px;
    border-radius: 99px;
    background: #ffb95f;
    color: #432500;
    font-weight: 900;
    letter-spacing: .08em;
}
.room-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.room-card {
    min-height: 190px;
    padding: 30px;
    position: relative;
    transition: transform .2s ease, box-shadow .2s ease;
}
.room-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(245,158,11,.14); }
.room-card.hot { box-shadow: 10px 10px 0 var(--primary-soft), var(--shadow); }
.room-card.normal:nth-child(2n) { box-shadow: 10px 10px 0 var(--blue), var(--shadow); }
.online-dot {
    position: absolute;
    top: 30px;
    right: 28px;
    padding: 6px 10px;
    border-radius: 99px;
    background: var(--surface-mid);
    font-weight: 900;
}
.online-dot::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 50%;
    background: #c91f28;
}
.room-card h2 { margin: 42px 0 8px; font: 800 26px/1.2 Georgia, "Noto Serif SC", serif; }
.room-card p { margin: 0; color: #534434; }
.classbar { margin-bottom: 30px; }
.classbar > a:first-child { font-size: 28px; }
.seat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.seat-card {
    min-height: 160px;
    display: grid;
    place-items: center;
    padding: 24px;
    text-align: center;
}
.seat-card.empty { border-style: dashed; background: transparent; }
.seat-card.empty span {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-mid);
    color: #756854;
}
.seat-card.focus .avatar { background: var(--paper); color: #4d4727; }
.seat-card p { margin: 6px 0 0; color: var(--primary-dark); font-weight: 800; }
.music-bar {
    position: fixed;
    left: calc(50% + 128px);
    bottom: 30px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 18px 32px;
}
.music-bar a { color: #ba1a1a; font-weight: 900; }
.profile-card {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 28px;
    background: radial-gradient(circle at 90% 0, rgba(245,158,11,.16), transparent 28%), var(--surface);
}
.profile-card p {
    display: inline-block;
    margin: 12px 0;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 99px;
    color: #4a2b11;
}
.profile-card blockquote { margin: 10px 0 0; color: #667085; font-size: 18px; }
.level {
    margin-left: auto;
    padding: 14px 18px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #ffb95f);
    color: #2a1700;
}
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.profile-stats article { min-height: 132px; padding: 24px; display: grid; align-content: end; }
.profile-stats strong { font-size: 38px; font-weight: 900; }
.profile-stats .rank { background: var(--paper); }
.settings { margin-top: 28px; overflow: hidden; }
.settings a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 28px;
    border-bottom: 1px solid var(--surface-mid);
    font-size: 20px;
}
.settings a:last-child { border-bottom: 0; }
.settings span { margin-left: auto; font-size: 32px; color: #667085; }
.settings em { margin-left: auto; background: #ffe6b9; color: var(--primary-dark); padding: 4px 10px; border-radius: 7px; font-style: normal; font-weight: 900; }
.avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    background: linear-gradient(135deg, #25364a, #f59e0b);
    border: 3px solid #fff;
    box-shadow: var(--shadow);
}
.avatar.small { width: 42px; height: 42px; font-size: 13px; }
.avatar.large { width: 132px; height: 132px; font-size: 34px; }

@media (max-width: 920px) {
    body { padding-bottom: 86px; }
    .sidebar { display: none; }
    .mobile-header {
        position: sticky;
        top: 0;
        height: 72px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 0 18px;
        background: rgba(248,249,255,.94);
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 12px rgba(18,28,40,.08);
        z-index: 20;
    }
    .mobile-header strong { color: var(--primary-dark); font-size: 24px; }
    .mobile-header button {
        width: 42px;
        height: 42px;
        border: 0;
        background: transparent;
        color: #5b3a10;
    }
    .app-shell {
        width: 100%;
        margin: 0;
        padding: 22px 16px 34px;
    }
    .page-head { display: none; }
    .dashboard { grid-template-columns: 1fr 1fr; margin-top: 0; }
    .study-card { grid-column: 1 / -1; min-height: 310px; align-items: center; text-align: center; padding: 28px 18px; }
    .progress-row { flex-direction: column; gap: 18px; }
    .progress-row strong { font-size: 34px; color: var(--primary-dark); }
    .ring { width: 170px; }
    .ring::before { width: 132px; }
    .stat { min-height: 116px; padding: 18px; }
    .stat strong { font-size: 28px; }
    .quick-grid { grid-template-columns: repeat(2, 1fr); }
    .quick-card { min-height: 150px; }
    .paper-item { grid-template-columns: 1fr auto; gap: 12px; }
    .paper-icon { display: none; }
    .paper-item h3 { font-size: 18px; line-height: 1.4; }
    .paper-item p { flex-wrap: wrap; }
    .forum-head, .composer { display: none; }
    .feed { gap: 0; margin: -22px -16px 0; }
    .post {
        border-width: 0 0 1px;
        border-radius: 0;
        box-shadow: none;
        padding: 22px 20px;
    }
    .post-visual { min-height: 130px; grid-template-columns: repeat(3, 1fr); }
    .post-visual img { height: 120px; }
    .campus-hero { margin: 0 -16px 20px; border-radius: 0; min-height: 210px; padding: 24px 18px; }
    .campus-hero h1 { font-size: 26px; }
    .room-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .room-card { min-height: 150px; padding: 16px; }
    .room-card h2 { margin-top: 28px; font-size: 17px; }
    .room-card p { font-size: 12px; }
    .online-dot { position: static; display: inline-block; margin-left: 8px; font-size: 11px; }
    .room-icon { width: 42px; height: 42px; }
    .classbar { padding: 16px; align-items: flex-start; }
    .classbar h1 { font-size: 22px; }
    .classbar .btn { display: none; }
    .seat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .seat-card { min-height: 132px; }
    .music-bar { left: 16px; right: 16px; bottom: 94px; transform: none; justify-content: space-between; padding: 14px 18px; }
    .profile-card { flex-direction: column; text-align: center; gap: 16px; padding: 28px 22px; }
    .profile-card .avatar.large { width: 104px; height: 104px; font-size: 28px; }
    .profile-card blockquote { border-top: 1px solid #eadfd3; padding-top: 18px; }
    .level { margin: 0; }
    .profile-stats { grid-template-columns: 1fr 1fr; }
    .profile-stats .rank { grid-column: 1 / -1; }
    .settings a { padding: 20px; font-size: 18px; }
    .mobile-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 30;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
        padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
        background: rgba(248,249,255,.96);
        border-top: 1px solid #e7d7c5;
        box-shadow: 0 -4px 20px rgba(245,158,11,.12);
        border-radius: 18px 18px 0 0;
    }
    .mobile-nav .nav-link {
        justify-content: center;
        flex-direction: column;
        gap: 4px;
        padding: 8px 4px;
        color: #667085;
        font-size: 13px;
    }
    .mobile-nav .nav-link.active {
        background: var(--primary);
        color: #2a1700;
        border-radius: 99px;
    }
    .mobile-nav svg { width: 24px; height: 24px; }
}

@media (max-width: 430px) {
    .dashboard { gap: 14px; }
    .stat { grid-column: auto; }
    .paper-item { grid-template-columns: 1fr 42px; }
    .paper-item .btn {
        width: 38px;
        height: 38px;
        padding: 0;
        overflow: hidden;
        border-radius: 50%;
    }
    .quick-card { min-height: 134px; }
    .post p { font-size: 16px; }
}
