/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Noto Serif SC", "SimHei", serif;
}
img {
  max-width: 100%;
  height: auto;
}

/* 无背景图：纯色背景 */
.page-container {
  width: 100%;
  min-height: 100vh;
  padding: 20px;
  box-sizing: border-box;
  background-color: #0c2f42;
  position: relative;
  overflow: hidden;
}
.page-container::before,
.page-container::after {
  display: none;
}
body.page-form .page-container {
  background-color: #0c2f42;
}
body.page-report .page-container {
  background-color: #f5f7fa;
}
body.page-report .container {
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border: 1px solid #e8ecf0;
  border-radius: 8px;
}

/* 容器样式：圆角+金边+新中式质感 */
.container {
  width: min(100%, 1000px);
  max-width: 1000px;
  margin: 0 auto;
  padding: 30px;
  background: rgba(255, 255, 255, 0.54);
  backdrop-filter: blur(1px);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  border: 1px solid #e0c890;
  position: relative;
  z-index: 2;
  overflow: hidden;
}
.container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, #d4af37, #f0e68c, #d4af37);
}

/* 标题样式：书法感+金色点缀 */
h1 {
  font-size: 2.2rem;
  color: #5a4a32;
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  padding-bottom: 0.8rem;
}
h1::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 2px;
  background: #d4af37;
}
h2 {
  font-size: 1.6rem;
  color: #5a4a32;
  margin: 2rem 0 1rem;
  border-left: 4px solid #d4af37;
  padding-left: 0.8rem;
}
h3 {
  font-size: 1.3rem;
  color: #6b583e;
  margin: 1rem 0 0.8rem;
}

/* 表单样式 */
.form-group {
  margin-bottom: 1.5rem;
}
label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #5a4a32;
}
input[type="text"],
select,
input[type="file"] {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid #d4c8b0;
  border-radius: 6px;
  background: #faf8f4;
  font-size: 1rem;
  color: #332b1f;
  transition: border-color 0.3s;
}
input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: #d4af37;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1);
}

/* 出生年月行列布局 */
.birth-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.birth-row select {
  flex: 1;
  min-width: 80px;
  position: relative;
  z-index: 3;
  appearance: auto;
  -webkit-appearance: menulist;
}

/* 多选框组 */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 实例图片样式 */
.example-img {
  display: block;
  width: min(100%, 360px);
  max-width: 100%;
  height: auto;
  margin: 0.8rem 0;
  border: 1px solid #d4c8b0;
  border-radius: 6px;
}
.example-tip {
  color: #888;
  margin: 0.5rem 0;
}

/* 按钮样式：金色渐变 */
.btn {
  display: inline-block;
  width: 100%;
  padding: 0.8rem 2rem;
  background: linear-gradient(to right, #d4af37, #f0e68c);
  color: #332b1f;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 1rem;
}
.btn:hover {
  background: linear-gradient(to right, #b8860b, #d4af37);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.btn-small {
  width: auto;
  padding: 0.45rem 0.9rem;
  margin-top: 0.4rem;
  margin-right: 0.45rem;
  font-size: 0.88rem;
}

/* 报告板块样式 */
.report-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(250, 248, 244, 0.46);
  border-radius: 8px;
  border: 1px solid #e0c890;
}
.report-14-wrapper { padding: 1rem 0; }
.report-14-title { font-size: 1.25rem; color: #2c3e50; margin-bottom: 1rem; border-left: 4px solid #4a6fa5; padding-left: 0.6rem; }
.report-14-content { margin-top: 0.8rem; }
.report-14-body { font-size: 0.95rem; line-height: 1.65; color: #333; }
.report-14-body .report-14-h1 { font-size: 1.35rem; margin: 1.2rem 0 0.6rem; color: #1a365d; }
.report-14-body .report-14-h2 { font-size: 1.2rem; margin: 1.1rem 0 0.5rem; color: #2c3e50; border-left: 3px solid #b8860b; padding-left: 0.5rem; }
.report-14-body .report-14-h3 { font-size: 1.05rem; margin: 0.9rem 0 0.4rem; color: #4a5568; }
.report-14-body .report-14-p { margin: 0.4rem 0; }
.report-14-body .report-14-ul { margin: 0.5rem 0 0.5rem 1.2rem; padding-left: 0.5rem; }
.report-14-body .report-14-ul li { margin: 0.25rem 0; }
.report-placeholder { color: #718096; font-style: italic; }
.report-charts-wrapper { margin-top: 1.5rem; }
.chart-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}
.chart-box {
  min-height: 280px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid #e8d8b6;
  border-radius: 6px;
  padding: 0.4rem;
}
.chart-wide {
  grid-column: span 2;
}
.fortune-params {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}
.highlight-param {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.55rem 0.8rem;
  background: #fff8e1;
  border-radius: 4px;
  border-left: 3px solid #d4af37;
}
.param-icon {
  width: 16px;
  height: 16px;
  margin-right: 0.4rem;
  vertical-align: middle;
}
.other-params {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px dashed #e0c890;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  color: #5a4a32;
}
.other-param-block {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid #e8d8b6;
  border-radius: 6px;
  padding: 0.8rem 0.9rem;
  line-height: 1.8;
}
.other-param-block h4 {
  color: #6b583e;
  margin-bottom: 0.35rem;
}
.other-param-block p {
  margin: 0;
}

/* 八方物品布局 */
.direction-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}
.direction-item {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.62);
  border-radius: 6px;
  border: 1px solid #d4c8b0;
}
.direction-item h4 {
  color: #5a4a32;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}
.direction-display.report-direction-readonly {
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.62);
  border-radius: 6px;
  border: 1px solid #d4c8b0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #3d3d3d;
  margin: 0.5rem 0 1rem;
}
.direction-display.report-direction-readonly .dir-line { margin: 0.2rem 0; }
.direction-grid-form { margin-top: 0.5rem; }
.direction-grid-form .direction-item { padding: 0.5rem; }
.direction-label { display: block; font-size: 0.9rem; color: #6b583e; margin-bottom: 0.25rem; }
.direction-grid-form input { width: 100%; padding: 0.4rem 0.5rem; font-size: 0.9rem; border: 1px solid #d4c8b0; border-radius: 4px; }
.direction-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #eee;
  border-radius: 4px;
  font-size: 0.9rem;
}
.recognition-tip {
  margin: 0.25rem 0 0.8rem;
  color: #8b6d3a;
}
.desk-image-wrap {
  margin: 0.5rem 0 0.8rem;
}
.desk-image-preview {
  display: block;
  width: min(100%, 360px);
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #d4c8b0;
  border-radius: 6px;
  padding: 4px;
}
.image-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.direction-input[disabled] {
  cursor: not-allowed;
  opacity: 0.7;
}
.direction-input {
  resize: vertical;
  min-height: 44px;
}

/* 报告内容样式 */
.report-content {
  line-height: 1.8;
  color: #332b1f;
}
.report-content p {
  white-space: pre-line;
}
.report-part {
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid #ead9b8;
  border-radius: 8px;
  padding: 0.9rem 1rem;
}
.report-title-icon {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0;
}
.optimize-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}
@media (max-width: 768px) {
  .optimize-grid { grid-template-columns: 1fr; }
}
.optimize-card {
  border: 1px solid #e8d8b6;
  border-radius: 8px;
  padding: 1rem;
  background: #faf8f4;
}
.optimize-card h4 {
  color: #8b6d3a;
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #e8d8b6;
}
.optimize-item { margin: 0.5rem 0; font-size: 0.95rem; }
.optimize-item .key { font-weight: 600; color: #5a4a32; }
.module-content { line-height: 1.9; }

/* 理工风报告样式 */
.report-title-main { font-size: 1.8rem; color: #1a365d; font-weight: 600; margin-bottom: 1.5rem; }
.report-section-data h2, .report-section-directions h2 { font-size: 1.3rem; color: #2c3e50; border-left: 4px solid #4a6fa5; padding-left: 0.6rem; }
.sub-section-title { font-size: 1.1rem; color: #4a5568; margin: 1rem 0 0.6rem; }
.chart-with-desc { margin-bottom: 2rem; border-bottom: 1px solid #e8ecf0; padding-bottom: 1.5rem; }
.chart-with-desc:last-of-type { border-bottom: none; }
.chart-with-desc h4 { font-size: 1rem; color: #2c3e50; margin-bottom: 0.5rem; }
.chart-desc { font-size: 0.95rem; line-height: 1.75; color: #4a5568; margin-top: 0.5rem; }
.report-text-block { font-size: 1rem; line-height: 1.9; color: #2c3e50; }
.status-tip { font-size: 0.9rem; color: #2e7d32; margin-top: 0.5rem; }
.btn-save { margin-top: 1.5rem; background: #2c3e50; color: #fff; }
.btn-save:hover { background: #34495e; }
/* 加载动画样式 */
.loading {
  text-align: center;
  padding: 2rem 0;
  color: #5a4a32;
}
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #d4af37;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* AI生成按钮特殊样式 */
.generate-btn {
  background: linear-gradient(to right, #8B4513, #A0522D);
  color: #fff;
}
.generate-btn:hover {
  background: linear-gradient(to right, #6B3E26, #8B4513);
}

/* 报告内容隐藏/显示切换 */
.report-hidden {
  display: none;
}

#deepOptimization p {
  margin-bottom: 0.7rem;
}
#deepOptimization span {
  white-space: pre-line;
}

@media (max-width: 960px) {
  .fortune-params,
  .other-params {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .fortune-params,
  .other-params,
  .direction-grid,
  .chart-grid {
    grid-template-columns: 1fr;
  }
  .container {
    padding: 18px;
    background: rgba(255, 255, 255, 0.38);
  }
  .page-container {
    padding: 10px;
    overflow: visible;
  }
  .page-container::before {
    background-size: cover;
    opacity: 0.92;
  }
  h1 {
    font-size: 1.7rem;
  }
  h2 {
    font-size: 1.3rem;
  }
  h3 {
    font-size: 1.1rem;
  }
  .btn-small {
    width: 100%;
    margin-right: 0;
  }
  .example-img {
    width: 100% !important;
    max-width: 100% !important;
    object-fit: contain;
  }
  .desk-image-preview {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 220px;
  }
  .chart-wide {
    grid-column: span 1;
  }
  .birth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .birth-row select {
    min-width: 0;
  }
}