:root {
  --primary: #ff6b6b;
  --primary-strong: #e5484d;
  --primary-soft: rgba(255, 107, 107, 0.12);
  --secondary: #ff9f68;
  --accent: #2563eb;
  --teal: #059669;
  --purple: #7c3aed;
  --amber: #d97706;
  --bg: #fff5f5;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --line: rgba(127, 29, 29, 0.13);
  --text: #391313;
  --muted: #77727b;
  --danger: #dc2626;
  --success: #047857;
  --shadow: 0 16px 44px rgba(127, 29, 29, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #f8f3f9 0%, #fff6f4 58%, #fffaf4 100%);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.main-container {
  width: min(820px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 78px;
}

.publish-card {
  overflow: hidden;
  border: 1px solid rgba(255, 107, 107, 0.18);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 64px rgba(127, 29, 29, 0.12);
  backdrop-filter: blur(22px);
}

.publish-card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 150px;
  padding: 28px 30px;
  color: #fff;
  background: linear-gradient(135deg, #ff6a6f 0%, #ff9867 100%);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 72px;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.46);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 38px;
  font-weight: 850;
  line-height: 1;
  box-shadow: 0 14px 34px rgba(120, 42, 12, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.brand-copy h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.15;
  font-weight: 820;
  letter-spacing: 0;
}

.brand-copy p {
  margin: 7px 0 0;
  font-size: 14px;
  opacity: 0.92;
  letter-spacing: 0;
}

.notice-panel {
  padding: 26px 30px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.notice-panel h2 {
  margin: 0 0 18px;
  color: #d71920;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 860;
}

.notice-panel p {
  margin: 9px 0;
  font-size: 15px;
  font-weight: 650;
}

.notice-panel .danger {
  color: #d71920;
  font-size: 17px;
  font-weight: 820;
  line-height: 1.55;
}

.lead-copy {
  margin: 16px 0 12px;
  color: #008a2e;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 830;
}

.notice-panel .highlight {
  color: #4f4617;
  font-size: 14px;
  line-height: 1.75;
  font-weight: 760;
}

.notice-panel .highlight span {
  padding: 1px 3px;
  border-radius: 2px;
  background: #fff200;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.qr-note {
  margin: 18px 0 0 !important;
  color: #d71920;
  text-align: center;
  font-size: 17px !important;
  font-weight: 850 !important;
}

.qr-strip {
  display: grid;
  place-items: center;
  padding: 16px 24px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.qr-placeholder {
  width: 150px;
  aspect-ratio: 1;
  border: 1px solid rgba(127, 29, 29, 0.09);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.publish-card-body {
  padding: 30px;
}

.gate-alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: var(--radius);
  background: rgba(254, 242, 242, 0.96);
  color: var(--danger);
  font-size: 14px;
  font-weight: 640;
}

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

.form-group {
  min-width: 0;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-label {
  display: block;
  margin-bottom: 9px;
  color: #4f1717;
  font-size: 15px;
  font-weight: 760;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.required {
  margin-left: 3px;
  color: var(--danger);
}

.form-control,
.multiselect-display {
  width: 100%;
  min-height: 50px;
  padding: 13px 16px;
  border: 1.5px solid rgba(127, 29, 29, 0.12);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-control:focus,
.multiselect-display:focus,
.multiselect-wrapper.open .multiselect-display {
  border-color: rgba(255, 107, 107, 0.72);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.12);
}

select.form-control {
  appearance: none;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--primary-strong) 50%),
    linear-gradient(135deg, var(--primary-strong) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 21px,
    calc(100% - 12px) 21px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

textarea.form-control {
  min-height: 104px;
  resize: vertical;
}

.hint {
  margin-top: 7px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #76717c;
  font-size: 13px;
  line-height: 1.55;
}

.input-with-unit {
  position: relative;
}

.input-with-unit .form-control {
  padding-right: 60px;
}

.unit {
  position: absolute;
  top: 3px;
  right: 3px;
  bottom: 3px;
  display: grid;
  min-width: 46px;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 107, 107, 0.09);
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 700;
}

.time-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.time-separator {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.multiselect-wrapper {
  position: relative;
}

.multiselect-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: left;
}

.multiselect-label {
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multiselect-label.has-value {
  color: var(--text);
}

.chevron {
  flex: 0 0 auto;
  color: var(--primary-strong);
  font-size: 14px;
}

.multiselect-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border: 1.5px solid rgba(255, 107, 107, 0.34);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 36px rgba(127, 29, 29, 0.14);
}

.multiselect-wrapper.open .multiselect-menu {
  display: block;
}

.multi-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 6px;
  color: #4d2727;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.35;
}

.multi-option:hover {
  background: rgba(255, 107, 107, 0.075);
}

.multi-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.calc-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 84px;
  padding: 16px;
  border: 1.5px solid rgba(37, 99, 235, 0.16);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: rgba(37, 99, 235, 0.055);
}

.calc-field.deposit {
  border-color: rgba(124, 58, 237, 0.18);
  border-left-color: var(--purple);
  background: rgba(124, 58, 237, 0.06);
}

.calc-field.lease {
  border-color: rgba(5, 150, 105, 0.18);
  border-left-color: var(--teal);
  background: rgba(5, 150, 105, 0.06);
}

.calc-field.equipment {
  border-color: rgba(217, 119, 6, 0.2);
  border-left-color: var(--amber);
  background: rgba(217, 119, 6, 0.065);
}

.calc-meta {
  min-width: 0;
}

.calc-title {
  margin: 0;
  color: #2e2934;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.calc-sub {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.calc-value {
  min-width: 108px;
  color: var(--accent);
  font-size: 26px;
  font-weight: 820;
  line-height: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.calc-field.deposit .calc-value {
  color: var(--purple);
}

.calc-field.lease .calc-value {
  color: var(--teal);
}

.calc-field.equipment .calc-value {
  color: var(--amber);
}

.calc-unit {
  margin-left: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.deposit-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.deposit-input {
  width: min(150px, 100%);
  min-height: 42px;
  padding: 9px 10px;
  border: 1.5px solid rgba(124, 58, 237, 0.24);
  border-radius: var(--radius);
  outline: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--purple);
  font-size: 19px;
  font-weight: 780;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.deposit-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.restore-btn {
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.8);
  color: var(--purple);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.restore-btn:hover {
  background: rgba(124, 58, 237, 0.08);
}

.urgent-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 9px;
}

.urgent-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--amber);
}

.urgent-row label {
  color: #92400e;
  font-size: 13px;
  font-weight: 740;
  cursor: pointer;
}

.equipment-line {
  display: none;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(217, 119, 6, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 251, 235, 0.9);
  color: #a15c07;
  font-size: 13px;
  font-weight: 650;
}

.equipment-line.show {
  display: block;
}

.action-bar {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 16px;
  font-weight: 760;
  line-height: 1.25;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(127, 29, 29, 0.12);
}

.action-btn:active {
  transform: translateY(0);
}

.action-btn.primary {
  border: 1.5px solid rgba(255, 107, 107, 0.18);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
}

.action-btn.secondary {
  border: 1.5px solid rgba(37, 99, 235, 0.16);
  background: rgba(37, 99, 235, 0.07);
  color: var(--accent);
}

.btn-icon {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1;
}

.toast {
  position: fixed;
  z-index: 100;
  top: 18px;
  left: 50%;
  max-width: min(520px, calc(100% - 32px));
  padding: 12px 16px;
  border: 1px solid rgba(127, 29, 29, 0.12);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: #432424;
  box-shadow: 0 18px 36px rgba(127, 29, 29, 0.18);
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.toast.success {
  border-color: rgba(5, 150, 105, 0.25);
  color: var(--success);
}

.toast.error {
  border-color: rgba(220, 38, 38, 0.25);
  color: var(--danger);
}

@media (max-width: 720px) {
  .main-container {
    width: min(100% - 20px, 920px);
    padding-top: 10px;
    padding-bottom: 48px;
  }

  .publish-card-header {
    justify-content: flex-start;
    padding: 22px 18px;
  }

  .brand-mark {
    width: 58px;
    font-size: 32px;
  }

  .brand-copy h1 {
    font-size: 21px;
  }

  .notice-panel,
  .publish-card-body {
    padding: 20px 16px;
  }

  .notice-panel h2 {
    font-size: 19px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .time-range {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .time-separator {
    text-align: center;
  }

  .calc-field {
    grid-template-columns: 1fr;
  }

  .calc-value,
  .deposit-control {
    justify-content: flex-start;
    text-align: left;
  }

  .deposit-input {
    width: 140px;
  }
}
