/* 基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Source Han Sans CN", "Noto Sans SC", "Arial", sans-serif;
    background-color: #f5f5f5;
    color: #333333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 品牌颜色变量 */
:root {
    --brand-red: #B71C1C;
    --brand-red-dark: #981218;
    --brand-red-light: #FFF5F5;
    --aux-color-yellow: #D4A04F;
    --aux-color-green: #2E5939;
    --text-dark: #333333;
    --text-medium: #666666;
    --text-light: #999999;
    --bg-white: #FFFFFF;
    --bg-light: #F5F5F5;
    --border-color: #ddd;
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --error-color: #F44336;
}

/* 主容器 */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100%;
    box-sizing: border-box;
}

/* 顶部导航 */
.navbar {
    background-color: var(--brand-red);
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 40px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Logo样式 */
.logo {
    color: white;
    font-size: 24px;
    font-weight: 600;
    font-family: "Source Han Sans CN", "Noto Sans SC", "Arial", sans-serif;
}

.navbar-logo {
    height: 40px;
}

.navbar-title {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin-left: 20px;
}

/* 工作区布局 */
.workspace {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    background-color: var(--bg-white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 0 0 0 20px;
    min-height: 0;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .workspace {
        grid-template-columns: 1fr;
    }
    
    .navbar {
        padding: 0 20px;
        height: 60px;
    }
    
    .navbar-title {
        font-size: 16px;
    }
}

/* 增强响应式设计 */
@media (max-width: 1024px) {
    .main-container {
        padding: 15px;
    }
    
    .workspace {
        padding: 0 0 0 15px;
    }
    
    .config-panel,
    .preview-panel {
        width: 100%;
    }
    
    .preview-container {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 10px;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab {
        text-align: center;
    }
    
    .toolbar {
        flex-direction: column;
    }
    
    .toolbar-left,
    .toolbar-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .modal {
        width: 100%;
        margin: 10px;
    }
    

}

@media (max-width: 480px) {
    .navbar-title {
        font-size: 14px;
    }
    
    button {
        padding: 8px 15px;
        font-size: 13px;
    }
    
    .config-panel,
    .preview-panel {
        padding: 15px;
    }
    
    .preview-image {
        max-width: 90%;
    }
    
    .size-option {
        padding: 8px 12px;
        font-size: 11px;
    }
}

/* 配置面板 */
.config-panel {
    background-color: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
}

/* 标签页 */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    white-space: nowrap;
}

/* 标签内容 */
.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

.tab {
    padding: 15px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: var(--text-medium);
    font-size: 14px;
    transition: all 0.3s ease;
    font-weight: 500;
}

/* 背景项样式 */
.bg-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.bg-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.bg-item:hover .bg-image-container img {
    transform: scale(1.05);
}

/* 删除背景按钮样式 */
.delete-bg-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
    padding: 0;
}

.bg-item:hover .delete-bg-btn {
    opacity: 1;
}

.delete-bg-btn:hover {
    background-color: var(--error-color);
    transform: scale(1.1);
}

.delete-bg-btn svg {
    pointer-events: none;
}

.tab.active {
    color: var(--brand-red);
    border-bottom: 2px solid var(--brand-red);
    font-weight: 600;
}

.tab:hover:not(.active) {
    color: var(--text-dark);
    background-color: var(--bg-light);
}

/* 配置内容 */
.config-content {
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
}

.config-section {
    margin-bottom: 25px;
}

.config-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-dark);
}

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

.config-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 500;
}

.config-group input[type="text"],
.config-group input[type="number"],
.config-group select,
.config-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.config-group input:focus,
.config-group select:focus,
.config-group textarea:focus {
    outline: none;
    border-color: var(--brand-red);
    box-shadow: 0 0 0 2px rgba(183, 28, 28, 0.1);
}

.config-group input[type="color"] {
    width: 50px;
    height: 35px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 3px;
    cursor: pointer;
}

.config-group input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.config-group .checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: normal;
}

/* 预览面板 */
.preview-panel {
    background-color: var(--bg-white);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.preview-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.preview-size-toggle {
    display: flex;
    gap: 10px;
}

.size-option {
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.size-option.active {
    background-color: var(--brand-red);
    color: white;
    border-color: var(--brand-red);
}

.preview-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: var(--bg-light);
    min-height: 400px;
    position: relative; /* 为下载按钮定位 */
}

#preview-canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: opacity 0.3s ease;
}

/* 下载按钮样式 */
.download-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    transform: translate(-50%, -50%); /* 让按钮中心点与右下角拐角点重叠 */
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: rgba(183, 28, 28, 0.95);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 10;
}

.download-btn svg {
    width: 16px;
    height: 16px;
}

/* 鼠标悬停在容器上时显示下载按钮 */
.preview-container:hover .download-btn {
    opacity: 1;
    pointer-events: auto;
}

.download-btn:hover {
    background-color: rgba(152, 18, 24, 0.95);
    transform: translate(-50%, -50%) translateY(-2px); /* 保持中心点位置，只添加上移效果 */
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.download-btn:active {
    transform: translate(-50%, -50%) translateY(0); /* 保持中心点位置，恢复Y轴偏移 */
}

/* 底部工具栏 */
.toolbar {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-white);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.toolbar-left,
.toolbar-right {
    display: flex;
    gap: 10px;
}

/* 按钮样式 */
button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--brand-red);
    color: white;
}

.btn-primary:hover {
    background-color: var(--brand-red-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

/* 按钮禁用状态 */
.btn:disabled,
.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #45a049;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #e68900;
}

/* 消息提示 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.message.show {
    opacity: 1;
    transform: translateY(0);
}

.message.success {
    background-color: var(--success-color);
}

.message.error {
    background-color: var(--error-color);
}

.message.warning {
    background-color: var(--warning-color);
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 模态框内容容器（被移除，使用下方统一的.modal定义） */

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-medium);
    padding: 5px;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

/* 配置列表 */
.config-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.config-item {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;  /* 改为顶部对齐 */
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.config-item > label {
    min-width: 120px;  /* label固定宽度 */
    padding-top: 2px;  /* 微调对齐 */
}



/* 单选按钮组样式 */
.radio-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.radio-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-white);
    transition: all 0.2s ease;
    user-select: none;
}

.radio-label:hover {
    background-color: var(--bg-light);
    border-color: var(--brand-red);
}

.radio-label input[type="radio"] {
    margin-right: 6px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--brand-red);
}

.radio-label input[type="radio"]:checked + span {
    color: var(--brand-red);
    font-weight: 600;
}

.radio-label:has(input[type="radio"]:checked) {
    background-color: var(--brand-red-light);
    border-color: var(--brand-red);
}

/* 极简提示样式 */
.simple-notice {
    margin-bottom: 24px;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border-left: 4px solid #4a90e2;
    border-radius: 4px;
}

.simple-notice p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.simple-notice strong {
    color: #333;
}

.triangle-info {
    flex: 1;
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

.triangle-info p {
    margin: 0 0 8px 0;
}

/* 国旗选择器样式 */
.current-flag-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-white);
}

.current-flag-display img {
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.current-flag-display span {
    flex: 1;
    font-weight: 500;
    color: var(--text-dark);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
    overflow: auto;
}

.modal-content {
    position: relative;
    background-color: var(--bg-white);
    margin: 50px auto;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.modal-body {
    padding: 20px 0;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

/* 搜索框样式 */
.search-container {
    margin: 0 24px 20px 24px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px rgba(183, 28, 28, 0.1);
}

/* 国旗网格容器 */
.flag-grid-container {
    flex: 1;
    overflow: hidden;
    border: none;
    border-radius: 0;
    background-color: var(--bg-white);
}

.flag-virtual-scroller {
    overflow-y: auto;
    height: 400px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    border-top: 1px solid #f0f0f0;
    grid-auto-rows: 95px;
}

/* 国旗行样式 */
.flag-row {
    display: flex;
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
}

.flag-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 8px;
    background-color: var(--bg-white);
    max-height: 95px;
    height: 95px;
}

.flag-item:nth-child(6n) {
    border-right: none;
}

/* 当搜索结果不足一行时，最后一个也去掉右边框 */
.flag-virtual-scroller:has(.flag-item:nth-child(-n+6)) .flag-item:last-child {
    border-right: none;
}

.flag-item:hover {
    background-color: var(--brand-red-light);
}

.flag-item.selected {
    background-color: var(--brand-red);
    color: white;
}

.flag-item.empty {
    cursor: default;
    background-color: transparent;
}

.flag-item.empty:hover {
    background-color: transparent;
}

.flag-icon {
    width: 60px;
    height: 45px;
    object-fit: contain;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    flex-shrink: 0;
}

.flag-name {
    font-size: 12px;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
    line-height: 1.2;
    font-weight: 500;
    flex-shrink: 0;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        margin: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }
    
    .flag-item {
        padding: 6px 8px;
        gap: 6px;
    }
    
    .flag-icon {
        width: 20px;
        height: 13px;
    }
    
    .flag-name {
        font-size: 11px;
    }
}

.config-item:hover {
    background-color: var(--brand-red-light);
    border-color: var(--brand-red);
}

.config-item.selected {
    background-color: var(--brand-red-light);
    border-color: var(--brand-red);
}

.config-item-name {
    font-weight: 500;
    color: var(--text-dark);
}

.config-item-date {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

.config-item-actions {
    display: flex;
    gap: 5px;
}

.config-item-btn {
    padding: 5px 10px;
    font-size: 12px;
}

/* 预设列表 */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.preset-item {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.preset-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: var(--brand-red);
}

.preset-item.selected {
    border-color: var(--brand-red);
    background-color: var(--brand-red-light);
}

.preset-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.preset-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

/* 加载动画 */
.loader {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 3px solid var(--brand-red);
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
    margin-left: 5px;
    color: var(--text-light);
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: var(--text-dark);
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    font-weight: normal;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 背景网格包装器 */
.bg-grid-wrapper {
    position: relative;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 当grid为空时隐藏wrapper */
.bg-grid-wrapper:has(.bg-grid:empty) {
    display: none;
}

/* 背景网格样式 */
.bg-grid {
    display: grid;
    grid-template-columns: repeat(3, 120px);  /* 每个图片120px */
    gap: 10px;
    /* 移除 min-height，避免空列表时占据空间 */
}

/* 酒瓶背景：5个图片一排 */
#bottle-bg-grid {
    grid-template-columns: repeat(5, 120px);
}

.bg-item {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    aspect-ratio: 1;  /* 保持正方形 */
    background-color: var(--bg-light);
    width: 100%;  /* 占满网格列宽 */
}

.bg-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bg-item:hover {
    border-color: var(--brand-red);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(183, 28, 28, 0.2);
    z-index: 1;
}

.bg-item.selected {
    border-color: var(--brand-red);
    border-width: 3px;
    box-shadow: 0 0 0 2px rgba(183, 28, 28, 0.1);
}

.bg-empty {
    display: none;  /* 默认隐藏，由 JS 控制显示 */
    align-items: center;
    justify-content: center;
    background-color: var(--bg-light);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    min-height: 120px;
    padding: 20px;
    text-align: center;
}

.bg-empty p {
    color: var(--text-light);
    font-size: 14px;
    margin: 0;
}

/* 上传进度样式 */
.upload-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.upload-progress span {
    font-size: 14px;
    color: var(--text-medium);
}

progress {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    border: none;
    background-color: var(--bg-light);
}

progress::-webkit-progress-bar {
    background-color: var(--bg-light);
    border-radius: 4px;
}

progress::-webkit-progress-value {
    background-color: var(--brand-red);
    border-radius: 4px;
}

progress::-moz-progress-bar {
    background-color: var(--brand-red);
    border-radius: 4px;
}

/* ============================================
   手风琴样式（基础设置专用）
   ============================================ */
.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0;
    overflow: hidden;
    background-color: var(--bg-white);
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 20px;
    background-color: var(--bg-light);
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.header-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-content > span:first-child {
    width: 120px;
    flex-shrink: 0;
}

.header-description {
    font-size: 12px;
    font-weight: normal;
    color: #666;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.accordion-header:hover {
    background-color: #e8e8e8;
}

.accordion-header.active {
    background-color: var(--brand-red-light);
    color: var(--brand-red);
}

.accordion-icon {
    font-size: 12px;
    transition: color 0.3s ease;
    color: var(--text-medium);
}

.accordion-header.active .accordion-icon {
    color: var(--brand-red);
}

.accordion-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 20px;
}

.accordion-content.collapsed {
    max-height: 0;
    padding: 0 20px;
}

/* 保存按钮区域 */
.save-button-area {
    position: fixed;
    bottom: 20px;
    left: 20px;
    text-align: center;
    padding: 15px 20px;
    z-index: 1000;
}

.save-button-area button {
    min-width: 150px;
}

/* 复选框组样式 */
.checkbox-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-white);
    transition: all 0.2s ease;
    user-select: none;
    flex: 1 1 auto;
    min-width: 80px;
    justify-content: center;
}

.checkbox-label:hover {
    background-color: var(--bg-light);
    border-color: var(--brand-red);
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--brand-red);
}

.checkbox-label input[type="checkbox"]:checked + span {
    color: var(--brand-red);
    font-weight: 600;
}

.checkbox-label:has(input[type="checkbox"]:checked) {
    background-color: var(--brand-red-light);
    border-color: var(--brand-red);
}

/* Loading提示样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    max-width: 400px;
}

.loading-content h2 {
    color: var(--brand-red);
    margin: 20px 0 10px 0;
    font-size: 24px;
}

.loading-content p {
    color: var(--text-medium);
    font-size: 16px;
    line-height: 1.5;
}

.loading-subtext {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 5px;
}

/* 旋转动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(183, 28, 28, 0.2);
    border-top: 5px solid var(--brand-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
