/* ============================================
   全新配色 & 样式 – 活力科技 iOS 毛玻璃风
   背景：深蓝紫渐变 + 动态光晕
   卡片：毛玻璃 + 柔和边框
   按钮：霓虹渐变
   ============================================ */

:root {
    --bg-start: #0b0b1a;
    --bg-end: #1a1040;
    --card-bg: rgba(255, 255, 255, 0.07);
    --text-main: #f0f0ff;
    --text-sub: #b0b0dd;
    --accent-color: #6c5ce7;
    --accent-hover: #a29bfe;
    --border-color: rgba(255, 255, 255, 0.12);
    --success-color: #34c759;
    --cheat-item-bg: rgba(255, 255, 255, 0.04);
    --code-bg: rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
    color: var(--text-main);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ===== 动态流光背景 ===== */
body::before {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 30% 40%, rgba(108, 92, 231, 0.15) 0%, transparent 35%),
        radial-gradient(circle at 70% 60%, rgba(0, 206, 201, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 10% 80%, rgba(255, 107, 53, 0.08) 0%, transparent 30%);
    animation: bgFloat 20s ease-in-out infinite alternate;
    z-index: -2;
    pointer-events: none;
}

@keyframes bgFloat {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(5%, 5%) rotate(3deg); }
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ===== 头部 ===== */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
}

h1 {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #6c5ce7, #00cec9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(108, 92, 231, 0.3);
    margin-bottom: 25px;
}

/* ===== 搜索框 ===== */
.search-box {
    display: flex;
    justify-content: center;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.search-box input {
    flex: 1;
    padding: 14px 22px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.search-box input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 25px rgba(108, 92, 231, 0.4);
}

.search-box button {
    padding: 14px 32px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #6c5ce7, #00cec9);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.4);
}

.search-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(108, 92, 231, 0.6);
}

/* ===== 统计信息 ===== */
.stats {
    text-align: center;
    color: var(--text-sub);
    margin-bottom: 30px;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 10px 20px;
    border-radius: 30px;
    display: inline-block;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-left: auto;
    margin-right: auto;
    width: auto;
}

/* ===== 卡片列表（网格） ===== */
.file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 28px;
    justify-content: center;
}

.file-item {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    padding: 20px 16px 18px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.file-item::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(108, 92, 231, 0.06), transparent 60%);
    transition: all 0.6s ease;
    pointer-events: none;
}

.file-item:hover::before {
    transform: scale(1.2);
    opacity: 0.8;
}

.file-item:hover {
    transform: translateY(-8px);
    border-color: rgba(108, 92, 231, 0.3);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(108, 92, 231, 0.1);
}

/* ===== 封面 ===== */
.cover-box {
    width: 208px;
    height: 260px;
    flex-shrink: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #0b1220;
    margin: 16px auto 16px; /* 顶部增加 28px 空白 */
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
}

.cover-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.cover-box:hover img {
    transform: scale(1.05);
}

/* ===== 文件信息 ===== */
.file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}

.file-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-sub);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #0f172a;
}
.tag-json { background: #38bdf8; }
.tag-shn { background: #fbbf24; }
.tag-mc4 { background: #c084fc; }

/* ===== 操作按钮 ===== */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.details-btn,
.download-btn,
.upload-btn {
    padding: 7px 4px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.75rem;
    text-align: center;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-weight: 500;
}

.details-btn {
    background: linear-gradient(135deg, #6c5ce7, #0984e3);
    color: #fff;
}
.details-btn:hover {
    background: linear-gradient(135deg, #a29bfe, #74b9ff);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.4);
}

.download-btn,
.upload-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
}
.download-btn:hover,
.upload-btn:hover {
    background: rgba(108, 92, 231, 0.2);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(108, 92, 231, 0.2);
}

/* ===== 编辑按钮 ===== */
.edit-btn {
    font-size: 0.65rem;
    color: var(--text-sub);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 4px;
    transition: all 0.3s ease;
}
.edit-btn:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background: rgba(108, 92, 231, 0.1);
}

/* ===== 弹窗（模态框） ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background: rgba(30, 30, 60, 0.8);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    padding: 28px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.modal h3 {
    margin-bottom: 15px;
    color: var(--accent-color);
    letter-spacing: 1px;
    font-weight: 600;
}

.modal input {
    width: 100%;
    padding: 12px 18px;
    margin-bottom: 20px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 15px;
    transition: all 0.3s ease;
}
.modal input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.3);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-actions button {
    padding: 10px 24px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

#saveNameBtn {
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: #fff;
}
#closeModalBtn,
#closeDetailsBtn {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}
#closeModalBtn:hover,
#closeDetailsBtn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ===== 详情弹窗 ===== */
#detailsModal .modal {
    max-width: 900px;
}

.modal-content {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.details-header {
    display: flex;
    gap: 22px;
    align-items: flex-start;
}

.details-cover-box {
    flex: 0 0 208px;
    height: 260px;
    border-radius: 16px;
    overflow: hidden;
    background: #0b1220;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.details-cover-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.details-info {
    flex: 1;
}

#detailsModal h3 {
    color: var(--accent-color);
    margin-bottom: 10px;
    font-size: 1.6rem;
}

.details-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.details-meta-item {
    display: flex;
    flex-direction: column;
}

.details-meta-label {
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-bottom: 3px;
}

.details-meta-value {
    font-size: 0.95rem;
    color: var(--text-main);
    word-break: break-all;
}

/* ===== 金手指列表 ===== */
.details-cheat-section h4 {
    color: var(--accent-color);
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.cheat-item {
    background: var(--cheat-item-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 14px 18px;
    border-radius: 14px;
    border-left: 4px solid var(--accent-color);
    margin-bottom: 10px;
    transition: all 0.3s ease;
}
.cheat-item:hover {
    background: rgba(108, 92, 231, 0.08);
}

.cheat-item-name {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.cheat-item-details {
    font-size: 0.8rem;
    color: var(--text-sub);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cheat-item-type {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
}

/* ===== 代码框 ===== */
.details-cheat-code {
    background: var(--code-bg);
    padding: 18px;
    border-radius: 14px;
    overflow-x: auto;
    white-space: pre-wrap;
    font-family: "SF Mono", "Menlo", monospace;
    font-size: 0.85em;
    line-height: 1.6;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #b0b0dd;
    max-height: 400px;
    overflow-y: auto;
}

/* ===== 分页 ===== */
#pagination {
    text-align: center;
    margin: 30px 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

#pagination button {
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

#pagination button:hover {
    background: rgba(108, 92, 231, 0.2);
    border-color: var(--accent-color);
}

#pagination button[style*="background:#06b6d4"] {
    background: linear-gradient(135deg, #6c5ce7, #00cec9) !important;
    color: #fff !important;
    border: none;
}

/* ===== 移动端适配 ===== */
@media (max-width: 480px) {
    body { padding: 12px; }
    h1 { font-size: 1.8rem; }
    .file-list { grid-template-columns: 1fr; gap: 18px; }
    .cover-box { width: 140px; height: 175px; margin-top: 20px;}
    .details-cover-box { flex: 0 0 140px; height: 175px; }
    .search-box { flex-direction: column; }
    .search-box button { width: 100%; }
    .action-buttons { grid-template-columns: 1fr 1fr; }
}

/* ===== 无结果提示 ===== */
.no-results {
    text-align: center;
    color: var(--text-sub);
    padding: 60px 20px;
    font-size: 1.1rem;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 24px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

/* ===== 关于弹窗 ===== */
#aboutModal .modal {
    max-width: 500px;
}



/* ===== 平台标签（封面左上角） ===== */
.platform-tag {
    position: absolute;
    top: 4px;
    left: 8px;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 5;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    pointer-events: none;
}
.platform-tag.ps5 { background: rgba(0,100,200,0.85); }
.platform-tag.ps4 { background: rgba(0,50,100,0.85); }