/* 邻修宝 - 全局样式 */
:root {
    --primary: #378ADD;
    --primary-light: #E6F1FB;
    --success: #639922;
    --success-light: #EAF3DE;
    --warning: #EF9F27;
    --warning-light: #FAEEDA;
    --danger: #E24B4A;
    --danger-light: #FCEBEB;
    --purple: #7F77DD;
    --purple-light: #EEEDFE;
    --text: #2C2C2A;
    --text-secondary: #5F5E5A;
    --text-muted: #888780;
    --border: #D3D1C7;
    --bg: #F5F4F0;
    --bg-card: #FFFFFF;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
}

* { 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;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 14px;
}

/* Header */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
}

.header .logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header .logo .icon { font-size: 22px; }

.header .nav { display: flex; gap: 4px; }

.header .nav a {
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.header .nav a:hover { background: var(--primary-light); color: var(--primary); }
.header .nav a.active { background: var(--primary); color: #fff; }

.header .user-info {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Container */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Forms */
.form-group { margin-bottom: 14px; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    background: var(--bg-card);
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(55, 138, 221, 0.1);
}

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

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #2E7AC9; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #55881E; }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #D88D1D; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #CC3D3D; }

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

/* 禁用按钮样式（如"已评价"） */
.btn:disabled {
    background: #E8E6E0;
    color: #9A988F;
    border: none;
    cursor: not-allowed;
    opacity: 1;
}
.btn:disabled:hover {
    background: #E8E6E0;
    color: #9A988F;
    border: none;
}

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending { background: var(--warning-light); color: #854F0B; }
.status-accepted { background: #E6F1FB; color: #0C447C; }
.status-in_progress { background: #EEEDFE; color: #3C3489; }
.status-completed { background: var(--success-light); color: #27500A; }
.status-cancelled { background: #F1EFE8; color: #5F5E5A; }

/* Urgency badges */
.urgency-urgent { background: var(--danger-light); color: #791F1F; }
.urgency-normal { background: var(--warning-light); color: #854F0B; }
.urgency-minor { background: var(--success-light); color: #27500A; }

/* Category badges */
.cat-water_electric { background: #E6F1FB; color: #0C447C; }
.cat-wall_door { background: #EEEDFE; color: #3C3489; }
.cat-pipeline { background: var(--warning-light); color: #633806; }
.cat-elevator { background: var(--danger-light); color: #791F1F; }
.cat-public_area { background: var(--success-light); color: #27500A; }
.cat-other { background: #F1EFE8; color: #2C2C2A; }

/* Repair card */
.repair-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s;
}
.repair-card:hover { box-shadow: var(--shadow); }

.repair-card .repair-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.repair-card .repair-title {
    font-size: 15px;
    font-weight: 600;
}

.repair-card .repair-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.repair-card .repair-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 8px 0;
    line-height: 1.5;
}

.repair-card .repair-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* AI badge */
.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--purple-light);
    color: var(--purple);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

/* Progress timeline */
.timeline { position: relative; padding-left: 24px; }

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
}

.timeline-item.active::before {
    background: var(--primary);
    border-color: var(--primary);
}

.timeline-item.completed::before {
    background: var(--success);
    border-color: var(--success);
}

.timeline-item .tl-time { font-size: 11px; color: var(--text-muted); }
.timeline-item .tl-note { font-size: 13px; margin-top: 2px; }

/* Image preview */
.image-preview {
    max-width: 200px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-top: 8px;
}

.image-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 12px;
}

.image-compare .compare-item {
    text-align: center;
}

.image-compare .compare-item img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.image-compare .compare-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border);
    text-align: center;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    margin: 4px 0;
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

.stat-card .stat-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 看板大按钮：可点击 + 选中态 */
.stat-clickable { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.stat-clickable:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.stat-active { outline: 2px solid var(--primary); background: #eef4ff; }

/* Chart containers */
.chart-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

.chart-container canvas { max-height: 300px; }

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 4px;
    border: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-family: inherit;
}

.tab-btn.active {
    background: var(--primary);
    color: #fff;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 14px;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }

/* Modal overlay */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 600px) {
    .container { padding: 12px; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .header { padding: 10px 12px; }
    .header .nav a { padding: 4px 10px; font-size: 12px; }
    .image-compare { grid-template-columns: 1fr; }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .empty-text { font-size: 14px; }

/* Workflow stepper (报修流程) */
.workflow-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0 10px;
}

.workflow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.workflow-step::after {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.workflow-step:last-child::after { display: none; }

.workflow-step .step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    position: relative;
    z-index: 1;
    background: var(--border);
    color: var(--text-muted);
}

.workflow-step.active .step-dot { background: var(--primary); color: #fff; }
.workflow-step.done .step-dot { background: var(--success); color: #fff; }

.workflow-step .step-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    text-align: center;
}

.workflow-step.active .step-label { color: var(--primary); font-weight: 500; }
.workflow-step.done .step-label { color: var(--success); font-weight: 500; }
