:root {
  --blue: #2456f5;
  --blue-dark: #153dcb;
  --navy: #101f45;
  --muted: #6d7690;
  --pale: #eef4ff;
  --gold: #f4ad24;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--navy);
  background: radial-gradient(circle at 15% 12%, rgba(66, 112, 255, 0.13), transparent 30%), linear-gradient(135deg, #f6f8fd 0%, #edf3ff 100%);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button, input { font: inherit; }

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, 410px) minmax(620px, 1fr);
  gap: 34px;
  padding: 34px;
  align-items: center;
}

.editor {
  align-self: stretch;
  max-height: calc(100vh - 68px);
  overflow: auto;
  padding: 30px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(31, 79, 234, 0.1);
  border-radius: 28px;
  box-shadow: 0 20px 55px rgba(29, 52, 117, 0.12);
}

.eyebrow { color: var(--blue); font-size: 13px; font-weight: 800; letter-spacing: 0.12em; }
.editor h1 { margin: 10px 0; font-size: clamp(25px, 3vw, 33px); line-height: 1.22; letter-spacing: -0.04em; }
.editor-heading p { margin: 0 0 24px; color: var(--muted); font-size: 14px; line-height: 1.75; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
.field { display: grid; gap: 7px; }
.field-wide { grid-column: 1 / -1; }
.field span { color: #53607e; font-size: 13px; font-weight: 700; }

.field input {
  width: 100%;
  height: 44px;
  border: 1px solid #d8e0f1;
  border-radius: 12px;
  padding: 0 13px;
  color: var(--navy);
  background: #fbfcff;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(36, 86, 245, 0.1); }
.editor-actions { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: 10px; margin-top: 24px; }

.editor-actions button, .exit-capture {
  height: 48px;
  border-radius: 13px;
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.secondary-button { color: var(--blue); background: var(--pale); }
.primary-button { color: white; background: var(--blue); box-shadow: 0 10px 22px rgba(36, 86, 245, 0.24); }
.primary-button:hover { background: var(--blue-dark); }
.privacy-note { margin: 13px 0 0; text-align: center; color: #8a93aa; font-size: 12px; }

.preview-shell { min-width: 0; display: grid; justify-items: center; align-content: center; gap: 10px; }
.preview-label { width: min(100%, 780px); margin: 0; padding-left: 4px; color: #7c86a1; font-size: 13px; font-weight: 700; }

.appointment-card {
  position: relative;
  isolation: isolate;
  width: min(100%, 780px);
  aspect-ratio: 1.13 / 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 4.2vw, 48px) clamp(24px, 5vw, 58px) clamp(22px, 3vw, 36px);
  background: #fff;
  border: 10px solid var(--blue);
  border-radius: 30px;
  box-shadow: 0 30px 75px rgba(25, 52, 134, 0.22);
}

.appointment-card::before { content: ""; position: absolute; inset: 0; z-index: -2; background: radial-gradient(circle at 51% 45%, rgba(46, 98, 255, 0.055), transparent 45%); }

.watermark-layer {
  position: absolute;
  inset: -80px -50px;
  z-index: -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  place-items: center;
  transform: rotate(-29deg);
  color: rgba(27, 67, 190, 0.043);
  font-size: 24px;
  font-weight: 800;
  pointer-events: none;
}

.card-header { text-align: center; }
.exclusive-tag { display: inline-flex; align-items: center; min-height: 36px; padding: 0 26px; border-radius: 999px; color: #163987; background: linear-gradient(100deg, #edf3ff, #dce8ff); font-size: clamp(14px, 2.2vw, 19px); font-weight: 800; }
.success-title { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 22px; }
.success-title h2 { margin: 0; color: var(--blue); font-size: clamp(30px, 5vw, 48px); letter-spacing: 0.01em; }

.checkmark {
  width: clamp(44px, 6vw, 58px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(36, 86, 245, 0.24);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 900;
}

.warm-line { margin: 16px 0 22px; color: #23335b; font-size: clamp(15px, 2.4vw, 22px); font-weight: 700; }
.tiny-heart { margin-left: 8px; color: var(--gold); font-size: 1.35em; }

.time-panel {
  min-height: clamp(78px, 12vw, 112px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(13px, 3vw, 34px);
  padding: 12px 24px;
  border: 1px solid #e0e9fb;
  border-radius: 24px;
  color: var(--blue);
  background: linear-gradient(100deg, #eef4ff, #e7f0ff);
  font-size: clamp(24px, 4.6vw, 43px);
  font-weight: 900;
  white-space: nowrap;
}

.time-panel i { width: 5px; height: 5px; border-radius: 50%; background: #9db4ed; }
.time-panel strong { font-size: 1.06em; }

.details-panel { margin-top: 11px; padding: 0 24px; border: 1px solid #e0e8f8; border-radius: 20px; background: rgba(255, 255, 255, 0.7); }
.detail-row { min-height: clamp(43px, 6vw, 56px); display: grid; grid-template-columns: 38px 112px 1fr; align-items: center; border-bottom: 1px dashed #d5def0; font-size: clamp(13px, 1.8vw, 17px); }
.detail-row:last-child { border-bottom: 0; }
.detail-icon { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid #cbd9ff; border-radius: 50%; color: var(--blue); background: var(--pale); font-size: 12px; font-weight: 900; }
.detail-label { color: #6c7488; font-weight: 700; }
.detail-row strong { min-width: 0; color: #13203d; overflow-wrap: anywhere; }

.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: auto; padding-top: 18px; }
.service-box { flex: 1; min-height: 74px; display: flex; align-items: center; gap: 15px; padding: 12px 22px; border-radius: 18px; background: linear-gradient(100deg, #eaf2ff, #f4f7ff); }
.service-icon { flex: 0 0 42px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--blue); font-size: 26px; font-weight: 900; }
.service-box strong { color: var(--blue); font-size: clamp(16px, 2vw, 20px); }
.service-box p { margin: 3px 0 0; color: #53617f; font-size: clamp(11px, 1.55vw, 15px); }

.brand { flex: 0 0 auto; display: flex; align-items: center; width: clamp(138px, 21vw, 190px); }
.brand img { display: block; width: 100%; height: auto; object-fit: contain; }

.capture-mode { display: grid; grid-template-columns: 1fr; place-items: center; padding: 24px; background: #eaf0fb; }
.capture-mode .editor, .capture-mode .preview-label { display: none; }
.capture-mode .preview-shell { width: 100%; }
.capture-mode .appointment-card { width: min(100%, 860px); }
.exit-capture { position: fixed; right: 22px; bottom: 22px; z-index: 5; padding: 0 24px; color: white; background: rgba(14, 31, 75, 0.85); box-shadow: 0 10px 28px rgba(12, 25, 62, 0.2); backdrop-filter: blur(10px); }

@media (max-width: 1050px) {
  .app { grid-template-columns: 1fr; padding: 22px; }
  .editor { max-height: none; }
  .preview-shell { order: -1; }
}

@media (max-width: 620px) {
  .app { padding: 12px; gap: 18px; }
  .editor { padding: 22px 18px; border-radius: 22px; }
  .appointment-card { padding: 22px 18px 18px; border-width: 6px; border-radius: 22px; aspect-ratio: auto; min-height: 590px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .details-panel { padding: 0 12px; }
  .detail-row { grid-template-columns: 32px 78px 1fr; }
  .card-footer { align-items: stretch; flex-direction: column; }
  .brand { align-self: flex-end; }
  .time-panel { gap: 10px; padding-inline: 12px; }
  .capture-mode { padding: 8px; }
  .exit-capture { right: 12px; bottom: 12px; }
}

@media print {
  body { background: white; }
  .editor, .preview-label, .exit-capture { display: none !important; }
  .app { display: block; min-height: 0; padding: 0; }
  .appointment-card { width: 100%; box-shadow: none; }
}
