/* 酒店改造装修评估系统 - 样式文件 */

/* 主题颜色定义 */
:root {
  --primary-color: #1e3a5f;
  --secondary-color: #c9a96e;
  --background-color: #f5f2eb;
  --card-background: #ffffff;
  --text-primary: #1e3a5f;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-color: #e5e0d8;
  --success-color: #27ae60;
  --danger-color: #e74c3c;
  --warning-color: #f39c12;
  --shadow-light: 0 2px 8px rgba(30, 58, 95, 0.08);
  --shadow-medium: 0 4px 16px rgba(30, 58, 95, 0.12);
  --shadow-heavy: 0 8px 32px rgba(30, 58, 95, 0.16);
}

/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background-color: var(--background-color);
  color: var(--text-primary);
}

/* 登录页面 */
.login-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: linear-gradient(135deg, var(--primary-color) 0%, #2c5282 100%);
  padding: 20px;
}

.login-container {
  background: var(--card-background);
  border-radius: 16px;
  padding: 40px 30px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-heavy);
}

.login-title {
  text-align: center;
  margin-bottom: 30px;
}

.login-title h1 {
  color: var(--primary-color);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.login-title .subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 14px;
}

.login-form input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
  background-color: var(--background-color);
}

.login-form input:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.1);
}

.login-form .btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--secondary-color) 0%, #b8955b 100%);
  color: var(--primary-color);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.login-form .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.login-form .btn-primary:active {
  transform: translateY(0);
}

/* 主应用布局 */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* 侧边栏 */
.sidebar {
  width: 280px;
  background: var(--primary-color);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  overflow: hidden;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.sidebar-header h1 {
  font-size: 18px;
  font-weight: 700;
}

.sidebar-header .subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  min-height: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 4px;
  font-size: 14px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
  background: var(--secondary-color);
  color: var(--primary-color);
  font-weight: 600;
}

.nav-item .icon {
  margin-right: 12px;
  font-size: 18px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--secondary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-weight: 700;
  margin-right: 12px;
}

.user-details {
  flex: 1;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
}

.user-role {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.logout-btn {
  margin-top: 12px;
  padding: 10px;
  width: 100%;
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  background: rgba(231, 76, 60, 0.3);
}

/* 主内容区 */
.main-content {
  flex: 1;
  margin-left: 280px;
  height: 100vh;
  overflow-y: auto;
  padding: 24px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-color);
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 卡片样式 */
.card {
  background: var(--card-background);
  border-radius: 12px;
  box-shadow: var(--shadow-light);
  padding: 24px;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-color);
}

/* 按钮样式 */
.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: #2c5282;
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.btn-secondary {
  background: var(--secondary-color);
  color: var(--primary-color);
}

.btn-secondary:hover {
  background: #b8955b;
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-success {
  background: var(--success-color);
  color: white;
}

.btn-success:hover {
  background: #219a52;
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* 表单样式 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: var(--background-color);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.1);
}

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

.form-group.checkbox-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-group.checkbox-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* 复选框组 */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-background);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-light);
  text-align: center;
  border-left: 4px solid var(--secondary-color);
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
}

/* 表格样式 */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  margin: 0;
}

.data-table {
  width: 100%;
  min-width: 720px; /* 关键：防止字段过多时表格被挤压换行，强制触发横向滚动 */
  border-collapse: collapse;
  background: var(--card-background);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-light);
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap; /* 禁止单元格内容换行 */
}

.data-table th {
  background: var(--primary-color);
  color: white;
  font-weight: 600;
  font-size: 13px;
}

.data-table tr:hover {
  background: rgba(30, 58, 95, 0.03);
}

/* 手风琴内容也允许横向滚动 */
.accordion-content {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 报告明细表格外层容器 */
#report-items {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#report-items table {
  min-width: 680px;
}

/* 卡片内直接出现表格时，外层自动包滚动容器的兜底样式 */
.card > .data-table,
.card > table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 滚动条美化（Chrome/Webkit） */
.table-container::-webkit-scrollbar,
.accordion-content::-webkit-scrollbar,
#report-items::-webkit-scrollbar,
.data-table::-webkit-scrollbar {
  height: 8px;
}
.table-container::-webkit-scrollbar-track,
.accordion-content::-webkit-scrollbar-track,
#report-items::-webkit-scrollbar-track,
.data-table::-webkit-scrollbar-track {
  background: #f1ebe0;
  border-radius: 4px;
}
.table-container::-webkit-scrollbar-thumb,
.accordion-content::-webkit-scrollbar-thumb,
#report-items::-webkit-scrollbar-thumb,
.data-table::-webkit-scrollbar-thumb {
  background: #c9a96e;
  border-radius: 4px;
}
.table-container::-webkit-scrollbar-thumb:hover,
.accordion-content::-webkit-scrollbar-thumb:hover,
#report-items::-webkit-scrollbar-thumb:hover,
.data-table::-webkit-scrollbar-thumb:hover {
  background: #b8955b;
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* —— 横向滚动时「第1列改造内容」冻结在左侧（所有模块表格通用）—— */
.data-table th:first-child,
.data-table td:first-child,
table th:first-child,
table td:first-child {
  position: sticky;
  left: 0;
  z-index: 5;
  background: inherit; /* 继承行底色，避免透明漏底 */
  box-shadow: 2px 0 4px -2px rgba(0,0,0,0.08); /* 右侧轻微分隔阴影 */
}
.data-table th:first-child,
table th:first-child {
  z-index: 10; /* 表头冻结列比 body 列层级更高，防止滚动被遮住 */
}

/* —— 第1列「改造内容」列宽紧凑化（默认尽量多显示其它列）—— */
.data-table th:first-child,
.data-table td:first-child,
table th:first-child,
table td:first-child {
  max-width: 200px;     /* 紧凑上限 200px，超过显示省略号 hover 看全文 */
  min-width: 120px;     /* 但保证至少能看清 4~6 个字 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 12px;
  padding-right: 10px;
}
.data-table td:first-child:hover,
table td:first-child:hover {
  white-space: normal; /* hover 展开全文，方便阅读 */
  word-break: break-word;
}

/* —— 行底色继承：保证 sticky 冻结列在斑马纹时能和对应行一致的底色 —— */
.data-table tbody tr,
.data-table tbody tr:nth-child(odd) td,
.data-table tbody tr:nth-child(even) td,
table tbody tr,
table tbody tr:nth-child(odd) td,
table tbody tr:nth-child(even) td {
  background: inherit;
}

/* ===== 用户要求：仅「评估详情」和「预览报告」两个页面，取消横向滚动条 + 取消首列冻结 ===== */
/* （品牌标准库 / 价格管理 / 操作日志 等其他页面保持原状：sticky 冻结 + 独立横向滚动条） */

/* 1. 评估详情页：取消首列 sticky（解冻）+ 取消紧凑首列宽限制 + 取消横向滚动容器 */
.assessment-detail-page .data-table th:first-child,
.assessment-detail-page .data-table td:first-child,
.assessment-detail-page table th:first-child,
.assessment-detail-page table td:first-child,
#report-modal .data-table th:first-child,
#report-modal .data-table td:first-child,
#report-modal table th:first-child,
#report-modal table td:first-child {
  position: static !important;   /* 取消首列冻结在左边（position:sticky → 还原普通流） */
  left: auto !important;
  z-index: auto !important;
  box-shadow: none !important;  /* 取消冻结列的右侧阴影分隔线 */
  max-width: none !important;  /* 不再强制 200px 上限，首列自然展示全文 */
  min-width: 0 !important;     /* 不强制最低宽度，按内容自适应 */
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important; /* 允许换行完整展示，不再省略号 */
  padding-left: 14px !important; /* 与全局保持一致视觉密度 */
  padding-right: 12px !important;
}
.assessment-detail-page .data-table td:first-child:hover,
.assessment-detail-page table td:first-child:hover,
#report-modal .data-table td:first-child:hover,
#report-modal table td:first-child:hover {
  white-space: normal !important;
}
/* 取消容器横向滚动条：表格自然展开，全部列一屏看完，不再需要拉滚动条 */
.assessment-detail-page .table-container,
#report-modal .table-container {
  overflow-x: visible !important;
  border: none !important;
  margin-bottom: 12px !important;
}
.assessment-detail-page .data-table,
.assessment-detail-page table,
#report-modal .data-table,
#report-modal table {
  min-width: 0 !important;     /* 不强制最小宽，按实际内容自适应 */
  width: 100% !important;
  table-layout: auto !important; /* 让浏览器按每列内容比例自然分配宽度 */
}

/* —— 仅预览评估报告弹窗内表格：增加浅色斑马纹（odd淡金/even白），防止错行—— */
#report-modal .data-table tbody tr:nth-child(odd) td,
#report-modal table tbody tr:nth-child(odd) td {
  background-color: #faf7ef; /* 极淡金色，护眼，不刺眼 */
}
#report-modal .data-table tbody tr:nth-child(even) td,
#report-modal table tbody tr:nth-child(even) td {
  background-color: #ffffff;
}
/* 小计汇总行（最后一行）独立底色，不参与斑马 */
#report-modal table tbody tr:last-child td,
#report-modal .data-table tbody tr:last-child td {
  background-color: #f5f2eb !important;
  font-weight: 600;
  border-top: 2px solid #e5e0d8;
}

/* 手风琴样式 */
.accordion {
  margin-bottom: 12px;
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--card-background);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-light);
}

.accordion-header:hover {
  background: #faf9f7;
}

.accordion-header.active {
  border-radius: 8px 8px 0 0;
}

.accordion-title {
  font-weight: 600;
  color: var(--primary-color);
}

.accordion-arrow {
  font-size: 20px;
  color: var(--secondary-color);
  transition: transform 0.3s ease;
}

.accordion-header.active .accordion-arrow {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 20px;
  background: var(--card-background);
  border-radius: 0 0 8px 8px;
  border-top: 1px solid var(--border-color);
  box-shadow: var(--shadow-light);
  display: none;
}

.accordion-content.active {
  display: block;
}

/* 图片上传区域 */
.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--background-color);
}

.upload-area:hover {
  border-color: var(--secondary-color);
  background: rgba(201, 169, 110, 0.05);
}

.upload-area.dragover {
  border-color: var(--secondary-color);
  background: rgba(201, 169, 110, 0.1);
}

.upload-icon {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.upload-text {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 8px;
}

.upload-hint {
  font-size: 14px;
  color: var(--text-muted);
}

/* 图片预览网格 */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.photo-item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-light);
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-item .delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.photo-item:hover .delete-btn {
  opacity: 1;
}

/* 图片轮播弹窗 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.modal-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 8px;
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 32px;
  cursor: pointer;
  padding: 16px;
  border-radius: 50%;
  transition: background 0.3s ease;
}

.modal-nav:hover {
  background: rgba(255, 255, 255, 0.4);
}

.modal-nav.prev {
  left: -60px;
}

.modal-nav.next {
  right: -60px;
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
}

.modal-indicator {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 14px;
}

/* 批量粘贴区域 */
.paste-area {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 24px;
  background: var(--background-color);
}

.paste-area textarea {
  width: 100%;
  height: 120px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: monospace;
  font-size: 13px;
  resize: vertical;
}

.paste-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* 评估报告弹窗 */
.report-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.report-modal.active {
  display: flex;
}

.report-content {
  background: white;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;           /* 三段布局：header(固定) + body(滚动) + actions(固定)，保证手机端底部导出PDF按钮永远可见 */
  flex-direction: column;
  border-radius: 12px;
  box-shadow: var(--shadow-heavy);
  overflow: hidden;        /* 外层不再滚动，只让 .report-body 滚动，固定 footer 按钮 */
}

.report-header {
  background: var(--primary-color);
  color: white;
  padding: 24px;
  border-radius: 12px 12px 0 0;
  text-align: center;
  flex-shrink: 0;
}

.report-header h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.report-header .subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.report-body {
  padding: 24px;
  flex: 1 1 auto;
  overflow-y: auto;           /* 只有报告正文部分滚动，顶部标题 + 底部操作栏永远固定 */
  -webkit-overflow-scrolling: touch;
  min-height: 0;              /* flex 子项正确收缩，超出显示滚动条 */
}

.report-section {
  margin-bottom: 24px;
}

.report-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--secondary-color);
}

.report-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.report-detail-row:last-child {
  border-bottom: none;
}

.report-detail-label {
  color: var(--text-secondary);
}

.report-detail-value {
  font-weight: 600;
  color: var(--primary-color);
}

.report-total {
  background: var(--background-color);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

.report-total-label {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.report-total-value {
  font-size: 48px;
  font-weight: 700;
  color: var(--secondary-color);
}

.report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;               /* 操作栏永远固定在底部，不参与正文滚动 */
  background: #fff;              /* 防止滚动过程中正文内容从按钮下方"透出来" */
  position: -webkit-sticky;      /* iOS Safari 需要加前缀才能稳定 sticky */
  position: sticky;
  bottom: 0;
  z-index: 2;
  /* 兼容 iPhone X+ 底部 Home 指示条，避免导出 PDF / 关闭按钮被挡一半 */
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

/* 搜索框 */
.search-box {
  position: relative;
  margin-bottom: 20px;
}

.search-box input {
  width: 100%;
  padding: 12px 40px 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background: var(--card-background);
}

.search-box input:focus {
  outline: none;
  border-color: var(--secondary-color);
}

.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

/* 列表项 */
.list-item {
  background: var(--card-background);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-light);
}

.list-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-medium);
}

.list-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.list-item-title {
  font-weight: 600;
  color: var(--primary-color);
}

.list-item-date {
  font-size: 12px;
  color: var(--text-muted);
}

.list-item-meta {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* 状态标签 */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.draft {
  background: rgba(243, 156, 18, 0.1);
  color: var(--warning-color);
}

.status-badge.completed {
  background: rgba(39, 174, 96, 0.1);
  color: var(--success-color);
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 64px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* 加载状态 */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--secondary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 通知提示 */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 24px;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  z-index: 2000;
  animation: slideIn 0.3s ease;
  display: none;
}

.notification.show {
  display: block;
}

.notification.success {
  background: var(--success-color);
}

.notification.error {
  background: var(--danger-color);
}

.notification.warning {
  background: var(--warning-color);
}

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

/* 移动端适配 */
/* 侧边栏遮罩层（手机端点击关闭侧边栏） */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}

@media (max-width: 768px) {
  /* 侧边栏：从左边滑出，宽度 80% */
  .sidebar {
    width: 80%;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* 主内容区：占满宽度，缩小 padding */
  .main-content {
    margin-left: 0;
    padding: 10px;
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-value {
    font-size: 24px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .card {
    padding: 12px;
  }

  .login-container {
    padding: 30px 20px;
  }

  /* 按钮：最小高度 44px，字体不小于 14px（适合手指点击） */
  .btn,
  .btn-primary,
  .btn-outline,
  .btn-sm {
    min-height: 44px;
    font-size: 14px;
    padding: 10px 16px;
  }

  /* 输入框：高度 44px，字体不小于 16px（防止 iOS 自动缩放） */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="url"],
  input[type="search"],
  select,
  textarea {
    min-height: 44px;
    font-size: 16px !important;
  }

  /* 弹窗适配：宽度 90%，使用三段式 flex 固定高度，保证"关闭/导出PDF"按钮冻结在底部
     （header 固定 + body 独立滚动 + actions 固定） —— 手机端不再需要滑到底才看得到按钮 */
  .report-modal {
    padding: 5px;
    /* 兼容 iOS 动态地址栏：使用 100dvh 作为视口高度参考，兜底 100vh */
    min-height: 100vh;
    min-height: 100dvh;
  }

  .report-content {
    max-width: 90vw;
    max-height: none;
    /* 给 .report-content 明确高度：三段式 flex 才能正确压缩 .report-body 并让 actions 永远在 footer */
    height: min(92vh, 860px);
    height: min(92dvh, 860px);
    width: 100%;
    border-radius: 8px;
    /* 保证 footer flex-shrink:0 不被压缩 */
  }

  .report-header {
    padding: 16px;
  }

  .report-header h2 {
    font-size: 16px;
  }

  .report-body {
    padding: 12px;
    /* 让中间滚动体真正占 1 份，且不把 footer 撑走（关键：min-height:0 + overflow-y:auto） */
    -webkit-overflow-scrolling: touch;
  }

  .report-actions {
    /* 移动端按钮冻结：不再依赖 sticky，直接用 flex-shrink:0 保证在最底部；
       加 -webkit-sticky / position: sticky 做双重保险（iOS Safari 有时 sticky 比 flex 更稳） */
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    flex-shrink: 0 !important;
    position: -webkit-sticky;
    position: sticky;
    bottom: 0;
    z-index: 3;
    background: #fff;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
  }

  .report-actions .btn {
    width: 100%;
  }

  /* 图片轮播弹窗 */
  .modal-content {
    max-width: 90vw;
    max-height: 80vh;
  }

  .modal-content img {
    max-height: 70vh;
  }

  .modal-nav {
    font-size: 24px;
    padding: 10px;
  }

  .modal-nav.prev {
    left: 5px;
  }

  .modal-nav.next {
    right: 5px;
  }

  /* 关闭按钮放大到 44x44px */
  .modal-close {
    top: 5px;
    right: 5px;
    width: 44px;
    height: 44px;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
  }

  /* 表格容器：水平滚动 + 触摸滑动 */
  .table-container,
  .data-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 表格卡片化：每行变为一张卡片 */
  .data-table.mobile-cards thead {
    display: none;
  }

  .data-table.mobile-cards,
  .data-table.mobile-cards tbody {
    display: block !important;
    width: 100% !important;
  }

  .data-table.mobile-cards tr {
    display: block !important;
    margin-bottom: 12px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    background: white !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  }

  .data-table.mobile-cards td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 12px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    font-size: 14px !important;
    text-align: right !important;
  }

  .data-table.mobile-cards td:last-child {
    border-bottom: none !important;
  }

  .data-table.mobile-cards td::before {
    content: attr(data-label) !important;
    font-weight: 600 !important;
    color: #1e3a5f !important;
    margin-right: 12px !important;
    text-align: left !important;
    flex-shrink: 0 !important;
  }

  /* 卡片化表格中的按钮占满宽度 */
  .data-table.mobile-cards td .btn,
  .data-table.mobile-cards td button {
    margin: 2px !important;
  }

  /* 卡片化表格中的输入框/下拉框：扩展宽度，覆盖内联 width */
  .data-table.mobile-cards td input,
  .data-table.mobile-cards td select {
    width: auto !important;
    max-width: 200px;
    flex: 1;
  }

  /* 卡片化表格中的链接图标不换行 */
  .data-table.mobile-cards td a {
    display: inline;
  }

  /* 修改密码弹窗：覆盖内联 max-width */
  #changePasswordModal .report-content {
    max-width: 90vw !important;
  }

  /* showConfirm 弹窗按钮：增加触摸区域 */
  div[style*="z-index:10001"] button {
    min-height: 44px !important;
    font-size: 14px !important;
    padding: 10px 20px !important;
  }

  /* 表格容器：移动端取消固定 max-height，避免嵌套滚动 */
  .table-container {
    max-height: none !important;
    overflow-y: visible !important;
  }

  /* 通知弹窗适配 */
  #notification {
    left: 10px;
    right: 10px;
    top: 10px;
  }

  /* 页面标题缩小 */
  .page-title {
    font-size: 18px;
  }

  .page-subtitle {
    font-size: 13px;
  }

  /* 评估报告总额缩小 */
  .report-total-value {
    font-size: 32px;
  }

  /* 侧边栏底部用户信息区压缩 */
  .sidebar-footer {
    padding: 12px;
  }

  .user-info {
    gap: 8px;
  }

  .user-name {
    font-size: 13px;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .user-role {
    font-size: 11px;
  }

  .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  /* 退出和修改密码按钮缩小 */
  .sidebar-footer .btn-sm,
  .sidebar-footer .logout-btn {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 36px;
  }
}

/* 菜单按钮（移动端） */
.menu-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  width: 44px;
  height: 44px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 24px;
  cursor: pointer;
  z-index: 101;
}

/* ========== 数据看板样式 ========== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 16px 20px 20px;
}

.dashboard-chart-card {
  background: #faf8f5;
  border: 1px solid #e5e0d8;
  border-radius: 8px;
  padding: 16px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.chart-container {
  flex: 1;
  position: relative;
  min-height: 260px;
}

.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 260px;
  color: #999;
  font-size: 15px;
  background: #faf8f5;
  border-radius: 8px;
}

/* 手机端看板：图表上下堆叠 */
@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 10px;
  }

  .dashboard-chart-card {
    min-height: 220px;
    padding: 12px;
  }

  .chart-container {
    min-height: 200px;
  }

  .chart-empty {
    height: 200px;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* 外部查询页面 */
.external-container {
  min-height: 100vh;
  background: var(--background-color);
  padding: 20px;
}

.external-header {
  text-align: center;
  margin-bottom: 30px;
}

.external-header h1 {
  color: var(--primary-color);
  font-size: 22px;
  margin-bottom: 8px;
}

.external-header .subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

.external-content {
  max-width: 800px;
  margin: 0 auto;
}

/* ===== 草稿自动保存状态栏 ===== */
.draft-status-bar {
  padding: 8px 0;
  text-align: center;
  border-top: 1px dashed #e5e0d8;
  margin-top: 4px;
}

.draft-status-text {
  font-size: 13px;
  color: #888;
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
}

.draft-status-text:hover {
  color: #b8860b;
  text-decoration: underline;
}

/* 草稿恢复弹窗 - 手机端适配 */
@media (max-width: 768px) {
  .draft-status-text {
    font-size: 11px;
  }

  .draft-restore-modal {
    width: 90% !important;
    padding: 20px 16px !important;
  }
}
/* ========== ���������� Combobox ��� ========== */
.combobox {
  position: relative;
  width: 100%;
}

.combobox-input-wrap {
  position: relative;
}

.combobox-input-wrap::after {
  content: " ??\;
 position: absolute;
 right: 14px;
 top: 50%;
 transform: translateY(-50%);
 font-size: 14px;
 color: #999;
 pointer-events: none;
 opacity: 0.7;
}

.combobox input {
 width: 100%;
 padding: 12px 40px 12px 16px !important;
}

.combobox-dropdown {
 position: absolute;
 top: calc(100% + 4px);
 left: 0;
 right: 0;
 max-height: 260px;
 overflow-y: auto;
 overflow-x: hidden;
 background: white;
 border: 2px solid var(--border-color);
 border-radius: 8px;
 box-shadow: 0 8px 24px rgba(30, 58, 95, 0.15);
 z-index: 500;
 display: none;
}

.combobox-dropdown.active {
 display: block;
 animation: fadeInUp 0.18s ease;
}

@keyframes fadeInUp {
 from { opacity: 0; transform: translateY(-6px); }
 to { opacity: 1; transform: translateY(0); }
}

.combobox-item {
 padding: 10px 14px;
 font-size: 14px;
 color: #333;
 cursor: pointer;
 border-bottom: 1px solid #f3eee4;
 transition: background 0.15s;
 user-select: none;
}

.combobox-item:last-child {
 border-bottom: none;
}

.combobox-item:hover,
.combobox-item.selected {
 background: rgba(201, 169, 110, 0.12);
 color: var(--primary-color);
 font-weight: 500;
}

.combobox-empty {
 padding: 14px;
 text-align: center;
 color: #999;
 font-size: 13px;
}

.combobox-hint {
 position: absolute;
 right: 36px;
 top: 50%;
 transform: translateY(-50%);
 font-size: 11px;
 color: #bbb;
 pointer-events: none;
}
