/* ===== 全局重置 & 基础样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', Roboto, 'Helvetica Neue', sans-serif;
    min-height: 100vh;
    background: linear-gradient(145deg, #0b0e1a 0%, #1a1040 40%, #2d1b69 100%);
    color: #fff;
    user-select: none;
    overflow-x: hidden;
}

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    position: relative;
    padding: 70px 16px 20px;
    transition: opacity 0.3s ease;
}

/* ===== 页面切换 ===== */
.page-view {
    display: none;
    flex-direction: column;
    width: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.page-view.active {
    display: flex;
    opacity: 1;
}
.page-view.hidden {
    display: none;
    opacity: 0;
}

/* ===== 顶部栏 ===== */
.auth-bar {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    padding: 4px 10px 4px 14px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    flex-wrap: wrap;
}
.auth-bar:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.20);
}
.auth-bar .user-greeting {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.3px;
    margin-right: 2px;
    white-space: nowrap;
}
.auth-bar .user-greeting span {
    color: #f0c27f;
    font-weight: 600;
}

.btn {
    padding: 4px 12px;
    border: none;
    border-radius: 30px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.3px;
    outline: none;
    white-space: nowrap;
}
.btn-login {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-login:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: scale(1.04);
}
.btn-register {
    background: linear-gradient(135deg, #f6b868, #f5a342);
    color: #1a1040;
    box-shadow: 0 4px 16px rgba(245, 163, 66, 0.35);
}
.btn-register:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 24px rgba(245, 163, 66, 0.50);
}
.btn-logout {
    background: rgba(255, 70, 70, 0.20);
    color: #ff8a8a;
    border: 1px solid rgba(255, 70, 70, 0.25);
    padding: 4px 12px;
    font-size: 10px;
}
.btn-logout:hover {
    background: rgba(255, 70, 70, 0.35);
    transform: scale(1.04);
}
.btn-auth-hidden {
    display: none !important;
}

.admin-btn {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 40px;
    padding: 5px 14px;
    color: #f5c27b;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.admin-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.04);
}

.back-home-btn {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 40px;
    padding: 5px 16px;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s;
    display: none;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.back-home-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-50%) scale(1.04);
}
.back-home-btn.show {
    display: flex;
}

/* ===== 主页卡片 ===== */
.row {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}
.row-header {
    flex: 0 0 auto;
    flex-direction: column;
    text-align: center;
    padding: 10px 0 8px;
}
.row-header h1 {
    font-size: clamp(1.8rem, 8vw, 3.6rem);
    font-weight: 800;
    background: linear-gradient(135deg, #f9e3b6 0%, #f5c27b 40%, #f0a85a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 60px rgba(245, 194, 123, 0.15);
    letter-spacing: 2px;
    line-height: 1.2;
    padding: 0 10px;
    animation: titleGlow 4s ease-in-out infinite alternate;
}
@keyframes titleGlow {
    0% { text-shadow: 0 0 40px rgba(245, 194, 123, 0.10); }
    100% { text-shadow: 0 0 80px rgba(245, 194, 123, 0.30); }
}
.row-header .subtitle {
    margin-top: 4px;
    font-size: clamp(0.7rem, 2vw, 1rem);
    color: rgba(255, 255, 255, 0.40);
    letter-spacing: 4px;
    font-weight: 300;
}
.row-cards {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
}
.card {
    flex: 1 1 calc(50% - 12px);
    max-width: 200px;
    min-width: 100px;
    min-height: 100px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.30);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: default;
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.03) 0%, transparent 60%);
    pointer-events: none;
}
.card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    background: rgba(255, 255, 255, 0.08);
}
.card .icon {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    margin-bottom: 6px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.20));
}
.card .name {
    font-size: clamp(0.85rem, 2vw, 1.3rem);
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    text-align: center;
}
.card .desc {
    font-size: clamp(0.55rem, 1.2vw, 0.75rem);
    color: rgba(255, 255, 255, 0.50);
    text-align: center;
    font-weight: 300;
    letter-spacing: 0.3px;
    max-width: 90%;
}
.card .badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 8px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 10px;
    border-radius: 40px;
    letter-spacing: 0.3px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.card-about .icon { color: #7eb8f0; }
.card-create .icon { color: #f5c27b; }
.card-learn .icon { color: #8fdfb0; }
.card-community .icon { color: #a78bfa; }
.card-undefined .icon { color: rgba(255, 255, 255, 0.20); }
.card-undefined .name { color: rgba(255, 255, 255, 0.30); }
.card-undefined .desc { color: rgba(255, 255, 255, 0.15); }
.card-undefined .badge { color: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.04); }
.card-clickable { cursor: pointer; }

/* ===== 创作页 ===== */
#createView {
    padding: 60px 12px 20px;
    overflow-y: auto;
    align-items: center;
}
#createView .create-header {
    width: 100%;
    text-align: center;
    margin-bottom: 24px;
}
#createView .create-header h2 {
    font-size: clamp(1.5rem, 4vw, 2.4rem);
    font-weight: 700;
    background: linear-gradient(135deg, #f9e3b6, #f5c27b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}
#createView .create-header p {
    color: rgba(255, 255, 255, 0.40);
    font-size: clamp(0.8rem, 1.5vw, 1rem);
    margin-top: 4px;
}
.create-upload-area {
    background: rgba(255, 255, 255, 0.04);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 28px;
    padding: 28px 20px;
    width: 100%;
    max-width: 500px;
    text-align: center;
    transition: 0.3s;
    margin-bottom: 24px;
}
.create-upload-area:hover {
    border-color: rgba(245, 194, 123, 0.40);
    background: rgba(255, 255, 255, 0.06);
}
.create-upload-area .upload-btn {
    background: linear-gradient(135deg, #f6b868, #f5a342);
    color: #1a1040;
    border: none;
    padding: 12px 32px;
    border-radius: 40px;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(245, 163, 66, 0.30);
    transition: 0.25s;
    letter-spacing: 0.3px;
}
.create-upload-area .upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(245, 163, 66, 0.45);
}
.create-upload-area .upload-btn:active {
    transform: scale(0.96);
}
.create-upload-area .file-input {
    display: none;
}
.create-upload-area .hint {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.75rem;
    margin-top: 10px;
}
.file-list {
    width: 100%;
    max-width: 500px;
    margin-top: 6px;
}
.file-list .list-title {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.40);
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
}
.file-list .list-title span {
    font-weight: 300;
}
.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    padding: 10px 14px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: 0.2s;
    flex-wrap: wrap;
    gap: 6px;
}
.file-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.08);
}
.file-item .file-name {
    color: #fff;
    font-weight: 500;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 80px;
}
.file-item .file-name .icon {
    font-size: 1rem;
}
.file-item .file-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.file-item .file-actions .btn-sm {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 30px;
    padding: 3px 12px;
    color: rgba(255, 255, 255, 0.60);
    font-size: 0.7rem;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}
.file-item .file-actions .btn-sm:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.file-item .file-actions .btn-sm.danger:hover {
    background: rgba(255, 70, 70, 0.20);
    color: #ff7a7a;
}
.file-item .file-actions .btn-sm.success:hover {
    background: rgba(143, 223, 176, 0.20);
    color: #8fdfb0;
}
.file-empty {
    color: rgba(255, 255, 255, 0.20);
    text-align: center;
    padding: 20px 0;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}

/* ===== 社区中心 ===== */
#communityView {
    padding: 60px 12px 20px;
    overflow-y: auto;
    align-items: center;
}
#communityView .community-header {
    width: 100%;
    max-width: 700px;
    text-align: center;
    margin-bottom: 8px;
}
#communityView .community-header h2 {
    font-size: clamp(1.5rem, 4vw, 2.4rem);
    font-weight: 700;
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}
#communityView .community-header p {
    color: rgba(255, 255, 255, 0.40);
    font-size: clamp(0.8rem, 1.5vw, 1rem);
    margin-top: 4px;
}
.community-grid {
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.community-item {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 18px;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: 0.3s;
    cursor: pointer;
}
.community-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}
.community-item .item-top {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.community-item .item-thumb {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.community-item .item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.community-item .item-thumb .no-img {
    font-size: 1.8rem;
    opacity: 0.3;
}
.community-item .item-info {
    flex: 1;
    min-width: 0;
}
.community-item .item-info .item-title {
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
    margin-bottom: 2px;
}
.community-item .item-info .item-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.50);
    margin-bottom: 4px;
    word-break: break-word;
}
.community-item .item-info .item-meta {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.30);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.community-item .item-info .item-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}
.community-empty {
    color: rgba(255, 255, 255, 0.25);
    text-align: center;
    padding: 40px 0;
    font-size: 0.95rem;
}

/* ===== 发布页 ===== */
#publishView {
    padding: 60px 12px 20px;
    overflow-y: auto;
    align-items: center;
}
#publishView .publish-header {
    width: 100%;
    max-width: 500px;
    text-align: center;
    margin-bottom: 20px;
}
#publishView .publish-header h2 {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 700;
    background: linear-gradient(135deg, #f9e3b6, #f5c27b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}
.publish-form {
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 24px;
    padding: 24px 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.publish-form .form-group {
    margin-bottom: 16px;
}
.publish-form .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.60);
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}
.publish-form .form-group input,
.publish-form .form-group textarea,
.publish-form .form-group select {
    width: 100%;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 0.9rem;
    transition: 0.25s;
    outline: none;
    font-family: inherit;
}
.publish-form .form-group select option {
    background: #1a1040;
    color: #fff;
}
.publish-form .form-group textarea {
    min-height: 70px;
    resize: vertical;
}
.publish-form .form-group input:focus,
.publish-form .form-group textarea:focus,
.publish-form .form-group select:focus {
    border-color: rgba(245, 194, 123, 0.40);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(245, 194, 123, 0.06);
}
.publish-form .form-group input::placeholder,
.publish-form .form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.20);
    font-weight: 300;
}
.publish-form .form-group .file-upload-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.publish-form .form-group .file-input-label {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.60);
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s;
    display: inline-block;
}
.publish-form .form-group .file-input-label:hover {
    background: rgba(255, 255, 255, 0.10);
}
.publish-form .form-group .file-name-display {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.40);
    flex: 1;
    min-width: 60px;
}
.publish-form .form-group input[type="file"] {
    display: none;
}
.publish-form .form-group .error-msg {
    color: #ff7a7a;
    font-size: 0.75rem;
    margin-top: 4px;
    display: none;
}
.publish-form .form-group .error-msg.show {
    display: block;
}
.publish-form .btn-submit {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 18px;
    background: linear-gradient(135deg, #f6b868, #f5a342);
    color: #1a1040;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.25s;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 20px rgba(245, 163, 66, 0.30);
}
.publish-form .btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(245, 163, 66, 0.45);
}
.publish-form .btn-submit:active {
    transform: scale(0.98);
}
.btn-sm.danger.remove-img {
    background: rgba(255, 70, 70, 0.15);
    color: #ff7a7a;
    border: 1px solid rgba(255, 70, 70, 0.15);
    padding: 4px 12px;
    font-size: 0.7rem;
    border-radius: 30px;
    cursor: pointer;
    transition: 0.2s;
}
.btn-sm.danger.remove-img:hover {
    background: rgba(255, 70, 70, 0.25);
    color: #ff5555;
}
.file-upload-wrap .btn-sm.danger.remove-img {
    display: none;
}
.file-upload-wrap .btn-sm.danger.remove-img.show {
    display: inline-block;
}

/* ===== 标签（Tag）样式 ===== */

/* --- 标签选择器（发布表单） --- */
.tag-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
}

.tag-bubble {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.60);
    transition: all 0.2s ease;
    cursor: default;
    user-select: none;
}

.tag-selectable {
    cursor: pointer;
}
.tag-selectable:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.20);
    transform: scale(1.04);
}
.tag-selectable.active {
    background: rgba(245, 194, 123, 0.20);
    border-color: #f5c27b;
    color: #f5c27b;
}
.tag-selectable.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

/* --- 社区项目内的小标签 --- */
.tag-bubble-sm {
    font-size: 0.65rem;
    padding: 2px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.50);
    border-radius: 30px;
    display: inline-block;
    margin-right: 4px;
    margin-top: 4px;
}

.item-tags {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* --- 筛选栏 --- */
.tag-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 8px 0 16px 0;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.tag-filter {
    cursor: pointer;
    padding: 4px 16px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.50);
    border-radius: 30px;
    transition: all 0.25s ease;
}
.tag-filter:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    transform: scale(1.04);
}
.tag-filter.active {
    background: rgba(167, 139, 250, 0.25);
    border-color: #a78bfa;
    color: #c4b5fd;
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.10);
}

.filter-hint {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.30);
    margin-bottom: 6px;
}
.filter-hint #filterTagName {
    color: #a78bfa;
    font-weight: 500;
}

/* ===== 学习创作页面 ===== */
#learnView {
    padding: 60px 12px 20px;
    overflow-y: auto;
    align-items: center;
    width: 100%;
}
.learn-header {
    text-align: center;
    margin-bottom: 30px;
    width: 100%;
    padding: 20px 0;
}
.learn-header h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 800;
    background: linear-gradient(135deg, #8fdfb0, #4ade80);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    margin-bottom: 8px;
}
.learn-header p {
    color: rgba(255, 255, 255, 0.45);
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    font-weight: 300;
    letter-spacing: 1px;
}

.learn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1100px;
}

.learn-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
}

.learn-card:hover {
    transform: translateY(-6px) scale(1.01);
    border-color: rgba(143, 223, 176, 0.30);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.40);
    background: rgba(255, 255, 255, 0.08);
}

.learn-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
}

.learn-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.learn-card:hover .learn-card-image img {
    transform: scale(1.05);
}

.learn-card-body {
    padding: 14px 16px 16px;
}

.learn-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.learn-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
    flex-wrap: wrap;
    gap: 4px;
}

.learn-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.learn-loading {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(255, 255, 255, 0.25);
    padding: 60px 0;
    font-size: 0.95rem;
}

.learn-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(255, 255, 255, 0.25);
    padding: 60px 0;
    font-size: 1.1rem;
}

/* ===== 后台学习管理 ===== */
#adminLearnPanel .file-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 6px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

/* ===== 后台管理 ===== */
#adminView {
    padding: 60px 12px 20px;
    overflow-y: auto;
    align-items: center;
}
#adminView .admin-header {
    width: 100%;
    max-width: 900px;
    text-align: center;
    margin-bottom: 20px;
}
#adminView .admin-header h2 {
    font-size: clamp(1.5rem, 4vw, 2.4rem);
    font-weight: 700;
    background: linear-gradient(135deg, #f9e3b6, #f5c27b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}
.admin-tabs {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 900px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}
.admin-tabs .tab-btn {
    padding: 8px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.50);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s;
}
.admin-tabs .tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.admin-tabs .tab-btn.active {
    background: rgba(245, 194, 123, 0.15);
    border-color: rgba(245, 194, 123, 0.30);
    color: #f5c27b;
}
.admin-panel {
    width: 100%;
    max-width: 900px;
    display: none;
}
.admin-panel.active {
    display: block;
}
.admin-table-wrap {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    padding: 14px 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    color: #fff;
    font-size: 0.8rem;
    min-width: 480px;
}
.admin-table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.60);
    font-size: 0.75rem;
    letter-spacing: 0.3px;
}
.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}
.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}
.admin-table .user-row {
    cursor: pointer;
}
.admin-table .user-row .arrow {
    display: inline-block;
    transition: 0.2s;
    margin-right: 6px;
}
.admin-table .user-row.expanded .arrow {
    transform: rotate(90deg);
}
.admin-table .file-subrow td {
    padding: 6px 12px 6px 36px;
}
.admin-table .file-subrow .file-item {
    background: transparent;
    border: none;
    padding: 4px 0;
    margin: 0;
}
.admin-table .file-subrow .file-item .file-name {
    font-size: 0.8rem;
}
.admin-table .btn-sm {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 30px;
    padding: 3px 12px;
    color: rgba(255, 255, 255, 0.60);
    font-size: 0.7rem;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}
.admin-table .btn-sm:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.admin-table .btn-sm.danger:hover {
    background: rgba(255, 70, 70, 0.20);
    color: #ff7a7a;
}
.admin-table .btn-sm.warning:hover {
    background: rgba(245, 194, 123, 0.20);
    color: #f5c27b;
}
.admin-table .btn-sm.success:hover {
    background: rgba(143, 223, 176, 0.20);
    color: #8fdfb0;
}
.admin-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.request-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.request-item .req-top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.request-item .req-thumb {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.request-item .req-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.request-item .req-thumb .no-img {
    font-size: 1.5rem;
    opacity: 0.3;
}
.request-item .req-info {
    flex: 1;
    min-width: 0;
}
.request-item .req-info .req-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
}
.request-item .req-info .req-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.50);
    margin: 2px 0;
}
.request-item .req-info .req-meta {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.30);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.request-item .req-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* ===== 模态框 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.3s ease;
}
.modal-overlay.active {
    display: flex;
}
@keyframes fadeIn {
    0% { opacity: 0; transform: scale(0.96); }
    100% { opacity: 1; transform: scale(1); }
}
.modal {
    background: linear-gradient(145deg, #1e1a3a, #2a1f55);
    border-radius: 32px;
    padding: 32px 28px 28px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.70);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes slideUp {
    0% { opacity: 0; transform: translateY(30px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.modal .close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.30);
    font-size: 22px;
    cursor: pointer;
    transition: 0.2s;
    line-height: 1;
}
.modal .close-btn:hover {
    color: #fff;
    transform: rotate(90deg);
}
.modal h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #f9e3b6, #f5c27b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.modal .sub {
    color: rgba(255, 255, 255, 0.35);
    font-size: 13px;
    margin-bottom: 20px;
    letter-spacing: 0.3px;
}
.modal .form-group {
    margin-bottom: 16px;
}
.modal .form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.60);
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}
.modal .form-group input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 14px;
    transition: 0.25s;
    outline: none;
}
.modal .form-group input:focus {
    border-color: rgba(245, 194, 123, 0.40);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(245, 194, 123, 0.06);
}
.modal .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.20);
    font-weight: 300;
}
.modal .form-group .error-msg {
    color: #ff7a7a;
    font-size: 11px;
    margin-top: 4px;
    display: none;
}
.modal .form-group .error-msg.show {
    display: block;
}
.modal .btn-submit {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 18px;
    background: linear-gradient(135deg, #f6b868, #f5a342);
    color: #1a1040;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.25s;
    letter-spacing: 0.5px;
    margin-top: 4px;
    box-shadow: 0 4px 20px rgba(245, 163, 66, 0.30);
}
.modal .btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(245, 163, 66, 0.45);
}
.modal .btn-submit:active {
    transform: scale(0.98);
}
.modal .switch-action {
    text-align: center;
    margin-top: 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.35);
}
.modal .switch-action a {
    color: #f5c27b;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.modal .switch-action a:hover {
    color: #f5a342;
    text-decoration: underline;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 16, 48, 0.92);
    backdrop-filter: blur(12px);
    padding: 10px 24px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.50);
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    letter-spacing: 0.3px;
    max-width: 90%;
    text-align: center;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.success {
    border-color: rgba(143, 223, 176, 0.25);
}
.toast.error {
    border-color: rgba(255, 122, 122, 0.25);
}
.toast.info {
    border-color: rgba(126, 184, 240, 0.25);
}

/* ===== 响应式 ===== */
@media (min-width: 600px) {
    .app { padding: 80px 40px 30px; }
    .auth-bar { top: 20px; right: 30px; padding: 6px 16px 6px 20px; gap: 10px; }
    .auth-bar .user-greeting { font-size: 13px; }
    .btn { padding: 6px 18px; font-size: 12px; }
    .admin-btn { top: 20px; left: 30px; padding: 6px 18px; font-size: 13px; }
    .card { flex: 1 1 calc(33.33% - 16px); max-width: 260px; min-height: 140px; padding: 24px 16px; }
    .back-home-btn { top: 20px; padding: 6px 20px; font-size: 13px; }
    #createView, #communityView, #publishView, #adminView, #learnView { padding: 80px 30px 30px; }
    .learn-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
    .create-upload-area { padding: 36px 30px; }
    .file-item { padding: 12px 18px; }
    .modal { padding: 40px 36px 32px; max-width: 440px; }
    .modal h2 { font-size: 24px; }
    .community-item { padding: 18px 22px; }
    .community-item .item-thumb { width: 72px; height: 72px; }
    .publish-form { padding: 28px 24px; }
    .admin-table-wrap { padding: 18px 16px; }
    .admin-table { font-size: 0.9rem; min-width: auto; }
    .admin-table th, .admin-table td { padding: 12px 16px; }
    .request-item { padding: 16px 20px; }
    .request-item .req-thumb { width: 60px; height: 60px; }
}
@media (min-width: 1024px) {
    .app { padding: 100px 60px 40px; }
    .card { flex: 1 1 calc(20% - 20px); max-width: 280px; min-height: 160px; }
    .row-cards { gap: 20px; }
    .learn-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 28px; }
}

@media (max-width: 500px) {
    .tag-selector {
        gap: 6px;
    }
    .tag-bubble {
        font-size: 0.7rem;
        padding: 3px 10px;
    }
    .tag-filter-bar {
        gap: 6px;
        padding: 4px 0 12px 0;
    }
    .tag-filter {
        font-size: 0.7rem;
        padding: 3px 12px;
    }
    .tag-bubble-sm {
        font-size: 0.6rem;
        padding: 1px 8px;
    }
}

/* 管理员登录隐藏元素 */
#adminLoginModal .sub { display: none !important; }
#adminLoginModal .form-group .error-msg { display: none !important; }