/*
 * 董氏奇穴针灸辅助工具
 * 复诊管理彻底解耦版 V5.5
 */

:root {
  --ds-v55-panel: rgba(8, 27, 41, .86);
  --ds-v55-panel-soft: rgba(5, 20, 31, .66);
  --ds-v55-line: rgba(103, 208, 255, .15);
  --ds-v55-line-strong: rgba(103, 208, 255, .34);
  --ds-v55-cyan: #68dcff;
  --ds-v55-green: #55ddc8;
  --ds-v55-gold: #e5bc6c;
  --ds-v55-red: #ff8794;
  --ds-v55-text: #eefaff;
  --ds-v55-muted: #88a7ba;
  --ds-v55-muted-2: #607f93;
  --ds-v55-shadow: 0 24px 70px rgba(0, 8, 15, .38);
}

#dsV54FollowupHost {
  display: none !important;
}

body.ds-v55-followup-active .main {
  background:
    linear-gradient(rgba(64, 157, 207, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(64, 157, 207, .035) 1px, transparent 1px),
    radial-gradient(circle at 8% 0%, rgba(71, 198, 255, .14), transparent 28%),
    radial-gradient(circle at 100% 74%, rgba(58, 112, 231, .10), transparent 34%),
    linear-gradient(135deg, #04101a, #071825) !important;
  background-size: 46px 46px, 46px 46px, auto, auto, auto;
}

#page-followup.ds-v55-followup-mounted,
#page-followups.ds-v55-followup-mounted,
.page[data-page="followup"].ds-v55-followup-mounted,
[data-page-container="followup"].ds-v55-followup-mounted {
  min-height: 100%;
  padding: 26px 24px 110px;
  background: transparent !important;
  color: var(--ds-v55-text);
}

#dsV55FollowupHost {
  display: block !important;
  color: var(--ds-v55-text);
}

.ds-v55-shell {
  width: min(1460px, 100%);
  margin: 0 auto;
}

.ds-v55-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 22px;
  margin-bottom: 22px;
}

.ds-v55-eyebrow,
.ds-v55-section-head > div > span {
  color: var(--ds-v55-cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.ds-v55-hero h2 {
  margin: 8px 0 7px;
  color: #f5fcff;
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.06;
  letter-spacing: -.035em;
}

.ds-v55-hero p,
.ds-v55-section-head p {
  margin: 0;
  color: var(--ds-v55-muted);
  line-height: 1.65;
}

.ds-v55-mode-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border: 1px solid rgba(85, 221, 200, .20);
  border-radius: 999px;
  color: #a9eee2;
  background: rgba(20, 78, 70, .16);
  font-size: 12px;
}

.ds-v55-mode-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ds-v55-green);
  box-shadow: 0 0 12px rgba(85, 221, 200, .75);
}

.ds-v55-panel {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--ds-v55-line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.008)),
    var(--ds-v55-panel);
  box-shadow: var(--ds-v55-shadow);
  backdrop-filter: blur(17px);
}

.ds-v55-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 18px;
}

.ds-v55-section-head h3 {
  margin: 5px 0 5px;
  color: #f1fbff;
  font-size: 25px;
}

.ds-v55-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #7598ac;
  font-size: 12px;
}

.ds-v55-step b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--ds-v55-line);
  border-radius: 50%;
  color: #dff7ff;
  background: rgba(25, 77, 107, .28);
}

.ds-v55-patient-layout {
  display: grid;
  grid-template-columns: minmax(320px, .95fr) minmax(0, 1.4fr);
  gap: 16px;
}

.ds-v55-search-column,
.ds-v55-patient-brief {
  border: 1px solid rgba(103, 208, 255, .12);
  border-radius: 18px;
  background: rgba(5, 20, 31, .58);
}

.ds-v55-search-column {
  position: relative;
  padding: 17px;
}

.ds-v55-search-column > label > span,
.ds-v55-field > span,
.ds-v55-feedback-section > span {
  display: block;
  margin-bottom: 8px;
  color: #a8c4d3;
  font-size: 12px;
  font-weight: 760;
}

.ds-v55-search-box {
  position: relative;
}

.ds-v55-search-box i {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: var(--ds-v55-cyan);
  font-style: normal;
}

.ds-v55-search-box input {
  width: 100%;
  min-height: 50px;
  padding: 0 46px 0 42px;
  border: 1px solid rgba(103, 208, 255, .17);
  border-radius: 14px;
  outline: none;
  color: var(--ds-v55-text);
  background: rgba(2, 13, 21, .82);
  font: inherit;
}

.ds-v55-search-box input:focus,
.ds-v55-field textarea:focus {
  border-color: rgba(104, 220, 255, .54);
  box-shadow: 0 0 0 4px rgba(63, 164, 220, .08);
}

.ds-v55-search-box button {
  position: absolute;
  top: 50%;
  right: 9px;
  width: 32px;
  height: 32px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 10px;
  color: #8aa7b7;
  background: rgba(255,255,255,.045);
  cursor: pointer;
}

.ds-v55-search-column > small {
  display: block;
  margin-top: 10px;
  color: var(--ds-v55-muted-2);
  line-height: 1.5;
}

.ds-v55-results {
  position: absolute;
  z-index: 30;
  top: 96px;
  right: 17px;
  left: 17px;
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--ds-v55-line-strong);
  border-radius: 14px;
  background: rgba(3, 16, 25, .98);
  box-shadow: 0 20px 50px rgba(0,0,0,.42);
}

.ds-v55-results[hidden] {
  display: none;
}

.ds-v55-results > button {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.ds-v55-results > button:hover {
  border-color: rgba(103, 208, 255, .18);
  background: rgba(33, 100, 139, .18);
}

.ds-v55-result-avatar,
.ds-v55-avatar {
  display: grid;
  place-items: center;
  border: 1px solid rgba(104, 220, 255, .26);
  color: #ecfbff;
  background: linear-gradient(145deg, rgba(32, 147, 198, .66), rgba(45, 84, 172, .64));
  font-weight: 850;
}

.ds-v55-result-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.ds-v55-results strong,
.ds-v55-results small {
  display: block;
}

.ds-v55-results strong {
  color: #edfaff;
}

.ds-v55-results small {
  margin-top: 3px;
  color: #789aab;
}

.ds-v55-results em {
  color: #6e91a5;
  font-size: 11px;
  font-style: normal;
}

.ds-v55-no-results {
  padding: 28px 12px;
  color: #7898aa;
  text-align: center;
  font-size: 12px;
}

.ds-v55-patient-brief {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 18px;
  padding: 17px;
}

.ds-v55-id-card {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 145px;
  border: 1px solid rgba(104, 220, 255, .16);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 10%, rgba(87, 197, 255, .16), transparent 48%),
    rgba(8, 31, 47, .62);
}

.ds-v55-avatar {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  font-size: 22px;
  box-shadow: 0 12px 25px rgba(31, 107, 180, .26);
}

.ds-v55-id-card small {
  max-width: 88px;
  overflow: hidden;
  margin-top: 9px;
  color: #7497ab;
  font-size: 9px;
  text-overflow: ellipsis;
}

.ds-v55-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ds-v55-summary-cell {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid rgba(103, 208, 255, .10);
  border-radius: 14px;
  background: rgba(9, 31, 46, .52);
}

.ds-v55-summary-cell.wide {
  grid-column: 1 / -1;
}

.ds-v55-summary-cell span {
  display: block;
  color: #62869a;
  font-size: 10px;
}

.ds-v55-summary-cell strong {
  display: block;
  margin-top: 6px;
  color: #edfaff;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ds-v55-patient-placeholder {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 145px;
  padding: 20px;
  border: 1px dashed rgba(103, 208, 255, .13);
  border-radius: 16px;
  color: #708fa1;
  text-align: center;
}

.ds-v55-history-panel {
  position: relative;
  overflow: hidden;
}

.ds-v55-history-panel::after {
  position: absolute;
  top: -90px;
  right: -50px;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(104, 220, 255, .07);
  border-radius: 50%;
  content: "";
  box-shadow:
    0 0 0 36px rgba(104, 220, 255, .018),
    0 0 0 90px rgba(104, 220, 255, .012);
  pointer-events: none;
}

.ds-v55-history-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
}

.ds-v55-history-date {
  display: grid;
  align-content: center;
  padding: 18px;
  border: 1px solid rgba(229, 188, 108, .18);
  border-radius: 18px;
  background: rgba(73, 54, 19, .16);
}

.ds-v55-history-date span {
  color: #9a8254;
  font-size: 10px;
  letter-spacing: .08em;
}

.ds-v55-history-date strong {
  margin-top: 8px;
  color: #f3d594;
  font-size: 22px;
}

.ds-v55-history-date small {
  margin-top: 7px;
  color: #8c7955;
  line-height: 1.45;
}

.ds-v55-history-content {
  display: grid;
  gap: 12px;
}

.ds-v55-history-row {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 15px;
  border: 1px solid rgba(103, 208, 255, .10);
  border-radius: 15px;
  background: rgba(7, 27, 41, .55);
}

.ds-v55-history-row > b {
  color: #85cce8;
  font-size: 12px;
}

.ds-v55-history-row > div {
  color: #d9edf6;
  line-height: 1.65;
}

.ds-v55-prescription-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ds-v55-prescription-grid article {
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
}

.ds-v55-prescription-grid span {
  display: block;
  color: #66899c;
  font-size: 10px;
}

.ds-v55-prescription-grid strong {
  display: block;
  margin-top: 5px;
  color: #e8f7fd;
  font-size: 12px;
  line-height: 1.55;
}

.ds-v55-feedback-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(85, 221, 200, .20);
  border-radius: 999px;
  color: #9ae8da;
  background: rgba(28, 105, 91, .14);
  font-size: 12px;
}

.ds-v55-history-empty {
  grid-column: 1 / -1;
  padding: 34px;
  border: 1px dashed rgba(103, 208, 255, .13);
  border-radius: 17px;
  color: #718fa0;
  text-align: center;
}

.ds-v55-form {
  display: grid;
  gap: 15px;
}

.ds-v55-field {
  display: grid;
  gap: 8px;
}

.ds-v55-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.ds-v55-field textarea {
  width: 100%;
  resize: vertical;
  padding: 14px 15px;
  border: 1px solid rgba(103, 208, 255, .14);
  border-radius: 15px;
  outline: none;
  color: #effaff;
  background: rgba(3, 14, 23, .72);
  line-height: 1.65;
  font: inherit;
}

.ds-v55-field textarea::placeholder,
.ds-v55-search-box input::placeholder {
  color: #4f6d7f;
}

.ds-v55-feedback-section {
  padding: 16px;
  border: 1px solid rgba(103, 208, 255, .10);
  border-radius: 16px;
  background: rgba(6, 24, 36, .54);
}

.ds-v55-feedback-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ds-v55-feedback-button {
  min-height: 46px;
  border: 1px solid rgba(103, 208, 255, .14);
  border-radius: 13px;
  color: #cce5f0;
  background: rgba(255,255,255,.035);
  cursor: pointer;
  font: inherit;
  font-weight: 760;
}

.ds-v55-feedback-button:hover {
  border-color: rgba(103, 208, 255, .28);
}

.ds-v55-feedback-button[data-feedback="显效"].active,
.ds-v55-feedback-button[data-feedback="有效"].active {
  color: #eafffb;
  border-color: rgba(85, 221, 200, .40);
  background: linear-gradient(135deg, rgba(27, 126, 108, .74), rgba(22, 83, 77, .78));
}

.ds-v55-feedback-button[data-feedback="无效"].active {
  color: #fff6df;
  border-color: rgba(229, 188, 108, .40);
  background: linear-gradient(135deg, rgba(113, 82, 25, .82), rgba(73, 52, 18, .82));
}

.ds-v55-feedback-button[data-feedback="加重"].active {
  color: #fff0f2;
  border-color: rgba(255, 135, 148, .42);
  background: linear-gradient(135deg, rgba(138, 41, 56, .86), rgba(88, 24, 36, .86));
}

.ds-v55-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.ds-v55-form-actions p {
  margin: 0;
  color: #6f90a3;
  font-size: 11px;
}

.ds-v55-form-actions > div {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.ds-v55-form-actions button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 820;
}

.ds-v55-form-actions .secondary {
  border: 1px solid rgba(103, 208, 255, .16);
  color: #d9eff8;
  background: rgba(255,255,255,.04);
}

.ds-v55-form-actions .primary {
  min-width: 210px;
  border: 1px solid rgba(111, 209, 255, .30);
  color: #fff;
  background: linear-gradient(135deg, #188fc8 0%, #2a83d4 52%, #435fd0 100%);
  box-shadow: 0 16px 36px rgba(38, 115, 181, .26);
}

.ds-v55-toast {
  position: fixed;
  z-index: 1600;
  left: 50%;
  bottom: 34px;
  max-width: min(460px, calc(100vw - 32px));
  transform: translate(-50%, 18px);
  opacity: 0;
  padding: 12px 17px;
  border: 1px solid rgba(85, 221, 200, .28);
  border-radius: 13px;
  color: #dffbf5;
  background: rgba(6, 38, 42, .96);
  box-shadow: 0 18px 44px rgba(0,0,0,.34);
  transition: opacity .20s ease, transform .20s ease;
}

.ds-v55-toast.error {
  border-color: rgba(255, 135, 148, .32);
  color: #ffe7ea;
  background: rgba(70, 20, 29, .96);
}

.ds-v55-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1050px) {
  .ds-v55-patient-layout,
  .ds-v55-history-grid {
    grid-template-columns: 1fr;
  }

  .ds-v55-hero,
  .ds-v55-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ds-v55-patient-brief {
    grid-template-columns: 88px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  #page-followup.ds-v55-followup-mounted,
  #page-followups.ds-v55-followup-mounted,
  .page[data-page="followup"].ds-v55-followup-mounted,
  [data-page-container="followup"].ds-v55-followup-mounted {
    padding: 18px 12px 100px;
  }

  .ds-v55-panel {
    padding: 17px;
  }

  .ds-v55-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ds-v55-patient-brief,
  .ds-v55-summary-grid,
  .ds-v55-prescription-grid,
  .ds-v55-two-column {
    grid-template-columns: 1fr;
  }

  .ds-v55-summary-cell.wide {
    grid-column: auto;
  }

  .ds-v55-history-row {
    grid-template-columns: 1fr;
  }

  .ds-v55-feedback-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ds-v55-form-actions > div {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .ds-v55-form-actions .primary {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ds-v55-toast {
    transition-duration: .01ms !important;
  }
}
