/**
 * 云存档系统样式
 * 包含：存档选择UI、存档槽位选择UI、游戏内存档UI
 */

/* ============================================
   存档槽位选择 UI
   ============================================ */
.save-slot-selection-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
}

.save-slot-selection-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.save-slot-selection-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 40px;
    box-sizing: border-box;
}

.save-slot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.save-slot-back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.save-slot-back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.save-slot-title {
    color: #ffd700;
    font-size: 32px;
    font-weight: bold;
    margin: 0;
}

.save-slot-spacer {
    width: 100px;
}

.save-slots-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 20px;
    overflow-y: auto;
}

.save-slot-item {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
}

.save-slot-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
    transform: translateY(-5px);
}

.save-slot-item.selected {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.save-slot-empty-icon {
    font-size: 64px;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 15px;
}

.save-slot-empty-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
}

.save-slot-time {
    color: #ffd700;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 12px;
}

.save-slot-info {
    text-align: center;
}

.save-slot-characters {
    color: white;
    font-size: 14px;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    max-width: 280px;
}

.save-slot-char {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    min-width: 48px;
}

.save-slot-char-img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.save-slot-char-img-placeholder {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.save-slot-char-lv {
    font-size: 10px;
    color: #ffd700;
    font-weight: bold;
    white-space: nowrap;
}

.save-slot-no-chars {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.save-slot-details {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    margin-top: 4px;
}

.save-slot-footer {
    display: flex;
    gap: 20px;
    justify-content: center;
    padding: 20px;
}

.save-slot-confirm-btn,
.save-slot-cancel-btn {
    padding: 15px 50px;
    font-size: 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.save-slot-confirm-btn {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #1a1a2e;
}

.save-slot-confirm-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

.save-slot-confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.save-slot-cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.save-slot-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   游戏内存档 UI
   ============================================ */
.ingame-save-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
}

.ingame-save-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.ingame-save-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 600px;
    background: linear-gradient(135deg, #2a2a4a 0%, #1a1a2e 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    overflow: hidden;
}

.ingame-save-sidebar {
    width: 200px;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px 0;
}

.save-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.save-tab:hover {
    background: rgba(255, 255, 255, 0.05);
}

.save-tab.active {
    background: rgba(255, 215, 0, 0.1);
    border-left-color: #ffd700;
}

.save-tab .tab-icon {
    font-size: 32px;
}

.save-tab .tab-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.save-tab.active .tab-text {
    color: #ffd700;
    font-weight: bold;
}

.ingame-save-main {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.save-tab-title {
    color: #ffd700;
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 25px 0;
}

.save-action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.save-primary-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.save-primary-btn .btn-icon {
    font-size: 20px;
}

.save-slots-container {
    margin-bottom: 25px;
}

.save-slots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.ingame-save-slot {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 150px;
    display: flex;
    flex-direction: column;
}

.ingame-save-slot:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ingame-save-slot.selected {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.ingame-save-slot.empty {
    opacity: 0.5;
}

.save-slot-empty {
    color: rgba(255, 255, 255, 0.4);
    font-size: 16px;
    text-align: center;
}

.ingame-save-slot .save-slot-time {
    font-size: 16px;
    margin-bottom: 15px;
}

.save-slot-characters {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.character-mini {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.character-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.save-modal-footer {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.save-modal-confirm-btn,
.save-modal-cancel-btn {
    padding: 12px 40px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.save-modal-confirm-btn {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #1a1a2e;
}

.save-modal-confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.save-modal-cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 声音设置 */
.sound-settings {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sound-setting-item {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sound-label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 120px;
    color: white;
    font-size: 16px;
}

.sound-icon {
    font-size: 24px;
}

.sound-slider {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    outline: none;
}

.sound-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #ffd700;
    border-radius: 50%;
    cursor: pointer;
}

.sound-value {
    min-width: 40px;
    text-align: right;
    color: #ffd700;
    font-weight: bold;
}

.game-settings-placeholder {
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 50px;
    font-size: 18px;
}

/* Banner 提示 */
.save-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(76, 175, 80, 0.95);
    color: white;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    z-index: 10002;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.save-banner.show {
    opacity: 1;
}
