/* ============ 全局重置 ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    background: #f0f2f5;
}

:root {
    --primary: #1677ff;
    --primary-light: #e6f0ff;
    --primary-dark: #0958d9;
    --success: #52c41a;
    --warning: #faad14;
    --danger: #ff4d4f;
    --text-1: #1a1a1a;
    --text-2: #666;
    --text-3: #999;
    --border: #eee;
    --bg: #f5f6f8;
    --card-bg: #fff;
    --radius: 12px;
    --radius-sm: 8px;
}

/* ============ 桌面预览背景 ============ */
.desktop-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-wrap: wrap;
}

.demo-tip {
    max-width: 280px;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 24px;
}
.demo-tip h3 { font-size: 18px; margin-bottom: 12px; }
.demo-tip p { font-size: 13px; line-height: 1.8; opacity: 0.9; }

/* ============ 手机外壳 ============ */
.phone-frame {
    width: 390px;
    height: 844px;
    background: #000;
    border-radius: 54px;
    padding: 12px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4), 0 0 0 2px #1a1a1a;
    position: relative;
    flex-shrink: 0;
}

.phone-notch {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 32px;
    background: #000;
    border-radius: 20px;
    z-index: 100;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: var(--bg);
    border-radius: 42px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ============ 状态栏 ============ */
.status-bar {
    height: 50px;
    padding: 0 30px 0 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    background: var(--card-bg);
    flex-shrink: 0;
    padding-top: 12px;
}
.status-icons { display: flex; gap: 6px; font-size: 12px; }

/* ============ 页面容器 ============ */
.page-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    position: relative;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE10+ */
}
.page-container::-webkit-scrollbar {
    display: none; /* Chrome / Safari / Edge */
}

.page {
    min-height: 100%;
    padding-bottom: 20px;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}

/* 通用页面头部 */
.page-header {
    background: var(--card-bg);
    padding: 12px 16px 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-1);
}
.page-subtitle {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
}

/* 导航栏（带返回） */
.nav-bar {
    height: 48px;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    padding: 0 8px;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border);
}
.nav-back {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-1);
    cursor: pointer;
}
.nav-title {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    margin-right: 40px;
}
.nav-action {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--primary);
    cursor: pointer;
}

/* ============ 底部 Tab ============ */
.tab-bar {
    height: 64px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    display: flex;
    flex-shrink: 0;
    padding-bottom: 10px;
}
.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-3);
    cursor: pointer;
    transition: color 0.2s;
}
.tab-item.active { color: var(--primary); }
.tab-icon { font-size: 22px; line-height: 1; }
.tab-label { font-size: 10px; }

/* home indicator */
.home-indicator {
    height: 8px;
    background: var(--card-bg);
    position: relative;
}
.home-indicator::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 134px;
    height: 5px;
    background: #1a1a1a;
    border-radius: 3px;
}

/* ============ 通用组件 ============ */
.section { padding: 12px 16px; }

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    gap: 6px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-ghost { background: var(--primary-light); color: var(--primary); }
.btn-ghost:active { background: #d1e4ff; }
.btn-danger { background: #fff1f0; color: var(--danger); }
.btn-outline { background: #fff; color: var(--text-1); border: 1px solid var(--border); }
.btn-block { width: 100%; padding: 13px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; }

/* 标签/状态 */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.6;
    gap: 3px;
}
.tag-success { background: #f6ffed; color: var(--success); border: 1px solid #d9f7be; }
.tag-warning { background: #fffbe6; color: var(--warning); border: 1px solid #ffe58f; }
.tag-danger { background: #fff1f0; color: var(--danger); border: 1px solid #ffccc7; }
.tag-info { background: var(--primary-light); color: var(--primary); border: 1px solid #bae0ff; }
.tag-default { background: #f5f5f5; color: var(--text-2); border: 1px solid #e8e8e8; }
.tag-processing { background: #f0f5ff; color: #2f54eb; border: 1px solid #adc6ff; }

/* ============ 工作台 ============ */
.wb-hero {
    background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
    color: #fff;
    padding: 20px 16px 24px;
    margin: 12px;
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(22, 119, 255, 0.25);
}
.wb-hero-title { font-size: 14px; opacity: 0.9; }
.wb-hero-num { font-size: 32px; font-weight: 700; margin-top: 4px; }
.wb-hero-sub { font-size: 12px; opacity: 0.8; margin-top: 4px; }

.wb-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 0 12px;
    margin-top: -12px;
    position: relative;
    z-index: 2;
}
.wb-stat {
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 12px 4px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.wb-stat-num { font-size: 18px; font-weight: 600; color: var(--text-1); }
.wb-stat-label { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.wb-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    margin: 20px 16px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.wb-section-title .more { font-size: 12px; color: var(--text-3); font-weight: 400; }

.wb-quick {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 0 16px;
}
.wb-quick-item {
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 14px 4px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s;
}
.wb-quick-item:active { transform: scale(0.96); }
.wb-quick-icon { font-size: 26px; }
.wb-quick-label { font-size: 12px; color: var(--text-2); margin-top: 4px; }

.wb-todo-item {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 14px 16px;
    margin: 0 12px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.wb-todo-item:active { background: #fafafa; }
.wb-todo-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 12px;
    flex-shrink: 0;
}
.wb-todo-info { flex: 1; min-width: 0; }
.wb-todo-title { font-size: 14px; color: var(--text-1); font-weight: 500; }
.wb-todo-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.wb-todo-arrow { color: var(--text-3); font-size: 14px; }

/* ============ 门店列表 ============ */
.search-bar {
    padding: 8px 16px 12px;
    background: var(--card-bg);
    position: sticky;
    top: 0;
    z-index: 10;
}
.search-input-wrap {
    background: var(--bg);
    border-radius: 20px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.search-input-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: var(--text-1);
}
.search-icon { color: var(--text-3); font-size: 16px; }

.filter-tabs {
    display: flex;
    gap: 8px;
    padding: 0 16px 12px;
    background: var(--card-bg);
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE10+ */
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 13px;
    color: var(--text-2);
    background: var(--bg);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}
.filter-tab.active {
    background: var(--primary);
    color: #fff;
}

.store-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin: 12px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: transform 0.15s;
}
.store-card:active { transform: scale(0.98); }
.store-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}
.store-card-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-1);
    flex: 1;
}
.store-card-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.store-card-row {
    display: flex;
    font-size: 13px;
    color: var(--text-2);
    gap: 6px;
}
.store-card-row .label { color: var(--text-3); flex-shrink: 0; }
.store-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}
.store-card-time { font-size: 12px; color: var(--text-3); }
.store-card-actions { display: flex; gap: 8px; }

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-3);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-text { font-size: 14px; }

/* ============ 门店详情 ============ */
.detail-hero {
    background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
    color: #fff;
    padding: 24px 16px;
}
.detail-hero-name { font-size: 20px; font-weight: 600; }
.detail-hero-meta { font-size: 13px; opacity: 0.85; margin-top: 6px; }

.detail-block {
    background: #fff;
    margin: 12px;
    border-radius: var(--radius);
    overflow: hidden;
}
.detail-block-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
    padding: 14px 16px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.detail-row {
    display: flex;
    padding: 10px 16px;
    font-size: 14px;
    align-items: center;
}
.detail-row .label { color: var(--text-3); width: 90px; flex-shrink: 0; }
.detail-row .value { color: var(--text-1); flex: 1; }
.detail-row .value.copy { color: var(--primary); cursor: pointer; }

.timeline {
    padding: 4px 16px 12px;
}
.timeline-item {
    display: flex;
    gap: 12px;
    padding-bottom: 16px;
    position: relative;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 14px;
    bottom: 0;
    width: 1px;
    background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    margin-top: 4px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.timeline-item.active .timeline-dot { background: var(--primary); }
.timeline-content { flex: 1; }
.timeline-title { font-size: 14px; color: var(--text-1); }
.timeline-time { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.timeline-desc { font-size: 12px; color: var(--text-2); margin-top: 4px; }

.detail-actions {
    padding: 16px;
    display: flex;
    gap: 12px;
    background: #fff;
    border-top: 1px solid var(--border);
}

/* ============ 表单页 ============ */
.form-section {
    background: #fff;
    margin: 12px 0;
    padding: 4px 16px;
}
.form-section-title {
    font-size: 13px;
    color: var(--text-3);
    padding: 12px 16px 6px;
    background: var(--bg);
}
.form-group {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.form-group:last-child { border-bottom: none; }
.form-label {
    font-size: 14px;
    color: var(--text-1);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}
.form-label .required { color: var(--danger); margin-right: 4px; }
.form-label .hint { font-size: 12px; color: var(--text-3); margin-left: auto; font-weight: 400; }

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    border: none;
    outline: none;
    font-size: 15px;
    color: var(--text-1);
    background: transparent;
    padding: 4px 0;
    font-family: inherit;
}
.form-textarea { min-height: 80px; resize: none; line-height: 1.6; }
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-3); }

.form-select-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.form-select-wrap .arrow { color: var(--text-3); }

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.form-row:last-child { border-bottom: none; }
.form-row .form-label { margin-bottom: 0; flex: 1; }
.form-row .form-input { flex: 1; text-align: right; }

.form-upload {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 8px;
}
.upload-item {
    aspect-ratio: 1;
    border-radius: 8px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-3);
    cursor: pointer;
    border: 1px dashed #d9d9d9;
    position: relative;
    overflow: hidden;
}
.upload-item.has-img {
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border);
}
.upload-item.has-img::after {
    content: '×';
    position: absolute;
    top: 2px;
    right: 4px;
    color: #fff;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.form-agreement {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 16px;
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.6;
}
.form-agreement input { margin-top: 3px; }
.form-agreement a { color: var(--primary); text-decoration: none; }

.form-footer {
    padding: 12px 16px 20px;
    background: #fff;
    border-top: 1px solid var(--border);
}

/* ============ 弹窗 ============ */
.modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    animation: maskIn 0.2s;
}
.modal-mask.show { display: flex; }
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }

.modal-sheet {
    background: #fff;
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-height: 80%;
    overflow-y: auto;
    animation: sheetUp 0.25s ease;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE10+ */
}
.modal-sheet::-webkit-scrollbar {
    display: none; /* Chrome / Safari / Edge */
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-sheet-head {
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    position: relative;
}
.modal-sheet-title { font-size: 16px; font-weight: 600; }
.modal-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    font-size: 20px;
    cursor: pointer;
}
.modal-sheet-body { padding: 16px; }
.modal-sheet-footer {
    padding: 12px 16px 24px;
    display: flex;
    gap: 12px;
    border-top: 1px solid var(--border);
}

.modal-center {
    background: #fff;
    border-radius: 14px;
    width: 80%;
    max-width: 300px;
    overflow: hidden;
    animation: centerIn 0.2s ease;
}
@keyframes centerIn { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-center-head { padding: 20px 20px 8px; text-align: center; }
.modal-center-title { font-size: 16px; font-weight: 600; }
.modal-center-body { padding: 8px 20px 20px; text-align: center; font-size: 14px; color: var(--text-2); line-height: 1.6; }
.modal-center-footer { display: flex; border-top: 1px solid var(--border); }
.modal-center-footer .btn { flex: 1; border-radius: 0; padding: 13px; background: #fff; }
.modal-center-footer .btn-cancel { color: var(--text-2); border-right: 1px solid var(--border); }
.modal-center-footer .btn-confirm { color: var(--primary); font-weight: 500; }
.modal-center-footer .btn-confirm.danger { color: var(--danger); }

.action-sheet-item {
    padding: 16px;
    text-align: center;
    font-size: 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.action-sheet-item:active { background: #fafafa; }
.action-sheet-item.danger { color: var(--danger); }
.action-sheet-cancel {
    padding: 16px;
    text-align: center;
    font-size: 16px;
    color: var(--text-2);
    margin-top: 8px;
    background: #fff;
    cursor: pointer;
}

/* ============ Toast ============ */
.toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    max-width: 240px;
    text-align: center;
    line-height: 1.5;
}
.toast.show { opacity: 1; }

/* ============ 我的 ============ */
.mine-header {
    background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
    padding: 30px 16px 60px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 14px;
}
.mine-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border: 2px solid rgba(255,255,255,0.5);
}
.mine-name { font-size: 18px; font-weight: 600; }
.mine-role { font-size: 12px; opacity: 0.85; margin-top: 2px; }

.mine-card {
    background: #fff;
    margin: -40px 12px 12px;
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    justify-content: space-around;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: relative;
}
.mine-stat { text-align: center; }
.mine-stat-num { font-size: 20px; font-weight: 600; color: var(--text-1); }
.mine-stat-label { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.mine-menu {
    background: #fff;
    margin: 12px;
    border-radius: var(--radius);
    overflow: hidden;
}
.mine-menu-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.mine-menu-item:last-child { border-bottom: none; }
.mine-menu-item:active { background: #fafafa; }
.mine-menu-icon { font-size: 18px; margin-right: 12px; width: 24px; text-align: center; }
.mine-menu-text { flex: 1; font-size: 15px; color: var(--text-1); }
.mine-menu-arrow { color: var(--text-3); }

/* ============ 结果页 ============ */
.result-page {
    padding: 60px 24px;
    text-align: center;
}
.result-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}
.result-icon.success { background: #f6ffed; color: var(--success); }
.result-icon.fail { background: #fff1f0; color: var(--danger); }
.result-title { font-size: 18px; font-weight: 600; color: var(--text-1); }
.result-desc { font-size: 13px; color: var(--text-3); margin-top: 8px; line-height: 1.6; }
.result-actions { margin-top: 32px; display: flex; flex-direction: column; gap: 10px; }
