/* 全球偏好设置 - 手风琴样式 */

.global-preferences-wrapper {
    position: relative;
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 触发标签 */
.preferences-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preferences-trigger:hover {
    opacity: 0.7;
}

.preferences-trigger.active .trigger-chevron {
    transform: rotate(180deg);
}

.trigger-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: #000;
    margin-right: 12px;
}

.trigger-title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #000;
    text-align: center;
}

.trigger-chevron {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: #000;
    transition: transform 0.3s ease;
}

/* 下拉内容容器 */
.preferences-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 10px;
    min-width: 400px;
    max-width: 90vw;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 手风琴容器 */
.preferences-accordion {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

/* 手风琴项 */
.accordion-item {
    border-bottom: 1px solid #e0e0e0;
}

.accordion-item:last-child {
    border-bottom: none;
}

/* 手风琴头部 */
.accordion-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    background: #fff;
}

.accordion-header:hover {
    background: #f9f9f9;
}

.accordion-header.active {
    background: #f5f5f5;
}

/* 图标 */
.accordion-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: #666;
    margin-right: 12px;
}

/* 货币图标优化 */
.currency-icon {
    color: #4caf50;
}

/* 语言图标优化 */
.language-icon {
    color: #2196f3;
}

/* 标题 */
.accordion-title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* 箭头图标 */
.chevron-down {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: #999;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.accordion-header.active .chevron-down {
    transform: rotate(180deg);
}

/* Edit 操作按钮 */
.accordion-action {
    margin-left: auto;
    font-size: 14px;
    color: #007bff;
    cursor: pointer;
    padding: 4px 8px;
}

.accordion-action:hover {
    text-decoration: underline;
}

/* 手风琴内容 */
.accordion-content {
    display: none;
    padding: 0 20px 20px 20px;
    background: #fff;
}

.accordion-content.show {
    display: block;
}

/* 地区选择器 */
.region-selector {
    padding-top: 10px;
}

.preference-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.preference-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
}

.preference-select:focus {
    outline: none;
    border-color: #007bff;
}

/* 语言网格布局 - 横向2列 */
.language-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding-top: 10px;
}

.language-item {
    padding: 12px 16px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-item:hover {
    background: #e9ecef;
    border-color: #007bff;
}

.language-item.selected {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

/* 货币弹窗 */
.currency-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.currency-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.currency-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.currency-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.currency-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.close-currency-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-currency-modal:hover {
    background: #f5f5f5;
    color: #333;
}

.currency-modal-body {
    padding: 20px 24px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

.currency-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.currency-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.currency-option:hover {
    background: #e9ecef;
    border-color: #007bff;
}

.currency-option.selected {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

.currency-name {
    font-size: 14px;
    font-weight: 500;
}

.currency-symbol {
    font-size: 16px;
    font-weight: 600;
}

/* 响应式 */
@media (max-width: 480px) {
    .language-grid {
        grid-template-columns: 1fr;
    }
    
    .currency-modal-content {
        width: 95%;
        max-width: none;
    }
}

/* 成功提示 */
.preferences-success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4caf50;
    color: #fff;
    padding: 15px 25px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10001;
    font-size: 14px;
    font-weight: 600;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 手机端简码样式 - 只显示地球图标 */
.global-preferences-mobile .preferences-trigger-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    cursor: pointer;
}

.global-preferences-mobile .preferences-trigger-mobile .trigger-icon {
    margin-right: 0;
    width: 24px;
    height: 24px;
}

.global-preferences-mobile .preferences-dropdown-mobile {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    transform: none;
    margin-top: 10px;
    min-width: 320px;
    max-width: 95vw;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
