/* Ant Design 风格 - 本地化样式 */
:root {
    --primary-color: #1677ff;
    --primary-hover: #4096ff;
    --primary-active: #0958d9;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --error-color: #ff4d4f;
    --text-color: rgba(0, 0, 0, 0.88);
    --text-secondary: rgba(0, 0, 0, 0.65);
    --text-tertiary: rgba(0, 0, 0, 0.45);
    --border-color: #d9d9d9;
    --bg-color: #f5f5f5;
    --component-bg: #ffffff;
    --border-radius: 8px;
    --box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5714;
    color: var(--text-color);
    background-color: var(--bg-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--primary-hover);
}

/* Layout */
.layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: var(--component-bg);
    height: 64px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), #722ed1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.content {
    flex: 1;
    padding: 24px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-tertiary);
    background: var(--component-bg);
}

/* Cards */
.card {
    background: var(--component-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02);
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.3s;
    position: relative;
}

.card:hover {
    box-shadow: var(--box-shadow);
}

/* 卡片右上角标签 */
.card-corner-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

.card-body {
    padding: 24px;
}

.card-hoverable:hover {
    transform: translateY(-2px);
}

/* Modpack Card */
.modpack-card {
    display: flex;
    cursor: pointer;
}

.modpack-cover {
    width: 150px;
    height: 150px;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 8px;
}

.modpack-cover-empty {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, #f0f5ff 0%, #e6f4ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 48px;
    flex-shrink: 0;
    border-radius: 8px;
}

.modpack-info {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.modpack-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.modpack-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: pre-line;
}

.modpack-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

/* Card Action Buttons */
.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    margin-left: auto;
    flex-shrink: 0;
}

.card-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
}

.card-icon-btn svg {
    width: 22px;
    height: 22px;
}

.card-icon-btn::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
}

.card-icon-btn:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.card-icon-download {
    background: #f0f5ff;
    color: #1677ff;
}

.card-icon-download:hover {
    background: #1677ff;
    color: #fff;
    box-shadow: 0 3px 10px rgba(22, 119, 255, 0.3);
    transform: translateY(-2px);
}

.card-icon-detail {
    background: #f0f5ff;
    color: #1677ff;
}

.card-icon-detail:hover {
    background: #722ed1;
    color: #fff;
    box-shadow: 0 3px 10px rgba(114, 46, 209, 0.3);
    transform: translateY(-2px);
}

.card-icon-patch {
    background: #fff7e6;
    color: #d46b08;
}

.card-icon-patch:hover {
    background: #fa8c16;
    color: #fff;
    box-shadow: 0 3px 10px rgba(250, 140, 22, 0.3);
    transform: translateY(-2px);
}


/* Tags */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    height: 24px;
    font-size: 12px;
    border-radius: 4px;
    background: #fafafa;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.tag-blue {
    color: #1677ff;
    background: #e6f4ff;
    border-color: #91caff;
}

.tag-green {
    color: #52c41a;
    background: #f6ffed;
    border-color: #b7eb8f;
}

.tag-purple {
    color: #722ed1;
    background: #f9f0ff;
    border-color: #d3adf7;
}

.tag-orange {
    color: #fa8c16;
    background: #fff7e6;
    border-color: #ffd591;
}

.tag-cyan {
    color: #13c2c2;
    background: #e6fffb;
    border-color: #87e8de;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 16px;
    height: 32px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-lg {
    height: 40px;
    padding: 6px 20px;
    font-size: 16px;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: white;
}

.btn-default {
    background: var(--component-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

.btn-default:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-danger {
    background: var(--error-color);
    border-color: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background: #ff7875;
    border-color: #ff7875;
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--primary-color);
    padding: 0;
    height: auto;
}

.btn-link:hover {
    color: var(--primary-hover);
}

/* Form */
.form-item {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-label.required::before {
    content: '*';
    color: var(--error-color);
    margin-right: 4px;
}

.input {
    width: 100%;
    height: 32px;
    padding: 4px 12px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    transition: all 0.2s;
}

.input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

.input-lg {
    height: 40px;
    padding: 6px 16px;
    font-size: 16px;
}

.textarea {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    transition: all 0.2s;
}

.textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

.select {
    width: 100%;
    height: 32px;
    padding: 4px 12px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    background: var(--component-bg);
    cursor: pointer;
    transition: all 0.2s;
}

.select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

/* Filter Section */
.filter-section {
    background: var(--component-bg);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.filter-item label {
    display: block;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}

.filter-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

/* Page Header */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--text-secondary);
}

/* Detail Page */
.detail-cover {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 24px;
}

.detail-cover-empty {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #f0f5ff 0%, #e6f4ff 100%);
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    color: var(--primary-color);
}

.detail-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 16px;
}

.detail-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* Detail Top Action Buttons */
.detail-top-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 32px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
    letter-spacing: 0.5px;
}

.btn-action:hover {
    transform: translateY(-1px);
}

.btn-action:active {
    transform: translateY(0);
}

.btn-action-download {
    background: #1677ff;
    color: #fff;
    box-shadow: 0 2px 8px rgba(22, 119, 255, 0.25);
}

.btn-action-download:hover {
    background: #4096ff;
    color: #fff;
    box-shadow: 0 4px 14px rgba(22, 119, 255, 0.35);
}

.btn-action-detail {
    background: #f0f5ff;
    color: #1677ff;
    border: 1px solid #badeff;
}

.btn-action-detail:hover {
    background: #e6f4ff;
    color: #0958d9;
    border-color: #91caff;
}

.btn-action-patch {
    background: #fff7e6;
    color: #d46b08;
    border: 1px solid #ffd591;
}

.btn-action-patch:hover {
    background: #fff1d6;
    color: #ad4e00;
    border-color: #ffc069;
}

@media (max-width: 768px) {
    .detail-top-actions {
        flex-direction: column;
    }
    .btn-action {
        justify-content: center;
        width: 100%;
    }
}

.info-list {
    border-top: 1px solid #f0f0f0;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-label {
    color: var(--text-secondary);
}

.info-value {
    font-weight: 500;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

/* Login Page */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f7fa;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 24px rgba(245, 171, 185, 0.15);
    border: 1px solid rgba(245, 171, 185, 0.2);
}

.login-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.login-logo-icon {
    width: 36px;
    height: 36px;
    background: #f5abb9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.login-title {
    font-size: 22px;
    font-weight: 600;
    color: #333;
}

.login-subtitle {
    color: rgba(0, 0, 0, 0.45);
    text-align: center;
    margin-bottom: 32px;
    font-size: 14px;
}

.login-input {
    height: 44px;
    padding: 8px 16px;
    font-size: 15px;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    transition: all 0.2s;
}

.login-input:focus {
    border-color: #f5abb9;
    box-shadow: 0 0 0 2px rgba(245, 171, 185, 0.2);
}

.login-input::placeholder {
    color: rgba(0, 0, 0, 0.25);
}

.login-btn {
    width: 100%;
    height: 44px;
    background: #f5abb9;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.login-btn:hover {
    background: #f8bfc9;
    color: #fff;
}

.login-btn:active {
    background: #e89dac;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.login-footer-link {
    color: #f5abb9;
    font-size: 13px;
    text-decoration: none;
}

.login-footer-link:hover {
    color: #e89dac;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 24px;
    font-size: 14px;
}

.alert-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: var(--error-color);
}

/* Empty State */
.empty {
    text-align: center;
    padding: 60px 24px;
}

.empty-icon {
    font-size: 64px;
    color: #d9d9d9;
    margin-bottom: 16px;
}

.empty-text {
    color: var(--text-tertiary);
    margin-bottom: 24px;
}

/* 404 Page */
.not-found {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}

.not-found-code {
    font-size: 120px;
    font-weight: 700;
    color: #f0f0f0;
    line-height: 1;
    margin-bottom: 16px;
}

.not-found-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.not-found-text {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #fafafa;
}

.upload-icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.upload-text {
    color: var(--text-secondary);
}

/* Switch */
.switch-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #fafafa;
    border-radius: var(--border-radius);
}

.switch-info h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.switch-info p {
    font-size: 12px;
    color: var(--text-tertiary);
}

.switch {
    position: relative;
    width: 44px;
    height: 22px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.switch.active {
    background: var(--primary-color);
}

.switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: all 0.2s;
}

.switch.active::after {
    left: 24px;
}

/* Grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -8px;
}

.col {
    padding: 8px;
}

.col-6 { width: 50%; }
.col-12 { width: 100%; }

@media (max-width: 768px) {
    .col-6 { width: 100%; }
    
    .modpack-card {
        flex-direction: column;
    }
    
    .modpack-cover,
    .modpack-cover-empty {
        width: 100%;
        aspect-ratio: 1/1;
        height: auto;
        max-width: 200px;
        margin: 16px auto 0;
    }

    .card-actions {
        justify-content: center;
        padding: 12px 16px;
    }
    
    .header-content {
        padding: 0 16px;
    }
    
    .content {
        padding: 16px;
    }
}

/* Divider */
.divider {
    height: 1px;
    background: #f0f0f0;
    margin: 24px 0;
}

/* Preview Image */
.preview-image {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    border-radius: var(--border-radius);
    background: #fafafa;
}

.preview-placeholder {
    width: 100%;
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, #f0f5ff 0%, #e6f4ff 100%);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--primary-color);
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }

/* Pagination */
.pagination-wrapper {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    background: var(--component-bg);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination-btn.disabled {
    color: var(--text-tertiary);
    cursor: not-allowed;
    opacity: 0.5;
}

.pagination-ellipsis {
    padding: 0 8px;
    color: var(--text-tertiary);
}

.pagination-jump {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.pagination-input {
    width: 60px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
}

.pagination-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Search Box in Header */
.search-box {
    position: relative;
    width: 300px;
}

.search-box .input {
    padding-left: 36px;
}

.search-box-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
