/* ==================== 管理页面样式 ==================== */

.admin-section {
    padding: 12px;
}

.import-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.import-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.import-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

/* 文件上传区域 */
.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 16px;
    transition: all 0.3s;
}

.file-upload:hover {
    border-color: var(--primary-color);
}

.file-upload.has-file {
    border-color: var(--success-color);
    border-style: solid;
}

.upload-placeholder {
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    display: block;
}

.upload-placeholder p {
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 0.75rem !important;
    color: var(--text-tertiary) !important;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #f6ffed;
}

.file-name {
    font-size: 0.875rem;
    color: var(--text-primary);
    word-break: break-all;
}

.btn-remove {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 8px;
}

.btn-remove:active {
    color: var(--error-color);
}

/* 按钮样式 */
.btn-primary {
    width: 100%;
    padding: 14px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:disabled {
    background: #d9d9d9;
    cursor: not-allowed;
}

.btn-primary:not(:disabled):active {
    background: var(--primary-dark);
}

.btn-refresh {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    margin-top: 12px;
}

.btn-refresh:active {
    background: #f5f5f5;
}

/* 进度条 */
.progress-bar {
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    margin-top: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-color);
    transition: width 0.3s;
    animation: progress-animation 1.5s ease-in-out infinite;
}

@keyframes progress-animation {
    0% {
        width: 0%;
        margin-left: 0%;
    }
    50% {
        width: 40%;
        margin-left: 30%;
    }
    100% {
        width: 0%;
        margin-left: 100%;
    }
}

/* 日志区域 */
.logs-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 12px;
    box-shadow: var(--shadow);
}

.logs-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.logs-list {
    max-height: 300px;
    overflow-y: auto;
}

.log-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.log-item:last-child {
    border-bottom: none;
}

.log-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-right: 12px;
    flex-shrink: 0;
}

.log-icon.success {
    background: #f6ffed;
}

.log-icon.error {
    background: #fff2f0;
}

.log-content {
    flex: 1;
    min-width: 0;
}

.log-title {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.log-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.log-status {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: 8px;
}

.log-status.success {
    background: #f6ffed;
    color: var(--success-color);
}

.log-status.failed {
    background: #fff2f0;
    color: var(--error-color);
}

/* 预览区域 */
.preview-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 12px;
    box-shadow: var(--shadow);
}

.preview-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.preview-content {
    max-height: 300px;
    overflow: auto;
    background: #fafafa;
    padding: 12px;
    border-radius: var(--radius);
}

.preview-table {
    width: 100%;
    font-size: 0.75rem;
    border-collapse: collapse;
}

.preview-table th,
.preview-table td {
    padding: 6px 8px;
    text-align: left;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.preview-table th {
    background: #f0f0f0;
    font-weight: 500;
}

/* 成功/失败提示 */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 0.875rem;
}

.alert-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: var(--success-color);
}

.alert-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: var(--error-color);
}

/* ==================== 价格增幅设置样式 ==================== */

.price-adjustment-section {
    margin-top: 8px;
}

.section-header {
    margin-bottom: 16px;
}

/* 退出登录按钮 */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.3);
}

/* 全局设置行 */
.global-setting-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9375rem;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

.setting-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group input {
    width: 100px;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    text-align: center;
    transition: all 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-suffix {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 国家设置头部 */
.country-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.header-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.btn-add-country {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add-country:disabled {
    background: #d9d9d9;
    cursor: not-allowed;
}

.btn-add-country:not(:disabled):active {
    background: var(--primary-dark);
}

/* 国家设置列表 */
.country-settings-list {
    min-height: 60px;
    max-height: 300px;
    overflow-y: auto;
    background: #f8fafc;
    border-radius: var(--radius);
    padding: 8px;
}

.empty-tip {
    text-align: center;
    padding: 24px;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.country-setting-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: var(--radius);
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.country-setting-item:last-child {
    margin-bottom: 0;
}

.country-info {
    flex: 1;
    min-width: 0;
}

.country-name {
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 500;
}

.percent-input-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.percent-input {
    width: 80px;
    padding: 8px 10px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    text-align: center;
    transition: all 0.3s;
}

.percent-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-remove-country {
    width: 32px;
    height: 32px;
    border: none;
    background: #fff2f0;
    color: var(--error-color);
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s;
}

.btn-remove-country:active {
    background: var(--error-color);
    color: white;
}

/* 设置操作按钮 */
.setting-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.btn-secondary {
    flex: 1;
    padding: 14px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:active {
    background: #f5f5f5;
}

.setting-actions .btn-primary {
    flex: 2;
}

/* 添加国家弹窗 */
.country-search {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.country-search input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    transition: all 0.3s;
    box-sizing: border-box;
}

.country-search input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.country-list-container {
    max-height: 60vh;
    overflow-y: auto;
    padding: 8px;
}

.continent-group {
    margin-bottom: 16px;
}

.continent-group:last-child {
    margin-bottom: 0;
}

.continent-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.country-option {
    padding: 12px;
    background: #f8fafc;
    border: 2px solid transparent;
    border-radius: var(--radius);
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
}

.country-option:hover {
    border-color: var(--primary-color);
    background: white;
}

.country-option:active {
    background: var(--primary-color);
    color: white;
}

/* ==================== 用户管理样式 ==================== */
.user-management-section {
    margin-top: 8px;
}

.user-list-container {
    max-height: 400px;
    overflow-y: auto;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    background: #f8fafc;
    border-radius: var(--radius);
    margin-bottom: 10px;
}

.user-item:last-child {
    margin-bottom: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.user-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.user-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 500;
}

.user-badge.admin {
    background: #e6f7ff;
    color: var(--primary-color);
}

.user-badge.readonly {
    background: #f6ffed;
    color: var(--success-color);
}

.user-badge.inactive {
    background: #fff2f0;
    color: var(--error-color);
}

.user-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-user-action {
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-user-action.edit {
    background: #e6f7ff;
    color: var(--primary-color);
}

.btn-user-action.edit:active {
    background: var(--primary-color);
    color: white;
}

.btn-user-action.toggle {
    background: #fffbe6;
    color: #fa8c16;
}

.btn-user-action.toggle:active {
    background: #fa8c16;
    color: white;
}

.btn-user-action.toggle.enable {
    background: #f6ffed;
    color: var(--success-color);
}

.btn-user-action.toggle.enable:active {
    background: var(--success-color);
    color: white;
}

.btn-user-action.delete {
    background: #fff2f0;
    color: var(--error-color);
}

.btn-user-action.delete:active {
    background: var(--error-color);
    color: white;
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    transition: all 0.3s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-actions .btn-secondary,
.modal-actions .btn-primary {
    flex: 1;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .global-setting-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .country-settings-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .setting-actions {
        flex-direction: column;
    }
    
    .setting-actions .btn-primary,
    .setting-actions .btn-secondary {
        flex: none;
        width: 100%;
    }
    
    .country-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .btn-logout .logout-text {
        display: none;
    }
}
