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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* 顶部控制按钮样式 */
.top-controls {
    position: absolute;
    top: 60px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
}

.btn-instructions {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 8px 16px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-instructions:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    background: linear-gradient(135deg, #2980b9, #1f4e79);
}

.btn-instructions:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.3);
}

.btn-language {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 8px 16px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-language:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    background: linear-gradient(135deg, #2980b9, #1f4e79);
}

.btn-language:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.3);
}

header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
}

.header-left {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.header-left .size-section {
    margin-bottom: 0;
}

.header-left .size-section h3 {
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 1em;
    font-weight: bold;
}

.header-left .size-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.custom-theme-btn {
    display: none;
    align-self: flex-start;
    padding: 6px 12px;
    font-size: 0.85em;
}

.upload-theme-btn {
    display: none;
    align-self: flex-start;
    padding: 6px 12px;
    font-size: 0.85em;
}

.header-left .size-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9em;
}

.header-left .size-option:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.header-left .size-option input[type="radio"] {
    margin: 0;
    accent-color: #3498db;
}

.header-left .size-option input[type="radio"]:checked + span {
    color: #3498db;
    font-weight: bold;
}

.header-left .size-option:has(input:checked) {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-color: #3498db;
    color: #2980b9;
}

.header-center {
    text-align: center;
}

.header-center h1 {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.score-display {
    font-size: 1.5em;
    color: #e74c3c;
    font-weight: bold;
    background: linear-gradient(135deg, #fffacd, #fff8dc);
    border: 2px solid #ffd700;
    border-radius: 15px;
    padding: 8px 20px;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-label {
    color: #34495e;
}

#score {
    color: #e74c3c;
    font-size: 1.2em;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.game-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: nowrap;
}

.left-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    min-width: 130px;
}

.left-controls .btn {
    width: 100px;
    padding: 12px 8px;
    font-size: 0.9em;
}

.game-board {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

#sudokuCanvas {
    border: none;
    border-radius: 10px;
    background: #f5deb3;
    cursor: crosshair;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.legend-panel {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    min-width: 400px;
    width: 500px;
    height: fit-content;
    display: flex;
    flex-direction: column;
}

.legend-panel h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.5em; /* 调大标题字体 */
}

#legend {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    flex: 1;
    padding: 0 0;
}

.legend-item {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.0em; /* 稍微调小字体 */
    font-weight: bold;
    padding: 10px 8px; /* 增加内边距 */
    border-radius: 8px;
    background: rgba(240, 248, 255, 0.5);
    min-height: 55px; /* 增加最小高度 */
    transition: all 0.3s ease;
}

.legend-item:hover {
    background: rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.upload-theme-legend-item {
    justify-content: flex-start;
    gap: 10px;
}

.legend-upload-preview {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px dashed #b0bec5;
    background-position: center;
    background-size: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    color: #607d8b;
    font-size: 0.9em;
    position: relative;
    overflow: hidden;
}

.legend-upload-preview.has-image {
    border-style: solid;
    color: transparent;
}

.legend-upload-preview {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px dashed #b0bec5;
    background-position: center;
    background-size: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5em;
    color: #90a4ae;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-upload-preview.has-image {
    border-style: solid;
    color: transparent;
}

/* 生肖主题样式 - 调整表情符号大小以适应一行显示 */
.legend-item.zodiac-symbol {
    font-size: 1.6em; /* 减小整体字体大小 */
}

.legend-item.zodiac-symbol span {
    font-size: 1.2em; /* 进一步减小表情符号大小 */
}

.controls {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    margin-top: 20px;
}

.controls h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.size-section,
.difficulty-section,
.puzzle-section,
.action-buttons,
.theme-section {
    margin-bottom: 15px;
}

.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 1.1em;
    padding: 8px 15px;
    border-radius: 8px;
    background: rgba(240, 248, 255, 0.5);
    transition: all 0.3s ease;
}

.radio-group label:hover {
    background: rgba(52, 152, 219, 0.1);
}

.radio-group input[type="radio"] {
    transform: scale(1.2);
}

.radio-group input[type="radio"]:checked + span {
    color: #2980b9;
    font-weight: bold;
}

#puzzleSelect {
    padding: 10px 15px;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    font-size: 1.1em;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

#puzzleSelect:focus {
    outline: none;
    border-color: #3498db;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(149, 165, 166, 0.4);
}

.btn-secondary.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.theme-select {
    background: linear-gradient(135deg, #f0f8ff, #e6f3ff);
    color: #222;
    border: 2px solid #3498db;
    font-size: 0.9em;
    padding: 8px 16px;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.2);
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 100px;
    outline: none;
}

.theme-select:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    background: linear-gradient(135deg, #e6f3ff, #d1ecf1);
}

.theme-select:focus {
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}



/* 响应式设计 */
@media (max-width: 768px) {
    .custom-theme-inputs {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 5px;
    }
    
    .custom-theme-row {
        padding: 10px 12px;
    }
    
    .custom-theme-row label {
        min-width: 28px;
        height: 28px;
        font-size: 1em;
    }
    
    .custom-theme-row input {
        padding: 8px 12px;
        font-size: 1em;
    }
    
    .modal-actions .btn {
        min-width: 100px;
        padding: 10px 20px;
        font-size: 0.95em;
    }

    .container {
        padding: 10px;
    }
    
    .top-controls {
        top: 10px;
        right: 10px;
        gap: 8px;
    }
    
    .btn-instructions,
    .btn-language {
        padding: 6px 12px;
        font-size: 0.8em;
    }
    
    .theme-select {
        padding: 6px 12px;
        font-size: 0.8em;
        min-width: 90px;
    }
    
    header {
        flex-direction: column;
        text-align: center;
        position: relative;
    }
    
    .header-left {
        position: static;
        transform: none;
        margin-bottom: 15px;
        align-items: center;
    }
    
    .header-center h1 {
        font-size: 2em;
        margin-top: 40px; /* 为语言切换按钮留出空间 */
    }
    
    .game-container {
        flex-direction: column;
        align-items: center;
    }
    
    .left-controls {
        flex-direction: row;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .left-controls .btn {
        width: auto;
        padding: 8px 12px;
        font-size: 0.8em;
    }
    
    #legend {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .legend-item {
        font-size: 1.1em;
        padding: 6px 4px;
        min-height: 40px;
    }
    
    /* 移动设备上的生肖主题样式 - 调整表情符号大小 */
    .legend-item.zodiac-symbol {
        font-size: 1.2em; /* 移动设备上进一步减小 */
    }
    
    .legend-item.zodiac-symbol span {
        font-size: 0.7em; /* 移动设备上进一步减小表情符号 */
    }
    
    #sudokuCanvas {
        width: 100%;
        max-width: 500px;
        height: auto;
    }
    
    .legend-panel {
        height: auto;
        min-height: 400px;
        width: 100%;
        max-width: 500px;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .btn {
        flex: 1;
        min-width: 120px;
    }
    
    .radio-group {
        justify-content: center;
    }
    
    /* 小键盘响应式设计 */
    .number-pad {
        min-width: 280px;
        max-width: 350px;
        padding: 15px;
    }
    
    .number-pad-grid {
        gap: 12px;
    }
    
    .number-btn {
        font-size: 1.6em;
        padding: 15px;
        min-height: 50px;
    }
    
    .pad-action-btn {
        padding: 10px 6px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .custom-theme-inputs {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .custom-theme-description {
        font-size: 0.9em;
        padding: 10px 12px;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-actions .btn {
        width: 100%;
        min-width: auto;
    }

    .top-controls {
        top: 5px;
        right: 5px;
        gap: 6px;
    }
    
    .btn-instructions,
    .btn-language {
        padding: 4px 8px;
        font-size: 0.7em;
    }
    
    .theme-select {
        padding: 4px 8px;
        font-size: 0.7em;
        min-width: 80px;
    }
    
    .header-center h1 {
        font-size: 1.5em;
        margin-top: 35px; /* 为语言切换按钮留出空间 */
    }
    
    #legend {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .legend-item {
        font-size: 1em;
        padding: 5px 3px;
        min-height: 35px;
    }
    
    /* 小屏幕设备上的生肖主题样式 - 调整表情符号大小 */
    .legend-item.zodiac-symbol {
        font-size: 1.0em; /* 小屏幕设备上进一步减小 */
    }
    
    .legend-item.zodiac-symbol span {
        font-size: 0.6em; /* 小屏幕设备上进一步减小表情符号 */
    }
    
    .btn {
        font-size: 1em;
        padding: 10px 15px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    /* 小键盘小屏幕样式 */
    .number-pad {
        min-width: 260px;
        max-width: 320px;
        padding: 12px;
    }
    
    .number-pad-grid {
        gap: 10px;
    }
    
    .number-btn {
        font-size: 1.4em;
        padding: 12px;
        min-height: 45px;
    }
    
    .pad-action-btn {
        padding: 8px 4px;
        font-size: 0.8em;
    }
    
    .number-pad-title {
        font-size: 1.1em;
    }
}

/* iPad特殊优化 */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
    .number-pad {
        min-width: 320px;
        max-width: 380px;
        padding: 25px;
    }
    
    .number-pad-grid {
        gap: 18px;
    }
    
    .number-btn {
        font-size: 2em;
        padding: 25px;
        min-height: 70px;
    }
    
    .pad-action-btn {
        padding: 15px 10px;
        font-size: 1.1em;
    }
    
    .number-pad-title {
        font-size: 1.4em;
    }
    
    .close-pad-btn {
        width: 40px;
        height: 40px;
        font-size: 1.8em;
    }
}

/* 动画效果 */
@keyframes flash {
    0% { background-color: #fff176; }
    50% { background-color: #ffd700; }
    100% { background-color: #fff176; }
}

.flash {
    animation: flash 0.3s ease-in-out;
}

@keyframes highlight {
    0% { background-color: #ffe4e1; }
    50% { background-color: #ffcdd2; }
    100% { background-color: #ffe4e1; }
}

.highlight {
    animation: highlight 0.5s ease-in-out;
}

/* 小键盘样式 */
.number-pad {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 20px;
    z-index: 1000;
    min-width: 300px;
    max-width: 400px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(52, 152, 219, 0.3);
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;
}

.number-pad.dragging {
    transition: none;
    cursor: move;
}

.number-pad.show {
    display: block;
    animation: padFadeIn 0.2s ease-out;
}

.number-pad.show-centered {
    display: block;
    animation: padSlideIn 0.3s ease-out;
}

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

@keyframes padSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.number-pad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
    min-height: 40px;
}

.drag-handle {
    color: #666;
    font-size: 1.2em;
    cursor: move;
    padding: 5px;
    margin-right: 10px;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
}

.drag-handle:hover {
    color: #333;
}


.close-pad-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-touch-callout: none;
}

.close-pad-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.number-pad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.number-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.8em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 20px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-touch-callout: none;
}

.number-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    background: linear-gradient(135deg, #2980b9, #1f4e79);
}

.number-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
}

.number-btn-upload {
    padding: 12px;
}

.number-btn-upload-preview {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.5);
    background-position: center;
    background-size: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.number-btn-upload-preview.has-image {
    border-style: solid;
    color: transparent;
}

.number-pad-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.pad-action-btn {
    flex: 1;
    padding: 12px 8px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-touch-callout: none;
}

.hint-btn {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.hint-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(149, 165, 166, 0.4);
}

.hint-btn.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.pencil-btn {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.pencil-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(149, 165, 166, 0.4);
}

.pencil-btn.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.eraser-btn {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.eraser-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(149, 165, 166, 0.4);
}

.eraser-btn.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 750px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    /* animation: modalSlideIn 0.3s ease-out; */ /* 已取消弹窗打开动画 */
}

/* @keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} */ /* 已取消弹窗打开动画 */

.modal-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 20px 25px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    font-weight: bold;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-body {
    padding: 25px;
    overflow-x: hidden;
}

.custom-theme-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.custom-theme-description {
    color: #5a6c7d;
    font-size: 0.95em;
    line-height: 1.5;
    margin: 0;
    padding: 12px 15px;
    background: linear-gradient(135deg, #e3f2fd, #f0f7ff);
    border-left: 4px solid #3498db;
    border-radius: 6px;
}

.custom-theme-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 5px 0;
    max-width: 100%;
}

.custom-theme-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    padding: 10px 12px;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    min-width: 0;
}

.custom-theme-row:hover {
    background: linear-gradient(135deg, #e3f2fd, #f0f8ff);
    border-color: #bbdefb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.custom-theme-row label {
    font-weight: bold;
    color: white;
    min-width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
}

.custom-theme-row:hover label {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.custom-theme-row input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    background: white;
    color: #2c3e50;
    min-width: 0;
    width: 100%;
}

.custom-theme-row input::placeholder {
    color: #bdc3c7;
    font-weight: normal;
}

.custom-theme-row input:hover {
    border-color: #3498db;
    background: #f8fbff;
}

.custom-theme-row input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.15), 0 4px 12px rgba(52, 152, 219, 0.2);
    background: white;
    transform: scale(1.02);
}

.custom-theme-row input.input-error {
    border-color: #e74c3c;
    background: #ffebee;
    animation: shake 0.3s ease;
}

.custom-theme-row input.input-error:focus {
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.15), 0 4px 12px rgba(231, 76, 60, 0.2);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.custom-theme-row input.custom-symbol-optional {
    opacity: 0.7;
    background: #f5f7fa;
}

.custom-theme-row input.custom-symbol-optional:focus {
    opacity: 1;
    background: white;
}

.custom-theme-error {
    color: #e74c3c;
    font-weight: 600;
    min-height: 1.4em;
    margin: -10px 0 0;
    padding: 10px 15px;
    background: #ffebee;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
    display: none;
}

.custom-theme-error:not(:empty) {
    display: block;
    animation: slideDown 0.3s ease;
}

/* 上传主题样式 */
.upload-theme-description {
    color: #5a6c7d;
    font-size: 0.95em;
    line-height: 1.5;
    margin: 0 0 20px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f0f4ff, #f5fbff);
    border-left: 4px solid #8ab6ff;
    border-radius: 6px;
}

.upload-theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.upload-theme-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fbff, #ffffff);
    border: 1px solid #dfe7f1;
    box-shadow: 0 6px 18px rgba(149, 165, 166, 0.15);
}

.upload-theme-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95em;
}

.upload-preview {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 2px dashed #b0bec5;
    background-color: #fdfdfd;
    background-position: center;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #90a4ae;
    font-size: 0.85em;
    text-align: center;
    padding: 6px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease, background-color 0.3s ease, transform 0.2s ease;
    cursor: pointer;
}

.upload-preview.has-image {
    border-style: solid;
    color: transparent;
    cursor: grab;
}

.upload-preview.dragging {
    cursor: grabbing;
}

.upload-preview.drag-over {
    border-color: #4fc3f7;
    background-color: rgba(79, 195, 247, 0.15);
    color: #4fc3f7;
    transform: scale(1.03);
}

.upload-preview.show-number-active::before,
.number-btn-upload-preview.show-number-active::before,
.legend-upload-preview.show-number-active::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    pointer-events: none;
}

.upload-preview.show-number-active::after,
.number-btn-upload-preview.show-number-active::after,
.legend-upload-preview.show-number-active::after {
    content: attr(data-label);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    pointer-events: none;
}

.upload-preview.show-number-active::after {
    font-size: 1.8em;
    color: #0d47a1;
}

.number-btn-upload-preview.show-number-active::after {
    font-size: 1.3em;
    color: #0d47a1;
}

.legend-upload-preview.show-number-active::after {
    font-size: 1em;
    color: #0d47a1;
}

.upload-theme-options {
    margin: 10px 0 5px;
    display: flex;
    justify-content: flex-end;
}

.upload-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    color: #34495e;
    user-select: none;
}

.upload-option input {
    width: 18px;
    height: 18px;
}

.upload-input {
    font-size: 0.85em;
    border: 1px dashed #b0bec5;
    border-radius: 8px;
    padding: 6px;
    background: #fff;
    cursor: pointer;
}

.upload-theme-error {
    color: #e74c3c;
    font-weight: 600;
    min-height: 1.4em;
    margin: -10px 0 0;
    padding: 10px 15px;
    background: #ffebee;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
    display: none;
}

.upload-theme-error:not(:empty) {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding-top: 10px;
}

.modal-actions .btn {
    min-width: 120px;
    padding: 12px 28px;
    font-size: 1.05em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.modal-actions .btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
}

.modal-actions .btn-secondary:hover {
    background: linear-gradient(135deg, #7f8c8d, #6c7a7b);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(149, 165, 166, 0.4);
}

.modal-actions .btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.modal-actions .btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1f6aa5);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.5);
}

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

.number-btn-custom {
    font-size: 1.2em;
    font-weight: 600;
}

.modal-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-body li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 1.1em;
    line-height: 1.6;
    color: #333;
}

.modal-body li:last-child {
    border-bottom: none;
}

.modal-body strong {
    color: #e74c3c;
    font-weight: bold;
}

