* {
  box-sizing: border-box;
}

:root {
  --page-gutter: clamp(10px, 4vw, 18px);
}

html {
  font-size: clamp(15px, 2.9vw, 16px);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #333;
  background: #f5f5f5;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  min-height: 100vh;
  max-width: 100%;
  padding-bottom: max(120px, calc(96px + env(safe-area-inset-bottom, 0px)));
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  overflow-x: hidden;
}

.page-home .container {
  background: linear-gradient(180deg, #e8f4ff 0%, #f5f5f5 40%);
}

.page-form .container {
  background: linear-gradient(180deg, #e8f4ff 0%, #f5f5f5 40%);
  padding-bottom: max(140px, calc(112px + env(safe-area-inset-bottom, 0px)));
}

.page-confirm .container {
  background: #f5f5f5;
  padding-bottom: max(120px, calc(96px + env(safe-area-inset-bottom, 0px)));
}

.header {
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
  color: #fff;
}

.header-inner {
  min-height: 44px;
  height: auto;
  padding-top: max(10px, env(safe-area-inset-top, 0px));
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
}

.title {
  margin: 0;
  font-size: clamp(16px, 4.5vw, 18px);
  font-weight: 700;
}

.banner {
  position: relative;
  padding: clamp(18px, 5vw, 25px) var(--page-gutter) clamp(36px, 10vw, 50px);
  min-height: clamp(120px, 28vw, 150px);
  overflow: hidden;
}

.banner-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(74, 144, 226, 0.35) 0%, transparent 100%);
}

.card {
  background: #fff;
  margin: 0 var(--page-gutter) 15px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.12);
  overflow: hidden;
}

.select-card {
  margin-top: -30px;
  position: relative;
  z-index: 2;
}

.card-head {
  background: linear-gradient(135deg, #f0f7ff 0%, #fff 100%);
  padding: 15px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
}

.card-ico {
  font-size: 20px;
  margin-right: 8px;
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #333;
}

.service-grid {
  padding: clamp(10px, 3.5vw, 15px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 2.5vw, 12px);
}

.service-card {
  display: block;
  background: linear-gradient(135deg, #f8fbff 0%, #fff 100%);
  border: 1px solid #e8f0ff;
  border-radius: 10px;
  padding: clamp(14px, 4vw, 18px) clamp(8px, 2.8vw, 12px);
  min-height: clamp(132px, 36vw, 168px);
  text-align: center;
  transition: transform 0.15s;
}

.service-card:active {
  transform: translateY(2px);
}

.service-card.theme-a {
  border-color: #d7e9ff;
}

.service-card.theme-b {
  border-color: #ffe0d6;
}

.service-card.theme-c {
  border-color: #d8f5e2;
}

.service-card.theme-d {
  border-color: #f2e4ff;
}

.card-icon {
  font-size: clamp(26px, 7vw, 30px);
  margin-bottom: 8px;
  line-height: 1;
}

.service-name {
  font-size: clamp(14px, 3.8vw, 15px);
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
  line-height: 1.35;
}

.service-desc {
  font-size: clamp(12px, 3.2vw, 13px);
  color: #999;
  line-height: 1.45;
  margin-bottom: 10px;
  min-height: 2.9em;
}

.select-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px clamp(14px, 4vw, 18px);
  min-height: 36px;
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
  color: #fff;
  border-radius: 15px;
  font-size: clamp(12px, 3.2vw, 13px);
  font-weight: 700;
}

.tips-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: clamp(12px, 3.5vw, 15px);
  margin-left: var(--page-gutter);
  margin-right: var(--page-gutter);
}

.tips-head {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.tips-ico {
  font-size: 18px;
  margin-right: 8px;
}

.tips-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.tips-highlight {
  margin: 0 0 0 clamp(12px, 5vw, 26px);
  font-size: clamp(13px, 3.5vw, 14px);
  color: #ff6b6b;
  line-height: 1.75;
  font-weight: 500;
}

.regulations-card {
  padding: clamp(12px, 3.5vw, 15px);
  margin-left: var(--page-gutter);
  margin-right: var(--page-gutter);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.reg-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
}

.reg-text {
  margin: 0;
  font-size: 13px;
  color: #666;
  line-height: 1.6;
}

.entry-list {
  margin-top: 15px;
}

.list-title {
  display: block;
  font-size: 14px;
  margin-bottom: 10px;
}

.list-item {
  margin: 0 0 8px;
  font-size: clamp(12px, 3.2vw, 13px);
  color: #666;
  line-height: 1.75;
  padding-left: 10px;
}

.special-note {
  margin-top: 15px;
  padding: 10px;
  background: #fff9e6;
  border-radius: 4px;
}

.note-title {
  font-size: 13px;
  color: #ff6b6b;
  font-weight: 700;
}

.note-content {
  margin: 8px 0 0;
  font-size: clamp(12px, 3.2vw, 13px);
  color: #666;
  line-height: 1.65;
}

.commitment {
  margin: 15px 0 0;
  text-align: center;
  font-size: clamp(11px, 3vw, 12px);
  color: #999;
}

.form-banner {
  position: relative;
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
  padding: clamp(22px, 6vw, 30px) var(--page-gutter) clamp(38px, 10vw, 50px);
  padding-top: max(clamp(22px, 6vw, 30px), env(safe-area-inset-top, 0px));
  overflow: hidden;
  color: #fff;
}

.banner-clouds {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background: radial-gradient(circle at 20% 30%, #fff 0%, transparent 40%),
    radial-gradient(circle at 80% 40%, #fff 0%, transparent 35%);
}

.banner-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.banner-title {
  margin: 0 0 5px;
  font-size: clamp(22px, 6.5vw, 28px);
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.banner-sub {
  margin: 0 0 20px;
  font-size: clamp(14px, 4vw, 16px);
  opacity: 0.95;
}

.step-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0.55;
}

.step.active {
  opacity: 1;
}

.step .num {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 5px;
}

.step.active .num {
  background: #fff;
  color: #4a90e2;
}

.step .txt {
  font-size: clamp(10px, 2.8vw, 11px);
  max-width: 4.5em;
  text-align: center;
  line-height: 1.25;
}

.step-flow .arrow {
  font-size: 14px;
  opacity: 0.5;
}

.form-card {
  margin-top: -30px;
  position: relative;
  z-index: 2;
  border: 1px solid #ebf2fb;
}

.service-tag {
  margin: 12px var(--page-gutter);
  padding: 12px var(--page-gutter);
  background: #f8fbff;
  border-left: 3px solid #4a90e2;
  border-radius: 4px;
}

.tag-label {
  font-size: 12px;
  color: #999;
  margin-right: 8px;
}

.tag-value {
  font-size: 14px;
  color: #4a90e2;
  font-weight: 700;
}

.form-error {
  margin: 0 var(--page-gutter) 10px;
  color: #e53935;
  font-size: 13px;
}

.form-body {
  padding: 5px var(--page-gutter) 20px;
}

.form-item {
  margin-bottom: 18px;
}

.item-label {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.item-label .dot {
  color: #4a90e2;
  margin-right: 6px;
  font-weight: 700;
}

.item-label {
  font-size: 14px;
  font-weight: 500;
}

.item-input {
  width: 100%;
  max-width: 100%;
  height: 48px;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 16px;
  background: #f8f8f8;
}

.item-input:focus {
  outline: none;
  border-color: #4a90e2;
  background: #fff;
}

.submit-fixed {
  position: fixed;
  left: max(var(--page-gutter), env(safe-area-inset-left, 0px));
  right: max(var(--page-gutter), env(safe-area-inset-right, 0px));
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  height: 48px;
  border: none;
  border-radius: 24px;
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.35);
  z-index: 100;
  cursor: pointer;
}

.law-detail .reg-block {
  margin-bottom: 12px;
  padding: 12px;
  background: #f8fbff;
  border-radius: 6px;
  border-left: 2px solid #4a90e2;
  font-size: clamp(12px, 3.3vw, 13px);
  color: #666;
  line-height: 1.75;
}

.law-detail .reg-block.warn {
  background: #fff5f5;
  border-left-color: #e53935;
}

.warn-txt {
  margin: 0;
  color: #e53935;
  font-weight: 700;
  font-size: 13px;
}

.sec-title {
  display: block;
  color: #4a90e2;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 13px;
}

.law-quote {
  display: inline-block;
  background: #f2d27a;
  padding: 6px 8px;
  border-radius: 4px;
  margin-top: 4px;
}

.confirm-head {
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
  color: #fff;
  padding: clamp(18px, 5vw, 22px) var(--page-gutter);
  padding-left: max(var(--page-gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--page-gutter), env(safe-area-inset-right, 0px));
}

.confirm-head .title {
  font-size: clamp(20px, 6vw, 24px);
  margin: 0 0 5px;
}

.confirm-head .sub {
  margin: 0 0 10px;
  font-size: 16px;
}

.confirm-head .steps {
  margin: 0;
  font-size: 12px;
  opacity: 0.9;
}

.info-box {
  background: #fff;
  margin: var(--page-gutter);
  padding: clamp(14px, 4vw, 16px);
  border-radius: 8px;
  border: 1px solid #ecf1f7;
}

.info-title {
  margin: 0 0 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 15px;
  font-weight: 700;
}

.info-row {
  display: flex;
  margin-bottom: 12px;
  align-items: flex-start;
}

.info-row .lbl {
  flex: 0 0 110px;
  font-size: 14px;
  color: #666;
}

.info-row .val {
  flex: 1;
  font-size: 14px;
  color: #333;
  word-break: break-all;
}

.price-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e0e0e0;
}

.price-row .price {
  font-size: 18px;
  color: #ff6b6b;
  font-weight: 700;
}

.law-box .reg-block {
  margin-bottom: 12px;
  padding: 10px;
  background: #f9fbfe;
  border-radius: 6px;
  font-size: 13px;
  color: #666;
  line-height: 1.7;
}

.pay-tip {
  margin: 0 var(--page-gutter) 10px;
  color: #e53935;
  font-size: 13px;
}

.btn-bar {
  position: fixed;
  left: max(var(--page-gutter), env(safe-area-inset-left, 0px));
  right: max(var(--page-gutter), env(safe-area-inset-right, 0px));
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 10px;
  z-index: 50;
}

.btn {
  flex: 1;
  height: 44px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}

.btn.ghost {
  background: #fff;
  color: #4a90e2;
  border: 2px solid #4a90e2;
}

.btn.primary {
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
  color: #fff;
}

.admin-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 15px 40px;
}

.admin-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.admin-nav a {
  padding: 8px 14px;
  background: #4a90e2;
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
}

.admin-nav a.secondary {
  background: #666;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.admin-table th,
.admin-table td {
  border: 1px solid #eee;
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  background: #f5f8fc;
}

.admin-form label {
  display: block;
  margin: 12px 0 4px;
  font-weight: 600;
  font-size: 14px;
}

.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form input[type="number"] {
  width: 100%;
  max-width: 420px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.admin-msg {
  padding: 10px;
  margin-bottom: 15px;
  border-radius: 4px;
  background: #e8f5e9;
  color: #2e7d32;
}

.admin-msg.err {
  background: #ffebee;
  color: #c62828;
}

@media (max-width: 380px) {
  .info-row {
    flex-direction: column;
    margin-bottom: 14px;
  }

  .info-row .lbl {
    flex: none;
    margin-bottom: 2px;
  }
}
