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

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: #f0f8ff;
    color: #2c3e50;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 30px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(36, 105, 174, 0.15);
    border-top: 4px solid #3498db;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2469ae;
}

.form-header {
    text-align: right;
    margin-bottom: 20px;
}

.init-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(36, 105, 174, 0.2);
}

.init-btn:hover {
    background-color: #2469ae;
    box-shadow: 0 4px 8px rgba(36, 105, 174, 0.3);
    transform: translateY(-1px);
}

.form-field {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 5px;
    background-color: #f5f9ff;
    border-left: 3px solid #3498db;
}

.form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2469ae;
}

.form-field .description {
    font-size: 14px;
    color: #5d7b9d;
    margin-bottom: 10px;
}

/* 输入框样式 */
.input-field input {
    width: 100%;
    padding: 10px;
    border: 1px solid #bbd8f3;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

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

/* 下拉框样式 */
.select-field select {
    width: 100%;
    padding: 10px;
    border: 1px solid #bbd8f3;
    border-radius: 4px;
    font-size: 16px;
    background-color: white;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%233498db' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

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

/* 自定义下拉框样式 */
.select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #bbd8f3;
    border-radius: 4px;
    font-size: 16px;
    background-color: white;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.custom-select:after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #3498db;
    transition: transform 0.3s;
}

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

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

.selected-value {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #2c3e50;
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #bbd8f3;
    border-radius: 4px;
    box-shadow: 0 6px 16px rgba(36, 105, 174, 0.15);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s;
}

.custom-select-dropdown[style*="display: block"] {
    opacity: 1;
    transform: translateY(0);
}

.custom-select-option {
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid #e8f4fc;
    color: #2c3e50;
}

.custom-select-option:last-child {
    border-bottom: none;
}

.custom-select-option:hover {
    background-color: #e8f4fc;
    color: #3498db;
}

.custom-select-option.selected {
    background-color: #e8f4fc;
    color: #3498db;
    font-weight: 500;
    position: relative;
}

.custom-select-option.selected:after {
    content: '✓';
    position: absolute;
    right: 15px;
    color: #3498db;
    font-weight: bold;
}

/* 美化滚动条 */
.custom-select-dropdown::-webkit-scrollbar {
    width: 8px;
}

.custom-select-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb {
    background: #bbd8f3;
    border-radius: 4px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
    background: #3498db;
}

/* 开关样式 */
.switch-field {
    position: relative;
}

.switch-field .switch {
    position: absolute;
    display: inline-block;
    width: 60px;
    height: 34px;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.switch-field .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-field .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #bbd8f3;
    transition: .4s;
    border-radius: 34px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}

.switch-field .slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.switch-field input:checked + .slider {
    background-color: #3498db;
}

.switch-field input:checked + .slider:before {
    transform: translateX(26px);
}

/* 按钮样式 */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 30px;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(36, 105, 174, 0.2);
    min-width: 150px;
    position: relative;
    overflow: hidden;
}

button:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.6s;
}

button:hover:before {
    left: 100%;
}

button:hover {
    background-color: #2469ae;
    box-shadow: 0 4px 8px rgba(36, 105, 174, 0.3);
    transform: translateY(-1px);
}

/* 特定按钮样式 */
#initFromClipboardBtn {
    background-color: #3498db;
}

#downloadBtn {
    background-color: #2980b9;
}

#copyJsonBtn {
    background-color: #1abc9c;
}

/* 可排序数组样式 */
.sortable-array-container {
    width: 100%;
}

.sortable-items-list {
    list-style: none;
    padding: 0;
    margin-bottom: 15px;
}

.sortable-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background-color: white;
    border: 1px solid #bbd8f3;
    border-radius: 4px;
    cursor: move;
    transition: all 0.3s;
}

.sortable-item.dragging {
    opacity: 0.5;
    border: 1px dashed #3498db;
    background-color: #f5f9ff;
}

.drag-handle {
    margin-right: 10px;
    color: #999;
    cursor: move;
    font-size: 20px;
    line-height: 1;
}

.sortable-item-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #bbd8f3;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.sortable-item-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.delete-item-btn {
    background-color: transparent;
    color: #ff4d4d;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 0 8px;
    margin-left: 10px;
    min-width: auto !important;
}

.delete-item-btn:hover {
    color: #ff0000;
}

.add-item-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(36, 105, 174, 0.2);
}

.add-item-btn:hover {
    background-color: #2469ae;
    box-shadow: 0 4px 8px rgba(36, 105, 174, 0.3);
    transform: translateY(-1px);
}