/* ==========================================================================
   合壹瑜伽 · 表单系统 —— 前台样式
   设计基调：纸白底 + 苔绿主色 + 沙金点缀，留白充足，移动端优先
   ========================================================================== */

:root {
  --ink: #23282a;
  --ink-2: #56605d;
  --ink-3: #8c9591;
  --paper: #faf9f6;
  --card: #ffffff;
  --sage: #5c7360;
  --sage-deep: #43574a;
  --sage-soft: #edf1ec;
  --sand: #bfa077;
  --line: #e6e5de;
  --line-2: #f0efe9;
  --danger: #b4553f;
  --danger-soft: #fbf1ee;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(35, 40, 42, 0.04);
  --shadow: 0 6px 20px rgba(35, 40, 42, 0.06);
  --shadow-lg: 0 18px 48px rgba(35, 40, 42, 0.1);
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --font-serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, "Times New Roman",
    serif;
  --maxw: 620px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font-family: inherit;
}

/* ---------------------------------------------------------------- 骨架 */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px 140px;
}

/* ---------------------------------------------------------------- 顶栏 */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line-2);
}

.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  border: 1px solid var(--sage);
  color: var(--sage-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.14em;
  color: var(--sage-deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- 进度条 */

.progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 100%;
  background: var(--line-2);
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--sage);
  transition: width 0.35s ease;
}

/* ---------------------------------------------------------------- 表头 */

.hero {
  padding: 34px 0 8px;
}

.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--sand);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero h1 {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.hero-intro {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.85;
  margin: 0;
  white-space: pre-line;
}

.rule {
  height: 1px;
  background: var(--line);
  margin: 26px 0 8px;
  border: 0;
}

/* ---------------------------------------------------------------- 字段 */

.fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 18px 16px 16px;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 70px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field.is-invalid {
  border-color: #e2bdb4;
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.field-label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
}

.field-no {
  flex: 0 0 auto;
  color: var(--sage);
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 400;
  padding-top: 1px;
}

.field-req {
  color: var(--danger);
  font-weight: 400;
  margin-left: 2px;
}

.field-note {
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.7;
  margin: 6px 0 0;
  padding-left: 22px;
}

.field-inputs {
  margin-top: 12px;
}

.field-error {
  display: none;
  margin-top: 10px;
  padding-left: 22px;
  color: var(--danger);
  font-size: 12.5px;
}

.field.is-invalid .field-error {
  display: block;
}

/* 纯文本说明块 */
.field-static {
  background: var(--sage-soft);
  border-color: transparent;
  box-shadow: none;
}

.field-static .field-label {
  color: var(--sage-deep);
  font-weight: 400;
  margin-bottom: 0;
}

/* ---------------------------------------------------------------- 输入控件 */

.input,
textarea.input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fcfcfa;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder {
  color: #b6bdb9;
}

.input:focus {
  border-color: var(--sage);
  background: #fff;
  box-shadow: 0 0 0 3px var(--sage-soft);
}

textarea.input {
  min-height: 92px;
  resize: vertical;
  line-height: 1.7;
}

/* ---------------------------------------------------------------- 选项 */

.options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.options.layout-grid2,
.options.layout-grid3 {
  display: grid;
  gap: 8px;
}

.options.layout-grid2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.options.layout-grid3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fcfcfa;
  cursor: pointer;
  font-size: 14.5px;
  line-height: 1.55;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
  user-select: none;
}

.option:hover {
  border-color: #cfd6cd;
  background: #fff;
}

.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option .mark {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1.5px solid #c3cac2;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.option .mark.round {
  border-radius: 50%;
}

.option .mark.square {
  border-radius: 5px;
}

.option .mark svg {
  width: 12px;
  height: 12px;
  display: block;
}

.option .mark svg path {
  fill: none;
  stroke: #fff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.option .mark.round::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.option .option-text {
  flex: 1;
  min-width: 0;
}

.option.is-checked {
  border-color: var(--sage);
  background: var(--sage-soft);
  color: var(--sage-deep);
}

.option.is-checked .mark {
  border-color: var(--sage);
  background: var(--sage);
}

.option.is-checked .mark.square svg path {
  opacity: 1;
}

.option.is-checked .mark.round::after {
  opacity: 1;
}

.option.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.options.layout-grid2 .option,
.options.layout-grid3 .option {
  justify-content: center;
  padding: 12px 8px;
}

.options.layout-grid2 .option-text,
.options.layout-grid3 .option-text {
  text-align: center;
  flex: 0 1 auto;
}

/* ---------------------------------------------------------------- 底部操作 */

.outro {
  margin: 24px 0 0;
  padding: 18px 4px 0;
  border-top: 1px dashed var(--line);
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.85;
}

.actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to bottom, rgba(250, 249, 246, 0.55), var(--paper) 34%);
}

.actionbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 999px;
  background: var(--sage-deep);
  color: #fff;
  font-size: 16px;
  letter-spacing: 0.08em;
  padding: 15px 20px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, background 0.18s ease, opacity 0.18s ease;
}

.btn:hover {
  background: #3a4c40;
}

.btn:active {
  transform: scale(0.988);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.btn-ghost {
  background: transparent;
  color: var(--sage-deep);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--sage-soft);
  border-color: var(--sage);
}

.hint-count {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-3);
  margin: 0 0 8px;
  min-height: 18px;
}

.hint-count .n {
  color: var(--danger);
  font-weight: 500;
}

/* ---------------------------------------------------------------- 状态页 */

.state {
  padding: 64px 0;
  text-align: center;
}

.state-mark {
  width: 62px;
  height: 62px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 1px solid var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
}

.state-mark svg {
  width: 28px;
  height: 28px;
}

.state-mark svg path {
  fill: none;
  stroke: var(--sage-deep);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.state h2 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.state p {
  margin: 0 auto;
  max-width: 400px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.85;
}

.state-actions {
  margin-top: 26px;
  display: flex;
  justify-content: center;
}

.state-actions .btn {
  width: auto;
  padding: 11px 26px;
  font-size: 14px;
}

.skeleton {
  background: linear-gradient(90deg, #f1f0eb 25%, #e9e8e2 37%, #f1f0eb 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

.sk-line {
  height: 14px;
  margin-bottom: 12px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------------------------------------------------------------- 表单目录页 */

.catalog-head {
  padding: 56px 0 28px;
  text-align: center;
}

.catalog-head .brand-mark {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
  font-size: 24px;
  margin: 0 auto 20px;
}

.catalog-head h1 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 400;
  letter-spacing: 0.1em;
}

.catalog-head p {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
  letter-spacing: 0.1em;
}

.form-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.form-card:hover {
  border-color: #d7ddd4;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.form-card h2 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.form-card p {
  margin: 0 0 14px;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.7;
}

.form-card .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--sage);
  letter-spacing: 0.06em;
}

.form-card .arrow {
  margin-left: auto;
  color: var(--ink-3);
}

.site-footer {
  padding: 34px 0 46px;
  text-align: center;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.9;
}

.site-footer a {
  color: var(--ink-3);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

/* ---------------------------------------------------------------- 提示条 */

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 12px);
  z-index: 60;
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  padding: 11px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  max-width: calc(100vw - 48px);
}

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

.toast.error {
  background: var(--danger);
}

@media (min-width: 560px) {
  .hero h1 {
    font-size: 29px;
  }
  .field {
    padding: 20px 20px 18px;
  }
}

@media print {
  .topbar,
  .actionbar,
  .toast {
    display: none !important;
  }
  .wrap {
    padding-bottom: 0;
  }
}
