* {
  box-sizing: border-box;
}

body,
html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background: #f6f7fb;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-container {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  padding: 0;
}

.card {
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 20px 16px;
  box-sizing: border-box;
  display: none;
  width: 100%;
  min-height: 100vh;
}

.card.active {
  display: block;
}

.card-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 8px;
}

.card-subtitle {
  font-size: 12px;
  color: #7a7f8c;
  margin: 0 0 16px;
}

.lang-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lang-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: #f5f6fb;
  color: #222;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: box-shadow 0.15s ease, transform 0.1s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 44px;
}

.lang-btn.primary {
  background: linear-gradient(90deg, #2f80ff, #00c7ff);
  color: #fff;
  text-align: center;
}

.lang-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.card-header.back-header {
  display: flex;
  align-items: center;
  margin: -8px -8px 12px;
}

.back-btn {
  border: none;
  background: transparent;
  font-size: 20px;
  padding: 8px 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-width: 44px;
  min-height: 44px;
}

.header-title {
  font-size: 16px;
  font-weight: 600;
}

.card-body.scrollable {
  overflow-y: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d7dce5;
  font-size: 16px;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  background-color: #ffffff;
}

.field input:focus {
  outline: none;
  border-color: #2f80ff;
}

.section-title {
  margin: 18px 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.photo-box {
  background: #f6f8fd;
  border-radius: 14px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
}

.photo-placeholder {
  width: 100%;
  max-width: 280px;
  height: 0;
  padding-bottom: 54.5%;
  border-radius: 18px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  position: relative;
  overflow: visible;
}

/* ID证件框样式 */
.id-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 75%;
  max-width: 200px;
  height: 0;
  padding-bottom: 50%;
  border: 2px dashed #2f80ff;
  border-radius: 12px;
  background: rgba(246, 248, 253, 0.5);
}

/* L形角标 */
.corner-guide {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid #2f80ff;
}

.corner-tl {
  top: -3px;
  left: -3px;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: 8px;
}

.corner-tr {
  top: -3px;
  right: -3px;
  border-left: none;
  border-bottom: none;
  border-top-right-radius: 8px;
}

.corner-bl {
  bottom: -3px;
  left: -3px;
  border-right: none;
  border-top: none;
  border-bottom-left-radius: 8px;
}

.corner-br {
  bottom: -3px;
  right: -3px;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: 8px;
}

/* 证件图标 */
.id-card-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: 70%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 242, 247, 0.9) 100%);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.id-card-icon::before {
  content: '';
  position: absolute;
  top: 15%;
  left: 10%;
  width: 30%;
  height: 35%;
  background: #e0e4ea;
  border-radius: 50%;
}

.id-card-icon::after {
  content: '';
  position: absolute;
  top: 15%;
  right: 10%;
  width: 50%;
  height: 8%;
  background: #e0e4ea;
  border-radius: 2px;
}

/* 相机图标 */
.camera-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: #2f80ff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(47, 128, 255, 0.4);
}

.camera-icon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border: 3px solid #ffffff;
  border-radius: 50%;
}

.camera-icon::after {
  content: '';
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: #ffffff;
  border-radius: 50%;
}

/* 自拍区域 */
.selfie-placeholder {
  background: #e8f0fe;
  padding-bottom: 80%;
}

.selfie-illustration {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  max-width: 180px;
}

.selfie-head {
  width: 80px;
  height: 80px;
  background: #fdbcb4;
  border-radius: 50%;
  margin: 0 auto 10px;
  position: relative;
}

.selfie-head::before {
  content: '';
  position: absolute;
  top: 35%;
  left: 30%;
  width: 8px;
  height: 8px;
  background: #333;
  border-radius: 50%;
  box-shadow: 20px 0 0 #333;
}

.selfie-head::after {
  content: '';
  position: absolute;
  bottom: 25%;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 8px;
  border: 2px solid #333;
  border-top: none;
  border-radius: 0 0 15px 15px;
}

.selfie-body {
  width: 100%;
  height: 120px;
  background: linear-gradient(180deg, #2f80ff 0%, #1e6dd9 100%);
  border-radius: 20px 20px 0 0;
  position: relative;
  margin-top: -20px;
}

.selfie-body::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  background: #ffffff;
  border-radius: 8px;
}

.selfie-body::after {
  content: '';
  position: absolute;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  background: #ffffff;
  border-radius: 4px;
  border: 2px solid #2f80ff;
}

.photo-link {
  background: none;
  border: none;
  color: #2f80ff;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  padding: 4px 8px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.selfie-box {
  padding: 20px 12px;
}

.selfie-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.selfie-text {
  color: #333;
  font-size: 13px;
}

.selfie-link {
  padding: 0;
  text-decoration: underline;
}

.photo-guidelines {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 8px;
  margin: 12px 0 16px;
  font-size: 11px;
}

.photo-guidelines.bottom {
  flex-direction: column;
  gap: 8px;
}

.guideline-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.guideline-icon-wrapper {
  position: relative;
  width: 60px;
  height: 60px;
  margin-bottom: 6px;
}

.guideline-icon {
  width: 100%;
  height: 100%;
  background: #ffffff;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  position: relative;
}

.guideline-icon.standard {
  background: linear-gradient(135deg, #ffffff 0%, #f5f7fa 100%);
}

.guideline-icon.standard::before,
.guideline-icon.standard::after {
  content: '';
  position: absolute;
  background: #ff9500;
  border-radius: 2px;
}

.guideline-icon.standard::before {
  top: 20%;
  left: 15%;
  width: 25px;
  height: 8px;
}

.guideline-icon.standard::after {
  top: 35%;
  left: 15%;
  width: 35px;
  height: 8px;
}

.guideline-icon.missing-border {
  background: linear-gradient(135deg, #ffffff 0%, #f5f7fa 100%);
}

.guideline-icon.missing-border::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 15%;
  width: 25px;
  height: 8px;
  background: #ff9500;
  border-radius: 2px;
}

.guideline-icon.missing-border::after {
  content: '';
  position: absolute;
  top: 35%;
  left: 15%;
  width: 35px;
  height: 8px;
  background: #ff9500;
  border-radius: 2px;
  clip-path: polygon(0 0, 85% 0, 85% 100%, 0 100%);
}

.guideline-icon.blurry {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, rgba(245, 247, 250, 0.5) 100%);
  filter: blur(2px);
}

.guideline-icon.blurry::before,
.guideline-icon.blurry::after {
  content: '';
  position: absolute;
  background: #ff9500;
  border-radius: 2px;
  filter: blur(1px);
}

.guideline-icon.blurry::before {
  top: 20%;
  left: 15%;
  width: 25px;
  height: 8px;
}

.guideline-icon.blurry::after {
  top: 35%;
  left: 15%;
  width: 35px;
  height: 8px;
}

.guideline-icon.flash {
  background: linear-gradient(135deg, #ffffff 0%, #f5f7fa 100%);
}

.guideline-icon.flash::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 15%;
  width: 25px;
  height: 8px;
  background: #ff9500;
  border-radius: 2px;
}

.guideline-icon.flash::after {
  content: '';
  position: absolute;
  top: 35%;
  left: 15%;
  width: 35px;
  height: 8px;
  background: #ff9500;
  border-radius: 2px;
}

.guideline-icon.flash {
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.3) 50%, #ffffff 100%);
}

.status-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.status-ok {
  background: #2f80ff;
}

.status-error {
  background: #e74c3c;
}

.guideline-text {
  font-size: 10px;
  color: #7a7f8c;
  text-align: center;
  line-height: 1.2;
}

.primary-btn,
.secondary-btn {
  border-radius: 999px;
  border: none;
  padding: 12px 16px;
  font-size: 15px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 44px;
  font-weight: 500;
}

.primary-btn {
  background: linear-gradient(90deg, #2f80ff, #00c7ff);
  color: #fff;
}

.secondary-btn {
  background: #f3f4fb;
  color: #2f80ff;
}

.full-width {
  width: 100%;
  margin-top: 12px;
}

.error-text {
  color: #e74c3c;
  font-size: 12px;
  margin-top: 6px;
}

.status-text {
  font-size: 12px;
  margin-top: 8px;
  color: #7a7f8c;
}

.video-wrapper {
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  position: relative;
}

.video-wrapper video {
  width: 100%;
  display: block;
}

.video-overlay {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(47, 128, 255, 0.7);
  border-radius: 18px;
  pointer-events: none;
}

.instruction {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 500;
}

/* 移动端优化 */
@media (max-width: 480px) {
  body {
    align-items: flex-start;
    padding: 0;
  }

  .app-container {
    max-width: 100%;
  }

  .card {
    border-radius: 0;
    box-shadow: none;
    padding: 16px 14px;
    min-height: 100vh;
  }

  .card-title {
    font-size: 20px;
  }

  .card-subtitle {
    font-size: 11px;
  }

  .field {
    margin-bottom: 16px;
  }

  .field label {
    font-size: 14px;
  }

  .field input {
    font-size: 16px;
    padding: 12px 14px;
  }

  .section-title {
    font-size: 15px;
    margin: 20px 0 10px;
  }

  .photo-box {
    padding: 12px 10px;
  }

  .photo-placeholder {
    max-width: 100%;
  }

  .guideline-icon-wrapper {
    width: 50px;
    height: 50px;
  }

  .guideline-text {
    font-size: 9px;
  }

  .id-frame {
    width: 80%;
  }

  .corner-guide {
    width: 16px;
    height: 16px;
    border-width: 2px;
  }

  .photo-guidelines {
    font-size: 10px;
    gap: 6px 8px;
  }

  .guideline {
    flex: 0 0 auto;
  }

  .primary-btn,
  .secondary-btn {
    padding: 12px 16px;
    font-size: 15px;
  }

  .back-btn {
    padding: 10px 12px;
    font-size: 22px;
  }

  .header-title {
    font-size: 17px;
  }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
  .card {
    padding: 12px 10px;
  }

  .photo-box {
    padding: 10px 8px;
  }

  .photo-guidelines {
    flex-direction: column;
    gap: 6px;
  }
}

/* 横屏模式 */
@media (max-height: 500px) and (orientation: landscape) {
  .card {
    min-height: auto;
    padding: 12px 16px;
  }

  .card-body.scrollable {
    max-height: calc(100vh - 100px);
  }
}

