/* ==========================================================================
   校园墙 · 主题样式 (School Wall Theme)
   视觉 1:1 还原，逻辑完全保留
   ========================================================================== */

:root {
    --sw-bg: #0d1117;
    --sw-bg-2: #12161f;
    --sw-card: #1a1f2b;
    --sw-card-2: #1e2432;
    --sw-border: rgba(255, 255, 255, 0.07);
    --sw-text: #e8ecf3;
    --sw-text-2: #9aa4b2;
    --sw-text-3: #6b7684;
    --sw-primary: #4d8bff;
    --sw-pink: #ff4d8d;
    --sw-green: #2ec27e;
    --sw-purple: #8b7bff;
    --sw-radius: 16px;
    --sw-radius-sm: 10px;
}

/* 覆盖 MDUI 主题底色，改为暗色校园墙 */
body {
    background: var(--sw-bg) !important;
    color: var(--sw-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    padding-bottom: 40px;
}

/* 隐藏原 MDUI 顶栏与 tab，改用新的校墙导航 */
body > .mdui-appbar {
    display: none !important;
}

/* 隐藏原悬浮按钮（保留逻辑挂钩） */
.mdui-fab-wrapper {
    display: none !important;
}

/* 让容器更宽 */
#jsParameter.mdui-container {
    max-width: 1080px;
    padding-left: 16px;
    padding-right: 16px;
    margin: 0 auto;
}

/* ==========================================================================
   顶部导航
   ========================================================================== */
.sw-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 17, 23, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--sw-border);
}

.sw-nav-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 16px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.sw-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 700;
    color: var(--sw-text);
    text-decoration: none;
    flex-shrink: 0;
    cursor: pointer;
}

.sw-logo-badge {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4d8bff, #6ea8ff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 17px;
    box-shadow: 0 4px 12px rgba(77, 139, 255, 0.35);
}

.sw-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--sw-card);
    border: 1px solid var(--sw-border);
    border-radius: 999px;
    padding: 0 16px;
    height: 40px;
    max-width: 520px;
}

.sw-search i {
    color: var(--sw-text-3);
    font-size: 18px;
}

.sw-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--sw-text);
    font-size: 14px;
    height: 100%;
}

.sw-search input::placeholder {
    color: var(--sw-text-3);
}

.sw-nav-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 18px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

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

.sw-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sw-btn-primary {
    background: linear-gradient(135deg, #4d8bff, #6ea8ff);
    color: #fff;
    box-shadow: 0 4px 14px rgba(77, 139, 255, 0.35);
}

.sw-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(77, 139, 255, 0.45);
}

/* 头像按钮 */
.sw-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

.sw-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ==========================================================================
   Banner 区
   ========================================================================== */
.sw-banner {
    position: relative;
    margin-top: 16px;
    border-radius: 20px;
    overflow: hidden;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 28px;
    background-color: #16233b;
    background-image:
        linear-gradient(180deg, rgba(13, 17, 23, 0.10) 0%, rgba(13, 17, 23, 0.80) 100%),
        url("./banner.jpg");
    background-size: cover;
    background-position: center;
    border: 1px solid var(--sw-border);
}

.sw-banner-clock {
    position: absolute;
    top: 22px;
    right: 26px;
    text-align: right;
    color: #fff;
}

.sw-banner-clock .t {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.sw-banner-clock .d {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 5px;
}

.sw-banner-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.sw-banner-tag {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 3px 10px;
    border-radius: 999px;
    backdrop-filter: blur(6px);
}

.sw-banner-title {
    font-size: 40px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px;
    letter-spacing: 2px;
    text-shadow: 0 3px 16px rgba(0, 0, 0, 0.5);
}

.sw-banner-sub {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    margin: 0 0 18px;
}

.sw-banner-post {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(77, 139, 255, 0.9);
    color: #fff;
    border: none;
    height: 42px;
    padding: 0 22px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(77, 139, 255, 0.4);
    backdrop-filter: blur(6px);
    transition: all 0.2s;
}

.sw-banner-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(77, 139, 255, 0.55);
}

/* ==========================================================================
   分类卡片 (2x2)
   ========================================================================== */
.sw-cats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 18px;
}

.sw-cat {
    position: relative;
    border-radius: var(--sw-radius);
    padding: 22px;
    min-height: 118px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.25s, box-shadow 0.25s;
}

.sw-cat:hover {
    transform: translateY(-3px);
}

.sw-cat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 14px;
    backdrop-filter: blur(4px);
}

.sw-cat-name {
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.sw-cat-desc {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.8);
}

.sw-cat-arrow {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    transition: transform 0.25s;
}

.sw-cat:hover .sw-cat-arrow {
    transform: translateX(3px);
}

.sw-cat-pink {
    background: linear-gradient(135deg, #ff4d8d 0%, #ff7ba9 100%);
    box-shadow: 0 8px 24px rgba(255, 77, 141, 0.28);
}

/* 动态分类配色（按顺序循环：粉/蓝/绿/紫） */
.sw-cat-color0 {
    background: linear-gradient(135deg, #ff4d8d 0%, #ff7ba9 100%);
    box-shadow: 0 8px 24px rgba(255, 77, 141, 0.28);
}
.sw-cat-color1 {
    background: linear-gradient(135deg, #4d8bff 0%, #6ea8ff 100%);
    box-shadow: 0 8px 24px rgba(77, 139, 255, 0.28);
}
.sw-cat-color2 {
    background: linear-gradient(135deg, #2ec27e 0%, #4dd39a 100%);
    box-shadow: 0 8px 24px rgba(46, 194, 126, 0.28);
}
.sw-cat-color3 {
    background: linear-gradient(135deg, #8b7bff 0%, #a89bff 100%);
    box-shadow: 0 8px 24px rgba(139, 123, 255, 0.28);
}
.sw-cat-color4 {
    background: linear-gradient(135deg, #ff9f43 0%, #ffb86b 100%);
    box-shadow: 0 8px 24px rgba(255, 159, 67, 0.28);
}
.sw-cat-color5 {
    background: linear-gradient(135deg, #00b8d4 0%, #4dd0e1 100%);
    box-shadow: 0 8px 24px rgba(0, 184, 212, 0.28);
}

.sw-cat-blue {
    background: linear-gradient(135deg, #4d8bff 0%, #6ea8ff 100%);
    box-shadow: 0 8px 24px rgba(77, 139, 255, 0.28);
}

.sw-cat-green {
    background: linear-gradient(135deg, #2ec27e 0%, #4dd39a 100%);
    box-shadow: 0 8px 24px rgba(46, 194, 126, 0.28);
}

.sw-cat-purple {
    background: linear-gradient(135deg, #8b7bff 0%, #a89bff 100%);
    box-shadow: 0 8px 24px rgba(139, 123, 255, 0.28);
}

/* ==========================================================================
   学校卡片区
   ========================================================================== */
.sw-schools {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.sw-school {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 10px;
    background: var(--sw-card);
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.22s;
}

.sw-school:hover {
    border-color: rgba(77, 139, 255, 0.45);
    background: var(--sw-card-2);
    transform: translateY(-2px);
}

.sw-school-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(77, 139, 255, 0.14);
    color: var(--sw-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sw-school-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--sw-text);
    white-space: nowrap;
}

/* 资源分享：绿色强调 */
.sw-school-res .sw-school-icon {
    background: rgba(46, 194, 126, 0.15);
    color: var(--sw-green);
}

.sw-school-res:hover {
    border-color: rgba(46, 194, 126, 0.45);
}

/* ==========================================================================
   筛选标签栏
   ========================================================================== */
.sw-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.sw-filter-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--sw-card);
    border: 1px solid var(--sw-border);
    color: var(--sw-text-2);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.sw-filter-item:hover {
    border-color: rgba(77, 139, 255, 0.4);
    color: var(--sw-text);
}

.sw-filter-item.active {
    background: linear-gradient(135deg, #4d8bff, #6ea8ff);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(77, 139, 255, 0.35);
}

/* 兼容原 tab 高亮（原 JS 会给 #jsTabXClass 加 mdui-tab-active） */
#jsTab1Class.mdui-tab-active,
#jsTab2Class.mdui-tab-active,
#jsTab3Class.mdui-tab-active {
    color: #fff;
}

/* ==========================================================================
   发帖框
   ========================================================================== */
.sw-postbox {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    background: var(--sw-card);
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius);
    padding: 14px 16px;
}

.sw-postbox-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--sw-card-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    overflow: hidden;
}

.sw-postbox-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sw-postbox-input {
    flex: 1;
    color: var(--sw-text-3);
    font-size: 14px;
    cursor: pointer;
    padding: 10px 0;
}

.sw-postbox-btn {
    flex-shrink: 0;
    height: 38px;
    padding: 0 24px;
    border-radius: 999px;
    background: var(--sw-card-2);
    border: 1px solid var(--sw-border);
    color: var(--sw-text-2);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.sw-postbox-btn:hover {
    background: linear-gradient(135deg, #4d8bff, #6ea8ff);
    border-color: transparent;
    color: #fff;
}

/* ==========================================================================
   排序 + 统计
   ========================================================================== */
.sw-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.sw-sort {
    display: flex;
    gap: 8px;
}

.sw-sort-item {
    height: 34px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--sw-card);
    border: 1px solid var(--sw-border);
    color: var(--sw-text-2);
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s;
}

.sw-sort-item.active {
    background: linear-gradient(135deg, #4d8bff, #6ea8ff);
    border-color: transparent;
    color: #fff;
}

.sw-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.sw-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--sw-text-2);
}

.sw-stat b {
    color: var(--sw-text);
    font-weight: 700;
}

.sw-stat i {
    font-size: 15px;
    color: var(--sw-text-3);
}

/* ==========================================================================
   卡片列表（覆盖原 mdui-card 视觉）
   同时作用于首页(.sw-list)与列表/搜索页(#jsParameter 内)
   ========================================================================== */
.sw-list {
    margin-top: 18px;
}

.sw-list .mdui-col,
#jsParameter .mdui-col {
    margin-bottom: 16px;
}

.sw-list .mdui-card,
#jsParameter .mdui-card {
    background: var(--sw-card) !important;
    border: 1px solid var(--sw-border) !important;
    border-radius: var(--sw-radius) !important;
    color: var(--sw-text) !important;
    box-shadow: none !important;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
}

.sw-list .mdui-card:hover,
#jsParameter .mdui-card:hover {
    border-color: rgba(77, 139, 255, 0.35) !important;
    transform: translateY(-2px);
}

.sw-list .css-caard-header-title,
#jsParameter .css-caard-header-title {
    color: var(--sw-primary) !important;
    font-size: 15px;
    font-weight: 700;
}

.sw-list .css-caard-header-subtite,
#jsParameter .css-caard-header-subtite {
    color: var(--sw-text-3);
    font-size: 12.5px;
}

.sw-list .css-caard-header-subtite-liulan,
#jsParameter .css-caard-header-subtite-liulan {
    color: var(--sw-text-3);
    float: right;
}

.sw-list .css-cards-primary-content,
#jsParameter .css-cards-primary-content {
    color: var(--sw-text);
    font-size: 14px;
    line-height: 1.65;
}

.sw-list .css-cards-img img,
#jsParameter .css-cards-img img {
    border-radius: var(--sw-radius-sm);
    width: 100%;
    display: block;
}

.sw-list .mdui-card-actions,
#jsParameter .mdui-card-actions {
    border-top: 1px solid var(--sw-border);
    padding: 6px 8px;
}

.sw-list .mdui-card-actions .mdui-btn,
#jsParameter .mdui-card-actions .mdui-btn {
    color: var(--sw-text-2) !important;
    font-size: 13px;
    text-transform: none;
}

.sw-list .mdui-card-actions .mdui-btn i,
#jsParameter .mdui-card-actions .mdui-btn i {
    font-size: 16px;
    vertical-align: -2px;
    margin-right: 3px;
}

.sw-list .css-card-actions-good-1,
#jsParameter .css-card-actions-good-1 {
    color: var(--sw-pink) !important;
}

/* Tag 标签样式 */
.sw-list .css-cards-primary-subtitle a,
.sw-list .css-cards-primary-subtitle,
#jsParameter .css-cards-primary-subtitle a,
#jsParameter .css-cards-primary-subtitle {
    color: var(--sw-primary);
    font-size: 12.5px;
    text-decoration: none;
}

/* ==========================================================================
   空状态
   ========================================================================== */
.sw-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--sw-text-3);
}

.sw-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px dashed var(--sw-border);
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: var(--sw-text-3);
}

.sw-empty-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--sw-text-2);
    margin-bottom: 6px;
}

.sw-empty-desc {
    font-size: 13px;
    color: var(--sw-text-3);
}

/* ==========================================================================
   弹窗美化（登录/注册）
   ========================================================================== */
.mdui-dialog {
    background: var(--sw-card) !important;
    border-radius: var(--sw-radius) !important;
    color: var(--sw-text);
}

.mdui-dialog-title {
    color: var(--sw-text) !important;
}

.mdui-textfield-input {
    color: var(--sw-text) !important;
    border-bottom-color: rgba(255, 255, 255, 0.2) !important;
}

.mdui-textfield-label {
    color: var(--sw-text-3) !important;
}

/* ==========================================================================
   SVG 图标通用
   ========================================================================== */
.sw-nav svg,
.sw-banner svg,
.sw-cats svg,
.sw-filter svg,
.sw-postbox svg,
.sw-toolbar svg {
    display: block;
}

.sw-filter-item {
    line-height: 1;
}

.sw-filter-item svg {
    flex-shrink: 0;
}

/* 卡片内 SVG 图标对齐 */
#jsParameter .css-caard-header-title svg,
.sw-list .css-caard-header-title svg {
    vertical-align: -2px;
}

#jsParameter .mdui-card-actions .mdui-btn svg,
.sw-list .mdui-card-actions .mdui-btn svg {
    vertical-align: -3px;
    margin-right: 4px;
    display: inline-block;
}

#jsParameter .sw-ic-share svg,
.sw-list .sw-ic-share svg {
    vertical-align: -2px;
    color: var(--sw-primary);
    cursor: pointer;
}

#jsParameter .sw-ic-top svg,
.sw-list .sw-ic-top svg,
#jsParameter .sw-ic-face svg,
.sw-list .sw-ic-face svg {
    vertical-align: -2px;
    color: var(--sw-text-3);
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 720px) {
    .sw-nav-inner {
        height: 56px;
        gap: 10px;
    }
    .sw-logo span:not(.sw-logo-badge) {
        display: none;
    }
    .sw-search {
        height: 38px;
        padding: 0 12px;
    }
    .sw-btn {
        height: 34px;
        padding: 0 14px;
        font-size: 13px;
    }
    .sw-banner {
        min-height: 200px;
        padding: 20px;
    }
    .sw-banner-title {
        font-size: 30px;
    }
    .sw-banner-clock .t {
        font-size: 22px;
    }
    .sw-cats {
        gap: 12px;
    }
    .sw-cat {
        padding: 16px;
        min-height: 104px;
    }
    .sw-cat-name {
        font-size: 17px;
    }
    .sw-cat-icon {
        width: 36px;
        height: 36px;
        font-size: 19px;
        margin-bottom: 10px;
    }
    .sw-stats {
        gap: 12px;
    }
    .sw-stat {
        font-size: 12px;
    }
    .sw-schools {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    .sw-school {
        padding: 14px 8px;
    }
    .sw-school-name {
        font-size: 13px;
    }
}

@media (max-width: 420px) {
    .sw-nav-actions .sw-btn-label {
        display: none;
    }
    .sw-schools {
        grid-template-columns: repeat(2, 1fr);
    }
}
