﻿/**
 * 商家设置 UI 样式
 * Phase 3: 商家中心前端样式
 */

/* ========== 商家设置容器 ========== */
.merchant-settings-container {
    padding: 16px;
}

/* ========== 顶部状态卡片 ========== */
.merchant-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(252, 213, 53, 0.1) 0%, rgba(33, 150, 243, 0.1) 100%);
    border: 1px solid rgba(252, 213, 53, 0.3);
}

.status-left h2 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
}

.shop-id {
    margin: 0;
    font-size: 12px;
    color: #B7BDC6;
}

.status-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ========== 营业状态开关 ========== */
.status-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2B3139;
    transition: 0.3s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.status-label {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

/* ========== 统计卡片网格 ========== */
.merchant-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    text-align: center;
    padding: 16px 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #FCD535;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: #B7BDC6;
}

/* ========== Tab导航 ========== */
.settings-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.settings-tabs::-webkit-scrollbar {
    height: 4px;
}

.settings-tabs::-webkit-scrollbar-thumb {
    background: #2B3139;
    border-radius: 4px;
}

.settings-tab {
    flex: 1;
    min-width: 110px;
    padding: 12px 16px;
    background: #1E2329;
    border: 1px solid #2B3139;
    border-radius: 12px;
    color: #B7BDC6;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.settings-tab:hover {
    background: #2B3139;
    border-color: #474D57;
}

.settings-tab.active {
    background: rgba(252, 213, 53, 0.1);
    border-color: #FCD535;
    color: #FCD535;
}

.settings-tab span {
    display: inline-block;
}

/* ========== Tab内容区 ========== */
.settings-tab-content {
    min-height: 300px;
}

.settings-section {
    padding: 20px;
    margin-bottom: 16px;
}

.settings-section h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
}

.section-desc {
    margin: 0 0 16px 0;
    font-size: 13px;
    color: #B7BDC6;
}

/* ========== 表单元素 ========== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #FFFFFF;
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #B7BDC6;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px;
    background: #0B0E11;
    border: 1px solid #2B3139;
    border-radius: 8px;
    color: #FFFFFF;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #FCD535;
    background: #1E2329;
}

.form-input-disabled {
    width: 100%;
    padding: 12px;
    background: #1E2329;
    border: 1px solid #2B3139;
    border-radius: 8px;
    color: #707A8A;
    font-size: 14px;
    cursor: not-allowed;
    box-sizing: border-box;
}

.input-error {
    border-color: #F6465D !important;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.char-counter {
    text-align: right;
    font-size: 12px;
    color: #B7BDC6;
    margin-top: 4px;
}

.required {
    color: #F6465D;
}

.form-row {
    display: flex;
    gap: 12px;
}

/* ========== 广告卡片 ========== */
.ad-card {
    background: #0B0E11;
    border: 1px solid #2B3139;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.ad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ad-title {
    font-size: 15px;
    font-weight: 600;
    color: #FCD535;
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(246, 70, 93, 0.1);
}

.ad-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-hint {
    padding: 40px 20px;
    text-align: center;
    color: #707A8A;
    font-size: 14px;
}

.hint-text {
    text-align: center;
    color: #707A8A;
    font-size: 13px;
    margin: 12px 0;
}

/* ========== 链选择器 ========== */
.chain-selector {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.chain-option {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #0B0E11;
    border: 1px solid #2B3139;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    min-width: 120px;
}

.chain-option:hover {
    border-color: #474D57;
    background: #1E2329;
}

.chain-option input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.chain-option input[type="checkbox"]:checked + span {
    color: #FCD535;
    font-weight: 600;
}

.chain-option span {
    font-size: 14px;
    color: #FFFFFF;
}

/* ========== 地址字段 ========== */
.address-fields {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid #2B3139;
}

.address-fields label {
    font-size: 13px;
    color: #B7BDC6;
    margin-bottom: 8px;
}

.address-fields small {
    display: block;
    font-size: 11px;
    color: #707A8A;
    margin-bottom: 4px;
}

/* ========== 按钮 ========== */
.btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #FCD535 0%, #F0B90B 100%);
    color: #000000;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(252, 213, 53, 0.4);
}

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

.btn-outline {
    background: transparent;
    border: 1px solid #2B3139;
    color: #FFFFFF;
}

.btn-outline:hover {
    background: #2B3139;
    border-color: #474D57;
}

.btn-full {
    width: 100%;
}

/* ========== 响应式 ========== */
@media (max-width: 400px) {
    .merchant-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .settings-tab {
        min-width: 90px;
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .chain-option {
        min-width: 100px;
    }
}

/* ========== 卡片基础样式 ========== */
.card {
    background: #1E2329;
    border-radius: 16px;
    border: 1px solid #2B3139;
}

/* ========== Toast提示 (继承全局样式) ========== */
/* 全局toast样式定义在mobile.css中 */
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}
