/**
 * 智橙同城电商服务系统 - 公共样式（响应式版本）
 * 配色：橙色 + 蓝色，清新风格
 * 适配：电脑 / 平板 / 手机 / 微信小程序 WebView
 */

:root {
    --primary-orange: #FF6B35;
    --primary-orange-light: #FF8C5A;
    --primary-orange-dark: #E55A2B;
    --primary-blue: #4A90D9;
    --primary-blue-light: #6BA5E7;
    --primary-blue-dark: #3A7BC8;
    --success-green: #27AE60;
    --warning-yellow: #F39C12;
    --danger-red: #E74C3C;
    --info-cyan: #00BCD4;
    --text-dark: #2C3E50;
    --text-gray: #7F8C8D;
    --text-light: #95A5A6;
    --bg-white: #FFFFFF;
    --bg-light: #F8F9FA;
    --bg-gray: #ECF0F1;
    --border-color: #E1E8ED;
    --gradient-orange: linear-gradient(135deg, #FF6B35, #FF8C5A);
    --gradient-blue: linear-gradient(135deg, #4A90D9, #6BA5E7);
    --gradient-mixed: linear-gradient(135deg, #FF6B35, #4A90D9);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --container-padding: 2rem;
    --header-height: 60px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.6;
    background: linear-gradient(135deg, #F5F7FA 0%, #E8EDF2 100%);
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* ========== 容器 ========== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--container-padding);
}

/* ========== 头部导航 ========== */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem var(--container-padding);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: var(--header-height);
}

.logo { display: flex; align-items: center; gap: 0.75rem; }

.logo-icon {
    width: 40px; height: 40px;
    background: var(--gradient-mixed);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: bold; font-size: 1.2rem;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.25rem; font-weight: 600;
    background: var(--gradient-mixed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-info { display: flex; align-items: center; gap: 0.75rem; }

.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--gradient-blue); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; flex-shrink: 0;
}

/* 汉堡菜单按钮 */
.menu-toggle {
    display: none;
    background: none; border: none; cursor: pointer;
    padding: 0.5rem; font-size: 1.5rem; color: var(--text-dark);
}

/* ========== 卡片 ========== */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-gray);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.card-title { font-size: 1.1rem; font-weight: 600; color: var(--text-dark); }

/* ========== 按钮 ========== */
.btn {
    padding: 0.6rem 1.25rem; border: none; border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 500; cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex; align-items: center; gap: 0.5rem;
    white-space: nowrap;
    min-height: 38px;
    -webkit-appearance: none;
}

.btn-primary {
    background: var(--gradient-orange); color: white;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4); }

.btn-secondary {
    background: var(--gradient-blue); color: white;
    box-shadow: 0 2px 8px rgba(74, 144, 217, 0.3);
}
.btn-secondary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(74, 144, 217, 0.4); }

.btn-outline {
    background: transparent; border: 1px solid var(--border-color); color: var(--text-gray);
}
.btn-outline:hover { background: var(--bg-light); border-color: var(--primary-blue); color: var(--primary-blue); }

.btn-success { background: var(--success-green); color: white; }
.btn-danger { background: var(--danger-red); color: white; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; min-height: 30px; }
.btn-lg { padding: 0.8rem 1.5rem; font-size: 1rem; min-height: 44px; }

/* ========== 表单 ========== */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: var(--text-dark); }

.form-input, .form-select, .form-textarea {
    width: 100%; padding: 0.75rem 1rem;
    border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    font-size: 0.9rem; transition: border-color 0.3s, box-shadow 0.3s;
    -webkit-appearance: none; appearance: none;
    min-height: 44px;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

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

/* ========== 表格（桌面端） ========== */
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
    background: var(--bg-light); padding: 0.875rem 1rem;
    text-align: left; font-weight: 600; font-size: 0.85rem;
    color: var(--text-gray); border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 0.875rem 1rem; border-bottom: 1px solid var(--border-color);
}

.data-table tr:hover { background: var(--bg-light); }

/* ========== 状态标签 ========== */
.status-badge {
    display: inline-block; padding: 0.25rem 0.75rem;
    border-radius: 20px; font-size: 0.75rem; font-weight: 500;
}
.status-active, .status-operating, .status-approved { background: rgba(39, 174, 96, 0.15); color: var(--success-green); }
.status-pending { background: rgba(243, 156, 18, 0.15); color: var(--warning-yellow); }
.status-suspended, .status-expired, .status-rejected { background: rgba(231, 76, 60, 0.15); color: var(--danger-red); }

/* ========== 统计卡片 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem; margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-white); border-radius: var(--radius-lg);
    padding: 1.5rem; box-shadow: var(--shadow-sm);
    display: flex; align-items: center; gap: 1rem;
    transition: transform 0.3s, box-shadow 0.3s;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.stat-icon {
    width: 56px; height: 56px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; flex-shrink: 0;
}
.stat-icon.orange { background: rgba(255, 107, 53, 0.15); }
.stat-icon.blue { background: rgba(74, 144, 217, 0.15); }
.stat-icon.green { background: rgba(39, 174, 96, 0.15); }
.stat-icon.yellow { background: rgba(243, 156, 18, 0.15); }

.stat-info { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: 0.85rem; color: var(--text-gray); margin-bottom: 0.25rem; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-dark); word-break: break-all; }

/* ========== 标签页 ========== */
.tabs {
    display: flex; gap: 0.5rem; margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--bg-gray);
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
    padding: 0.75rem 1.5rem; background: transparent; border: none;
    border-bottom: 3px solid transparent; cursor: pointer;
    font-size: 0.9rem; color: var(--text-gray);
    transition: all 0.3s; margin-bottom: -2px; white-space: nowrap;
    flex-shrink: 0;
}
.tab-btn:hover { color: var(--primary-blue); }
.tab-btn.active { color: var(--primary-orange); border-bottom-color: var(--primary-orange); font-weight: 600; }

/* ========== 模态框 ========== */
.modal {
    display: none; position: fixed; top: 0; left: 0;
    width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5);
    z-index: 1000; justify-content: center; align-items: center;
    padding: 1rem;
}
.modal.active { display: flex; }

.modal-content {
    background: var(--bg-white); border-radius: var(--radius-lg);
    width: 100%; max-width: 500px; max-height: 90vh;
    overflow-y: auto; animation: modalSlideIn 0.3s ease;
    -webkit-overflow-scrolling: touch;
}

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

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-color);
}
.modal-title { font-size: 1.1rem; font-weight: 600; }
.modal-close { font-size: 1.5rem; color: var(--text-gray); cursor: pointer; background: none; border: none; }
.modal-body { padding: 1.5rem; }
.modal-footer {
    padding: 1rem 1.5rem; border-top: 1px solid var(--border-color);
    display: flex; justify-content: flex-end; gap: 0.75rem;
    flex-wrap: wrap;
}

/* ========== 分页 ========== */
.pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 0.5rem; margin-top: 1.5rem; flex-wrap: wrap;
}

.page-btn {
    padding: 0.5rem 0.75rem; border: 1px solid var(--border-color);
    background: var(--bg-white); border-radius: var(--radius-sm);
    cursor: pointer; transition: all 0.2s; min-height: 36px;
}
.page-btn:hover:not(:disabled) { background: var(--primary-blue); color: white; border-color: var(--primary-blue); }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.page-btn.active { background: var(--primary-orange); color: white; border-color: var(--primary-orange); }

/* ========== 步骤条 ========== */
.steps { display: flex; justify-content: space-between; margin-bottom: 2rem; }

.step { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
.step::after {
    content: ''; position: absolute; top: 20px; left: 50%;
    width: 100%; height: 2px; background: var(--border-color);
}
.step:last-child::after { display: none; }

.step-circle {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--bg-gray); display: flex; align-items: center; justify-content: center;
    font-weight: 600; color: var(--text-gray); position: relative; z-index: 1;
}
.step.completed .step-circle { background: var(--success-green); color: white; }
.step.active .step-circle { background: var(--primary-orange); color: white; }
.step.completed::after { background: var(--success-green); }

.step-label { margin-top: 0.5rem; font-size: 0.85rem; color: var(--text-gray); text-align: center; }
.step.completed .step-label, .step.active .step-label { color: var(--text-dark); font-weight: 500; }

/* ========== 消息 ========== */
.message-item {
    padding: 1rem; border-bottom: 1px solid var(--border-color);
    display: flex; gap: 1rem;
}
.message-item.unread { background: rgba(74, 144, 217, 0.05); }
.message-icon {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--gradient-blue); display: flex; align-items: center; justify-content: center;
    color: white; flex-shrink: 0;
}
.message-content { flex: 1; min-width: 0; }
.message-title { font-weight: 600; margin-bottom: 0.25rem; }
.message-time { font-size: 0.8rem; color: var(--text-light); }

/* ========== 空状态 ========== */
.empty-state { text-align: center; padding: 3rem; color: var(--text-light); }
.empty-state::before { content: '📭'; display: block; font-size: 3rem; margin-bottom: 1rem; }

/* ========== 工具栏 ========== */
.toolbar {
    display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap;
    margin-bottom: 1rem;
}
.toolbar .form-input { max-width: 250px; }

/* ================================================================
   响应式 — 平板 (768px - 1024px)
   ================================================================ */
@media (max-width: 1024px) {
    :root { --container-padding: 1.5rem; }
    
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
    .stat-value { font-size: 1.3rem; }
}

/* ================================================================
   响应式 — 手机 (< 768px)
   ================================================================ */
@media (max-width: 768px) {
    :root { --container-padding: 1rem; --header-height: 56px; }
    
    body { font-size: 13px; }
    
    .header-content { padding: 0.5rem var(--container-padding); }
    
    .logo-text { font-size: 1.1rem; }
    .logo-icon { width: 36px; height: 36px; font-size: 1rem; }
    
    .user-info { gap: 0.5rem; }
    .user-info span { display: none; }
    .user-avatar { width: 32px; height: 32px; font-size: 0.85rem; }
    
    .container { padding: 1rem; }
    
    .card { padding: 1rem; margin-bottom: 1rem; border-radius: var(--radius-md); }
    .card-header { margin-bottom: 1rem; padding-bottom: 0.75rem; }
    .card-title { font-size: 1rem; }
    
    /* 按钮触摸优化 */
    .btn { padding: 0.5rem 1rem; font-size: 0.85rem; min-height: 36px; }
    .btn-lg { padding: 0.7rem 1.25rem; min-height: 42px; }
    .btn-sm { padding: 0.35rem 0.7rem; font-size: 0.75rem; min-height: 28px; }
    
    /* 表单触摸优化 */
    .form-input, .form-select, .form-textarea { font-size: 16px; min-height: 44px; }
    .form-group { margin-bottom: 1rem; }
    
    /* 统计卡片 */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .stat-card { padding: 1rem; gap: 0.75rem; }
    .stat-icon { width: 44px; height: 44px; font-size: 1.2rem; }
    .stat-value { font-size: 1.1rem; }
    .stat-label { font-size: 0.75rem; }
    
    /* 标签页滚动 */
    .tabs { gap: 0; margin-bottom: 1rem; }
    .tab-btn { padding: 0.6rem 1rem; font-size: 0.85rem; }
    
    /* 表格移动端卡片化 */
    .data-table thead { display: none; }
    .data-table tbody tr {
        display: block; margin-bottom: 1rem;
        border: 1px solid var(--border-color); border-radius: var(--radius-md);
        padding: 0.75rem; background: var(--bg-white);
    }
    .data-table td {
        display: flex; justify-content: space-between; align-items: center;
        padding: 0.5rem 0; border-bottom: 1px solid var(--bg-gray);
        font-size: 0.85rem;
    }
    .data-table td:last-child { border-bottom: none; }
    .data-table td::before {
        content: attr(data-label);
        font-weight: 600; color: var(--text-gray);
        margin-right: 1rem; flex-shrink: 0;
    }
    .data-table td:only-child::before { display: none; }
    
    /* 步骤条紧凑 */
    .steps { flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
    .step { flex: 0 0 calc(33.33% - 0.5rem); }
    .step::after { display: none; }
    .step-circle { width: 32px; height: 32px; font-size: 0.85rem; }
    .step-label { font-size: 0.75rem; margin-top: 0.25rem; }
    
    /* 模态框全屏 */
    .modal { padding: 0; align-items: flex-end; }
    .modal-content {
        max-width: 100%; max-height: 85vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    .modal-header { padding: 1rem; }
    .modal-body { padding: 1rem; }
    .modal-footer { padding: 0.75rem 1rem; }
    
    /* 分页紧凑 */
    .pagination { gap: 0.25rem; }
    .page-btn { padding: 0.4rem 0.6rem; font-size: 0.8rem; min-height: 32px; }
    
    /* 工具栏 */
    .toolbar { gap: 0.5rem; }
    .toolbar .form-input { max-width: 100%; flex: 1; min-width: 0; }
}

/* ================================================================
   响应式 — 小屏手机 (< 375px)
   ================================================================ */
@media (max-width: 375px) {
    :root { --container-padding: 0.75rem; }
    
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { padding: 0.75rem; }
    
    .card { padding: 0.75rem; }
    
    .logo-text { font-size: 1rem; }
    
    .tab-btn { padding: 0.5rem 0.75rem; font-size: 0.8rem; }
}

/* ================================================================
   安全区域适配（iPhone 刘海屏）
   ================================================================ */
@supports (padding-top: env(safe-area-inset-top)) {
    .header {
        padding-top: env(safe-area-inset-top);
    }
    .modal-footer {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
}

/* ========== 打印优化 ========== */
@media print {
    .header, .tabs, .btn, .pagination, .modal { display: none !important; }
    .container { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}
