@font-face {
  font-family: 'Source Han Sans SC';
  src: local('Source Han Sans SC');
}

/* 添加main-container样式 */
.main-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: visible !important;
  margin: 0;
  padding: 0;
}

/* 头部样式 */
.header {
  height: 60px;
  /* 背景渐变将通过JavaScript动态设置 */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
  z-index: 1000;
  padding: 0;
  margin: 0;
}

@keyframes gradientFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* 添加header-content样式，使logo与内容容器左对齐 */
.header-content {
  width: 1144px;  /* 与content-wrapper相同宽度 */
  padding: 0 20px;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.header img {
  width: 150px;
  height: 36px;
  margin-left: 0;  /* 修改为0，将logo左对齐 */
}

.input-with-color input[type="color"] {
  width: 32px;
  height: 32px;
  padding: 3px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
}

.input-with-color input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.input-with-color input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

/* 基础样式 */
:root {
  /* 主题颜色变量 */
  --theme-color: #5E619A; /* 默认主题色 */
  --theme-color-hover: #686ba3; /* 悬停状态色 */
  --theme-color-active: #4d4f7d; /* 按下状态色 */
  --theme-color-light: #eeeff5; /* 轻微强调色 */
  --theme-color-medium: #7577ab; /* 中等强调色 */
  --theme-color-selected: #999bc1; /* 选中状态色 */
}

body {
  font-family: 'Source Han Sans SC', sans-serif !important;
  margin: 0;
  padding: 0;
}

.rectangle, .right-panel, .header, .main-title, .sub-title, table, th, td, label, input, button, select, .custom-select-container, .custom-select-trigger, .custom-select-option, .watermark {
  font-family: 'Source Han Sans SC', sans-serif !important;
}

/* 内容区域布局 */
.content-wrapper {
  display: flex;
  flex: 1;
  max-width: 1144px;  /* 794px + 300px + 50px = 1144px，容纳矩形区域+间距+右侧设置栏 */
  margin: 0 auto;  /* 水平居中 */
  justify-content: center;  /* 水平居中 */
  align-items: flex-start;  /* 顶部对齐 */
  padding: 0;  /* 移除内边距，改为在子元素中控制 */
  overflow: visible !important;
}

/* 左侧面板响应式布局 */
.left-panel {
  flex: 0 0 auto;  /* 不伸缩 */
  box-sizing: border-box;
  height: auto;  /* 自动高度 */
  overflow-y: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: none;
  overflow-x: hidden;
  padding: 20px 0 0 0; /* 只设置顶部内边距 */
  overflow: visible !important;
}

/* 右侧面板响应式布局 */
.right-panel {
  width: 300px;
  padding: 20px 20px 0 20px;
  box-sizing: border-box;
  background-color: white;
  border-left: 1px solid #eee;
  height: 1123px;
  overflow-y: auto;
  margin-left: 50px;
  margin-top: 20px; /* 新增：与左侧白色区域顶部对齐 */
  font-weight: normal;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.10);
}

/* A4纸张响应式布局 */
.rectangle {
  background-color: white;
  width: 794px;
  height: 1123px;
  padding: 0 20px;  /* 移除顶部内边距 */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 32px auto;
  flex-shrink: 0;
  transform-origin: top center;
  border: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.1);
}

/* 移动设备适配 */
@media screen and (max-width: 834px) {
  body {
    overflow-x: hidden;
    width: 100%;
  }
  
  .content-wrapper {
    flex-direction: column-reverse;
    max-width: 100%;
    padding: 0;
  }

  .left-panel {
    width: 100vw;
    margin: 0;
    overflow-x: hidden;
    padding: 20px 0 0 0; /* 保持与桌面版一致 */
  }

  .rectangle {
    width: 100vw;
    transform-origin: top left;
    margin: calc((1123px * (1 - 100vw / 794)) / -2) 0;
    position: relative;
    left: 0;
    padding: 0 20px; /* 保持与桌面版一致 */
  }

  .rectangle {
    transform: scale(calc(100vw / 794));
  }

  .right-panel {
    width: 100vw;
    padding: 20px 20px 0 20px; /* 保持顶部内边距与左侧面板一致 */
    box-sizing: border-box;
    height: auto;
    margin-left: 0;
  }

  #main-title {
    margin-top: 40px; /* 保持与桌面版一致 */
  }
  
  .header img {
    margin-left: 20px; /* 在移动设备上恢复左边距 */
  }

  .header-content {
    padding: 0;
  }
}

/* 媒体查询 - 平板设备 */
@media screen and (max-width: 1024px) {
  .content-wrapper {
    flex-direction: column-reverse;
    max-width: 100%;
    padding: 0;
  }

  .right-panel {
    width: 100%;
    height: auto;
    min-height: auto;
    border-left: none;
    border-bottom: 1px solid #eee;
    margin-left: 0;
    padding: 20px 20px 0 20px; /* 保持顶部内边距与左侧面板一致 */
  }

  .left-panel {
    height: auto;
    padding: 20px 0 0 0; /* 保持与桌面版一致 */
  }
  
  .header img {
    margin-left: 20px; /* 在平板设备上恢复左边距 */
  }
}

@media screen and (max-width: 428px) {
  .rectangle {
    transform: scale(0.5);
    margin: -280px auto;
  }
}

/* 表格响应式布局 */
table {
  width: 100%;
  max-width: calc(100% - 40px);
  border-collapse: collapse;
  margin: 10px 0;
  border: 1px solid #ddd;
}

/* 标题响应式字体大小 */
#main-title {
  font-size: clamp(18px, 4vw, 24px);
  text-align: center;
  margin-bottom: 5px;
  margin-top: 40px; /* 添加顶部边距，替代矩形区域的内边距 */
}

/* 小标题样式 */
.sub-title {
  font-size: 16px;
  font-weight: normal;
  margin: 10px 0;
  text-align: center;
  letter-spacing: 0.01em;
  -webkit-user-select: none;
  user-select: none;
}

/* 媒体查询 - 移动设备 */
@media screen and (max-width: 768px) {
  .header {
    height: 50px;
  }
  
  .header img {
    width: 120px;
    height: 30px;
  }

  .input-group,
  .switch-container {
    margin-bottom: 12px;
  }

  .input-with-color {
    flex-wrap: wrap;
  }

  table td {
    padding: 4px;
    font-size: 14px;
  }

  .rectangle {
    padding: 0 10px; /* 左右内边距减小 */
  }
}

/* 打印样式 */
@media print {
  body {
    display: block;
  }

  .right-panel {
    display: none;
  }

  .header {
    display: none;
  }

  .main-container {
    display: block;
  }

  .left-panel {
    padding: 0;
    height: auto;
    overflow: visible;
  }

  .rectangle {
    box-shadow: none;
    page-break-after: always;
  }
}

/* 表单控件样式 */
label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-size: 14px;
}

span {
  font-size: 14px;
  color: #333;
  /*margin-bottom: 8px;*/
  /*margin-top: 10px;*/
  /*align-items: center;*/
}

select,
input[type="text"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #333;
}

/* 自定义下拉框样式 */
.custom-select {
  width: 100%;
  position: relative;
  cursor: pointer;
  margin-bottom: 16px;
}

.custom-select {
  width: 100%;
  position: relative;
  cursor: pointer;
}

.selected-option {
  padding: 8px 12px;
  padding-right: 32px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 0;
  font-size: 14px;
  color: #333;
  display: flex;
  align-items: center;
  background-color: #fff;
  position: relative;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

/* 通用下拉列表容器样式 */
.options-container,
.custom-select-options {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 320px;
  overflow-y: auto;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  z-index: 100;
  display: none;
  margin-top: 2px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  padding: 4px 0;
}

/* 确保背景颜色一致 */
.custom-select-options {
  background-color: #fff;
}

.option {
  padding: 8px 12px;
  display: flex;
  align-items: center;
}

.option:hover {
  background-color: var(--theme-color-light);
}

/* 自定义颜色块样式 */
.color-block {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border-radius: 3px;
  vertical-align: middle;
}

.option-text {
  flex: 1;
}

select:focus,
input[type="text"]:focus {
  outline: none;
  border-color: #5e619a;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

/* 颜色选择器容器 */
.color-picker-container {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

input[type="color"] {
  -webkit-appearance: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

/* 按钮样式 */
button {
  width: 100%; /* 设置宽度为100%，使按钮与上面控件左右对齐 */
  padding: 10px;
  background-color: var(--theme-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 12px;
  transition: background-color 0.2s;
  /* 禁止用户选择文本 */
  -webkit-user-select: none;
  /* 适用于 Chrome、Safari 和 Opera */
  -moz-user-select: none;
  /* 适用于 Firefox */
  -ms-user-select: none;
  /* 适用于 IE 和 Edge */
  user-select: none;
  /* 标准语法 */
}

button:hover {
  background-color: var(--theme-color-hover);
}

button:active {
  background-color: var(--theme-color-active);
}


/* 表格样式 */
th,
td {
  border: 1px solid #ddd;
  padding: 6px;
  text-align: center;
  height: 44px;
  box-sizing: border-box;
  color: #333;
}

/* 开关按钮容器 */
.switch-container {
  display: flex;
  align-items: center;
  align-items: center;
  margin-bottom: 16px !important;
  gap: 12px;
}

.switch-label {
  color: #333;
  font-size: 14px;
}

/* 开关按钮样式 */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--theme-color);
}

input:focus+.slider {
  box-shadow: 0 0 1px var(--theme-color-medium);
}

input:checked+.slider:before {
  transform: translateX(20px);
}

/* 输入组样式 */
.input-group {
  margin-bottom: 16px;
}

.input-with-color {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 18px;
  width: 100%;
}

.input-with-color input[type="text"] {
  width: 100%;
  flex: 1;
  margin-bottom: 0;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 14px;
  letter-spacing: 0.05em;

}

.input-with-color input[type="color"] {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 3px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
  box-sizing: border-box;
}

.input-with-color input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.input-with-color input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

/* 确保输入组内的所有元素右对齐 */
.input-group {
  display: flex;
  flex-direction: column;
}

.input-group label {
  align-self: flex-start;
}

/* 确保大标题和小标题输入框的样式一致 */
#title1, #title2 {
  width: 100%;
  flex: 1;
}

/* 加粗所有控件标签 */
label {
  margin-bottom: 8px;
  display: block;
  color: #333;
  font-size: 14px;
  font-weight: bold;
}

/* 修改颜色拾取器容器样式 */
.color-picker-container {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

/* 确保PDF内容垂直居中 */
.rectangle {
  background-color: white;
  width: 794px;
  height: 1123px;
  margin: 0 auto;
  padding: 40px 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px 0 rgba(0,0,0,0.1);

}

/* 调整表格在PDF中的位置 */
table {
  width: calc(100% - 100px);
  border-collapse: collapse;
  margin: auto 0;
  border: 1px solid #ddd;
  height: 880px;
}

/* 统一所有输入组的间距 */
.input-group,
select,
.switch-container {
  margin-bottom: 16px;
}

/* 移除多余的换行标签 */
br {
  display: none;
}

/* 防止文字被选中和复制 */
#main-title,
.sub-title,
table td {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* 自定义下拉列表容器 */
.custom-select-container {
  position: relative;
  width: 100%;
  margin-bottom: 16px;
  box-sizing: border-box;
}

/* 自定义下拉列表触发按钮 */
.custom-select-trigger {
  width: 100%;
  padding: 8px 12px;
  padding-right: 32px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  color: #333;
  background-color: white;
  cursor: pointer;
  position: relative;
  text-align: left;
  display: block;
  box-sizing: border-box;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

/* 移除custom-select-trigger中多余的after伪元素 */
.custom-select-trigger::after {
  display: none;
}

/* 自定义下拉列表选项容器样式已合并到通用样式中 */

/* 显示下拉选项 */
.custom-select-container.active .custom-select-options {
  display: block;
}

/* 自定义下拉列表选项 */
.custom-select-option {
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  line-height: 1.2;
  color: #333333;
}

/* 自定义下拉列表选项悬停效果 */
.custom-select-option:hover {
  background-color: var(--theme-color-medium);
  color: white;
}

/* 自定义下拉列表选中选项 */
.custom-select-option.selected {
  background-color: var(--theme-color-selected);
  color: white;
}

/* Firefox特定样式 */
@-moz-document url-prefix() {
  select {
    border-radius: 4px !important;
  }

  select:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 #333;
  }
}

/* IE特定样式 */
select::-ms-expand {
  display: none;
}

select::-ms-value {
  background: none;
  color: #333;
}

/* 单页时的布局 - 修改这部分 */
.left-panel:has(.rectangle:only-child) {
  justify-content: flex-start;
  padding-top: 20px;
}

/* 多页时的布局 */
.left-panel:not(:has(.rectangle:only-child)) {
  gap: 20px;
  padding: 20px 0;
}

/* 统一所有页面的标题样式 */
.rectangle h1 {
  font-size: 24px;
  font-weight: normal;
  margin: 0 0 5px 0;
  text-align: center;
  -webkit-user-select: none;
  user-select: none;
}

/* 小标题样式 */
.rectangle h3 {
  font-size: 16px;
  font-weight: normal;
  margin: 10px 0;
  text-align: center;
  letter-spacing: 0.01em;
  -webkit-user-select: none;
  user-select: none;
}

/* 移除之前可能存在的特殊样式 */
#main-title {
  font-size: 24px !important;
}

/* 移动端适配 */
@media screen and (max-width: 794px) {
  body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
  }

  .left-panel {
    overflow-x: hidden;
  }
}

/* 修改水印样式 */
.watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 80px;
  color: #CCCCCC;
  opacity: 0.1;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

/* 确保内容在水印上方且不受水印影响 */
.rectangle h1,
.rectangle h3,
.rectangle table {
  position: relative;
  z-index: 2;
  background: transparent;
}


/* 移动端适配 */
@media screen and (max-width: 768px) {
  .custom-select-container,
  .custom-select-trigger,
  .custom-select-options {
    width: 100%;
    box-sizing: border-box;
  }
}

/* 移动设备适配 */
@media screen and (max-width: 1200px) {
  .header-content {
    width: 100%;
  }
  
  .content-wrapper {
    max-width: 100%;
  }
}

@media screen and (min-width: 835px) {
  .header-content img {
    margin-left: 20px !important;
  }
}

.right-panel label {
  color: #666666;
  font-size: 14px;
}
.right-panel label strong{
  color: #666666;
}
