* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f5f6fa; color: #333; max-width: 480px; margin: 0 auto; min-height: 100vh; }
.header { background: linear-gradient(135deg, #2c3e50, #3498db); color: #fff; padding: 16px 20px; position: sticky; top: 0; z-index: 10; }
.header h1 { font-size: 20px; font-weight: 600; }
.header .sub { font-size: 12px; opacity: 0.8; margin-top: 2px; }

.tab-bar { display: flex; background: #fff; border-bottom: 1px solid #e0e0e0; position: sticky; top: 62px; z-index: 9; }
.tab-bar button { flex: 1; padding: 12px 0; border: none; background: none; font-size: 14px; color: #888; cursor: pointer; transition: all 0.2s; border-bottom: 2px solid transparent; }
.tab-bar button.active { color: #3498db; border-bottom-color: #3498db; font-weight: 600; }

.stats { display: flex; gap: 8px; padding: 12px 16px; flex-wrap: wrap; }
.stat-item { flex: 1; min-width: 60px; text-align: center; padding: 10px 4px; border-radius: 10px; font-size: 11px; color: #fff; font-weight: 500; }
.stat-item .num { font-size: 22px; font-weight: 700; display: block; }
.stat-all { background: #2c3e50; }
.stat-install { background: #27ae60; }
.stat-repair { background: #e67e22; }
.stat-pending { background: #f39c12; }
.stat-visit { background: #9b59b6; }

.cal-wrap { padding: 16px; }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-header .nav-btn { border: none; background: #fff; font-size: 18px; padding: 6px 12px; cursor: pointer; color: #333; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.cal-header .nav-btn:active { background: #eee; }
.cal-header .month-label { font-size: 17px; font-weight: 700; }
.cal-header .btn-today { font-size: 14px; color: #3498db; background: #eef5fb; border: none; padding: 6px 14px; border-radius: 6px; cursor: pointer; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px; color: #999; padding: 8px 0; font-weight: 500; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 10px; font-size: 15px; cursor: pointer; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.05); transition: all 0.15s; }
.cal-day:active { transform: scale(0.95); }
.cal-day.today { box-shadow: inset 0 0 0 2px #3498db; font-weight: 700; }
.cal-day.selected { background: #3498db; color: #fff; font-weight: 700; }
.cal-day.selected .dot { background: #fff; }
.cal-day.other-month { color: #ccc; background: #fafafa; box-shadow: none; }
.cal-day .dot { width: 5px; height: 5px; border-radius: 50%; background: #e74c3c; margin-top: 2px; }
.cal-day .count { font-size: 10px; color: #e74c3c; font-weight: 600; margin-top: 0; }
.cal-day.selected .count { color: #fff; }
.cal-legend { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 14px; font-size: 12px; color: #888; }
.cal-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e74c3c; margin-right: 4px; vertical-align: middle; }

.search-box { padding: 0 16px 12px; }
.search-box input { width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; outline: none; background: #fff; }
.search-box input:focus { border-color: #3498db; }

.filter-row { display: flex; gap: 6px; padding: 0 16px 12px; flex-wrap: wrap; }
.filter-row button { padding: 6px 12px; border: 1px solid #ddd; border-radius: 16px; background: #fff; font-size: 12px; color: #666; cursor: pointer; }
.filter-row button.active { background: #3498db; color: #fff; border-color: #3498db; }

.client-list { padding: 0 16px 80px; }
.client-card { background: #fff; border-radius: 10px; padding: 14px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); position: relative; }
.client-card .name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.client-card .info { font-size: 13px; color: #666; line-height: 1.6; }
.client-card .info span { margin-right: 12px; }
.client-card .info a { color: #3498db; text-decoration: none; border-bottom: 1px dashed #3498db; }
.client-card .info a:active { color: #217dbb; }
.client-card .date { font-size: 11px; color: #aaa; margin-top: 4px; }
.client-card .actions { position: absolute; right: 12px; top: 12px; display: flex; gap: 6px; }
.client-card .actions button { width: 28px; height: 28px; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn-edit { background: #ecf0f1; color: #2c3e50; }
.btn-del { background: #fde8e8; color: #e74c3c; }

.status-badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; color: #fff; margin-left: 8px; }
.s-安装 { background: #27ae60; }
.s-维修 { background: #e67e22; }
.s-待上门 { background: #f39c12; }
.s-预约 { background: #9b59b6; }

.empty { text-align: center; padding: 60px 20px; color: #bbb; }
.empty .icon { font-size: 48px; margin-bottom: 12px; }
.fab { position: fixed; bottom: 24px; right: 24px; width: 54px; height: 54px; border-radius: 50%; background: #3498db; color: #fff; border: none; font-size: 28px; cursor: pointer; box-shadow: 0 4px 12px rgba(52,152,219,0.4); z-index: 11; }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100; justify-content: center; align-items: flex-end; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; width: 100%; max-width: 480px; border-radius: 16px 16px 0 0; padding: 20px; max-height: 85vh; overflow-y: auto; }
.modal h3 { margin-bottom: 16px; font-size: 18px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 4px; }
.form-group input, .form-group select { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 15px; outline: none; }
.form-group input:focus, .form-group select:focus { border-color: #3498db; }
.addr-row { display: flex; gap: 8px; align-items: center; }
.addr-row input { flex: 1; }
.btn-locate { padding: 9px 10px; border: 1px solid #3498db; border-radius: 8px; background: #eef5fb; color: #3498db; font-size: 13px; cursor: pointer; white-space: nowrap; }
.btn-locate:active { background: #dceaf5; }
.btn-locate.locating { opacity: 0.6; pointer-events: none; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.form-actions button { flex: 1; padding: 12px; border: none; border-radius: 8px; font-size: 15px; cursor: pointer; font-weight: 500; }
.btn-save { background: #3498db; color: #fff; }
.btn-cancel { background: #ecf0f1; color: #666; }
.btn-save.delete-confirm { background: #e74c3c; }
.phone-area { font-size: 12px; color: #888; margin-top: 2px; display: block; min-height: 18px; }
.toast { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); background: #27ae60; color: #fff; padding: 10px 24px; border-radius: 8px; font-size: 14px; z-index: 999; box-shadow: 0 4px 12px rgba(0,0,0,.15); animation: toastIn .3s ease, toastOut .3s ease 1.7s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(-10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }
