/* form.css �?科技感移动端表单样式 */

/* =====================
   CSS 自定义属性（变量�?
   ===================== */
:root {
  --color-bg:          #0a0a0a;
  --color-bg-card:     #111111;
  --color-bg-input:    #161616;
  --color-border:      #1f2e1f;
  --color-border-focus:#00c875;
  --color-green:       #00c875;
  --color-green-dim:   #009a5a;
  --color-text:        #e8f5e8;
  --color-text-muted:  #4d7a4d;
  --color-error:       #ff4d4d;
  --color-success:     #00c875;
  --gradient-btn:      linear-gradient(135deg, #00c875 0%, #009a5a 100%);
  --gradient-title:    linear-gradient(90deg, #00c875 0%, #7fffb2 100%);
  --radius-sm:         6px;
  --radius-md:         12px;
  --radius-lg:         20px;
  --shadow-glow:       0 0 16px rgba(0,200,117,0.25);
  --transition-fast:   0.15s ease;
  --transition-med:    0.25s ease;
  --min-touch:         44px;
  --font-main:         'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
}

/* =====================
   Reset & Base
   ===================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-main);
  min-height: 100vh;
  line-height: 1.6;
  /* 微噪点背景纹�?*/
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(0,200,117,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(0,166,90,0.06) 0%, transparent 60%);
}

/* =====================
   页面包装
   ===================== */
.page-wrapper {
  max-width: 480px;
  min-width: 320px;
  margin: 0 auto;
  padding: 0 0 40px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* =====================
   页面头部 / 标题
   ===================== */
.page-header {
  padding: 40px 20px 28px;
  text-align: center;
  position: relative;
}

.page-header::after {
  content: '';
  display: block;
  margin: 20px auto 0;
  width: 60px;
  height: 2px;
  background: var(--gradient-btn);
  border-radius: 2px;
}

.page-title {
  font-size: clamp(20px, 6vw, 28px);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.3;
  /* 允许在小屏折�?*/
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0;
}

.title-tech {
  background: linear-gradient(135deg, #00c875, #7fffb2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.title-sep {
  color: var(--color-text-muted);
  -webkit-text-fill-color: var(--color-text-muted);
}

.title-human {
  background: linear-gradient(135deg, #009a5a, #00c875);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  margin-top: 8px;
  font-size: 13px;
  color: var(--color-text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* =====================
   表单容器
   ===================== */
.form-container {
  flex: 1;
  padding: 0 16px;
}

/* =====================
   状态提示（成功/失败�?
   ===================== */
.status-message[hidden] {
  display: none;
}

.status-message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 15px;
  font-weight: 500;
  animation: fadeInDown 0.3s ease;
}

.status-message[hidden] {
  display: none !important;
}

.success-message {
  background: rgba(0,229,160,0.12);
  border: 1px solid rgba(0,229,160,0.4);
  color: var(--color-success);
}

.error-message {
  background: rgba(255,77,109,0.12);
  border: 1px solid rgba(255,77,109,0.4);
  color: var(--color-error);
}

.status-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =====================
   Fieldset（单选组�?
   ===================== */
.form-fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
  background: var(--color-bg-card);
  transition: border-color var(--transition-med);
}

.form-fieldset:focus-within {
  border-color: var(--color-neon-blue);
  box-shadow: var(--shadow-glow-blue);
}

.form-fieldset.has-error {
  border-color: var(--color-error);
}

.fieldset-legend {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  padding: 0 6px;
  text-transform: uppercase;
  /* �?fieldset 内显示为内嵌图例 */
  float: left;
  width: 100%;
  margin-bottom: 12px;
}

/* =====================
   单选按钮组
   ===================== */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  clear: both;
}

.radio-group--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

/* 单个单选项 */
.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--min-touch);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.radio-label:hover {
  background: rgba(0,200,117,0.06);
}

.radio-label:active {
  background: rgba(0,200,117,0.12);
}

/* 隐藏原生 radio */
.radio-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* 自定义圆形指示器 */
.radio-custom {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--color-border-focus);
  background: transparent;
  position: relative;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.radio-custom::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: transparent;
  transition: background var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

/* 选中状�?*/
.radio-label input[type="radio"]:checked ~ .radio-custom {
  border-color: var(--color-green);
  box-shadow: 0 0 12px rgba(0,200,117,0.6);
}

.radio-label input[type="radio"]:checked ~ .radio-custom::after {
  background: var(--color-green);
  box-shadow: 0 0 8px rgba(0,200,117,0.8);
  transform: scale(1);
}

.radio-label input[type="radio"]:checked ~ .radio-text {
  color: var(--color-green);
  font-weight: 600;
}

/* Focus 可访问�?*/
.radio-label input[type="radio"]:focus-visible ~ .radio-custom {
  outline: 2px solid var(--color-green);
  outline-offset: 2px;
}

.radio-text {
  font-size: 15px;
  color: var(--color-text);
  transition: color var(--transition-fast);
  line-height: 1.4;
}

/* =====================
   普通文本输入字�?
   ===================== */
.form-field {
  margin-bottom: 18px;
}

.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.required-mark {
  color: var(--color-error);
  margin-left: 2px;
}

.optional-mark {
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.field-input {
  display: block;
  width: 100%;
  min-height: var(--min-touch);
  padding: 10px 14px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.5;
  transition: border-color var(--transition-med), box-shadow var(--transition-med);
  -webkit-appearance: none;
  appearance: none;
}

.field-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

.field-input:focus {
  outline: none;
  border-color: var(--color-neon-blue);
  box-shadow: var(--shadow-glow-blue);
}

.field-input.has-error {
  border-color: var(--color-error);
  box-shadow: 0 0 8px rgba(255,77,109,0.25);
}

/* Textarea 专属 */
.field-textarea {
  resize: vertical;
  min-height: 100px;
}

/* =====================
   错误提示文字
   ===================== */
.field-error {
  min-height: 18px;
  margin-top: 5px;
  font-size: 12px;
  color: var(--color-error);
  line-height: 1.4;
  /* 隐藏时不占位，有内容才显�?*/
}

.field-error:empty {
  display: none;
}

/* =====================
   提交按钮
   ===================== */
.form-actions {
  margin-top: 28px;
  margin-bottom: 10px;
}

.submit-btn {
  display: block;
  width: 100%;
  min-height: var(--min-touch);
  padding: 13px 24px;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--gradient-btn);
  color: #fff;
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.submit-btn:hover:not(:disabled) {
  box-shadow: none;
  transform: translateY(-1px);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-loading[hidden] {
  display: none;
}

.btn-loading::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =====================
   页脚
   ===================== */
.page-footer {
  margin-top: auto;
  padding: 24px 16px 16px;
  text-align: center;
}

.footer-text {
  font-size: 12px;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}

/* =====================
   响应式断�?
   ===================== */

/* 极小屏（320px）适配 */
@media (max-width: 360px) {
  .page-title {
    font-size: 18px;
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }
  .title-sep {
    display: none;
  }
  .radio-group--grid {
    grid-template-columns: 1fr;
  }
}

/* 标准移动端（361px�?80px�?*/
@media (min-width: 361px) and (max-width: 480px) {
  .page-title {
    font-size: clamp(20px, 5.5vw, 26px);
  }
}

/* 宽屏桌面居中展示 */
@media (min-width: 481px) {
  .page-wrapper {
    margin-top: 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0,200,117,0.08);
  }
}

/* =====================
   深色模式兜底（已默认深色�?
   ===================== */
@media (prefers-color-scheme: light) {
  /* 保持深色主题不随系统切换 */
  :root {
    color-scheme: dark;
  }
}

/* =====================
   成功/失败 SVG 图标动画
   ===================== */
.status-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.icon-success,
.icon-error {
  width: 80px;
  height: 80px;
}

.icon-success .circle-anim {
  animation: draw-circle 0.6s ease forwards;
}

.icon-success .check-anim {
  animation: draw-check 0.4s ease 0.5s forwards;
}

.icon-error .circle-anim {
  animation: draw-circle 0.6s ease forwards;
}

.icon-error .cross-anim {
  animation: draw-cross 0.3s ease 0.5s forwards;
}

@keyframes draw-circle {
  to { stroke-dashoffset: 0; }
}

@keyframes draw-check {
  to { stroke-dashoffset: 0; }
}

@keyframes draw-cross {
  to { stroke-dashoffset: 0; }
}

.status-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.success-message .status-title {
  color: var(--color-success);
}

.error-message .status-title {
  color: var(--color-error);
}

.status-sub {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.page-forum {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-green);
  letter-spacing: 0.12em;
  margin-top: 6px;
  opacity: 0.85;
}
