
/**
 * 游戏资源网盘 - 样式表
 * 配色: 黑白灰 | 主色: 白色 | 无触控反馈
 */

:root {
    --white: #ffffff;
    --black: #000000;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #e0e0e0;
    --gray-400: #bdbdbd;
    --gray-500: #9e9e9e;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;
    --border: #e0e0e0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1.2);
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    outline: none !important;
}

*:focus,
*:focus-visible,
*:active {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

input,
textarea,
select {
    -webkit-user-select: text;
    user-select: text;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: 64px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== 固定顶部导航栏 ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.92);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--gray-900);
    letter-spacing: -0.3px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-right: 8px;
}

.header-logo i {
    font-size: 1.4rem;
    color: var(--gray-700);
}

.header-divider {
    width: 1px;
    height: 28px;
    background: var(--gray-300);
    flex-shrink: 0;
    margin: 0 4px;
    border-radius: 1px;
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    overflow: hidden;
    min-width: 0;
    height: 100%;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    height: 100%;
    flex-wrap: nowrap;
    overflow: hidden;
    min-width: 0;
}

.nav-list li {
    flex-shrink: 0;
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-list li a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--gray-600);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: none;
    letter-spacing: -0.1px;
    cursor: default;
    position: relative;
}

.nav-list li a i {
    font-size: 0.85rem;
    color: var(--gray-400);
    transition: none;
}

.nav-list li a.active {
    color: var(--gray-900);
    background: var(--gray-100);
    font-weight: 600;
}

.nav-list li a.active i {
    color: var(--gray-700);
}

.nav-list li a .badge {
    font-size: 0.68rem;
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 500;
    letter-spacing: 0;
    transition: none;
}

.nav-list li a.active .badge {
    background: var(--gray-300);
    color: var(--gray-800);
}

/* 更多折叠按钮 */
.nav-more-wrapper {
    position: relative;
    flex-shrink: 0;
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-more-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--gray-600);
    cursor: default;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    letter-spacing: -0.1px;
    transition: none;
    font-family: inherit;
}

.nav-more-btn i {
    font-size: 0.75rem;
    color: var(--gray-400);
    transition: none;
}

.nav-more-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 6px;
    display: none;
    z-index: 1001;
    animation: dropdownIn 0.2s cubic-bezier(0.25, 0.8, 0.25, 1.2);
}

.nav-more-dropdown.show {
    display: block;
}

.nav-more-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--gray-600);
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    transition: none;
    cursor: default;
}

.nav-more-dropdown a i {
    font-size: 0.8rem;
    color: var(--gray-400);
    width: 16px;
    text-align: center;
}

.nav-more-dropdown a.active {
    color: var(--gray-900);
    background: var(--gray-100);
    font-weight: 600;
}

.nav-more-dropdown a.active i {
    color: var(--gray-700);
}

@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 上传按钮 */
.header-upload-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 8px;
    background: var(--gray-900);
    color: var(--white);
    border: none;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: default;
    white-space: nowrap;
    letter-spacing: -0.2px;
    transition: none;
    font-family: inherit;
    margin-left: 8px;
}

.header-upload-btn i {
    font-size: 0.85rem;
    color: var(--white);
}

/* ========== 主内容区 ========== */
.main-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px 60px;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 分类标题 */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--gray-200);
}

.section-header i {
    font-size: 1.5rem;
    color: var(--gray-700);
}

.section-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.3px;
}

.section-header .count {
    font-size: 0.82rem;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 500;
}

/* 帖子卡片 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.post-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    transition: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    animation: cardAppear 0.5s ease forwards;
    opacity: 0;
}

.post-card:nth-child(1) { animation-delay: 0.05s; }
.post-card:nth-child(2) { animation-delay: 0.1s; }
.post-card:nth-child(3) { animation-delay: 0.15s; }
.post-card:nth-child(4) { animation-delay: 0.2s; }
.post-card:nth-child(5) { animation-delay: 0.25s; }
.post-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.post-card-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
    color: var(--gray-600);
}

.post-card-tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--gray-100);
    color: var(--gray-600);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.post-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.2px;
    line-height: 1.3;
    word-break: break-word;
}

.post-card-desc {
    font-size: 0.85rem;
    color: var(--gray-500);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.75rem;
    color: var(--gray-400);
    flex-wrap: wrap;
}

.post-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-card-meta i {
    font-size: 0.7rem;
}

.post-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.btn-download {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--gray-900);
    color: var(--white);
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: default;
    letter-spacing: -0.1px;
    transition: none;
    font-family: inherit;
}

.btn-download i {
    font-size: 0.8rem;
    color: var(--white);
}

.btn-info-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    cursor: default;
    font-size: 0.9rem;
    transition: none;
    flex-shrink: 0;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--gray-400);
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
    color: var(--gray-300);
}

.empty-state p {
    font-size: 0.9rem;
}

/* ========== 模态框 ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: overlayIn 0.2s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

@keyframes overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1.2);
    border: 1px solid var(--border);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    background: var(--white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 1;
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header h3 i {
    color: var(--gray-500);
    font-size: 1rem;
}

.modal-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    cursor: default;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: none;
}

.modal-body {
    padding: 20px 22px;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
    letter-spacing: -0.1px;
}

.modal-body input[type="text"],
.modal-body input[type="password"],
.modal-body textarea,
.modal-body select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--gray-900);
    background: var(--gray-50);
    transition: none;
    -webkit-user-select: text;
    user-select: text;
}

.modal-body textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-body .file-input-wrapper {
    position: relative;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-md);
    padding: 28px 20px;
    text-align: center;
    cursor: default;
    transition: none;
    background: var(--gray-50);
}

.modal-body .file-input-wrapper i {
    font-size: 2rem;
    color: var(--gray-400);
    display: block;
    margin-bottom: 8px;
}

.modal-body .file-input-wrapper p {
    font-size: 0.82rem;
    color: var(--gray-500);
}

.modal-body .file-input-wrapper input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: default;
}

.modal-body .file-name-display {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--gray-600);
    font-weight: 500;
    word-break: break-all;
}

.modal-body .submit-btn {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    background: var(--gray-900);
    color: var(--white);
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: default;
    letter-spacing: -0.1px;
    font-family: inherit;
    transition: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modal-body .submit-btn i {
    color: var(--white);
}

.modal-body .submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========== Toast提示 ========== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: -0.1px;
    animation: toastIn 0.35s cubic-bezier(0.25, 0.8, 0.25, 1.2);
    box-shadow: var(--shadow-md);
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 380px;
    word-break: break-word;
}

.toast.success {
    background: #f0faf0;
    border-color: #c8e6c9;
    color: #2e7d32;
}

.toast.error {
    background: #faf0f0;
    border-color: #e6c8c8;
    color: #7d2e2e;
}

.toast.info {
    background: #f0f4fa;
    border-color: #c8d6e6;
    color: #2e4a7d;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(60px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(60px) scale(0.9);
    }
}

/* ========== 加载动画 ========== */
@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spin {
    animation: fa-spin 1s linear infinite;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .header {
        padding: 0 12px;
        height: 56px;
    }
    body {
        padding-top: 56px;
    }
    .header-logo {
        font-size: 1rem;
        gap: 6px;
    }
    .header-logo i {
        font-size: 1.1rem;
    }
    .header-divider {
        display: none;
    }
    .nav-list li a {
        padding: 6px 10px;
        font-size: 0.8rem;
        gap: 4px;
        border-radius: 6px;
    }
    .nav-list li a i {
        font-size: 0.7rem;
    }
    .header-upload-btn {
        padding: 7px 12px;
        font-size: 0.78rem;
        gap: 5px;
        border-radius: 6px;
    }
    .header-upload-btn i {
        font-size: 0.7rem;
    }
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .main-content {
        padding: 16px 10px 50px;
    }
    .post-card {
        padding: 16px;
        border-radius: var(--radius-md);
    }
    .modal {
        width: 95%;
        max-width: 95%;
        border-radius: var(--radius-md);
        max-height: 90vh;
    }
    .modal-header {
        padding: 14px 16px;
    }
    .modal-body {
        padding: 16px;
    }
    .toast-container {
        right: 8px;
        left: 8px;
        top: 64px;
    }
    .toast {
        max-width: 100%;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .header-logo span {
        display: none;
    }
    .header-logo {
        margin-right: 2px;
    }
    .nav-list li a {
        padding: 5px 7px;
        font-size: 0.75rem;
        gap: 3px;
    }
    .nav-list li a i {
        display: none;
    }
    .header-upload-btn span {
        display: none;
    }
    .header-upload-btn {
        padding: 8px 10px;
        border-radius: 6px;
    }
    .header-upload-btn i {
        font-size: 0.85rem;
    }
    .post-card-title {
        font-size: 0.9rem;
    }
    .btn-download {
        font-size: 0.8rem;
        padding: 9px 12px;
    }
}
