/* ============================================================
   数智消控室现场勘察系统 - 全局样式
   简洁明亮配色 · 浮动窗口 · 中文优先
   ============================================================ */

:root {
    --primary: #2563eb;
    --primary-light: #dbeafe;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --success-light: #dcfce7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --info: #0891b2;
    --info-light: #cffafe;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    font-size: 14px;
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: "SF Mono", "Cascadia Code", Consolas, monospace; font-size: 13px; }
.text-success { color: var(--success); }
.text-ellipsis { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.required { color: var(--danger); }
.empty-text { color: var(--gray-400); text-align: center; padding: 24px; }

/* ==================== 按钮 ==================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    padding: 8px 16px; border: 1px solid transparent; border-radius: var(--radius);
    font-size: 14px; font-weight: 500; cursor: pointer; transition: all .15s;
    text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: #fff; border-color: var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn-info { background: var(--info); color: #fff; }
.btn-info:hover { background: #0e7490; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-xs { padding: 2px 8px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-block { width: 100%; }

/* ==================== 登录注册页 ==================== */
.auth-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}
.auth-container { width: 100%; max-width: 440px; }
.auth-card {
    background: #fff; border-radius: var(--radius-lg); padding: 40px;
    box-shadow: var(--shadow-xl);
}
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-logo { font-size: 48px; margin-bottom: 12px; }
.auth-header h1 { font-size: 20px; color: var(--gray-900); margin-bottom: 4px; }
.auth-header p { font-size: 12px; color: var(--gray-400); letter-spacing: 1px; }

.tab-switch {
    display: flex; margin-bottom: 24px; background: var(--gray-100);
    border-radius: var(--radius); padding: 4px;
}
.tab-btn {
    flex: 1; padding: 10px; border: none; background: none; cursor: pointer;
    font-size: 15px; font-weight: 500; color: var(--gray-500);
    border-radius: 6px; transition: all .2s;
}
.tab-btn.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }

.auth-form .form-group { margin-bottom: 18px; }
.auth-form label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--gray-700); font-size: 13px; }
.auth-form input, .auth-form select {
    width: 100%; padding: 10px 14px; border: 1px solid var(--gray-300);
    border-radius: var(--radius); font-size: 14px; transition: border-color .15s;
}
.auth-form input:focus, .auth-form select:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}

/* ==================== 提示 ==================== */
.alert {
    padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px;
    font-size: 14px;
}
.alert-error { background: var(--danger-light); color: var(--danger); }
.alert-success { background: var(--success-light); color: var(--success); }
.alert-warning { background: var(--warning-light); color: #92400e; }
.alert-info { background: var(--info-light); color: var(--info); }

/* ==================== 顶部导航 ==================== */
.app-layout { min-height: 100vh; }
.top-bar {
    background: #fff; border-bottom: 1px solid var(--gray-200);
    padding: 0 24px; height: 56px; display: flex; align-items: center;
    justify-content: space-between; position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow-sm);
}
.top-bar-left { display: flex; align-items: center; gap: 16px; }
.top-bar-right { display: flex; align-items: center; gap: 12px; }
.logo-icon { font-size: 22px; }
.top-title { font-size: 16px; font-weight: 600; color: var(--gray-800); }
.user-info { display: flex; align-items: center; gap: 8px; }
.user-name { font-weight: 500; color: var(--gray-700); }
.badge-dept {
    display: inline-block; padding: 2px 8px; font-size: 12px;
    background: var(--primary-light); color: var(--primary);
    border-radius: 10px; font-weight: 500;
}

/* 置顶标识 — 小圆形图标 */
.pin-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 50%;
    background: #f59e0b; border: 1px solid #d97706;
    color: #fff; font-size: 10px;
    margin-right: 4px; vertical-align: middle;
    line-height: 1; flex-shrink: 0; cursor: help;
}
/* 置顶文字徽章"示例勘察记录" */
.pin-label {
    display: inline-block; padding: 2px 8px;
    background: #dc2626; color: #fff; font-weight: 700;
    font-size: 12px; border: 1px solid #b91c1c; border-radius: 4px;
    vertical-align: middle; line-height: 1.4; letter-spacing: 0.5px;
}
/* 置顶行高亮 */
.row-pinned {
    background: #fffbeb !important;
}
/* 置顶/常规分隔回行 */
.pin-separator td {
    padding: 0 !important; border: none;
}
.pin-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 0; padding: 0;
}
.pin-divider::after {
    content: ''; flex: 1; height: 2px;
    background: linear-gradient(90deg, #d1d5db, transparent);
}
.pin-divider span {
    color: #9ca3af; font-size: 12px; white-space: nowrap;
    padding: 4px 12px; background: #f9fafb; border-radius: 12px;
    border: 1px solid #e5e7eb;
}

/* 认证红色V标志 */
.verified-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--danger); color: #fff; font-size: 10px;
    font-weight: 700; margin-left: 4px; vertical-align: middle;
    line-height: 1; flex-shrink: 0;
}

/* 通知按钮 */
.btn-icon {
    position: relative; background: none; border: none; font-size: 20px;
    cursor: pointer; padding: 6px; border-radius: 50%; transition: background .15s;
}
.btn-icon:hover { background: var(--gray-100); }
.badge {
    position: absolute; top: 0; right: 0; background: var(--danger);
    color: #fff; font-size: 10px; min-width: 16px; height: 16px;
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    font-weight: 700; padding: 0 4px;
}

/* 通知面板 */
.notif-panel {
    position: fixed; top: 56px; right: 16px; width: 360px; max-height: 500px;
    background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
    z-index: 200; display: flex; flex-direction: column; overflow: hidden;
}
.notif-panel-header {
    padding: 16px 20px; border-bottom: 1px solid var(--gray-200);
    display: flex; justify-content: space-between; align-items: center;
}
.notif-panel-header h3 { font-size: 16px; }
.btn-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--gray-400); }
.notif-panel-body { overflow-y: auto; max-height: 400px; }
.notif-item {
    display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--gray-100);
    cursor: pointer; transition: background .15s;
}
.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: var(--primary-light); }
.notif-item.unread:hover { background: #c7dbfc; }
.notif-icon { font-size: 20px; flex-shrink: 0; }
.notif-content { flex: 1; }
.notif-content p { font-size: 13px; margin-bottom: 4px; }
.notif-content small { color: var(--gray-500); }
.notif-time { display: block; color: var(--gray-400); font-size: 11px; margin-top: 2px; }

/* ==================== 主内容区 ==================== */
.main-content { padding: 24px; max-width: 1400px; margin: 0 auto; }

/* 视图切换 */
.view-switcher {
    display: flex; gap: 4px; margin-bottom: 20px; background: #fff;
    padding: 4px; border-radius: var(--radius); width: fit-content;
    box-shadow: var(--shadow-sm);
}
.view-btn {
    padding: 8px 20px; border: none; background: none; cursor: pointer;
    font-size: 14px; color: var(--gray-500); border-radius: 6px; transition: all .15s;
}
.view-btn.active { background: var(--primary); color: #fff; }
.view-btn:hover:not(.active) { background: var(--gray-100); }

/* ==================== 日历视图 ==================== */
.calendar-container { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.calendar-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 24px; border-bottom: 1px solid var(--gray-200);
}
.calendar-header h2 { font-size: 20px; color: var(--gray-800); }
.cal-nav-btn {
    padding: 8px 16px; border: 1px solid var(--gray-300); border-radius: var(--radius);
    color: var(--gray-600); font-size: 14px; text-decoration: none; transition: all .15s;
}
.cal-nav-btn:hover { background: var(--gray-50); border-color: var(--primary); color: var(--primary); text-decoration: none; }

.calendar-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
    background: var(--gray-200); padding: 1px;
}
.cal-weekday {
    background: var(--gray-50); text-align: center; padding: 10px;
    font-weight: 600; color: var(--gray-500); font-size: 13px;
}
.cal-day {
    display: block;
    background: #fff; min-height: 100px; padding: 6px;
    transition: background .15s; position: relative;
    text-decoration: none; color: inherit;
}
.cal-day:hover { background: var(--gray-50); }
.cal-day-empty { background: var(--gray-50); }
.cal-day-today { background: var(--primary-light); }
.cal-day-today .cal-day-num { color: var(--primary); font-weight: 700; }
.cal-day-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.cal-day-num { font-size: 14px; color: var(--gray-600); font-weight: 600; }
.cal-day-count {
    font-size: 10px; color: #b45309; background: #fef3c7;
    border: 1px solid #f59e0b; border-radius: 8px; padding: 1px 6px;
}
.has-records { cursor: pointer; }
.has-records:hover { background: var(--primary-light); }
.has-records .cal-day-num { font-weight: 600; }
.cal-day-link {
    display: inline-block; margin-top: 4px; font-size: 11px;
    color: var(--primary); font-weight: 600;
}
.cal-day-link:hover { text-decoration: underline; }
.date-filter-banner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 10px 16px; margin-bottom: 14px;
    background: var(--primary-light); border: 1px solid var(--primary);
    border-radius: 8px; color: var(--primary-dark); font-size: 14px; font-weight: 600;
}

.status-dot {
    display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    margin-right: 4px; vertical-align: middle;
}
.status-dot.status-submitted { background: var(--warning); }
.status-dot.status-confirmed { background: var(--success); }
.status-dot.status-rejected { background: var(--danger); }

/* ==================== 模块首页 ==================== */
.modules-page {
    min-height: 100vh; background: var(--gray-100);
}
.modules-container {
    max-width: 1100px; margin: 0 auto; padding: 40px 24px;
}
.modules-header {
    text-align: center; margin-bottom: 40px;
}
.modules-header h1 {
    font-size: 26px; color: var(--gray-900); margin-bottom: 8px;
}
.modules-header p {
    color: var(--gray-500); font-size: 14px;
}
.modules-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
/* 首页模块两个单元分隔 */
.module-unit { margin-bottom: 40px; }
.module-unit-title {
    font-size: 20px; font-weight: 700; color: var(--gray-800);
    margin: 4px 0 18px; padding: 8px 0 8px 14px;
    border-left: 5px solid var(--primary);
    background: linear-gradient(90deg, rgba(37,99,235,0.07), transparent);
    border-radius: 0 6px 6px 0;
}
/* 后台模块管理：单元分隔标题行 */
.unit-header-row td {
    background: #f1f5f9; font-weight: 700; color: #334155;
    font-size: 14px; padding: 12px 14px; border-top: 2px solid #e2e8f0;
}
.module-card {
    background: #fff; border-radius: var(--radius-lg); padding: 32px 24px;
    text-align: center; cursor: pointer; transition: all .2s;
    box-shadow: var(--shadow); border: 2px solid transparent;
    position: relative; overflow: hidden;
}
.module-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}
.module-card.active:hover {
    border-color: var(--primary);
}
.module-card.disabled {
    cursor: default; opacity: 0.85;
}
.module-card.disabled:hover {
    transform: none; box-shadow: var(--shadow); border-color: transparent;
}
.module-icon {
    font-size: 48px; margin-bottom: 16px;
}
.module-title {
    font-size: 18px; font-weight: 600; color: var(--gray-800); margin-bottom: 8px;
}
.module-desc {
    font-size: 13px; color: var(--gray-500);
}
.module-badge {
    display: inline-block; margin-top: 12px; padding: 4px 12px;
    font-size: 12px; border-radius: 12px; font-weight: 500;
}
.module-badge.active { background: var(--success-light); color: var(--success); }
.module-badge.inactive { background: var(--gray-100); color: var(--gray-500); }
.module-badge.link { background: #e0f2fe; color: #0369a1; }

/* ==================== 天地图 ==================== */
.map-picker {
    width: 100%; height: 320px; margin-top: 8px;
    border: 1px solid var(--gray-300); border-radius: 8px; overflow: hidden;
    position: relative;
}
.map-picker-hint {
    position: absolute; inset: 0; z-index: 5;
    display: flex; align-items: center; justify-content: center;
    padding: 0 24px; text-align: center;
    background: var(--gray-50); color: var(--gray-500); font-size: 13px; line-height: 1.8;
}
.coord-status {
    margin-top: 8px; padding: 8px 12px; border-radius: 8px; font-size: 13px; line-height: 1.6;
    background: var(--gray-50); color: var(--gray-500); border: 1px dashed var(--gray-300);
}
.coord-status.ok {
    background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0;
}
/* 地图搜索框（地址 -> 坐标，走服务端地理编码代理） */
.map-search {
    display: flex; gap: 8px; margin-top: 10px; align-items: center;
}
.map-search .form-input { flex: 1; }
.map-search .btn { white-space: nowrap; }
@media (max-width: 480px) {
    .map-search { flex-direction: column; align-items: stretch; }
}
/* 天地图搜索结果列表 */
.map-search-results { margin-top: 10px; }
.map-search-results .msr-tip {
    padding: 10px 12px; font-size: 13px; color: var(--gray-500);
    background: var(--gray-50); border: 1px dashed var(--gray-300); border-radius: 8px;
}
.map-search-results .msr-item {
    padding: 10px 12px; border: 1px solid var(--gray-200); border-top: none;
    cursor: pointer; background: #fff; transition: background .15s;
}
.map-search-results .msr-item:first-child { border-top: 1px solid var(--gray-200); border-radius: 8px 8px 0 0; }
.map-search-results .msr-item:last-child { border-radius: 0 0 8px 8px; }
.map-search-results .msr-item:hover { background: var(--primary-light, #eef2ff); }
.map-search-results .msr-name { font-size: 14px; font-weight: 500; color: var(--gray-800); }
.map-search-results .msr-addr { font-size: 12px; color: var(--gray-500); margin-top: 2px; line-height: 1.5; }
/* 折叠式地图标记 */
.mark-enable { display: flex; gap: 18px; margin: 6px 0 4px; font-size: 14px; }
.mark-enable .radio-inline { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font-weight: 500; }
.collapsible-head {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    margin-top: 6px; padding: 10px 12px; border-radius: 8px;
    background: var(--gray-50); border: 1px dashed var(--gray-300);
    color: #374151; font-size: 14px; user-select: none;
}
.collapsible-head:hover { background: var(--gray-100); }
.collapsible-head .coll-title { flex: 1; }
.collapsible-head .coll-state { color: #6b7280; font-size: 13px; }
.collapsible-head .coll-arrow { color: #9ca3af; font-size: 13px; }
.collapsible-body { margin-top: 8px; }
/* 字段示范：「查看示例」红色链接 */
.example-link {
    display: inline-block;
    color: #dc2626;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 6px;
    text-decoration: underline;
}
.example-link:hover { color: #b91c1c; }
/* 后台字段表单：示范类型三选一（否 / 文字示例 / 图片示例） */
.example-type-group {
    display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 4px;
}
.example-type-group label {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 13px; color: var(--gray-700, #444); cursor: pointer;
}
.example-text-wrap, .example-image-wrap { }
/* 字段列表：已配置示范标识 */
.ex-badge {
    display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 10px;
    font-size: 11px; line-height: 1.6; color: #fff; background: #f59e0b; vertical-align: middle;
}
/* 字段示范弹窗 */
.example-modal {
    position: fixed; inset: 0; z-index: 9999;
    display: none; align-items: center; justify-content: center;
    background: rgba(0,0,0,.5); padding: 20px;
}
.example-modal-box {
    background: #fff; border-radius: 12px; max-width: 640px; width: 100%;
    max-height: 80vh; display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.example-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--gray-200, #eee);
}
.example-modal-header h3 { margin: 0; font-size: 16px; }
.example-modal-close {
    border: none; background: transparent; font-size: 24px; line-height: 1;
    cursor: pointer; color: #888; padding: 0 4px;
}
.example-modal-close:hover { color: #333; }
.example-modal-body { padding: 18px; overflow-y: auto; line-height: 1.8; font-size: 14px; }
.example-modal-body img { max-width: 100%; border-radius: 6px; margin: 6px 0; }
/* 示范图片：压缩预览，限制最大宽度，避免加载高清原图 */
.example-image { display: block; max-width: 100%; width: auto; height: auto; max-height: 460px; border-radius: 8px; margin: 4px 0 10px; border: 1px solid var(--gray-200, #eee); }
.example-text { margin-top: 6px; }
.map-view {
    width: 100%; height: 300px; margin-top: 10px;
    border: 1px solid var(--gray-300); border-radius: 8px; overflow: hidden;
}
.map-full {
    width: 100%; height: 70vh; min-height: 480px;
    border: 1px solid var(--gray-300); border-radius: 8px; overflow: hidden;
}
.map-view-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.map-view-count {
    font-size: 14px; color: var(--gray-700); font-weight: 600;
}
.map-info { font-size: 13px; line-height: 1.7; min-width: 200px; }
.map-info-title { font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.map-info-name { margin-bottom: 2px; }
.map-info-link {
    display: inline-block; margin-top: 6px; color: var(--primary);
    text-decoration: none; font-weight: 600;
}
.map-info-link:hover { text-decoration: underline; }

@media (max-width: 768px) {
    .modules-grid { grid-template-columns: 1fr; }
    .modules-container { padding: 24px 16px; }
}

/* ==================== 列表视图 ==================== */
.list-container { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    background: var(--gray-50); padding: 12px 16px; text-align: left;
    font-weight: 600; color: var(--gray-600); font-size: 13px;
    border-bottom: 1px solid var(--gray-200); white-space: nowrap;
}
.data-table td {
    padding: 12px 16px; border-bottom: 1px solid var(--gray-100);
    font-size: 13px; color: var(--gray-700); vertical-align: middle;
}
.data-table tr:hover td { background: var(--gray-50); }

/* 操作列：保持 table-cell，按钮 inline 排列，垂直居中对齐 */
.action-cell { white-space: nowrap; }
.action-cell .btn { margin-left: 4px; }
.action-cell .btn:first-child { margin-left: 0; }
.action-cell .text-muted { margin-left: 4px; }

/* 业主联系人双行 */
.owner-cell { line-height: 1.5; }
.owner-cell .owner-phone { display: block; font-size: 12px; color: var(--gray-400); }

/* 列不换行 */
.td-no-wrap { white-space: nowrap; }

/* 行状态背景色 */
.data-table tr.row-submitted td { background: #fffbeb; }
.data-table tr.row-submitted:hover td { background: #fef3c7; }
.data-table tr.row-rejected td { background: #fef2f2; }
.data-table tr.row-rejected:hover td { background: #fee2e2; }
.data-table tr.row-confirmed td { background: #f0fdf4; }
.data-table tr.row-confirmed:hover td { background: #dcfce7; }

.status-tag {
    display: inline-block; padding: 2px 10px; border-radius: 12px;
    font-size: 12px; font-weight: 500;
}
.status-tag.status-draft { background: var(--gray-200); color: var(--gray-600); }
.status-tag.status-submitted { background: var(--warning-light); color: #92400e; }
.status-tag.status-confirmed { background: var(--success-light); color: var(--success); }
.status-tag.status-rejected { background: var(--danger-light); color: var(--danger); }
.status-tag.status-link { background: #e0f2fe; color: #0369a1; }

/* ==================== 表单容器 ==================== */
.form-container { max-width: 700px; margin: 40px auto; }
.form-card {
    background: #fff; border-radius: 14px; padding: 36px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04); margin-bottom: 20px;
    border: 1px solid var(--gray-200);
}
.form-card-title { font-size: 22px; margin-bottom: 8px; color: var(--gray-900); }
.form-card-desc { color: var(--gray-500); margin-bottom: 28px; font-size: 14px; }
.project-form .form-group { margin-bottom: 20px; }
.project-form label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--gray-700); }
.project-form input, .project-form select {
    width: 100%; padding: 10px 14px; border: 1px solid var(--gray-300);
    border-radius: var(--radius); font-size: 14px; transition: border-color .15s;
}
.project-form input:focus, .project-form select:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.form-row { margin-bottom: 0; }
.form-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { margin-top: 28px; text-align: center; }

/* ==================== 项目信息条 ==================== */
.project-info-bar {
    background: #fff; border-radius: var(--radius); padding: 16px 24px;
    margin: 16px 24px; box-shadow: var(--shadow-sm);
    display: flex; flex-wrap: wrap; gap: 24px; align-items: center;
}
.project-info-item { display: flex; align-items: baseline; gap: 8px; }
.project-info-item .label { color: var(--gray-400); font-size: 12px; }
.project-info-item .value { color: var(--gray-800); font-weight: 500; }

/* ==================== 区块导航 ==================== */
.section-nav {
    position: sticky; top: 56px; z-index: 50; background: #fff;
    border-bottom: 1px solid var(--gray-200); padding: 0 24px;
    display: flex; gap: 0; overflow-x: auto; box-shadow: var(--shadow-sm);
}
.section-nav-link {
    padding: 12px 16px; font-size: 13px; color: var(--gray-500);
    white-space: nowrap; border-bottom: 2px solid transparent; transition: all .15s;
    text-decoration: none;
}
.section-nav-link:hover { color: var(--primary); text-decoration: none; }
.section-nav-link.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ==================== 勘察表单 ==================== */
.survey-form-container { padding: 24px; max-width: 900px; margin: 0 auto; }

.survey-section {
    background: #fff; border-radius: var(--radius-lg); padding: 24px;
    margin-bottom: 20px; box-shadow: var(--shadow);
}
.section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-num {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--primary); color: #fff; font-size: 16px; font-weight: 700;
    flex-shrink: 0;
}
.section-header h3 { font-size: 18px; color: var(--gray-800); }
.section-num-sm {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--primary); color: #fff; font-size: 12px; font-weight: 700;
    margin-right: 4px;
}
.section-tip {
    background: var(--info-light); border-left: 3px solid var(--info);
    padding: 10px 14px; border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--gray-700); font-size: 13px; margin-bottom: 16px;
}

/* 照片上传区域 */
.photo-upload-area { border: 2px dashed var(--gray-300); border-radius: var(--radius); padding: 20px; text-align: center; }
.photo-list {
    display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px;
    justify-content: flex-start;
}
.photo-list:empty { margin-bottom: 0; }
.photo-thumb {
    position: relative; width: 120px; height: 120px;
    border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.photo-thumb.uploading {
    display: flex; align-items: center; justify-content: center;
    background: var(--gray-100);
}
.upload-spinner { font-size: 24px; }

/* 上传进度条 */
.upload-progress-wrap {
    width: 100%; height: 100%; display: flex; flex-direction: column;
    align-items: center; justify-content: center; padding: 8px; position: relative;
}
.upload-progress-bar {
    width: 80%; height: 6px; background: var(--primary); border-radius: 3px;
    transition: width 0.2s; margin-bottom: 6px;
}
.upload-progress-text {
    font-size: 12px; color: var(--gray-600); font-weight: 600;
}
.photo-delete {
    position: absolute; top: 4px; right: 4px; width: 22px; height: 22px;
    border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff;
    border: none; cursor: pointer; font-size: 16px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.photo-delete:hover { background: var(--danger); }

.upload-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 20px; background: var(--primary-light); color: var(--primary);
    border-radius: var(--radius); cursor: pointer; font-size: 14px; font-weight: 500;
    transition: all .15s;
}
.upload-btn:hover { background: #c7dbfc; }
.upload-btn input[type=file] { display: none; }
.upload-hint { display: block; color: var(--gray-400); font-size: 12px; margin-top: 8px; }

/* 表单输入 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--gray-700); font-size: 13px; }
.form-input {
    width: 100%; padding: 10px 14px; border: 1px solid var(--gray-300);
    border-radius: var(--radius); font-size: 14px; transition: all .15s;
}
.form-input:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}

/* 单选组 */
.radio-group { display: flex; gap: 24px; }
.radio-label {
    display: flex; align-items: center; gap: 6px; cursor: pointer;
    font-size: 14px; color: var(--gray-700);
}
.radio-label input[type=radio] {
    width: 18px; height: 18px; accent-color: var(--primary);
}

/* 子区块 */
.sub-section {
    margin-top: 20px; padding: 20px; background: var(--gray-50);
    border-radius: var(--radius);
}
.sub-section-title { font-size: 15px; color: var(--gray-800); margin-bottom: 8px; }
.sub-section-desc { font-size: 13px; color: var(--gray-500); margin-bottom: 12px; }

/* 动态项 */
.dynamic-item {
    background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
    padding: 16px; margin-bottom: 12px;
}
.dynamic-item-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--gray-100);
}
.dynamic-item-header span { font-weight: 600; color: var(--gray-700); font-size: 14px; }
.dynamic-item-body { display: flex; flex-direction: column; gap: 12px; }
.btn-add-item {
    margin-top: 4px; border-style: dashed;
}

/* 底部操作栏 */
.form-actions-bar {
    position: sticky; bottom: 0; background: #fff;
    padding: 16px 24px; border-top: 1px solid var(--gray-200);
    display: flex; justify-content: center; gap: 16px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.06); z-index: 50;
    margin: 24px -24px -24px;
}

/* 只读模式（非编辑者/已确认状态） */
.readonly-mode .upload-btn,
.readonly-mode .photo-delete,
.readonly-mode .btn-add-item,
.readonly-mode .photo-thumb button {
    display: none !important;
}
.readonly-mode .form-input {
    pointer-events: none;
    background: var(--gray-100);
    color: var(--gray-500);
}
.readonly-mode .radio-group input { pointer-events: none; }
.readonly-mode .photo-upload-area { border-style: solid; border-color: var(--gray-200); }
.readonly-mode .upload-hint { display: none; }

/* ==================== 查看页 ==================== */
.view-container { padding: 24px; max-width: 900px; margin: 0 auto; }
.view-card {
    background: #fff; border-radius: var(--radius-lg); padding: 24px;
    margin-bottom: 16px; box-shadow: var(--shadow);
    page-break-inside: avoid; break-inside: avoid;
}
.view-card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--gray-100);
}
.view-card-header h2 { font-size: 20px; color: var(--gray-800); }
.view-card-header h3 { font-size: 16px; color: var(--gray-800); display: flex; align-items: center; }
.view-tip { font-size: 13px; color: var(--gray-500); margin-bottom: 16px; padding-left: 12px; border-left: 3px solid var(--gray-200); }

.view-info-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.view-info-item { display: flex; flex-direction: column; gap: 2px; }
.view-info-item .label { font-size: 12px; color: var(--gray-400); }
.view-info-item .value { font-size: 14px; color: var(--gray-800); font-weight: 500; }

.view-photo-gallery {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px; margin-top: 12px;
    page-break-inside: avoid; break-inside: avoid;
}
.view-photo {
    border-radius: var(--radius); overflow: hidden; border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .15s;
    aspect-ratio: 4/3;
    page-break-inside: avoid; break-inside: avoid;
    position: relative;
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}
.view-photo.loaded { animation: none; background: none; }
.view-photo:hover { transform: scale(1.02); }
.view-photo img {
    width: 100%; height: 100%; object-fit: cover;
    position: relative; z-index: 1;
}
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.view-host-list { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.view-host-item {
    background: var(--gray-50); border-radius: var(--radius); padding: 16px;
    page-break-inside: avoid; break-inside: avoid;
}
.view-host-item h4 { font-size: 14px; color: var(--gray-700); margin-bottom: 12px; }

/* ==================== 图片预览 ==================== */
.image-preview-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 9999; align-items: center; justify-content: center;
    cursor: pointer;
}
.image-preview-overlay img {
    max-width: 90%; max-height: 90%; border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
}
.img-preview-loading {
    color: #fff; font-size: 16px; letter-spacing: 2px;
    animation: pulse 1s infinite;
}
/* 预览工具栏：查看原图 / 关闭 */
.img-preview-toolbar {
    position: absolute; top: 16px; right: 16px; z-index: 2;
    display: flex; gap: 10px; align-items: center;
}
.img-preview-btn {
    background: rgba(255,255,255,0.92); color: #222; border: none;
    padding: 8px 16px; border-radius: 22px; font-size: 14px; cursor: pointer;
    box-shadow: var(--shadow-md); transition: background .2s, transform .1s;
}
.img-preview-btn:hover { background: #fff; }
.img-preview-btn:active { transform: scale(0.96); }
.img-preview-close { font-size: 20px; line-height: 1; padding: 4px 14px; }
/* 原图按 EXIF 方向渲染，避免竖拍照片显示为横版 */
#img-preview-src { image-orientation: from-image; }
@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ==================== Toast 通知 ==================== */
.toast {
    position: fixed; bottom: 24px; right: 24px; padding: 14px 24px;
    border-radius: var(--radius); color: #fff; font-size: 14px;
    box-shadow: var(--shadow-xl); z-index: 10000;
    transform: translateX(120%); transition: transform .3s ease;
    max-width: 400px;
}
.toast.show { transform: translateX(0); }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--info); }

/* ==================== 未读通知浮动窗口 ==================== */
.unread-float {
    position: fixed; right: 24px; bottom: 24px; width: 340px; max-width: calc(100vw - 32px);
    background: #fff; border: 1px solid var(--gray-200); border-left: 4px solid var(--primary);
    border-radius: var(--radius); box-shadow: var(--shadow-xl); z-index: 10001;
    overflow: hidden; transform: translateX(120%); opacity: 0;
    transition: transform .35s cubic-bezier(.2,.8,.3,1), opacity .35s ease;
}
.unread-float.show { transform: translateX(0); opacity: 1; }
.unread-float .uf-head {
    background: var(--primary-light); color: var(--primary-dark);
    padding: 10px 14px; font-size: 14px; font-weight: 600;
}
.unread-float .uf-body { display: flex; gap: 10px; padding: 14px; }
.unread-float .uf-icon { font-size: 22px; flex-shrink: 0; line-height: 1.2; }
.unread-float .uf-content { flex: 1; min-width: 0; }
.unread-float .uf-msg { font-size: 13px; line-height: 1.5; margin: 0 0 6px; color: var(--gray-800); word-break: break-word; }
.unread-float .uf-meta { display: block; color: var(--gray-500); font-size: 12px; }
.unread-float .uf-time { display: block; color: var(--gray-400); font-size: 11px; margin-top: 2px; }
.unread-float .uf-foot {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 10px 14px; border-top: 1px solid var(--gray-100); background: var(--gray-50);
}
@media (max-width: 480px) {
    .unread-float { right: 12px; left: 12px; bottom: 12px; width: auto; max-width: none; }
}

/* ==================== 工具栏行（视图切换+新增按钮） ==================== */
.toolbar-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; gap: 12px; flex-wrap: wrap;
}
.toolbar-row .view-switcher { margin-bottom: 0; }

/* ==================== 模态对话框 ==================== */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 5000; align-items: center; justify-content: center;
    padding: 20px;
}
.modal-card {
    background: #fff; border-radius: var(--radius-lg); max-width: 560px; width: 100%;
    max-height: 90vh; display: flex; flex-direction: column;
    box-shadow: var(--shadow-xl); overflow: hidden; animation: modalIn .25s ease;
}
/* 勘察填报须知弹窗 — 半透明毛玻璃效果 */
.modal-card.modal-transparent {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    max-width: 420px;
}
.modal-card.modal-transparent .modal-header,
.modal-card.modal-transparent .modal-body,
.modal-card.modal-transparent .modal-footer {
    background: transparent;
}
@keyframes modalIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header {
    padding: 20px 28px; border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}
.modal-header h3 { font-size: 18px; color: var(--gray-800); }
.modal-body { padding: 24px 28px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-footer {
    padding: 16px 28px; border-top: 1px solid var(--gray-200);
    display: flex; justify-content: flex-end; gap: 12px;
    flex-shrink: 0; background: #fff;
}
.reminder-content p {
    font-size: 14px; color: var(--gray-700); line-height: 1.8; margin-bottom: 12px;
}
.reminder-content p:last-child { margin-bottom: 0; }
.reminder-content strong { color: var(--gray-900); }

/* ==================== 回收站 ==================== */
.recycle-notice {
    background: var(--warning-light); border: 1px solid #fde68a;
    border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px;
    font-size: 13px; color: #92400e;
}
.recycle-row { opacity: 0.6; }
.recycle-row td { color: var(--gray-500) !important; }

/* 按钮文字桌面/移动端切换（默认桌面端） */
.btn-text-mobile { display: none; }
.btn-text-desktop { display: inline; }

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .form-row.two-col { grid-template-columns: 1fr; }
    .radio-group { flex-direction: column; gap: 8px; }
    .calendar-grid { grid-template-columns: repeat(7, 1fr); }
    .cal-day { min-height: 80px; padding: 4px; }
    .cal-day-num { font-size: 12px; }
    .cal-rec-title { font-size: 10px; }
    .cal-rec-line { font-size: 9px; }

    /* 顶部导航移动端适配：高度自适应、分为两行 */
    .top-bar {
        height: auto;
        min-height: 50px;
        padding: 8px 12px;
        flex-wrap: wrap;
        gap: 0;
    }
    .top-bar-left {
        flex: 1 1 100%;
        gap: 8px;
        padding-bottom: 8px;
    }
    .top-bar-right {
        flex: 1 1 100%;
        justify-content: flex-end;
        gap: 6px;
        flex-wrap: wrap;
        padding-top: 8px;
        border-top: 1px solid var(--gray-200);
    }
    .top-title { font-size: 14px; }
    .logo-icon { font-size: 18px; }
    .user-info .user-name { display: none; }
    .user-info { gap: 4px; }
    .badge-dept { font-size: 11px; padding: 1px 6px; }
    .btn-icon { font-size: 18px; padding: 4px; }
    .top-bar-left .btn,
    .top-bar-right .btn { padding: 4px 8px; font-size: 12px; }

    /* 按钮文字桌面/移动端切换 */
    .btn-text-mobile { display: inline; }
    .btn-text-desktop { display: none; }

    .main-content { padding: 12px; }
    .survey-form-container { padding: 12px; }
    .survey-section { padding: 16px; }
    .project-info-bar { margin: 8px 12px; gap: 12px; padding: 12px 16px; }
    .section-nav { padding: 0 12px; top: auto; }
    .section-nav-link { padding: 10px 12px; font-size: 12px; }
    .form-actions-bar { margin: 16px -12px -12px; padding: 12px; }
    .toolbar-row { flex-direction: column; align-items: stretch; }
    .toolbar-row .view-switcher { width: 100%; }
    .view-btn { flex: 1; text-align: center; padding: 8px 12px; font-size: 13px; }
    .toolbar-row .btn { width: 100%; }
    /* 表格滚动 */
    .list-container { overflow-x: auto; }
    .data-table { min-width: 800px; }
    /* 照片缩小 */
    .photo-thumb { width: 90px; height: 90px; }
    /* 模态全屏 */
    .modal-card { max-width: 100%; margin: 0; }
    .modal-overlay { padding: 0; }
    /* 通知面板全宽 */
    .notif-panel { width: 100%; right: 0; left: 0; border-radius: 0; top: auto; }
    /* 查看页 */
    .view-container { padding: 12px; }
    .view-card { padding: 16px; }
    .view-info-grid { grid-template-columns: 1fr; }
    .view-photo-gallery { grid-template-columns: repeat(2, 1fr); }
}

/* ==================== 打印样式 ==================== */
@media print {
    .top-bar, .section-nav, .form-actions-bar, .notif-panel, .modal-overlay,
    .photo-delete, .upload-btn, .btn, .view-photo { display: none !important; }
    body { background: #fff; }
    .view-container, .survey-view-content { padding: 0; max-width: 100%; }
    .view-card, .survey-section-card { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; }
    .survey-section-header { background: #f8f9fa !important; }
    .view-photo-gallery { grid-template-columns: repeat(3, 1fr); }
    .view-photo img { max-width: 100%; height: auto; }
}

/* ==================== PDF导出专用样式 ==================== */
body.pdf-exporting {
    background: #fff;
}
body.pdf-exporting .top-bar,
body.pdf-exporting .image-preview-overlay,
body.pdf-exporting .confirm-bar {
    display: none !important;
}
body.pdf-exporting .view-container {
    padding: 0;
    max-width: 100%;
}
body.pdf-exporting .view-card {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
    break-inside: avoid;
}
body.pdf-exporting .survey-section-card {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
    break-inside: avoid;
}
body.pdf-exporting .survey-section-header {
    background: #f8f9fa !important;
}
body.pdf-exporting .view-host-item {
    page-break-inside: avoid;
    break-inside: avoid;
}
body.pdf-exporting .view-photo-gallery {
    page-break-inside: avoid;
    break-inside: avoid;
}
body.pdf-exporting .view-photo {
    page-break-inside: avoid;
    break-inside: avoid;
    aspect-ratio: auto;
    overflow: visible;
    height: auto;
    animation: none;
    background: none;
}
body.pdf-exporting .view-photo img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* ==================== 后台管理样式 ==================== */
.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--gray-200);
    flex-wrap: wrap;
}
.admin-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all .2s;
    white-space: nowrap;
}
.admin-tab:hover { color: var(--primary); }
.admin-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.admin-panel {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.admin-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
    gap: 8px;
}
.admin-panel-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
}
.admin-panel-count {
    font-size: 13px;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 4px 12px;
    border-radius: 20px;
}
.admin-panel-hint {
    font-size: 13px;
    color: var(--gray-400);
}
.admin-panel .list-container {
    padding: 0 24px 24px;
}
.text-muted { color: var(--gray-400); font-size: 12px; }

/* 条目配置卡片 */
.config-list {
    padding: 20px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 16px;
}
.config-card {
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}
.config-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
}
.config-key-badge {
    font-size: 12px;
    font-family: monospace;
    color: var(--primary);
    background: rgba(79, 70, 229, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
}
.config-card-body {
    padding: 16px;
}
.config-card-body .form-group {
    margin-bottom: 12px;
}
.config-card-body .form-group:last-child {
    margin-bottom: 0;
}
.config-card-body label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 4px;
    display: block;
}
.config-card-body .form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}
.config-card-body .form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* 响应式补充 */
@media (max-width: 768px) {
    .admin-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .admin-tab { padding: 8px 14px; font-size: 13px; }
    .config-list { grid-template-columns: 1fr; padding: 12px; }
    .admin-panel .list-container { padding: 0 12px 16px; }
    .data-table { font-size: 13px; }
}

/* ==================== 后台管理重设计：侧边分组导航 + 统一面板 ==================== */
.admin-shell {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}
.admin-sidebar {
    width: 232px;
    flex: 0 0 232px;
    position: sticky;
    top: 80px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 12px;
}
.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.admin-nav-group { margin-bottom: 6px; }
.admin-nav-group + .admin-nav-group {
    border-top: 1px solid var(--gray-100);
    padding-top: 6px;
    margin-top: 6px;
}
.admin-sidebar-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-400);
    letter-spacing: .5px;
    padding: 12px 12px 6px;
}
.admin-nav-group:first-child .admin-sidebar-title { padding-top: 4px; }
.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 2px;
    transition: all .15s;
}
.admin-nav-item:hover { background: var(--gray-50); color: var(--primary); text-decoration: none; }
.admin-nav-item.active {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.admin-nav-item.active:hover { color: #fff; }
.admin-nav-item .nav-ico { font-size: 16px; line-height: 1; }

.admin-content { flex: 1 1 auto; min-width: 0; }

/* 面板描述（标题下方的灰色说明行） */
.admin-panel-desc {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 3px;
    line-height: 1.5;
}
.admin-panel-body { padding: 0 24px 24px; }

/* 面板内副标题 / 说明段 */
.panel-subtitle {
    margin: 0 0 14px;
    color: var(--gray-600);
    font-size: 13px;
    line-height: 1.6;
}

/* 表格内：缩略图 / 图标单元格 / 限宽单元格 */
.cell-thumb {
    width: 50px; height: 50px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}
.cell-icon { font-size: 20px; }
.cell-clamp { max-width: 320px; }

/* 文字警示说明 */
.text-warning-note {
    margin: 0 0 12px;
    color: #b45309;
    font-size: 13px;
    line-height: 1.6;
}
.text-danger-note {
    color: #b91c1c;
    font-weight: 600;
}

/* 数据管理容器 */
.data-mgmt { max-width: 820px; }

/* 导入拖拽区 */
.import-dropzone {
    border: 2px dashed var(--gray-300);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-bottom: 12px;
}

/* 导入结果（JS 动态设置背景/前景色） */
.import-result {
    display: none;
    margin-top: 16px;
    padding: 16px;
    border-radius: 8px;
}

/* 无权限卡片 */
.perm-denied { text-align: center; padding: 80px 24px; }
.perm-denied .perm-icon { font-size: 64px; margin-bottom: 16px; }
.perm-denied h2 { font-size: 22px; color: var(--gray-800); margin-bottom: 8px; }
.perm-denied p { color: var(--gray-500); margin-bottom: 24px; }

/* 窄屏：侧边栏变为顶部横向滚动导航 */
@media (max-width: 900px) {
    .admin-shell { flex-direction: column; gap: 16px; }
    .admin-sidebar {
        width: 100%;
        flex-basis: auto;
        position: static;
        padding: 8px 12px;
    }
    .admin-nav { flex-direction: row; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
    .admin-nav-group {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin: 0;
        padding: 0;
        border-top: none;
    }
    .admin-nav-group + .admin-nav-group { border-top: none; padding-top: 0; margin-top: 0; }
    .admin-sidebar-title { display: none; }
    .admin-nav-item { white-space: nowrap; margin-bottom: 0; }
    .admin-panel .list-container { padding: 0 12px 16px; }
    .admin-panel-body { padding: 0 12px 16px; }
    .config-list { grid-template-columns: 1fr; padding: 12px; }
}

/* ==================== v2.0 重构新增样式 ==================== */

/* 模块卡片图片 */
.module-image {
    width: 100%; height: 140px; border-radius: var(--radius); overflow: hidden;
    margin-bottom: 16px; background: var(--gray-100);
    display: flex; align-items: center; justify-content: center;
}
.module-image img {
    width: 100%; height: 100%; object-fit: cover;
}
.module-image .module-icon {
    font-size: 48px; margin-bottom: 0;
}

/* 后台管理入口按钮 */
.btn-admin-entry {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important; border: none !important; font-weight: 600;
}
.btn-admin-entry:hover {
    opacity: 0.9; text-decoration: none;
}

/* ==================== 勘察表单页（survey_form.php） ==================== */

/* 表单内容区窄宽度 */
.survey-form-content { max-width: 820px; }

/* 项目信息区块标题 */
.form-section {
    text-align: center; margin-bottom: 24px;
}
.form-section-title {
    font-size: 22px; color: var(--gray-900); margin-bottom: 8px;
}
.form-section-desc {
    color: var(--gray-500); font-size: 14px;
}

/* 勘察元信息 */
.survey-meta {
    display: flex; flex-wrap: wrap; gap: 16px; justify-content: center;
    margin-top: 12px; font-size: 13px; color: var(--gray-600);
}
.meta-item { display: inline-flex; align-items: center; gap: 4px; }

/* 项目基本信息卡片（只读展示） */
.info-card {
    background: #fff; border-radius: 14px; padding: 20px 24px;
    margin-bottom: 20px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.info-card h3 {
    font-size: 16px; color: var(--gray-800); margin-bottom: 12px;
    padding-bottom: 8px; border-bottom: 1px solid var(--gray-100);
}
.info-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px 24px; font-size: 14px; color: var(--gray-700);
}

/* 动态表单卡片头/体 */
.form-card-header {
    margin-bottom: 16px; padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-100);
}
.form-card-header h3 {
    font-size: 18px; color: var(--gray-800); margin-bottom: 4px;
}
.form-card-desc { font-size: 13px; color: var(--gray-500); }
.form-card-body { display: flex; flex-direction: column; gap: 20px; }

/* 类目卡片（勘察内容填写） */
.cat-card {
    padding: 0; margin-bottom: 20px;
    border: 1px solid var(--gray-200); overflow: hidden;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.cat-card .form-card-header {
    margin-bottom: 0; padding: 16px 24px;
    background: #fff;
    border-bottom: 1px solid var(--gray-100);
    display: flex; align-items: flex-start; gap: 12px;
}
.cat-card .form-card-header h3 {
    font-size: 16px; color: var(--gray-800); margin-bottom: 2px; font-weight: 600;
}
.cat-card .form-card-body {
    padding: 20px 24px;
}
.cat-num-badge {
    display: flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--primary); color: #fff; font-size: 13px;
    font-weight: 700; flex-shrink: 0; margin-top: 1px;
}
.cat-header-text { flex: 1; }

/* 字段块 */
.field-block {
    padding: 12px 0; border-bottom: 1px solid var(--gray-50);
}
.field-block:last-child { border-bottom: none; }
.field-label {
    font-size: 14px; font-weight: 600; color: var(--gray-700);
    margin-bottom: 8px;
}

/* 照片网格 */
.photo-grid {
    display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px;
}
.photo-grid:empty { margin-bottom: 0; }
.photo-item {
    position: relative; width: 110px; height: 110px;
    border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm);
}
.photo-item img {
    width: 100%; height: 100%; object-fit: cover; cursor: pointer;
    image-orientation: from-image; /* 按 EXIF 方向渲染，避免竖拍照片显示为横版 */
}
.photo-add-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px; background: var(--primary-light); color: var(--primary);
    border-radius: var(--radius); cursor: pointer; font-size: 14px; font-weight: 500;
    transition: all .15s;
}
.photo-add-btn:hover { background: #c7dbfc; }

/* 视频网格 */
.video-grid {
    display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px;
}
.video-grid:empty { margin-bottom: 0; }
.video-item {
    position: relative; width: 160px; height: 160px;
    border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); background: #000;
}
.video-item video {
    width: 100%; height: 100%; object-fit: cover; background: #000;
}
.video-add-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px; background: #e8f0ff; color: #2b5fd6;
    border-radius: var(--radius); cursor: pointer; font-size: 14px; font-weight: 500;
    transition: all .15s;
}
.video-add-btn:hover { background: #d3e0ff; }

/* 上传进度条 */
.upload-progress-wrap {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 4px 0;
}
.upload-progress-bar {
    flex: 1; height: 8px; background: var(--gray-200);
    border-radius: 4px; overflow: hidden;
}
.upload-progress-fill {
    height: 100%; background: var(--primary);
    border-radius: 4px; transition: width .2s ease;
}
.upload-progress-text {
    font-size: 12px; color: var(--gray-600);
    white-space: nowrap; min-width: 60px;
}

/* 子字段容器 */
.sub-fields-container {
    margin-top: 12px; padding-left: 16px;
    border-left: 3px solid #667eea;
}

/* 再次增加（repeat）字段 - 表单填写页 */
.repeat-container {
    display: flex; flex-direction: column; gap: 12px;
}
.repeat-instance {
    border: 1px solid var(--gray-200); border-radius: 10px;
    padding: 16px; background: var(--gray-50);
    box-shadow: var(--shadow-sm);
}
.repeat-instance-header {
    display: flex; justify-content: flex-end; align-items: center;
    margin-bottom: 8px;
}
.repeat-instance-num {
    display: none;
}
.repeat-add-btn {
    align-self: flex-start; margin-top: 4px;
    border: 1px dashed var(--primary) !important;
    background: var(--primary-light) !important;
    color: var(--primary) !important;
}
.repeat-add-btn:hover {
    background: #c7dbfc !important;
}
.repeat-delete-btn {
    white-space: nowrap;
}

/* 表单提示文字 */
.form-hint {
    font-size: 12px; color: var(--gray-400); margin-top: 4px;
}

/* 空状态 */
.empty-state {
    text-align: center; padding: 80px 24px;
}
.empty-state p { color: var(--gray-400); margin-bottom: 16px; font-size: 15px; }

/* ==================== 勘察查看页（survey_view.php） ==================== */

/* 查看页内容区窄宽度 */
.survey-view-content { max-width: 860px; }

/* 概览卡片 */
.survey-header-card {
    background: #fff; border-radius: 14px; padding: 24px;
    margin-bottom: 16px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    page-break-inside: avoid; break-inside: avoid;
}
.survey-header-top {
    display: flex; align-items: center; gap: 16px; margin-bottom: 16px;
}
.module-icon-lg { font-size: 40px; }
.survey-header-top h2 { font-size: 20px; color: var(--gray-800); margin-bottom: 4px; }
.survey-no { font-size: 13px; color: var(--gray-500); }
.status-lg { font-size: 14px; padding: 4px 14px; }

/* 元信息网格 */
.survey-meta-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px 24px; font-size: 14px; color: var(--gray-700);
    padding-top: 12px; border-top: 1px solid var(--gray-100);
}

/* 业主需求 */
.survey-requirement {
    margin-top: 12px; padding: 12px 16px;
    background: var(--info-light); border-left: 3px solid var(--info);
    border-radius: 0 var(--radius) var(--radius) 0; font-size: 13px;
}
.survey-requirement p { margin-top: 4px; color: var(--gray-700); }

/* 驳回原因 */
.survey-reject-reason {
    margin-top: 12px; padding: 12px 16px;
    background: var(--danger-light); border-left: 3px solid var(--danger);
    border-radius: 0 var(--radius) var(--radius) 0; font-size: 13px;
}
.survey-reject-reason p { margin-top: 4px; color: var(--danger); }

/* 内容区块卡片 */
.survey-section-card {
    background: #fff; border-radius: 14px; padding: 0;
    margin-bottom: 16px;
    border: 1px solid var(--gray-200); overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    page-break-inside: avoid; break-inside: avoid;
}
.survey-section-header {
    margin-bottom: 0; padding: 16px 24px;
    background: #fff;
    border-bottom: 1px solid var(--gray-100);
    display: flex; align-items: flex-start; gap: 12px;
}
.survey-section-header h3 { font-size: 16px; color: var(--gray-800); margin-bottom: 2px; font-weight: 600; }
.survey-section-desc { font-size: 13px; color: var(--gray-500); }
.survey-section-body {
    display: flex; flex-direction: column; gap: 16px;
    padding: 20px 24px;
}

/* 字段展示 */
.survey-field {
    padding: 8px 0; border-bottom: 1px solid var(--gray-50);
}
.survey-field:last-child { border-bottom: none; }
.survey-field-label {
    font-size: 13px; font-weight: 600; color: var(--gray-600); margin-bottom: 6px;
}
.survey-field-content { font-size: 14px; color: var(--gray-800); }

/* 子字段展示 */
.sub-fields-display {
    margin-top: 8px; padding-left: 16px; border-left: 3px solid var(--primary-light);
}
.survey-field.sub-field { padding: 6px 0; }

/* 再次增加（repeat）字段 - 勘察查看页 */
.repeat-display-instance {
    border: 1px solid var(--gray-200); border-radius: 10px;
    margin-bottom: 12px; overflow: hidden;
    page-break-inside: avoid; break-inside: avoid;
}
.repeat-instance-label {
    display: none;
}
.repeat-instance-content {
    padding: 12px 16px;
}

/* 照片展示网格 */
.photo-display-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px; margin-top: 6px;
    page-break-inside: avoid; break-inside: avoid;
}
.photo-display-item {
    border-radius: var(--radius); overflow: hidden; border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .15s;
    aspect-ratio: 4/3;
    page-break-inside: avoid; break-inside: avoid;
}
.photo-display-item:hover { transform: scale(1.02); }
.photo-display-item img {
    width: 100%; height: 100%; object-fit: cover;
    image-orientation: from-image; /* 按 EXIF 方向渲染，避免竖拍照片显示为横版 */
}

/* 视频展示网格 */
.video-display-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px; margin-top: 6px;
    page-break-inside: avoid; break-inside: avoid;
}
.video-display-item {
    border-radius: var(--radius); overflow: hidden; border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm); background: #000;
    aspect-ratio: 16/9;
    page-break-inside: avoid; break-inside: avoid;
}
.video-display-item video {
    width: 100%; height: 100%; object-fit: contain; background: #000;
}

/* 文字内容 */
.text-content {
    background: var(--gray-50); padding: 8px 12px; border-radius: var(--radius);
    color: var(--gray-700); line-height: 1.6;
}

/* 单选展示 */
.radio-display {
    display: inline-block; padding: 2px 12px; border-radius: 12px;
    font-size: 13px; font-weight: 500;
}
.radio-yes { background: var(--success-light); color: var(--success); }
.radio-no { background: var(--danger-light); color: var(--danger); }

/* 确认/驳回操作栏 */
.confirm-bar {
    position: sticky; bottom: 0; background: #fff;
    padding: 16px 24px; border-top: 1px solid var(--gray-200);
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.06); z-index: 50;
    flex-wrap: wrap; gap: 12px;
    page-break-inside: avoid; break-inside: avoid;
}
.confirm-bar-info { font-size: 13px; color: var(--gray-600); flex: 1; min-width: 200px; }
.confirm-bar-actions { display: flex; gap: 12px; }

/* ==================== 移动端适配（v2.0新增） ==================== */
@media (max-width: 768px) {
    .info-grid { grid-template-columns: 1fr; }
    .survey-meta-grid { grid-template-columns: 1fr; }
    .photo-display-grid { grid-template-columns: repeat(2, 1fr); }
    .photo-item { width: 90px; height: 90px; }
    .confirm-bar { flex-direction: column; }
    .confirm-bar-actions { width: 100%; }
    .confirm-bar-actions .btn { flex: 1; }
    .cat-card, .survey-section-card { border-radius: 10px; }
    .cat-card .form-card-header, .survey-section-header { padding: 12px 16px; }
    .cat-card .form-card-body, .survey-section-body { padding: 16px; }
    .repeat-instance { padding: 12px; }
    .repeat-instance-header { flex-wrap: wrap; gap: 8px; }
    .repeat-instance-content { padding: 10px 12px; }
}

/* ==================== 分页组件 ==================== */
.pagination {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    margin-top: 18px; padding: 14px 4px; border-top: 1px solid var(--gray-200);
}
.pagination .page-info { font-size: 13px; color: var(--gray-600); margin-right: 6px; }
.pagination .page-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 10px;
    border: 1px solid var(--gray-200); border-radius: 8px;
    background: #fff; color: var(--gray-700); font-size: 13px; text-decoration: none;
    transition: all .15s ease; cursor: pointer;
}
.pagination .page-btn:hover { border-color: var(--primary); color: var(--primary); }
.pagination .page-btn.active {
    background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600;
}
.pagination .page-btn.disabled {
    opacity: .45; pointer-events: none; cursor: not-allowed;
}
.pagination .page-ellipsis { color: var(--gray-400); padding: 0 2px; }
.pagination .page-jump {
    display: inline-flex; align-items: center; gap: 6px; margin-left: auto;
    font-size: 13px; color: var(--gray-600);
}
.pagination .page-input {
    width: 58px; height: 34px; padding: 0 8px; text-align: center;
    border: 1px solid var(--gray-200); border-radius: 8px; font-size: 13px;
}

/* ==================== 项目名称智能选择下拉 ==================== */
.project-suggestions {
    position: absolute;
    left: 0; right: 0; top: 100%;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(30,58,138,.12);
    z-index: 50;
    max-height: 280px;
    overflow-y: auto;
}
.ps-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}
.ps-item:last-child { border-bottom: none; }
.ps-item:hover { background: #f1f5f9; }
.ps-name { font-weight: 600; color: #1e293b; font-size: 14px; }
.ps-sub { font-size: 12px; color: #64748b; margin-top: 2px; }

/* ==================== 查找页 ==================== */
.search-box {
    background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
    padding: 22px 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.search-form { display: flex; flex-direction: column; gap: 16px; }
.search-row { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.search-label {
    width: 84px; flex-shrink: 0; font-size: 14px; font-weight: 600; color: var(--gray-700);
    padding-top: 8px;
}
.search-type-group { display: flex; flex-wrap: wrap; gap: 10px; }
.search-type-opt {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border: 1px solid var(--gray-200); border-radius: 8px;
    font-size: 13px; color: var(--gray-700); cursor: pointer; background: #fff;
    transition: all .15s ease; user-select: none;
}
.search-type-opt:hover { border-color: var(--primary); }
.search-type-opt.active {
    border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); font-weight: 600;
}
.search-type-opt input { accent-color: var(--primary); }
.search-module { max-width: 260px; }
.search-row-main { align-items: center; }
.search-input { flex: 1; min-width: 240px; }
.search-tip {
    margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--gray-500);
    background: var(--gray-50); border: 1px dashed var(--gray-200);
    border-radius: 8px; padding: 10px 14px;
}
.search-tip strong { color: var(--gray-700); }

@media (max-width: 600px) {
    .search-row { flex-direction: column; align-items: stretch; gap: 8px; }
    .search-label { width: auto; padding-top: 0; }
    .search-module { max-width: none; }
    .pagination .page-jump { margin-left: 0; width: 100%; justify-content: flex-start; }
}

