* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 0 40px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #1c2b3a;
  background: linear-gradient(180deg, #e9f3ff 0, #f5f9fd 360px, #f3f7fb 100%);
  -webkit-font-smoothing: antialiased;
}

.hero {
  background: linear-gradient(115deg, #2b67c9 0%, #3f8fe8 58%, #5eb0f2 100%);
  color: #fff;
  padding: 30px 20px 34px;
  box-shadow: 0 8px 26px rgba(43, 103, 201, .18);
}
.hero-inner {
  max-width: 980px; margin: 0 auto;
  display: flex; align-items: center; gap: 18px;
}
.logo {
  width: 52px; height: 52px; flex: none; border-radius: 15px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .45);
  display: grid; place-items: center;
  font-size: 22px; font-weight: 700; letter-spacing: 1px;
}
.hero h1 { margin: 0; font-size: 23px; letter-spacing: .5px; }
.hero p { margin: 7px 0 0; font-size: 13.5px; opacity: .88; }

.container { max-width: 980px; margin: 0 auto; padding: 24px 20px 0; }

.card {
  background: #fff;
  border: 1px solid #e2ebf4;
  border-radius: 16px;
  padding: 22px 24px 24px;
  margin-bottom: 18px;
  box-shadow: 0 6px 22px rgba(35, 78, 125, .06);
}
.card h2 {
  margin: 0 0 20px;
  font-size: 16px;
  display: flex; align-items: center; gap: 10px;
}
.step {
  display: inline-grid; place-items: center;
  min-width: 34px; height: 26px; padding: 0 7px;
  border-radius: 8px;
  background: #e8f2ff; color: #2b67c9;
  font-size: 12px; font-weight: 700; letter-spacing: .4px;
}
.step.ok { background: #e3f5e9; color: #1e7a45; }

.grid { display: grid; gap: 16px 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.label { font-size: 13px; font-weight: 600; color: #566e86; }
input[type="text"], input[type="number"], input[type="date"], input[readonly], select, .link-row input {
  width: 100%; height: 42px;
  padding: 0 12px;
  border: 1px solid #d7e3ef;
  border-radius: 10px;
  background: #fbfdff;
  color: #1c2b3a;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  border-color: #4b9cf0;
  box-shadow: 0 0 0 3px rgba(75, 156, 240, .16);
}
input[readonly] { background: #f3f8fd; color: #3d5c7a; font-family: ui-monospace, Consolas, monospace; letter-spacing: 1px; }
select { cursor: pointer; }

.radio-row { display: flex; gap: 10px; height: 42px; }
.pill { flex: 1; cursor: pointer; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span {
  display: grid; place-items: center; height: 42px;
  border: 1px solid #d7e3ef; border-radius: 10px;
  background: #fbfdff; color: #566e86; font-size: 14px; font-weight: 600;
  transition: .15s;
}
.pill input:checked + span {
  background: linear-gradient(135deg, #3f8fe8, #2b6cd0);
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 12px rgba(43, 108, 208, .25);
}

.with-btn { display: flex; gap: 8px; }
.with-btn input { flex: 1; min-width: 0; }
.with-btn button {
  flex: none; padding: 0 14px; height: 42px;
  border: 1px solid #d7e3ef; border-radius: 10px;
  background: #f3f8fd; color: #2b67c9; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.with-btn button:hover { background: #e7f2ff; }

.tip { margin: 16px 0 0; font-size: 12.5px; color: #8497aa; line-height: 1.7; }
.hidden { display: none !important; }

.upload-row { display: flex; gap: 24px; align-items: flex-start; }
.drop {
  position: relative; flex: none;
  width: 220px; height: 240px;
  border: 2px dashed #b9d6f2; border-radius: 14px;
  background: #f7fbff;
  display: grid; place-items: center;
  overflow: hidden; cursor: pointer;
  transition: .18s;
}
.drop:hover, .drop.dragover { border-color: #4b9cf0; background: #eef7ff; }
.drop input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; z-index: 3;
}
.drop img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 2; display: none;
}
.drop.has-photo img { display: block; }
.drop.has-photo .drop-hint { display: none; }
.drop-hint { text-align: center; padding: 16px; z-index: 1; }
.drop-hint strong { display: block; font-size: 14px; color: #2c5173; margin-top: 14px; }
.drop-hint span { display: block; font-size: 12px; color: #8ca1b6; margin-top: 8px; line-height: 1.6; }
.camera {
  width: 46px; height: 34px; margin: 0 auto;
  border: 2px solid #7fb2e6; border-radius: 8px; position: relative;
}
.camera::before {
  content: ""; position: absolute; top: -8px; left: 12px;
  width: 18px; height: 7px; border: 2px solid #7fb2e6; border-bottom: none; border-radius: 5px 5px 0 0;
}
.camera::after {
  content: ""; position: absolute; top: 9px; left: 15px;
  width: 12px; height: 12px; border: 2px solid #7fb2e6; border-radius: 50%;
}
.upload-side { flex: 1; min-width: 0; }
.upload-side p { margin: 0; font-size: 13.5px; line-height: 1.9; color: #60768c; }
.upload-side strong { color: #2b67c9; }
.check {
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px; font-size: 13px; color: #566e86; cursor: pointer;
}
.check input { width: 16px; height: 16px; flex: none; accent-color: #2b67c9; cursor: pointer; }
.side-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

button.ghost, .btn-primary, .link-row button {
  appearance: none; cursor: pointer; font-family: inherit;
  padding: 10px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  border: 1px solid #d5e2ef; background: #fff; color: #2c5173;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  transition: .16s;
}
button.ghost:hover, .link-row button:hover { background: #f2f8ff; border-color: #7fb4ee; }
.btn-primary {
  background: linear-gradient(135deg, #3f8fe8, #2b6cd0);
  color: #fff; border-color: transparent; white-space: nowrap;
}
.btn-primary:hover { background: linear-gradient(135deg, #2f80e0, #205dc0); }

.advanced {
  background: #f8fbff; border: 1px solid #e2ebf4; border-radius: 14px;
  padding: 14px 20px 16px; margin-bottom: 22px;
}
.advanced summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: #2c5173; }
.advanced .field { margin-top: 16px; }

.actions { text-align: center; }
button.generate {
  appearance: none; border: none; cursor: pointer; font-family: inherit;
  padding: 15px 46px; border-radius: 13px;
  font-size: 16px; font-weight: 700; letter-spacing: .5px; color: #fff;
  background: linear-gradient(135deg, #3f8fe8 0%, #2b67c9 100%);
  box-shadow: 0 10px 24px rgba(43, 103, 201, .28);
  transition: .18s;
}
button.generate:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(43, 103, 201, .34); }
button.generate:disabled { opacity: .6; cursor: wait; transform: none; }
.form-error {
  margin: 14px 0 0; color: #c0362c; font-size: 13.5px; font-weight: 600;
  background: #fff1f0; border: 1px solid #ffd7d3; border-radius: 9px; padding: 10px 14px;
}

.result-frame {
  width: 100%; height: 680px;
  background: #fff; border-radius: 14px; overflow: hidden;
  border: 1px solid #e2ebf4;
}
.result-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.link-row { display: flex; gap: 10px; margin-top: 18px; }
.link-row input { flex: 1; min-width: 0; font-size: 13px; font-family: ui-monospace, Consolas, monospace; }
.result .ghost { margin-top: 16px; }

footer { text-align: center; color: #93a4b6; font-size: 12px; padding: 12px 0 0; }

@media (max-width: 760px) {
  .grid.two { grid-template-columns: 1fr; }
  .upload-row { flex-direction: column; }
  .drop { width: 100%; }
  .link-row { flex-wrap: wrap; }
  .link-row input { flex-basis: 100%; }
  .hero h1 { font-size: 19px; }
}
