/* TONIC-CODE: 汉唐经方 · 赛博舌相与九大体质防虚茶饮卡 (3:4 出片海报样式) */

.tonic-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 26, 22, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.tonic-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.tonic-modal-container {
  background: #FAF7EE;
  border: 1.5px solid #C5B293;
  box-shadow: 0 25px 70px rgba(50, 40, 30, 0.45), 0 0 40px rgba(194, 53, 49, 0.1);
  border-radius: 18px;
  max-width: 1020px;
  width: 100%;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(15px) scale(0.97);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Noto Serif SC", "PingFang SC", "Songti SC", serif;
  color: #2C2A29;
}

.tonic-modal-backdrop.active .tonic-modal-container {
  transform: translateY(0) scale(1);
}

.tonic-modal-header {
  padding: 14px 22px;
  background: #F3ECE0;
  border-bottom: 1px solid #D8C7A3;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tonic-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 900;
  color: #8C2D19;
  letter-spacing: 0.05em;
}

.tonic-close-btn {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #665;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.15s;
}

.tonic-close-btn:hover {
  background: #C23531;
  color: #fff;
  border-color: #C23531;
}

.tonic-modal-body {
  display: grid;
  grid-template-columns: 1fr 470px;
  gap: 20px;
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

@media (max-width: 960px) {
  .tonic-modal-body {
    grid-template-columns: 1fr;
  }
}

/* 控制表单区 */
.tonic-ctrl-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tonic-section-title {
  font-size: 13px;
  font-weight: 800;
  color: #8C2D19;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 舌相四选一网格 */
.tongue-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.tongue-card {
  padding: 10px 12px;
  background: #FFFFFF;
  border: 1.5px solid #E2D7C3;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.tongue-card:hover {
  border-color: #C23531;
  background: #FDFBF7;
}

.tongue-card.active {
  border-color: #C23531;
  background: #FAF2EC;
  box-shadow: 0 0 12px rgba(194, 53, 49, 0.15);
}

.tongue-name {
  font-size: 13px;
  font-weight: 800;
  color: #2C2A29;
}

.tongue-card.active .tongue-name {
  color: #C23531;
}

.tongue-desc {
  font-size: 11px;
  color: #7A6F5D;
  margin-top: 3px;
  line-height: 1.4;
}

/* 症候多选胶囊 */
.symptom-tag-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.symptom-check-tag {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: #FFFFFF;
  border: 1px solid #D8C7A3;
  color: #554D3F;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.symptom-check-tag:hover {
  border-color: #C23531;
}

.symptom-check-tag.active {
  background: #C23531;
  border-color: #C23531;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(194, 53, 49, 0.25);
}

/* 3:4 黄金画幅仿生宣纸处方笺海报 (450 x 600) */
.tonic-poster-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#tonic-tea-poster-card {
  width: 450px;
  height: 600px;
  background: #FAF7EE;
  border: 1.5px solid #C5B293;
  box-shadow: 0 25px 60px rgba(50, 40, 30, 0.4), inset 0 0 50px rgba(184, 146, 42, 0.08);
  border-radius: 16px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  color: #2C2A29;
  position: relative;
  overflow: hidden;
  user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "Noto Serif SC", "Songti SC", serif;
}

/* 四角暗纹角标 */
.tonic-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.tonic-corner.tl { top: 10px; left: 10px; border-top: 1px solid #A38242; border-left: 1px solid #A38242; }
.tonic-corner.tr { top: 10px; right: 10px; border-top: 1px solid #A38242; border-right: 1px solid #A38242; }
.tonic-corner.bl { bottom: 10px; left: 10px; border-bottom: 1px solid #A38242; border-left: 1px solid #A38242; }
.tonic-corner.br { bottom: 10px; right: 10px; border-bottom: 1px solid #A38242; border-right: 1px solid #A38242; }

/* 海报顶栏 */
.tonic-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #D8C7A3;
  padding-bottom: 8px;
}
.tonic-tag {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: #2C2A29;
  display: flex;
  align-items: center;
  gap: 5px;
}
.tonic-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #C23531;
}
.tonic-no {
  font-size: 10px;
  font-family: monospace;
  color: #8C6D23;
  font-weight: 700;
}

/* 处方笺头与分数 */
.tonic-hero {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tonic-title-sub {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: #8C6D23;
  font-weight: 700;
  text-transform: uppercase;
}
.tonic-hero-name {
  font-size: 19px;
  font-weight: 900;
  color: #2C2A29;
  margin-top: 2px;
}
.tonic-score-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F3ECE0;
  border: 1px solid #CDBA93;
  padding: 4px 10px;
  border-radius: 8px;
}
.tonic-score-num {
  font-size: 24px;
  font-weight: 900;
  color: #C23531;
  font-family: monospace;
}
.tonic-score-label {
  font-size: 10px;
  color: #7A5813;
  font-weight: 700;
  line-height: 1.2;
}

/* 望舌与病机精要卡 */
.tonic-inspection-box {
  background: #F4EFE4;
  border: 1px solid #DDD0B8;
  border-radius: 10px;
  padding: 9px 12px;
  margin-top: 2px;
}
.tonic-inspection-title {
  font-size: 10px;
  font-weight: 800;
  color: #8C6D23;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
}
.tonic-inspection-text {
  font-size: 10.5px;
  color: #4A443B;
  line-height: 1.45;
}

/* 经方溯源与赛博特调饮 */
.tonic-formula-box {
  background: #FFFFFF;
  border: 1px solid #CDBA93;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.tonic-formula-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.tonic-formula-name {
  font-size: 13.5px;
  font-weight: 900;
  color: #2C2A29;
}
.tonic-formula-tea-name {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  background: #EFE3C8;
  color: #8B6214;
  border-radius: 20px;
  border: 1px solid #D9C49A;
}

/* 四味君臣佐使药料网格 */
.tonic-herbs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 4px;
}
.tonic-herb-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FAF6EE;
  border: 1px solid #E8DEC9;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 10px;
}
.tonic-herb-role {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #8C6D23;
  color: #FFFFFF;
  font-size: 8px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
}

/* 冲泡指南 */
.tonic-brew-tip {
  font-size: 9.5px;
  color: #645A4C;
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px dashed #E5DAC5;
  line-height: 1.4;
}

/* 倪师调神心法 */
.tonic-mind-box {
  background: #F5EDE1;
  border-left: 3px solid #C23531;
  padding: 6px 10px;
  border-radius: 4px;
  margin-top: 2px;
}
.tonic-mind-text {
  font-size: 10px;
  font-style: italic;
  color: #3D352B;
  line-height: 1.45;
  font-weight: 600;
}

/* 底部防伪与印章 */
.tonic-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #D8C7A3;
  padding-top: 8px;
}
.tonic-auth-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tonic-seal-box {
  width: 34px;
  height: 34px;
  border: 1.5px solid #C23531;
  background: #FAF6EE;
  color: #C23531;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: serif;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  transform: rotate(2deg);
}
.tonic-auth-text {
  font-size: 9px;
  color: #7A6F5D;
  line-height: 1.3;
}
.tonic-auth-main {
  color: #2C2A29;
  font-weight: 800;
}

.tonic-download-btn {
  background: linear-gradient(135deg, #C23531 0%, #A82824 100%);
  color: #FFFFFF;
  border: 1px solid #8C1C18;
  font-weight: 800;
  font-size: 13px;
  padding: 10px 24px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(194, 53, 49, 0.35);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.tonic-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(194, 53, 49, 0.5);
}
