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

@font-face {
    font-family: 'Minecraft';
    src: url('../font/minecraft.woff2') format('woff2');
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #0d1117;
    color: #f0f0f0;
}

.main-wrapper {
    width: 100%;
    background-color: #161b22;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Minecraft', 'Microsoft YaHei', sans-serif;
}

/* 头部区域 */
header {
    width: 100%;
    height: 365px;
    position: relative;
    margin-bottom: 20px;
    margin-top: 40px;
}

#skin_container {
    position: fixed;
    z-index: 100;
    left: 50%;
    top: 120px;
    transform: translate(-50%, 0);
    image-rendering: auto;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #27ae60, #1e8449);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid #3498db;
    color: #3498db;
}

.btn-outline-primary:hover {
    background: #3498db;
    color: white;
}

.btn-outline-danger {
    background: transparent;
    border: 2px solid #e74c3c;
    color: #e74c3c;
    padding: 8px 16px;
    font-size: 13px;
    min-width: auto;
}

.btn-outline-danger:hover {
    background: #e74c3c;
    color: white;
}

/* 控制按钮区域 */
.control-btn-section {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 20px;
}

/* 卡片样式 */
section {
    margin-bottom: 20px;
}

.card {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
}

.card-header {
    background: #1d232a;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #30363d;
    color: #3498db;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 20px;
    background: #0d1117;
}

/* 表单元素样式 */
.form-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.input-row label:not(.checkbox-label):not(.radio-label) {
    min-width: 100px;
    color: #c9d1d9;
    flex-shrink: 0;
}

.input-row .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #c9d1d9;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #c9d1d9;
    font-weight: 500;
}

.input-label {
    padding: 10px 15px;
    background: #1d232a;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    white-space: nowrap;
    flex-shrink: 0;
}

.form-control {
    flex: 1;
    padding: 10px 15px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #f0f0f0;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-control::placeholder {
    color: #6e7681;
}

/* 文件选择按钮样式 */
.form-control[type="file"] {
    padding: 8px 12px;
    cursor: pointer;
}

.form-control[type="file"]::file-selector-button {
    padding: 8px 16px;
    margin-right: 12px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-control[type="file"]::file-selector-button:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-1px);
}

.form-control[type="file"]::-webkit-file-upload-button {
    padding: 8px 16px;
    margin-right: 12px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-control[type="file"]::-webkit-file-upload-button:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-1px);
}

.input-group .form-control {
    border-radius: 6px;
}

.input-group:has(.input-label) .form-control {
    border-radius: 0 6px 6px 0;
}

.input-group:has(.btn) {
    display: flex;
    gap: 0;
}

.input-group:has(.btn) .form-control {
    border-radius: 6px 0 0 6px;
}

.input-group:has(.btn) .btn {
    border-radius: 0 6px 6px 0;
}

.form-select {
    padding: 10px 15px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #f0f0f0;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.select-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.select-group label {
    color: #c9d1d9;
}

/* 单选框样式 */
.radio-group {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #c9d1d9;
    padding: 8px 0;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3498db;
}

.radio-label:hover {
    color: #3498db;
}

/* 复选框样式 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #c9d1d9;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3498db;
}

.checkbox-label:hover {
    color: #3498db;
}

/* 表格样式 */
.layers-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.layers-table th,
.layers-table td {
    padding: 12px;
    border: 1px solid #30363d;
}

.layers-table thead th {
    background: #1d232a;
    color: #3498db;
    font-weight: 600;
}

.layers-table tbody th {
    background: #1d232a;
    color: #c9d1d9;
    font-weight: 600;
}

.layers-table td {
    background: #161b22;
}

.layers-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3498db;
}

/* 分隔线 */
hr {
    border: none;
    border-top: 1px solid #30363d;
    margin: 20px 0;
}

/* 页脚样式 */
.footer-section {
    text-align: center;
    padding: 30px 20px;
    color: #8b949e;
    border-top: 1px solid #30363d;
    margin-top: 40px;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

.footer-credits {
    margin-bottom: 0;
}

.footer-credits p {
    margin: 8px 0;
    font-size: 14px;
}

.footer-credits a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-credits a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.modal-lg {
    max-width: 800px;
}

.modal-content {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    margin: 50px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #30363d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #3498db;
    font-size: 18px;
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    color: #8b949e;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: #e74c3c;
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #30363d;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Alert样式 */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.alert-danger {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.alert-text {
    font-size: 14px;
}

/* 图片样式 */
.img-fluid {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.mcpack-text-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
        padding-top: 0;
    }

    /* 3D模型优化 */
    #skin_container {
        top: 80px;
        transform: translate(-50%, 0) scale(0.8);
    }

    header {
        margin-top: 20px;
        margin-bottom: 10px;
    }

    /* 顶部按钮组优化 */
    .control-btn-section {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 15px;
    }

    .control-btn-section .btn {
        flex: 1 1 calc(50% - 4px);
        min-width: 120px;
        padding: 10px 12px;
        font-size: 14px;
    }

    /* 卡片间距优化 */
    .card {
        margin-bottom: 15px;
    }

    .card-header {
        font-size: 16px;
        padding: 12px 15px;
    }

    .card-body {
        padding: 15px;
    }

    /* 表单布局优化 */
    .form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .input-row {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .input-row label:not(.checkbox-label):not(.radio-label) {
        width: 100%;
        min-width: auto;
        margin-bottom: 5px;
    }
    
    .input-row .form-control {
        flex: 1;
        min-width: 0;
    }
    
    .input-row .btn {
        flex-shrink: 0;
    }
    
    /* 特殊处理：用户名输入框占满宽度 */
    .input-row .form-control[type="text"] {
        flex: 1 1 100%;
    }
    
    /* 特殊处理：窃取皮肤和BE皮肤按钮 */
    .input-row .btn-outline-primary {
        flex: 1 1 calc(50% - 4px);
        min-width: 120px;
    }

    /* 输入框优化 */
    .form-control,
    .form-select {
        font-size: 16px; /* 防止iOS自动缩放 */
        padding: 12px 15px;
        min-height: 44px; /* iOS触摸友好 */
    }

    .input-label {
        padding: 12px 15px;
        font-size: 14px;
    }

    /* 单选框和复选框组优化 */
    .radio-group {
        flex-wrap: wrap;
        gap: 8px;
    }

    .radio-label,
    .checkbox-label {
        padding: 8px 12px;
        background: #1d232a;
        border-radius: 6px;
        min-height: 40px;
        display: flex;
        align-items: center;
    }

    .select-group {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }

    /* 按钮优化 */
    .btn {
        padding: 10px 16px;
        font-size: 14px;
        min-height: 44px;
        white-space: nowrap;
    }
    
    /* 清除按钮移动端优化 - 单独一行 */
    .btn-outline-danger {
        flex: 1 1 100% !important;
        padding: 12px 16px;
        font-size: 14px;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
    }
    
    /* 确保file input也占满一行 */
    .input-row input[type="file"] {
        flex: 1 1 100% !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 8px;
    }

    .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .btn-group .btn {
        flex: 1 1 auto;
    }

    /* 文件选择按钮 */
    .form-control[type="file"]::file-selector-button,
    .form-control[type="file"]::-webkit-file-upload-button {
        padding: 10px 14px;
        font-size: 14px;
        min-height: 40px;
    }

    /* 皮肤层表格优化 */
    .layers-table {
        font-size: 12px;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .layers-table th,
    .layers-table td {
        padding: 8px 4px;
        min-width: 50px;
    }

    .layers-table input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    /* 数字输入框优化 */
    input[type="number"] {
        max-width: 100%;
    }

    #auto-rotate-speed {
        max-width: 100%;
    }

    /* 模态框优化 */
    .modal-content {
        margin: 10px;
        max-width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }

    .modal-header {
        padding: 12px 15px;
    }

    .modal-body {
        padding: 15px;
    }

    /* 页脚优化 */
    .footer-section {
        padding: 20px 15px;
        font-size: 12px;
    }

    .footer-section p {
        margin-bottom: 8px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    #skin_container {
        top: 60px;
        transform: translate(-50%, 0) scale(0.7);
    }

    header {
        margin-top: 15px;
    }

    .control-btn-section .btn {
        flex: 1 1 100%;
        font-size: 13px;
    }

    .card-header {
        font-size: 15px;
    }

    .btn {
        font-size: 13px;
        padding: 9px 12px;
    }

    .form-control,
    .form-select {
        font-size: 16px;
        padding: 10px 12px;
    }

    .radio-label,
    .checkbox-label {
        font-size: 14px;
    }
}

/* 修复像素化问题 */
#skin_container,
canvas,
.img-fluid {
    image-rendering: auto !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
