/* ============================================================
   全局重置 & 基础
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #f1f5f9;
    min-height: 100vh;
    padding: 16px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* 工具类 */
.hidden {
    display: none !important;
}
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   登录面板
   ============================================================ */
.login-card {
    background: #fff;
    padding: 32px 24px;
    max-width: 400px;
    width: 100%;
    margin: 60px auto;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9edf2;
    text-align: center;
    box-sizing: border-box;
    overflow: hidden;
}
.login-card .login-img {
    margin-bottom: 12px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}
.login-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0a0f1c;
    margin-bottom: 20px;
}
.login-card input {
    width: 100%;
    padding: 12px 16px;
    margin: 8px 0;
    border: 1px solid #d1d9e8;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.login-card input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.login-card button {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    width: 100%;
    margin-top: 16px;
    font-size: 1rem;
    transition: background 0.2s, transform 0.1s;
}
.login-card button:active {
    transform: scale(0.97);
}
.login-card .error {
    color: #e03e3e;
    font-size: 0.8rem;
    margin-top: 10px;
}

/* ============================================================
   主面板
   ============================================================ */
.material-panel {
    animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   顶栏
   ============================================================ */
.header {
    background: #fff;
    padding: 10px 18px;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 1px solid #eef2f8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px 14px;
    flex-wrap: wrap;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

/* Logo */
.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.logo-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #eef2ff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.logo-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}
.header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #0b1c3a;
    white-space: nowrap;
}

/* 筛选栏（桌面） */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    flex-wrap: wrap;
}
.filter-bar .search-input {
    background: #fff;
    border: 1px solid #e0e7ef;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.85rem;
    outline: none;
    width: 200px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.filter-bar .search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}
.filter-bar .reset-btn {
    background: transparent;
    border: none;
    color: #5b6e8c;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    transition: background 0.15s, color 0.15s;
}
.filter-bar .reset-btn:active {
    background: #e9edf2;
}

/* 移动端筛选触发按钮 */
.mobile-filter-trigger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
}
.mobile-filter-trigger i {
    color: #2563eb;
    font-size: 1rem;
}
.mobile-filter-trigger.filter-active {
    background: #3b82f6;
    border-color: #3b82f6;
}
.mobile-filter-trigger.filter-active i {
    color: #fff;
}

/* 头像 & 下拉 */
.avatar-container {
    position: relative;
    flex-shrink: 0;
}
.avatar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #e2e8f0;
    background: #eef2ff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s;
}
.avatar-btn:active {
    border-color: #b8c8e0;
}
.avatar-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    color: #2563eb;
}
.avatar-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* 下拉菜单 */
.dropdown-menu {
    position: absolute;
    top: 46px;
    right: 0;
    background: #fff;
    min-width: 220px;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.10);
    border: 1px solid #eff3f8;
    padding: 6px 0;
    z-index: 1000;
}
.dropdown-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #ecf3fa;
}
.dropdown-avatar-wrapper {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #e2e8f0;
    background: #eef2ff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s;
}
.dropdown-avatar-wrapper:active {
    border-color: #3b82f6;
}
.dropdown-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.dropdown-avatar-wrapper .avatar-placeholder {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2563eb;
    text-transform: uppercase;
}
.dropdown-user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 1px;
}
.dropdown-nickname-area {
    display: flex;
    align-items: center;
    gap: 6px;
}
.dropdown-nickname-area #dropdownNickname {
    font-weight: 600;
    font-size: 0.9rem;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.edit-nickname-btn {
    background: transparent;
    border: none;
    color: #8ba0bc;
    cursor: pointer;
    padding: 0 4px;
    font-size: 0.75rem;
    transition: color 0.15s;
}
.edit-nickname-btn:active {
    color: #2563eb;
}
.dropdown-username {
    font-size: 0.7rem;
    color: #8ba0bc;
}
.dropdown-item {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #1f2a44;
    font-weight: 500;
    font-size: 0.85rem;
    transition: background 0.1s;
}
.dropdown-item:active {
    background: #f8fafd;
}
.dropdown-item i {
    width: 18px;
    text-align: center;
}

/* ============================================================
   素材网格 & 卡片
   ============================================================ */
.material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    margin-top: 16px;
    max-width: 100%;
    overflow: hidden;
}
.card {
    background: #fff;
    padding: 16px 16px 18px;
    border-radius: 10px;
    border: 1px solid #eef2f8;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    max-width: 100%;
    overflow: hidden;
    min-width: 0;
}
.card:active {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.06);
    border-color: #dce5f0;
}
.file-icon {
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafcff;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}
.file-icon img,
.file-icon .thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.file-icon i {
    font-size: 3rem;
    color: #5b6e8c;
}
.file-name {
    font-weight: 600;
    font-size: 0.88rem;
    margin: 8px 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #0f172a;
}
.file-meta {
    font-size: 0.7rem;
    color: #5c6f91;
    margin: 6px 0 8px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
}
.file-category {
    display: inline-block;
    background: #eef2ff;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.65rem;
    color: #1e3a8a;
    margin-top: 4px;
}
.card-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eef2f8;
    font-size: 0.75rem;
    color: #5b6e8c;
}
.card-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}
.card-stats i {
    font-size: 0.8rem;
}

/* 空状态 & 加载 */
.empty-state,
.loading {
    grid-column: 1 / -1;
    width: 100%;
    text-align: center;
    padding: 48px 20px;
    background: transparent;
    border:none !important;
    color: #3b82f6;
}
.loading i {
    margin-right: 8px;
}

/* ============================================================
   分页
   ============================================================ */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 28px 0 8px;
    flex-wrap: wrap;
    padding: 0 4px;
}
.pagination-container .page-btn {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    color: #1f2a44;
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    user-select: none;
}
.pagination-container .page-btn:active:not(:disabled) {
    transform: scale(0.94);
}
.pagination-container .page-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    font-weight: 600;
}
.pagination-container .page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.pagination-container .page-btn:not(:disabled):active {
    background: #f1f5f9;
}
.pagination-container .page-ellipsis {
    padding: 0 4px;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* ============================================================
   页脚
   ============================================================ */
footer {
    text-align: center;
    margin-top: 48px;
    color: #8ba0bc;
    font-size: 0.7rem;
    padding-bottom: 16px;
}

/* ============================================================
   自定义下拉（桌面 & 移动复用）—— 网格排列核心样式
   ============================================================ */
.custom-select-wrapper {
    position: relative;
    display: inline-block;
    min-width: 130px;
}
.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #e0e7ef;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s;
    gap: 8px;
}
.custom-select-trigger:active {
    border-color: #b0c4d8;
}
.custom-select-trigger .selected-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.custom-select-trigger i {
    color: #6b7f9c;
    font-size: 0.7rem;
    transition: transform 0.2s;
}
.custom-select-trigger.open i {
    transform: rotate(180deg);
}

/* ---------- 桌面下拉选项（网格） ---------- */
/* 桌面下拉菜单基础样式 */
.custom-select-options {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;                /* 右对齐，不超出屏幕右侧 */
    left: 100px;              /* 取消左对齐 */
    min-width: 100%;         /* 至少与触发按钮同宽 */
    width: max-content;      /* 根据内容自适应宽度 */
    max-width: min(500px, calc(100vw - 24px)); /* 限制最大宽度，避免溢出 */
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e0e7ef;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    z-index: 100;
    display: none;
    padding: 8px;
}

/* 打开状态下的网格布局 */
.custom-select-options.open {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)) !important;
    gap: 6px !important;
    padding: 10px !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    /* 宽度继承上面的设置，无需重复声明 */
}

.custom-select-options .option-item {
    white-space: normal !important;      /* 允许换行 */
    overflow: visible !important;        /* 不隐藏溢出 */
    text-overflow: unset !important;     /* 移除省略号 */
    word-break: break-word !important;   /* 长单词换行 */
    padding: 6px 10px !important;
    line-height: 1.3 !important;
    min-height: 32px;                    /* 保持整齐 */
    display: flex;
    align-items: center;
    justify-content: center;
	border-radius:8px;
	font-size:14px
}

.custom-select-options .option-item:active {
    background: #f1f5f9;
}

.custom-select-options .option-item.selected {
    background: #eef2ff;
    color: #2563eb;
    font-weight: 500;
}

/* ---------- 移动端浮层内的下拉（网格） ---------- */
.modal-select-wrapper {
	position: relative;
    width: 100%;
    margin: 10px 0;
}
.modal-select-wrapper .custom-select-trigger {
    background: #fafcff;
    border-color: #cfddee;
}

.modal-options {
    position: absolute;            /* 关键：脱离文档流 */
    top: 100%;                    /* 紧贴触发按钮下方 */
    left: 0;
    width: 100%;
    max-height: 200px;            /* 限制高度，超出滚动 */
    overflow-y: auto;
    background: #fff;
    border: 1px solid #cfddee;
    border-radius: 8px;
    display: none;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    z-index: 10; 
}

.modal-options.open {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 6px;
}

.modal-options .option-item {
    padding: 6px 8px;
    font-size: 0.85rem;
    text-align: center;
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #f9fafc;
    cursor: pointer;
    transition: background 0.1s;
}

.modal-options .option-item.selected {
    background: #eef2ff;
    color: #2563eb;
    font-weight: 500;
}

/* ============================================================
   预览弹窗
   ============================================================ */
.preview-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.preview-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.preview-modal-box {
    background: #0a0c12;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #2a2e3a;
    background: #0f1117;
    color: #fff;
    flex-shrink: 0;
    min-height: 50px;
}
.preview-header h3 {
    font-size: 0.95rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    color: #eef2ff;
    margin-right: 12px;
}
.preview-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #ccd6f0;
    line-height: 1;
    padding: 0 6px;
    transition: color 0.15s;
}
.preview-close:active {
    color: #fff;
}
.preview-body {
    flex: 1;
    position: relative;
    background: #000;
    min-height: 0;
}
.preview-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.preview-content > * {
    display: block;
    margin: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    flex-shrink: 0;
}
.preview-content img,
.preview-content video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.preview-content audio {
    width: 70%;
    min-width: 200px;
    margin: 0 auto;
}
.preview-content embed {
    width: 90%;
    height: 90%;
    min-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.preview-text {
    background: #1e1f2c;
    color: #eef2ff;
    padding: 20px;
    border-radius: 16px;
    width: 100%;
    max-width: 960px;
    max-height: 90%;
    overflow: auto;
    font-family: 'SF Mono', monospace;
    white-space: pre-wrap;
    font-size: 0.85rem;
}
.preview-loading,
.preview-unsupported {
    background: #11131c;
    padding: 28px;
    border-radius: 24px;
    text-align: center;
    color: #94a3b8;
}
.preview-unsupported i {
    font-size: 44px;
    margin-bottom: 12px;
    color: #5b6e8c;
}
.preview-unsupported h4 {
    font-size: 1.1rem;
    margin: 10px 0;
}
.preview-footer {
    flex-shrink: 0;
    background: rgba(15, 17, 23, 0.95);
    backdrop-filter: blur(8px);
    border-top: 1px solid #2a2e3a;
    padding: 8px 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    min-height: 58px;
}
.preview-footer .action-btn {
    background: transparent;
    border: none;
    color: #b0c4e0;
    font-size: 1.1rem;
    padding: 6px 10px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    width: 44px;
    height: 44px;
}
.preview-footer .action-btn i {
    font-size: 1.3rem;
}
.preview-footer .action-btn:active {
    background: #2a2e3a;
    color: #fff;
}
.preview-footer .action-btn.fav-active {
    color: #ef4444;
}
.preview-footer .action-btn.fav-active i {
    color: #ef4444;
}

/* ============================================================
   评论面板（全屏覆盖）
   ============================================================ */
.preview-comments-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    flex-direction: column;
    background: #0d0f15;
    color: #eef2ff;
    overflow: hidden;
    z-index: 10;
}
.preview-comments-panel.active {
    display: flex;
}
.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px 10px;
    border-bottom: 1px solid #282d3a;
    flex-shrink: 0;
    background: #0d0f15;
    z-index: 2;
}
.comments-header > span {
    font-size: 0.95rem;
    font-weight: 600;
    color: #eef2ff;
    display: flex;
    align-items: center;
    gap: 6px;
}
.comments-header > span .comment-count {
    background: #282d3a;
    color: #94a3b8;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 1px 10px;
    border-radius: 20px;
}
.back-btn {
    background: transparent;
    border: none;
    color: #8ba0bc;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s, color 0.2s;
    font-weight: 500;
}
.back-btn i {
    font-size: 0.75rem;
}
.back-btn:active {
    background: rgba(255, 255, 255, 0.06);
    color: #eef2ff;
}
.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px 18px 10px;
    min-height: 0;
}
.comments-list::-webkit-scrollbar {
    width: 4px;
}
.comments-list::-webkit-scrollbar-track {
    background: transparent;
}
.comments-list::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
}
.no-comments {
    text-align: center;
    color: #6b7f9c;
    padding: 40px 0;
    font-size: 0.9rem;
}
.no-comments i {
    font-size: 2.2rem;
    color: #3b82f6;
    opacity: 0.4;
    display: block;
    margin-bottom: 10px;
}
.comment-item {
    background: #171b24;
    border-radius: 10px;
    padding: 12px 14px 12px 16px;
    margin-bottom: 8px;
    border: 1px solid #282d3a;
    transition: border-color 0.2s, background 0.2s;
}
.comment-item:active {
    border-color: #3a4050;
    background: #1c212c;
}
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    gap: 10px;
}
.comment-user {
    font-weight: 600;
    color: #eef2ff;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.comment-user .user-badge {
    background: #2563eb;
    color: #fff;
    font-size: 0.5rem;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 12px;
    letter-spacing: 0.3px;
}
.comment-time {
    color: #6b7f9c;
    font-size: 0.65rem;
    flex-shrink: 0;
}
.comment-content {
    font-size: 0.85rem;
    color: #d1d9e8;
    word-break: break-word;
    line-height: 1.5;
    padding-right: 4px;
}
.delete-comment-btn {
    background: rgba(239, 68, 68, 0.10);
    color: #ef4444;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-size: 0.7rem;
    flex-shrink: 0;
    padding: 0;
}
.delete-comment-btn:active {
    background: rgba(239, 68, 68, 0.22);
    transform: scale(0.92);
}
.comment-input-area {
    flex-shrink: 0;
    padding: 10px 18px 14px;
    background: #0d0f15;
    border-top: 1px solid #282d3a;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.comment-input-area textarea {
    flex: 1;
    background: #171b24;
    border: 1px solid #282d3a;
    border-radius: 10px;
    padding: 10px 14px;
    color: #eef2ff;
    font-size: 0.85rem;
    resize: none;
    outline: none;
    min-height: 38px;
    max-height: 110px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    line-height: 1.5;
}
.comment-input-area textarea::placeholder {
    color: #5a6f8c;
}
.comment-input-area textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.10);
}
.submit-comment-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 0 20px;
    height: 42px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: inherit;
}
.submit-comment-btn:active {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.submit-comment-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================================
   收藏全屏弹窗
   ============================================================ */
.favorites-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.favorites-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.favorites-modal-box {
    background: #0f1117;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #fff;
}
.favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #2a2e3a;
    background: #0f1117;
    flex-shrink: 0;
    min-height: 50px;
}
.favorites-header h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #eef2ff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.favorites-header h3 i {
    color: #ef4444;
}
.favorites-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #ccd6f0;
    line-height: 1;
    padding: 0 6px;
    transition: color 0.15s;
}
.favorites-close:active {
    color: #fff;
}
.favorites-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #0a0c12;
}
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}
.favorite-item {
    background: #1a1d24;
    border-radius: 8px;
    padding: 14px;
    border: 1px solid #2a2e3a;
    transition: border-color 0.2s, transform 0.15s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
}
.favorite-item:active {
    border-color: #3b82f6;
    transform: translateY(-2px);
}
.favorite-item .file-icon-small {
    height: 90px;
    background: #11131c;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    overflow: hidden;
}
.favorite-item .file-icon-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.favorite-item .file-icon-small i {
    font-size: 2.2rem;
    color: #5b6e8c;
}
.favorite-item .fav-name {
    font-weight: 500;
    font-size: 0.85rem;
    margin: 4px 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.favorite-item .fav-meta {
    font-size: 0.65rem;
    color: #8ba0bc;
    display: flex;
    justify-content: space-between;
}
.favorite-item .remove-fav-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #ef4444;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.favorite-item .remove-fav-btn:active {
    background: #ef4444;
    color: #fff;
    transform: scale(0.92);
}

/* ============================================================
   移动端筛选浮层
   ============================================================ */
.filter-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.40);
    align-items: flex-start;
    justify-content: center;
    z-index: 2000;
}
.filter-modal.active {
    display: flex;
}
.modal-content {
    background: #fff;
    width: 100%;
    border-radius: 0 0 16px 16px;
    padding: 20px 22px 24px;
    animation: slideDown 0.28s ease;
}
@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-content h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #eef2f8;
    padding-bottom: 10px;
}
.modal-close {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
}
.modal-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cfddee;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.modal-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}
.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}
.modal-buttons button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.15s, transform 0.1s;
}
.modal-buttons button:active {
    transform: scale(0.97);
}
.btn-reset-modal {
    background: #f1f5f9;
    color: #2c3e66;
}
.btn-reset-modal:active {
    background: #e5eaf0;
}
.btn-apply-modal {
    background: #2563eb;
    color: #fff;
}
.btn-apply-modal:active {
    background: #1d4ed8;
}

/* ============================================================
   模态框（修改密码 / 修改昵称）
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}
.modal-overlay .modal-card {
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px;
    width: 400px;
    max-width: 92%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #eef2f8;
}
.modal-overlay .modal-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 18px;
}
.modal-overlay .modal-card .form-group {
    margin-bottom: 14px;
}
.modal-overlay .modal-card .form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #334155;
    margin-bottom: 4px;
}
.modal-overlay .modal-card .form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d9e8;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.modal-overlay .modal-card .form-group input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}
.modal-overlay .modal-card .error-text {
    color: #ef4444;
    font-size: 0.75rem;
    margin: 6px 0 0;
}
.modal-overlay .modal-card button {
    padding: 0 20px;
    height: 38px;
    border-radius: 8px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.modal-overlay .modal-card button:active {
    transform: scale(0.97);
}
.modal-overlay .modal-card button.outline {
    background: transparent;
    border: 1px solid #d1d9e8;
    color: #334155;
}
.modal-overlay .modal-card button.outline:active {
    background: #f1f5f9;
}
.modal-overlay .modal-card button.save-btn,
.modal-overlay .modal-card #confirmChangePwdBtn {
    background: #2563eb;
    color: #fff;
}
.modal-overlay .modal-card button.save-btn:active,
.modal-overlay .modal-card #confirmChangePwdBtn:active {
    background: #1d4ed8;
}

/* ============================================================
   头像裁剪弹窗
   ============================================================ */
.crop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.crop-modal.active {
    opacity: 1;
    visibility: visible;
}
.crop-modal-content {
    background: #1a1e26;
    border-radius: 16px;
    max-width: 90vw;
    max-height: 90vh;
    padding: 18px;
    position: relative;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.crop-image-container {
    max-width: 100%;
    max-height: 65vh;
    overflow: hidden;
    border-radius: 8px;
    background: #0a0c12;
}
.crop-image-container img {
    display: block;
    max-width: 100%;
    max-height: 65vh;
    width: auto;
    height: auto;
}
.crop-close {
    position: absolute;
    top: 6px;
    right: 14px;
    font-size: 1.8rem;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    background: none;
    border: none;
}
.crop-close:active {
    color: #fff;
}
.crop-actions {
    display: flex;
    gap: 14px;
    margin-top: 16px;
    width: 100%;
    justify-content: center;
}
.crop-actions button {
    padding: 10px 28px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.crop-actions button:active {
    transform: scale(0.96);
}
.crop-actions button:first-child {
    background: #2563eb;
    color: #fff;
}
.crop-actions button:first-child:active {
    background: #1d4ed8;
}
.crop-actions button:last-child {
    background: #2a2e3a;
    color: #94a3b8;
}
.crop-actions button:last-child:active {
    background: #3a4050;
    color: #fff;
}

/* ============================================================
   移动端布局（≤768px）—— 舒适阅读与操作
   ============================================================ */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }
    .header {
        padding: 10px 16px;
        gap: 8px 12px;
        border-radius: 10px;
        margin-bottom: 16px;
    }
    .header-left {
        gap: 10px;
    }
    .header-right {
        gap: 8px;
        margin-left: 0;
    }
    .logo-area h4 {
        display: none;
    }
    .logo-img {
        width: 36px;
        height: 36px;
    }
    .filter-bar {
        display: none !important;
    }
    .mobile-filter-trigger {
        display: flex;
        width: 40px;
        height: 40px;
    }
    .mobile-filter-trigger i {
        font-size: 1.1rem;
    }
    .avatar-btn {
        width: 40px;
        height: 40px;
    }

    /* 素材网格：2列 */
    .material-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .card {
        padding: 14px 14px 16px;
        border-radius: 10px;
    }
    .file-icon {
        height: 130px;
        border-radius: 8px;
        margin-bottom: 10px;
    }
    .file-name {
        font-size: 0.88rem;
        margin: 6px 0 4px;
    }
    .file-meta {
        font-size: 0.7rem;
        flex-wrap: wrap;
        gap: 4px;
        margin: 4px 0 6px;
    }
    .file-category {
        font-size: 0.65rem;
        padding: 3px 12px;
    }
    .card-stats {
        font-size: 0.75rem;
        padding-top: 10px;
        margin-top: 10px;
    }
    .card-stats i {
        font-size: 0.8rem;
    }

    /* 收藏网格 */
    .favorites-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .favorite-item .file-icon-small {
        height: 100px;
    }
    .favorite-item {
        padding: 14px;
    }
    .favorite-item .fav-name {
        font-size: 0.85rem;
    }

    /* 预览弹窗 */
    .preview-header {
        padding: 10px 18px;
        min-height: 48px;
    }
    .preview-header h3 {
        font-size: 0.9rem;
    }
    .preview-content {
        padding: 12px;
    }
    .preview-content embed {
        width: 95%;
        height: 80%;
        min-height: 320px;
    }
    .preview-footer {
        padding: 8px 14px;
        min-height: 56px;
        gap: 8px;
    }
    .preview-footer .action-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    .preview-footer .action-btn i {
        font-size: 1.3rem;
    }

    /* 评论面板 */
    .comments-header {
        padding: 12px 16px 10px;
    }
    .comments-header > span {
        font-size: 0.9rem;
    }
    .comments-list {
        padding: 12px 16px 10px;
    }
    .comment-item {
        padding: 12px 14px;
        border-radius: 10px;
    }
    .comment-user {
        font-size: 0.82rem;
    }
    .comment-content {
        font-size: 0.85rem;
    }
    .comment-input-area {
        padding: 10px 16px 14px;
        gap: 10px;
    }
    .comment-input-area textarea {
        font-size: 0.85rem;
        padding: 10px 14px;
        min-height: 38px;
    }
    .submit-comment-btn {
        padding: 0 18px;
        height: 42px;
        font-size: 0.85rem;
    }
    .delete-comment-btn {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }

    /* 分页 */
    .pagination-container {
        gap: 6px;
        padding: 0 6px;
        margin: 24px 0 8px;
    }
    .pagination-container .page-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
        min-width: 38px;
        min-height: 38px;
        border-radius: 6px;
    }
    .pagination-container .page-ellipsis {
        font-size: 0.85rem;
    }

    /* 下拉菜单 */
    .dropdown-menu {
        min-width: 200px;
        right: -2px;
    }
    .dropdown-info {
        padding: 10px 16px;
        gap: 12px;
    }
    .dropdown-avatar-wrapper {
        width: 38px;
        height: 38px;
    }
    .dropdown-nickname-area #dropdownNickname {
        font-size: 0.9rem;
    }
    .dropdown-item {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    /* 裁剪弹窗 */
    .crop-modal-content {
        padding: 16px;
        max-width: 92vw;
    }
    .crop-image-container {
        max-height: 60vh;
    }
    .crop-image-container img {
        max-height: 60vh;
    }
    .crop-actions button {
        padding: 10px 24px;
        font-size: 0.9rem;
    }
    .crop-close {
        font-size: 1.8rem;
        top: 6px;
        right: 12px;
    }

    /* 筛选浮层 */
    .modal-content {
        padding: 20px 22px 24px;
    }
    .modal-content h3 {
        font-size: 1.1rem;
        padding-bottom: 10px;
        margin-bottom: 14px;
    }
    .modal-input {
        padding: 12px 14px;
        font-size: 0.95rem;
        margin: 10px 0;
    }
    .modal-buttons button {
        padding: 12px;
        font-size: 0.9rem;
    }
    .custom-select-wrapper {
        min-width: 280px !important;
    }
    .custom-select-trigger {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    /* 移动端下拉网格微调 */
    .custom-select-options.open {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 4px;
        padding: 6px;
		z-index:1000;
    }
    .custom-select-options .option-item {
        padding: 6px 6px;
        font-size: 0.8rem;
    }
    .modal-options.open {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 4px;
        padding: 6px;
    }
    .modal-options .option-item {
        padding: 6px 6px;
        font-size: 0.8rem;
    }

    /* 修改密码/昵称模态框 */
    .modal-overlay .modal-card {
        padding: 26px 22px;
        width: 92%;
    }
    .modal-overlay .modal-card h3 {
        font-size: 1.1rem;
        margin-bottom: 16px;
    }
    .modal-overlay .modal-card .form-group {
        margin-bottom: 14px;
    }
    .modal-overlay .modal-card .form-group input {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
    .modal-overlay .modal-card button {
        height: 40px;
        font-size: 0.85rem;
        padding: 0 18px;
    }

    /* 登录面板 */
    .login-card {
        padding: 28px 20px;
        margin: 40px auto;
    }
    .login-card h2 {
        font-size: 1.4rem;
    }
    .login-card input {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
    .login-card button {
        padding: 12px;
        font-size: 0.95rem;
        margin-top: 14px;
    }
    footer {
        margin-top: 36px;
        font-size: 0.65rem;
        padding-bottom: 12px;
    }
}