/* ═══════════════════════════════════════════════════════════════
 * 丧仪葬程 - 样式表
 * ═══════════════════════════════════════════════════════════════ */

:root {
  color-scheme: light;
  font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
  color: #1a1a2e;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { min-height: 100vh; padding: 24px 16px 48px; }

.container { max-width: 1100px; margin: 0 auto; }

header { text-align: center; margin-bottom: 28px; }
header h1 {
  font-size: 2rem;
  font-weight: 600;
  background: linear-gradient(135deg, #2c3e50 0%, #4a5568 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.08em;
}
header p { color: #718096; margin-top: 6px; font-size: 0.9rem; }
.screenshot-btn {
  position: absolute;
  top: 24px;
  right: 16px;
  padding: 8px 16px;
  background: #4a5568;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}
.screenshot-btn:hover { background: #2c3e50; }

/* ── 主面板 ── */
.panel {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
}

/* ── 身份输入区 ── */
.section-input {
  background: linear-gradient(135deg, #fefefe 0%, #f8fafc 100%);
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
}
.section-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #a0aec0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  width: 3px;
  height: 14px;
  background: linear-gradient(180deg, #f0c040, #e0a030);
  border-radius: 2px;
}
.input-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.input-grid.five-col { grid-template-columns: repeat(5, 1fr); }
.field label {
  display: block;
  font-size: 0.82rem;
  color: #4a5568;
  margin-bottom: 6px;
  font-weight: 500;
}
.field input, .field select, .field textarea {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.95rem;
  background: #fff;
  transition: all 0.2s ease;
}
.field textarea {
  min-height: 80px;
  resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: #f0c040;
  box-shadow: 0 0 0 3px rgba(240,192,64,0.15);
}
input.editable, select.editable, textarea.editable {
  background: #fffbf0 !important;
  border-color: #f0c040 !important;
  color: #744210;
}

/* ── 主内容区 ── */
.content-area {
  display: grid;
  grid-template-columns: 1fr 320px;
  min-height: 400px;
}

/* ── 左侧：殃位计算 ── */
.section-yang {
  padding: 20px 24px;
  border-right: 1px solid #e2e8f0;
}

.info-group { margin-bottom: 20px; }
.info-group:last-child { margin-bottom: 0; }
.group-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #e2e8f0;
}

.info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}
.info-row.three-col { grid-template-columns: 1fr 1fr 1fr; }
.info-row.full { grid-template-columns: 1fr; }

.info-cell label {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 4px;
}
.info-cell input {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.9rem;
  background: #f8fafc;
  color: #2d3748;
  transition: all 0.15s ease;
}
.info-cell input[readonly] {
  background: #edf2f7;
  color: #4a5568;
  cursor: default;
}
.info-cell input.pair { border-radius: 8px; }

/* ── 右侧：火化安排 ── */
.section-cremation {
  background: linear-gradient(180deg, #fff9f0 0%, #fefcf8 100%);
  padding: 20px 20px;
}
.section-cremation .group-title { color: #b45309; }
.section-cremation .group-title::before {
  background: linear-gradient(180deg, #f59e0b, #d97706);
}

.timeline {
  position: relative;
  padding-left: 20px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, #f59e0b, #fbbf24, #f59e0b);
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  margin-bottom: 14px;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -17px;
  top: 11px;
  width: 8px;
  height: 8px;
  background: #f59e0b;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #fbbf24;
}
.timeline-item label {
  display: block;
  font-size: 0.75rem;
  color: #92400e;
  margin-bottom: 3px;
  font-weight: 500;
}
.timeline-item input {
  width: 100%;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.95rem;
  background: #fff;
  color: #92400e;
  font-weight: 500;
  text-align: center;
}
.timeline-item input[readonly] {
  background: #fef3c7;
  cursor: default;
}

/* ── 分隔强调 ── */
.divider {
  border: none;
  border-top: 1px dashed #e2e8f0;
  margin: 16px 0;
}

/* ── 祭祀日期 ── */
.section-ritual {
  padding: 20px 24px;
  background: linear-gradient(180deg, #f8f9fa 0%, #fff 100%);
  border-top: 1px solid #e2e8f0;
}
/* ── 可收缩展开内容块 ── */
.collapse-block {
  margin-bottom: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}
.collapse-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 14px;
  background: #fff;
  cursor: pointer;
  user-select: none;
}
.collapse-header:hover {
  background: #f8f8f8;
}
.collapse-header-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 0 !important;
}
.collapse-header-top,
.collapse-header-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 第二行标题默认无margin */
.collapse-header-bottom .collapse-subtitle {
  margin-left: 0 !important;
}
.collapse-subtitle {
  font-weight: 700;
  color: #333;
  font-size: 15px;
}
.collapse-title {
  font-weight: 600;
  color: #333;
}
.collapse-arrow {
  color: #999;
  font-size: 12px;
  transition: transform 0.2s;
}
.collapse-content {
  padding: 14px;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  line-height: 1.8;
  overflow: visible !important;
}
.collapse-block.collapsed .collapse-content {
  display: none;
}

/* ── 三种内容样式 ── */
/* 普通文本 */
.collapse-text {
  margin: 0 0 8px 0;
  color: #333;
  font-size: 14px;
}

/* 可复制代码块 */
.collapse-code-block {
  margin: 10px 0;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  overflow: visible !important;
}
.collapse-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: #f5f5f5;
  border-bottom: 1px solid #e8e8e8;
  font-size: 12px;
  color: #666;
}
.collapse-copy-btn {
  padding: 2px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  color: #666;
  font-size: 11px;
  cursor: pointer;
}
.collapse-copy-btn:hover {
  background: #f0f0f0;
}
.collapse-code {
  margin: 0;
  padding: 12px;
  background: #fafafa;
  font-size: 13px;
  color: #333;
  overflow-x: visible !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
}
.collapse-code code {
  font-family: Consolas, Monaco, 'Courier New', monospace;
}

/* 不同颜色的内容区域（基于category） */
.content-red {
  background: #fff5f5 !important;
}
.content-red .collapse-suggestion {
  background: #ffebee !important;
  border-color: #ffcdd2 !important;
}
.content-red .collapse-code-block {
  border-color: #ffcdd2 !important;
}
.content-red .collapse-code-header {
  background: #ffebee !important;
  border-bottom-color: #ffcdd2 !important;
  color: #c62828 !important;
}
.content-red .collapse-code {
  background: #fff5f5 !important;
}

.content-green {
  background: #f5fff5 !important;
}
.content-green .collapse-suggestion {
  background: #e8f5e9 !important;
  border-color: #c8e6c9 !important;
}
.content-green .collapse-code-block {
  border-color: #c8e6c9 !important;
}
.content-green .collapse-code-header {
  background: #e8f5e9 !important;
  border-bottom-color: #c8e6c9 !important;
  color: #2e7d32 !important;
}
.content-green .collapse-code {
  background: #f5fff5 !important;
}

.content-blue {
  background: #f5faff !important;
}
.content-blue .collapse-suggestion {
  background: #e3f2fd !important;
  border-color: #bbdefb !important;
}
.content-blue .collapse-code-block {
  border-color: #bbdefb !important;
}
.content-blue .collapse-code-header {
  background: #e3f2fd !important;
  border-bottom-color: #bbdefb !important;
  color: #1565c0 !important;
}
.content-blue .collapse-code {
  background: #f5faff !important;
}

.content-gray {
  background: #fafafa !important;
}
.content-gray .collapse-suggestion {
  background: #f5f5f5 !important;
  border-color: #e0e0e0 !important;
}
.content-gray .collapse-code-block {
  border-color: #e0e0e0 !important;
}
.content-gray .collapse-code-header {
  background: #fafafa !important;
  border-bottom-color: #e0e0e0 !important;
  color: #616161 !important;
}
.content-gray .collapse-code {
  background: #fafafa !important;
}

/* 带背景色的建议块 */
.collapse-suggestion {
  margin: 10px 0;
  padding: 12px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 6px;
}
.collapse-suggestion-title {
  margin-bottom: 6px;
  font-weight: 600;
  color: #f57c00;
  font-size: 13px;
}
.collapse-suggestion p {
  margin: 0;
  color: #5d4037;
  font-size: 13px;
}

.ritual-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: #1a1a1a;
  margin-bottom: 16px;
  letter-spacing: 0.3em;
}

.ritual-table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 auto 16px;
  border: 1px solid #ccc;
}
.ritual-table td {
  border: 1px solid #ccc;
  padding: 0;
  vertical-align: top;
}
.ritual-table .ritual-name {
  font-weight: 600;
  color: #333;
  text-align: center;
  white-space: nowrap;
  width: 80px;
  min-width: 80px;
  background: #f5f5f5;
  padding: 6px 10px;
  vertical-align: middle;
}
.ritual-table .ritual-right {
  display: flex;
  padding: 0;
  border: none !important;
}
.ritual-table .ritual-date {
  text-align: center;
  white-space: normal;
  width: 200px;
  min-width: 200px;
  color: #666;
  padding: 6px 8px;
  border: none !important;
  border-right: 1px solid #ccc !important;
  border-bottom: 1px solid #ccc !important;
  flex-shrink: 0;
  vertical-align: middle;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.ritual-table .ritual-date span { color: #c00; font-weight: 600; margin: 0 2px; display: block; }
.ritual-table .ritual-desc {
  flex: 1;
  color: #333;
  line-height: 1.6;
  font-size: 0.88rem;
  padding: 6px 10px;
  border: none !important;
  border-bottom: 1px solid #ccc !important;
}
.ritual-item { margin-bottom: 4px; list-style: none !important; padding-left: 0; }
.ritual-item::before { display: none !important; content: none !important; }
.ritual-note-title {
  color: #e65100;
  font-weight: 600;
  margin-bottom: 4px;
}
.ritual-supply-text .ritual-note-title {
  background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 6px;
}
.ritual-supply-text { margin-bottom: 16px; padding: 0 12px; }
.ritual-supply-section { margin-bottom: 12px; }
.ritual-supply-section:last-child { margin-bottom: 0; }
.ritual-notice {
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  color: #333;
  line-height: 1.7;
}
.ritual-notice p { margin-bottom: 4px; }
.ritual-notice p:last-child { margin-bottom: 0; }
.ritual-yearly {
  font-size: 0.88rem;
  color: #333;
  padding: 12px 16px;
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: 8px;
  line-height: 1.7;
  margin-bottom: 16px;
}
.ritual-ad {
  padding: 16px;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 10px;
  color: #333;
  text-align: center;
  margin-top: 16px;
}
.ritual-ad .slogan {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.5;
}
.ritual-ad .services { font-size: 0.8rem; margin-bottom: 10px; line-height: 1.6; }
.ritual-ad .phone {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  line-height: 1.5;
}

/* ── 选项卡 ── */
.tabs {
  display: flex;
  gap: 4px;
  padding: 12px 24px 0;
  background: #f8f9fa;
  border-bottom: 1px solid #e2e8f0;
}
.tab-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  color: #666;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: all 0.2s;
  position: relative;
  white-space: nowrap;
}

/* 桌面端隐藏标签内的换行符 */
@media (min-width: 641px) {
  .tab-btn br {
    display: none;
  }
}
.tab-btn:hover { color: #333; background: #e9ecef; }
.tab-btn.active {
  color: #2c3e50;
  background: #fff;
  font-weight: 600;
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #2c3e50;
}
.tab-content { display: none; padding: 20px 24px; }
.tab-content.active { display: block; }

/* ── 服务区域样式 ── */
.service-section {
  margin-top: 20px;
  padding: 16px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.service-section .section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #2c3e50;
}

/* ── 四列布局 ── */
.input-grid.four-col { grid-template-columns: repeat(4, 1fr); }
.input-grid.two-col { grid-template-columns: repeat(2, 1fr); }
.input-grid.one-col { grid-template-columns: 1fr; }
.info-row-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.info-row-inline .field { flex: 1; min-width: 120px; }

/* ── 信息区块样式 ── */
.info-section {
  margin-top: 16px;
  padding: 16px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.info-section .section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #2c3e50;
}

/* ── 通用标签样式 ── */
.flower-field-inline, .table-combo-field-inline, .urn-combo-field-inline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
}
.flower-field-inline label, .table-combo-field-inline label, .urn-combo-field-inline label {
  display: block;
  font-size: 0.82rem;
  color: #4a5568;
  margin-bottom: 6px;
  font-weight: 500;
}

/* ── 通用行和标签 ── */
.flower-row, .table-row, .urn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.flower-tags, .table-tags, .urn-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── 通用标签样式 ── */
.flower-tag, .table-tag, .urn-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #fffbf0;
  color: #744210;
  border: 1.5px solid #f0c040;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
.flower-tag:hover, .table-tag:hover, .urn-tag:hover { background: #fff5d6; }
.flower-tag .remove, .table-tag .remove, .urn-tag .remove {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f0c040;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
}
.flower-tag .remove:hover { background: #d4a030; }
.table-tag .remove:hover { background: #d4a030; }
.urn-tag:hover .remove { background: #d97706; }

/* ── 汇总行 ── */
.flower-summary, .table-summary, .urn-summary {
  font-size: 0.9rem;
  color: #555;
  white-space: nowrap;
}
.flower-summary strong, .table-summary strong, .urn-summary strong {
  color: #744210;
  font-size: 1rem;
}

/* ── 添加按钮 ── */
.btn-add-flower, .btn-add-table, .btn-add-urn {
  width: 32px;
  height: 32px;
  padding: 0;
  background: #fff;
  color: #333;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-add-flower:hover, .btn-add-table:hover, .btn-add-urn:hover {
  border-color: #f0c040;
  box-shadow: 0 0 0 3px rgba(240,192,64,0.15);
}

/* ── 输入区域 ── */
.flower-input-row, .table-input-row, .urn-input-row {
  margin-top: 8px;
  padding: 12px;
  border: 1.5px dashed #e2e8f0;
  border-radius: 10px;
}
.flower-input-group, .table-input-group, .urn-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.flower-input-group input, .table-input-group input, .urn-input-group input {
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.95rem;
  background: #fff;
  transition: all 0.2s;
}
.flower-input-group input:focus { outline: none; border-color: #f0c040; box-shadow: 0 0 0 3px rgba(240,192,64,0.15); }
.table-input-group input:focus { outline: none; border-color: #f0c040; box-shadow: 0 0 0 3px rgba(240,192,64,0.15); }
.urn-input-group input:focus { outline: none; border-color: #f0c040; box-shadow: 0 0 0 3px rgba(240,192,64,0.15); }

/* ── 桌数输入特定 ── */
.flower-input-group input { width: 80px; }
.table-input-group input:first-child { flex: 1; min-width: 80px; }
.table-input-group input[type="number"] { width: 80px; }

/* ── 骨灰盒输入特定 ── */
.urn-input-group select {
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.95rem;
  background: #fff;
  color: #333;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 60px;
}
.urn-input-group select:focus { outline: none; border-color: #f0c040; box-shadow: 0 0 0 3px rgba(240,192,64,0.15); }
.urn-input-group input:nth-child(2) { width: 70px; }
.urn-input-group input:nth-child(3) { width: 80px; }
.urn-input-group input:nth-child(4) { width: 80px; }

/* ── 鲜花佣金 ── */
.flower-commission-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.flower-commission-field input { width: 100%; }

/* ── 动作按钮 ── */
.flower-input-actions, .table-input-actions, .urn-input-actions {
  display: flex;
  gap: 8px;
}
.btn-confirm-flower, .btn-confirm-table, .btn-confirm-urn {
  padding: 10px 16px;
  background: #fff;
  color: #333;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s;
}
.btn-confirm-flower:hover, .btn-confirm-table:hover, .btn-confirm-urn:hover {
  border-color: #f0c040;
  box-shadow: 0 0 0 3px rgba(240,192,64,0.15);
}
.btn-cancel-flower, .btn-cancel-table, .btn-cancel-urn {
  padding: 10px 16px;
  background: #fff;
  color: #999;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s;
}
.btn-cancel-flower:hover, .btn-cancel-table:hover, .btn-cancel-urn:hover {
  border-color: #ccc;
  color: #666;
}

/* ── 禁用状态 ── */
.editable.disabled {
  background: #f0f0f0;
  color: #999;
  cursor: not-allowed;
}

/* ── 横向时间线 ── */
.timeline-horizontal {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.timeline-horizontal .field { flex: 1; min-width: 100px; }

/* ── 火化安排一行显示 ── */
.cremation-row { padding: 16px; }
.cremation-inline {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.cremation-inline .field { flex: 1; min-width: 90px; }
.cremation-inline .field label { font-size: 0.75rem; }

/* ── 用户数据变量切换按钮 ══════════════════════════════════════ */
#tab-userData .btn-user-vars-toggle {
  float: right;
  width: 22px;
  height: 22px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  color: #ccc;
  transition: color 0.2s;
}
#tab-userData .btn-user-vars-toggle:hover { color: #999; }
#tab-userData .btn-user-vars-toggle::before { content: '●'; }
#tab-userData.user-vars-hidden .btn-user-vars-toggle::before { content: '○'; }
#tab-userData.user-vars-hidden #userVarsList { display: none !important; }

/* ── 费用汇总折叠按钮 ── */
.btn-fee-toggle {
  float: right;
  width: 22px;
  height: 22px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  color: #ccc;
  transition: color 0.2s;
}
.btn-fee-toggle:hover { color: #999; }
.btn-fee-toggle::before { content: '●'; }
.fee-tab-collapsed .btn-fee-toggle::before { content: '○'; }
.fee-tab-collapsed .input-grid { grid-template-columns: 1fr; }
.fee-tab-collapsed .input-grid .field:nth-child(even of .field) { display: none; }

/* 丧葬用品页面 - 折叠时隐藏右列 */
.fee-tab-collapsed .input-grid.two-col .field:nth-child(even) {
  display: none;
}

/* ── Toast 提示 ── */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  z-index: 10000;
  animation: toastIn 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.toast-success { background: #10b981; }
.toast-error { background: #ef4444; }
.toast-info { background: #3b82f6; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── 输入验证样式 ── */
input.invalid, select.invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}
input.invalid:focus { border-color: #dc2626 !important; }

/* ── 加载状态 ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e2e8f0;
  border-top-color: #4a5568;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 工具栏 ── */
.toolbar {
  position: absolute;
  top: 24px;
  right: 16px;
  display: flex;
  gap: 8px;
}
.toolbar-btn {
  padding: 8px 12px;
  background: #4a5568;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}
.toolbar-btn:hover { background: #2c3e50; }
.toolbar-btn.danger { background: #dc2626; }
.toolbar-btn.danger:hover { background: #b91c1c; }

/* ── 确认对话框 ── */
.cl-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}
.cl-dialog {
  background: #fff;
  border-radius: 12px;
  padding: 28px 28px 20px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.cl-dialog-title {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}
.cl-dialog-msg {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 20px;
  line-height: 1.5;
}
.cl-dialog-btns {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.cl-dialog-btns button {
  padding: 8px 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.cl-dialog-cancel { background:#f3f4f6; color:#374151; border-color:#e5e7eb; }
.cl-dialog-cancel:hover { background:#e5e7eb; }
.cl-dialog-discard { background:#fff; color:#dc2626; border-color:#fca5a5; }
.cl-dialog-discard:hover { background:#fef2f2; }
.cl-dialog-save { background:#2563eb; color:#fff; border-color:#2563eb; }
.cl-dialog-save:hover { background:#1d4ed8; }


/* ══════════════════════════════════════════════════════════
 * 表文页面 - 侧边栏布局（圆角卡片风格）
 * ══════════════════════════════════════════════════════════ */

/* 修复：active时才flex，避免两个tab同时显示 */
.biaowen-tab {
  padding: 0 !important;
}
.biaowen-tab.active {
  display: flex !important;
  align-items: flex-start;
  gap: 0;
  min-height: 500px;
}

/* ── 左侧边栏容器 ── */
.biaowen-sidebar {
  width: 200px;
  min-width: 180px;
  flex-shrink: 0;
  padding: 14px 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: transparent;
  min-height: 100%;
}

/* ── 右侧内容区 ── */
.biaowen-content {
  flex: 1;
  padding: 14px 16px;
  min-width: 0;
}

/* ── 侧边栏卡片（独立单元） ── */
.sidebar-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 12px 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 0 0 1px rgba(0,0,0,0.04);
}

/* ── 卡片标题 ── */
.sidebar-card-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  padding: 0 4px;
}

/* ── 过滤项 ── */
.sidebar-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  margin-bottom: 2px;
  user-select: none;
}
.sidebar-filter-item:hover {
  background: #edf1f7;
}
.sidebar-filter-item.active {
  background: #1e293b;
  box-shadow: 0 2px 6px rgba(30,41,59,0.25);
}
.sidebar-filter-item.active .sidebar-filter-label {
  color: #f8fafc;
  font-weight: 600;
}
.sidebar-filter-item.active .sidebar-count {
  background: rgba(255,255,255,0.18);
  color: #f8fafc;
}
.sidebar-filter-label {
  flex: 1;
  font-size: 0.84rem;
  color: #374151;
  font-weight: 500;
}
.sidebar-count {
  font-size: 0.72rem;
  font-weight: 600;
  background: #edf1f7;
  color: #64748b;
  padding: 2px 8px;
  border-radius: 20px;
  min-width: 24px;
  text-align: center;
  line-height: 1.5;
}

/* ── 四种颜色分类的背景色 ── */
.sidebar-filter-item[data-filter="red"] {
  background: #fef2f2;
}
.sidebar-filter-item[data-filter="red"]:hover {
  background: #fee2e2;
}
.sidebar-filter-item[data-filter="red"] .sidebar-filter-label {
  color: #dc2626;
}

.sidebar-filter-item[data-filter="green"] {
  background: #f0fdf4;
}
.sidebar-filter-item[data-filter="green"]:hover {
  background: #dcfce7;
}
.sidebar-filter-item[data-filter="green"] .sidebar-filter-label {
  color: #16a34a;
}

.sidebar-filter-item[data-filter="blue"] {
  background: #eff6ff;
}
.sidebar-filter-item[data-filter="blue"]:hover {
  background: #dbeafe;
}
.sidebar-filter-item[data-filter="blue"] .sidebar-filter-label {
  color: #2563eb;
}

.sidebar-filter-item[data-filter="gray"] {
  background: #f9fafb;
}
.sidebar-filter-item[data-filter="gray"]:hover {
  background: #f3f4f6;
}
.sidebar-filter-item[data-filter="gray"] .sidebar-filter-label {
  color: #6b7280;
}

/* ── 侧边栏圆点 ── */
.sidebar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-red   { background: #ef4444; }
.dot-green { background: #22c55e; }
.dot-blue  { background: #3b82f6; }
.dot-gray  { background: #9ca3af; }

/* 同步给 collapse-dot 补上基础样式和颜色 */
.collapse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.collapse-dot.green  { background: #22c55e; }
.collapse-dot.gray   { background: #9ca3af; }
.collapse-dot.blue   { background: #1e88e5; }
.collapse-dot.red     { background: #e53935; }

/* badge 基础样式和颜色 */
.collapse-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.collapse-tag {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  background: #f5f5f5;
  color: #666;
}
.collapse-tag.red   { background: #ffebee; color: #c62828; }
.collapse-tag.green { background: #dcfce7; color: #15803d; }
.collapse-tag.blue  { background: #e3f2fd; color: #1565c0; }
.collapse-tag.gray  { background: #f3f4f6; color: #6b7280; }
.collapse-badge.green {
  background: #dcfce7;
  color: #15803d;
}
.collapse-badge.blue {
  background: #e3f2fd;
  color: #1565c0;
}
.collapse-badge.gray {
  background: #f3f4f6;
  color: #6b7280;
}
.collapse-badge.red {
  background: #ffebee;
  color: #c62828;
}

/* ── initBiaowenSidebar 通过 data-severity 读取英文值，category 映射在 JS 完成 ── */
/* 预留：若将来直接用中文 class，可在此扩展 */

/* ── 标题列表卡片内的项 ── */
.sidebar-title-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sidebar-title-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s;
}
.sidebar-title-item:hover {
  background: #edf1f7;
}
.sidebar-title-item .sidebar-dot {
  margin-top: 5px;
}
.sidebar-title-text {
  font-size: 0.8rem;
  color: #374151;
  line-height: 1.45;
  word-break: break-all;
}

/* ── 深色模式 ── */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --text-primary: #e4e8ec;
    --text-secondary: #a0aec0;
    --border-color: #2d3748;
  }
  :root {
    background: var(--bg-primary);
    color: var(--text-primary);
  }
  .panel { background: var(--bg-secondary); }
  .section-input { background: linear-gradient(135deg, #1e2a4a 0%, #16213e 100%); border-color: var(--border-color); }
  .info-section { background: #1e2a4a; }
  .section-title { color: var(--text-secondary); }
  .field label { color: var(--text-secondary); }
  .section-cremation { background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%); }
  .timeline-item label { color: #fbbf24; }
  .timeline-item input { background: #1a1a2e; border-color: #4a5568; color: #fbbf24; }
  input, select { background: #1e2a4a; border-color: var(--border-color); color: var(--text-primary); }
  input[readonly] { background: #16213e; }
  .tabs { background: #16213e; border-color: var(--border-color); }
  .tab-btn { color: var(--text-secondary); }
  .ritual-notice, .ritual-yearly { background: #1e2a4a; border-color: var(--border-color); }
  .ritual-ad { background: #1a3a2a; border-color: #2d5a3d; }
}

/* 用户数据管理面板 */
.user-data-panel {
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
}
.user-data-header {
  text-align: center;
  margin-bottom: 20px;
}
.user-data-header h3 {
  margin: 0;
  color: #333;
}
.user-data-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.user-data-select {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}
.btn-primary {
  padding: 8px 20px;
  background: #1976d2;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.btn-primary:hover { background: #1565c0; }
.btn-secondary {
  padding: 8px 20px;
  background: #757575;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.btn-secondary:hover { background: #616161; }
.btn-danger {
  padding: 8px 20px;
  background: #d32f2f;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.btn-danger:hover { background: #c62828; }

/* 相关图片面板 */
.images-panel {
  padding: 20px;
}
.images-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.images-header h3 {
  margin: 0;
  color: #333;
}
.images-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.image-item {
  position: relative;
  aspect-ratio: 1;
  border: 1px dashed #ddd;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-item .delete-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.image-item .delete-btn:hover {
  background: #c62828;
}
.add-image {
  border: 2px dashed #1976d2;
  background: transparent;
}
.add-image:hover {
  background: #e3f2fd;
}
.add-icon {
  font-size: 48px;
  color: #1976d2;
  font-weight: 300;
}
/* 图片放大弹窗 */
.image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.image-modal.show {
  display: flex;
}
.image-modal img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
}
.image-modal .close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 24px;
}
.image-modal .close-btn:hover {
  background: rgba(255,255,255,0.3);
}

.user-data-message {
  margin-top: 15px;
  padding: 10px;
  border-radius: 4px;
  display: none;
}
.user-data-message.info {
  display: block;
  background: #e3f2fd;
  color: #1565c0;
}
.user-data-message.success {
  display: block;
  background: #e8f5e9;
  color: #2e7d32;
}
.user-data-message.warning {
  display: block;
  background: #fff3e0;
  color: #e65100;
}
.user-data-message.error {
  display: block;
  background: #ffebee;
  color: #c62828;
}

/* 用户变量列表 */
.user-vars-list {
  margin-top: 15px;
}
.var-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 8px;
  padding: 4px 0;
  border-bottom: 1px dashed #eee;
}
.var-item:last-child {
  border-bottom: none;
}
.var-name {
  font-weight: bold;
  color: #1976d2;
  width: 120px;
  text-align: right;
  padding-right: 8px;
  flex-shrink: 0;
}
.var-copy {
  width: 36px;
  padding: 2px 4px;
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}
.var-copy:hover {
  background: #45a049;
}
.var-label {
  width: 140px;
  color: #666;
  padding-left: 8px;
  flex-shrink: 0;
}
.var-text {
  color: #333;
  font-size: 13px;
  flex: 1;
}

/* ── 丧葬费用页添加按钮样式 ── */
.btn-add {
  width: 32px;
  height: 32px;
  padding: 0;
  background: #fff;
  color: #333;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-add:hover {
  border-color: #f0c040;
  box-shadow: 0 0 0 3px rgba(240,192,64,0.15);
}

/* ── 标签容器 ── */
.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: 8px;
  flex: 1;
}
.flower-tag, .urn-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #f0f4f8;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}
.flower-tag .remove, .urn-tag .remove {
  color: #999;
  font-weight: bold;
}
.flower-tag:hover, .urn-tag:hover {
  background: #ffe0e0;
}
.flower-tag:hover .remove, .urn-tag:hover .remove {
  color: #f44336;
}

/* ── 输入+按钮组合 ── */
.input-with-btn {
  display: flex;
  align-items: center;
  gap: 0;
}

/* ── 输入行 ── */
.input-row {
  margin-top: 8px;
  padding: 12px;
  border: 1.5px dashed #e2e8f0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.input-row input {
  padding: 8px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #fff;
}
.input-row input:focus {
  outline: none;
  border-color: #f0c040;
  box-shadow: 0 0 0 3px rgba(240,192,64,0.15);
}
.input-row button {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}
#btnConfirmFlower, #btnConfirmUrn, #btnConfirmWaterTable, #btnConfirmMainTable {
  background: #f0c040;
  color: #333;
}
#btnCancelFlower, #btnCancelUrn, #btnCancelWaterTable, #btnCancelMainTable {
  background: #e2e8f0;
  color: #666;
}

/* ══════════════════════════════════════════════════════
   风水模块 v3 · 格龙立向 + 消砂纳水
   ══════════════════════════════════════════════════════ */

/* ── 通用结果面板 ── */
.fengshui-tab { padding: 0; }
.fengshui-result-panel { border-top: 3px solid #f0c040; }
.fs-result-subhead {
  font-size: 0.82rem; font-weight: 700; color: #64748b;
  padding: 10px 0 6px; margin-top: 8px;
  border-top: 1px dashed #e2e8f0; letter-spacing: 0.05em;
}

/* ── 输入区 ── */
.fs-input-row {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 10px 0; border-bottom: 1px solid #f1f5f9;
}
.fs-input-row:last-child { border-bottom: none; }
.fs-input-label {
  width: 50px; flex-shrink: 0; font-size: 0.78rem; font-weight: 700;
  color: #f0c040; background: #1e2a4a; border-radius: 8px;
  padding: 8px 4px; text-align: center; line-height: 1.4; margin-top: 2px;
}
.fs-input-fields { display: flex; flex: 1; gap: 10px; flex-wrap: wrap; }
.fs-input-fields .field { flex: 1; min-width: 110px; }

/* ── 摘要标签栏 ── */
.fengshui-summary-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.fs-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 16px; font-size: 0.8rem; font-weight: 500; }
.fs-tag-blue  { background: #dbeafe; color: #1d4ed8; }
.fs-tag-gray  { background: #f1f5f9; color: #475569; }
.fs-tag-amber { background: #fef3c7; color: #92400e; }

/* ── 排龙诀表格 ── */
.fengshui-table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid #e2e8f0; margin-bottom: 12px; }
.fengshui-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.fengshui-table thead tr { background: linear-gradient(135deg, #1e2a4a 0%, #16213e 100%); color: #f0c040; }
.fengshui-table th { padding: 10px 12px; text-align: center; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.fengshui-table tbody tr { border-bottom: 1px solid #f1f5f9; }
.fengshui-table tbody tr:last-child { border-bottom: none; }
.fengshui-table tbody tr:hover { background: #f8fafc; }
.fengshui-table td { padding: 9px 12px; text-align: center; vertical-align: middle; }
.fs-row-good { background: #f0fdf4 !important; }
.fs-row-good:hover { background: #dcfce7 !important; }
.fs-pair { font-size: 0.95rem; letter-spacing: 0.06em; }
.fs-star { font-weight: 600; }
.fs-mtn  { font-size: 0.84rem; }
.fs-muted { color: #cbd5e1; }
.fs-level { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.76rem; font-weight: 700; }
.fs-daji  { background: #dcfce7; color: #15803d; }
.fs-ji    { background: #d1fae5; color: #16a34a; }
.fs-xiong { background: #fee2e2; color: #dc2626; }
.fs-ping  { background: #fef9c3; color: #a16207; }
.fs-xiang-tag { display: inline-block; padding: 2px 7px; margin: 1px; background: #dbeafe; color: #1d4ed8; border-radius: 8px; font-size: 0.78rem; font-weight: 600; }
.fs-zuo-tag   { display: inline-block; padding: 2px 7px; margin: 1px; background: #fef3c7; color: #92400e; border-radius: 8px; font-size: 0.78rem; font-weight: 600; }

/* ── 推荐坐向 ── */
.fengshui-recommend-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.fs-recommend-item { display: flex; flex-direction: column; gap: 5px; padding: 10px 14px; background: #f8fafc; border-radius: 9px; border-left: 4px solid #f0c040; }
.fs-rec-badge { }
.fs-rec-lines { display: flex; flex-direction: column; gap: 3px; }
.fs-rec-line { display: flex; align-items: center; gap: 5px; font-size: 0.9rem; color: #374151; }
.fs-rec-line strong { color: #1e2a4a; font-size: 0.96rem; min-width: 1.3em; text-align: center; }
.fs-badge { display: inline-block; padding: 3px 10px; border-radius: 16px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.fs-badge-daji { background: #dcfce7; color: #15803d; }
.fs-badge-ji   { background: #d1fae5; color: #16a34a; }
.fs-badge-xiong{ background: #fee2e2; color: #dc2626; }

/* ── 地母翻卦宫位图 ── */
.fs-dima-grid-wrap { overflow-x: auto; margin-bottom: 10px; }
.fs-dima-grid { display: flex; flex-direction: column; gap: 4px; min-width: 380px; }
.fs-dima-row  { display: flex; gap: 4px; }
.fs-dima-cell { flex: 1; border-radius: 9px; padding: 9px 6px; text-align: center; border: 1px solid #e2e8f0; min-width: 70px; }
.fs-dima-cell-ji    { background: #f0fdf4; border-color: #86efac; }
.fs-dima-cell-xiong { background: #fff7f7; border-color: #fca5a5; }
.fs-dima-gua  { font-size: 1rem; font-weight: 800; color: #1e2a4a; }
.fs-dima-seq  { font-size: 1.3rem; font-weight: 900; color: #f0c040; line-height: 1.1; }
.fs-dima-star { font-size: 0.78rem; font-weight: 700; color: #374151; }
.fs-dima-ji   { font-size: 0.7rem; margin-top: 2px; }
.fs-dima-mtns { font-size: 0.68rem; color: #6b7280; margin-top: 3px; line-height: 1.4; }

/* 地母翻卦格龙立向结果块 */
.fs-dima-long-result { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.fs-dima-long-block { border: 1px solid #e2e8f0; border-radius: 9px; overflow: hidden; }
.fs-dima-long-header { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.fs-dima-gua-name { font-weight: 700; color: #1e2a4a; font-size: 0.88rem; }
.fs-dima-long-lines { padding: 8px 12px; display: flex; flex-direction: column; gap: 3px; }

/* 消砂行 */
.fs-sha-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; margin-bottom: 4px; }
.fs-sha-ji    { background: #f0fdf4; border-left: 3px solid #16a34a; }
.fs-sha-xiong { background: #fff7f7; border-left: 3px solid #dc2626; }
.fs-sha-name  { font-weight: 700; color: #1e2a4a; min-width: 75px; font-size: 0.88rem; }
.fs-sha-result{ font-size: 0.9rem; font-weight: 600; }

/* 阳宅布局 */
.fs-yang-section { margin-bottom: 10px; }
.fs-yang-label   { font-size: 0.78rem; font-weight: 600; color: #6b7280; margin-bottom: 5px; }
.fs-yang-item    { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 8px; margin-bottom: 3px; font-size: 0.86rem; }
.fs-yang-ji      { background: #f0fdf4; }
.fs-yang-xiong   { background: #fff7f7; }

/* ── 综合权重对比 ── */
.fs-cw-block { padding: 14px 16px; border-radius: 10px; border-left: 4px solid; margin-bottom: 10px; }
.fs-cw-best  { background: #f0fdf4; border-color: #16a34a; }
.fs-cw-near  { background: #eff6ff; border-color: #3b82f6; }
.fs-cw-ref   { background: #f8fafc; border-color: #94a3b8; }
.fs-cw-avoid { background: #fff7f7; border-color: #dc2626; }
.fs-cw-block-title { font-size: 0.88rem; font-weight: 700; color: #1e2a4a; margin-bottom: 10px; letter-spacing: 0.04em; }
.fs-cw-subtitle { font-size: 0.76rem; font-weight: 400; color: #6b7280; margin-left: 6px; }
.fs-cw-item { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(0,0,0,0.05); }
.fs-cw-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.fs-cw-zuoxiang { font-size: 1.12rem; font-weight: 700; color: #1e2a4a; display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.fs-cw-zuoxiang strong { font-size: 1.22rem; color: #1e3a8a; min-width: 1.4em; text-align: center; }
.fs-cw-hint { font-size: 0.74rem; color: #6b7280; padding-left: 2px; }
.fs-cw-empty { font-size: 0.82rem; color: #94a3b8; font-style: italic; }
.fs-cw-dual { display: flex; gap: 12px; flex-wrap: wrap; }
.fs-cw-side { flex: 1; min-width: 140px; }
.fs-cw-dir  { font-size: 0.78rem; font-weight: 700; color: #3b82f6; margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid #dbeafe; }
.fs-cw-ref-item { font-size: 0.84rem; color: #374151; padding: 3px 0; }
.fs-cw-hint-inline { font-size: 0.74rem; color: #94a3b8; margin-left: 4px; }
.fs-cw-avoid-mtns { display: flex; flex-wrap: wrap; gap: 6px; }
.fs-avoid-tag { display: inline-block; padding: 3px 10px; background: #fee2e2; color: #991b1b; border-radius: 10px; font-size: 0.82rem; font-weight: 600; }

/* ── 二十八星宿消砂 ── */
.fs-28star-info { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.fs-28star-table { font-size: 0.82rem; }
.fs-star28-ji   { background: #f0fdf4; }
.fs-star28-xiong{ background: #fff7f7; }
.fs-dir-cell    { font-size: 0.76rem; color: #64748b; white-space: nowrap; font-weight: 600; }

/* ── 罗盘 ── */
.fs-compass-row { align-items: flex-start; }
.fs-compass-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fs-compass-svg { width: 300px; height: 300px; user-select: none; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3)); }
.fs-compass-sector { transition: filter 0.15s; cursor: pointer; }
.fs-compass-sector:hover { filter: brightness(1.35) saturate(1.2); }
.fs-compass-hint { font-size: 0.76rem; color: #94a3b8; }
.fs-sand-selected { display: flex; flex-wrap: wrap; gap: 5px; min-height: 26px; }
.fs-sand-tag { display: inline-block; padding: 3px 9px; background: #fef3c7; color: #92400e; border-radius: 10px; font-size: 0.8rem; font-weight: 700; }
.fs-clear-btn { padding: 5px 12px; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 0.78rem; color: #64748b; cursor: pointer; transition: background 0.15s; }
.fs-clear-btn:hover { background: #fee2e2; color: #dc2626; }

/* ── 说明文字区 ── */
.fengshui-explanation-section { margin-top: 14px; border-top: 1px dashed #e2e8f0; padding-top: 10px; }
.fengshui-exp-title { display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-size: 0.82rem; font-weight: 600; color: #64748b; padding: 4px 0; user-select: none; }
.fengshui-exp-title:hover { color: #1e2a4a; }
.fs-exp-arrow { font-size: 0.68rem; color: #94a3b8; }
.fengshui-exp-body { margin-top: 8px; }
.fs-copy-btn { padding: 5px 14px; background: #1e2a4a; color: #f0c040; border: none; border-radius: 6px; font-size: 0.78rem; font-weight: 600; cursor: pointer; margin-bottom: 8px; }
.fs-copy-btn:hover { background: #2d3a5a; }
.fengshui-exp-text { margin: 0; padding: 14px; background: #0f1724; color: #c8d6e8; border-radius: 8px; font-family: 'Courier New', monospace; font-size: 0.8rem; line-height: 1.8; white-space: pre-wrap; word-break: break-word; border: 1px solid #2d3a5a; }

/* ── 暗色模式 ── */
@media (prefers-color-scheme: dark) {
  .fengshui-table tbody tr { border-color: #2d3a5a; }
  .fengshui-table tbody tr:hover { background: #1e2a3a; }
  .fs-row-good { background: #052e16 !important; }
  .fengshui-table-wrap { border-color: #2d3a5a; }
  .fs-recommend-item { background: #1e2a4a; }
  .fs-dima-cell { border-color: #2d3a5a; }
  .fs-dima-cell-ji    { background: #052e16; border-color: #166534; }
  .fs-dima-cell-xiong { background: #2d0a0a; border-color: #7f1d1d; }
  .fs-dima-star { color: #cbd5e1; }
  .fs-dima-mtns { color: #94a3b8; }
  .fs-dima-long-block { border-color: #2d3a5a; }
  .fs-dima-long-header { background: #1e2a4a; border-color: #2d3a5a; }
  .fs-sha-ji    { background: #052e16; }
  .fs-sha-xiong { background: #2d0a0a; }
  .fs-yang-ji   { background: #052e16; }
  .fs-yang-xiong{ background: #2d0a0a; }
  .fs-cw-best  { background: #052e16; }
  .fs-cw-near  { background: #0c1a3a; }
  .fs-cw-ref   { background: #1e2a4a; }
  .fs-cw-avoid { background: #2d0a0a; }
  .fs-cw-block-title { color: #f0c040; }
  .fs-cw-zuoxiang { color: #e2e8f0; }
  .fs-cw-zuoxiang strong { color: #93c5fd; }
  .fs-cw-hint { color: #94a3b8; }
  .fs-cw-dir  { color: #60a5fa; border-color: #1e3a6a; }
  .fs-cw-ref-item { color: #cbd5e1; }
  .fs-input-row { border-color: #2d3a5a; }
  .fs-result-subhead { border-color: #2d3a5a; color: #94a3b8; }
}
