/* ============ 服务人员工作台样式 ============ */
:root {
  --primary: #10b981;
  --primary-dark: #059669;
  --bg: #f0fdf4;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gradient: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

.phone-wrapper { max-width: 430px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; box-shadow: 0 0 40px rgba(0,0,0,0.1); }
#app { min-height: 100vh; display: flex; flex-direction: column; }

.header { background: var(--gradient); color: #fff; padding: 16px; position: sticky; top: 0; z-index: 100; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.header-row { display: flex; align-items: center; gap: 12px; }
.header h1 { font-size: 20px; font-weight: 700; }
.header .back-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,0.2); cursor: pointer; font-size: 18px; border: none; color: #fff; }

.page { flex: 1; padding-bottom: 70px; }
.page-padded { padding: 16px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 16px; }
.stat-card { background: var(--card-bg); border-radius: 12px; padding: 16px; text-align: center; cursor: pointer; transition: transform 0.2s; }
.stat-card:active { transform: scale(0.96); }
.stat-card .icon { font-size: 28px; margin-bottom: 4px; }
.stat-card .value { font-size: 24px; font-weight: 800; color: var(--primary); }
.stat-card .label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.stat-card.warning .value { color: var(--warning); }
.stat-card.danger .value { color: var(--danger); }

/* 订单卡片 */
.order-card { background: var(--card-bg); border-radius: 12px; padding: 14px; margin-bottom: 10px; cursor: pointer; border: 1px solid var(--border); transition: all 0.2s; }
.order-card:active { transform: scale(0.98); }
.order-card .header-row { justify-content: space-between; margin-bottom: 10px; background: none; padding: 0; box-shadow: none; position: static; }
.order-card .order-no { font-size: 12px; color: var(--text-light); }
.order-card .status { font-size: 13px; font-weight: 600; }
.order-card .body { display: flex; gap: 10px; margin-bottom: 10px; }
.order-card .game-icon { font-size: 28px; }
.order-card .info { flex: 1; }
.order-card .service-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.order-card .game-name { font-size: 12px; color: var(--text-secondary); }
.order-card .req { font-size: 12px; color: var(--text-secondary); margin-top: 4px; background: #f8fafc; padding: 6px 8px; border-radius: 6px; }
.order-card .footer-row { display: flex; justify-content: space-between; align-items: center; }

/* Tab */
.tabs { display: flex; background: var(--card-bg); border-bottom: 1px solid var(--border); overflow-x: auto; position: sticky; top: 0; z-index: 50; }
.tab-item { padding: 12px 16px; white-space: nowrap; font-size: 14px; color: var(--text-secondary); cursor: pointer; position: relative; }
.tab-item.active { color: var(--primary); font-weight: 600; }
.tab-item.active::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 3px; background: var(--primary); border-radius: 2px; }

/* 底部导航 */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; background: var(--card-bg); border-top: 1px solid var(--border); display: flex; height: 60px; z-index: 200; }
.tabbar-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; color: var(--text-light); }
.tabbar-item.active { color: var(--primary); }
.tabbar-item .icon { font-size: 22px; }
.tabbar-item .text { font-size: 11px; }

/* 按钮 */
.btn { display: inline-block; padding: 10px 20px; border-radius: 8px; border: none; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; text-align: center; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-block { display: block; width: 100%; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; }

/* 详情卡片 */
.detail-card { background: var(--card-bg); border-radius: 12px; padding: 16px; margin: 12px; }
.detail-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.detail-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.detail-row .label { color: var(--text-secondary); }
.detail-row .value { font-weight: 600; text-align: right; max-width: 200px; }

/* 时间线 */
.timeline { padding: 8px 0; }
.timeline-item { display: flex; gap: 12px; padding-bottom: 20px; position: relative; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px; background: var(--border); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; z-index: 1; background: var(--primary); color: #fff; }
.timeline-dot.system { background: var(--text-light); }
.timeline-content { flex: 1; }
.timeline-content .text { font-size: 14px; margin-bottom: 4px; }
.timeline-content .time { font-size: 12px; color: var(--text-light); }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.form-label .required { color: var(--danger); }
.form-input, .form-textarea, .form-select { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; outline: none; background: var(--card-bg); font-family: inherit; }
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--primary); }
.form-textarea { min-height: 80px; resize: vertical; }

/* 上传 */
.upload-area { border: 2px dashed var(--border); border-radius: 10px; padding: 20px; text-align: center; color: var(--text-light); cursor: pointer; }
.upload-area:active { border-color: var(--primary); }
.upload-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.upload-preview .img-item { width: 70px; height: 70px; border-radius: 8px; background: #e2e8f0; display: flex; align-items: center; justify-content: center; position: relative; }
.upload-preview .img-item .remove { position: absolute; top: -4px; right: -4px; width: 18px; height: 18px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; }

/* Toast & Modal */
.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,0.8); color: #fff; padding: 12px 24px; border-radius: 10px; font-size: 14px; z-index: 9999; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.toast.show { opacity: 1; }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--card-bg); border-radius: 16px; width: 100%; max-width: 360px; overflow: hidden; }
.modal-header { padding: 20px 20px 10px; font-size: 17px; font-weight: 700; text-align: center; }
.modal-body { padding: 10px 20px 20px; }
.modal-footer { display: flex; border-top: 1px solid var(--border); }
.modal-footer .btn { flex: 1; border-radius: 0; padding: 14px; }

/* 空状态 & 加载 */
.empty { text-align: center; padding: 60px 20px; color: var(--text-light); }
.empty .icon { font-size: 48px; margin-bottom: 12px; }
.loading { text-align: center; padding: 20px; color: var(--text-light); }

/* 状态颜色 */
.status { font-weight: 600; }
.status.ASSIGNED { color: var(--warning); }
.status.IN_PROGRESS { color: #3b82f6; }
.status.WAITING_CONFIRM { color: var(--warning); }
.status.COMPLETED { color: var(--success); }
.status.AFTER_SALE { color: var(--danger); }

/* 登录页 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--gradient); }
.login-box { background: #fff; border-radius: 16px; padding: 40px; width: 320px; }
.login-box h1 { text-align: center; font-size: 22px; margin-bottom: 8px; }
.login-box p { text-align: center; color: var(--text-secondary); font-size: 13px; margin-bottom: 24px; }

/* 个人信息 */
.profile-header { background: var(--gradient); color: #fff; padding: 24px 20px; text-align: center; }
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,0.2); display: inline-flex; align-items: center; justify-content: center; font-size: 32px; margin-bottom: 8px; }
.profile-name { font-size: 18px; font-weight: 700; }
.profile-role { font-size: 13px; opacity: 0.8; margin-top: 4px; }
.profile-menu { background: var(--card-bg); margin: 12px; border-radius: 12px; overflow: hidden; }
.menu-item { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: #f0fdf4; }
.menu-item .icon { font-size: 20px; margin-right: 12px; }
.menu-item .text { flex: 1; }
.menu-item .arrow { color: var(--text-light); }
