/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background-color: #f0f2f5;
  color: #1a1a2e;
  line-height: 1.6;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

.hidden {
  display: none !important;
}

/* ===== Header ===== */
.header {
  background: linear-gradient(135deg, #1b2a4a 0%, #162240 50%, #0f1a33 100%);
  border-bottom: 3px solid #c8a45a;
  position: relative;
}

.header::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 164, 90, 0.4), transparent);
}

.header-inner {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-box {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  background: linear-gradient(135deg, #1e3a5f, #0f2440);
  border: 2px solid #c8a45a;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(200, 164, 90, 0.2);
}

.logo-icon svg {
  width: 28px;
  height: 28px;
  color: #c8a45a;
}

.logo-text h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #ffffff;
}

.logo-text p {
  margin: 3px 0 0;
  font-size: 12px;
  color: #7a8ea0;
  letter-spacing: 0.02em;
}

/* ===== Main ===== */
.main {
  flex: 1;
  padding: 36px 0 48px;
}

/* Page Title */
.page-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
}

.page-title-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1e3a5f, #2a4a6f);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.page-title-icon svg {
  width: 22px;
  height: 22px;
  color: #ffffff;
}

.page-title h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
}

.page-title p {
  margin: 0;
  font-size: 14px;
  color: #64748b;
}

/* ===== Card ===== */
.card {
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid #e2e6ed;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 14px 24px;
  border-bottom: 1px solid #e5e8ed;
  background-color: #f8f9fb;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background-color: #eef2f7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-header-icon svg {
  width: 15px;
  height: 15px;
  color: #1e3a5f;
}

.card-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a2e;
}

.card-body {
  padding: 28px 24px;
}

/* ===== Form ===== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.required {
  color: #e53e3e;
  margin-left: 2px;
}

.form-field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  color: #1a1a2e;
  background-color: #ffffff;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input::placeholder {
  color: #9ca3af;
}

.form-field input:focus {
  border-color: #1e3a5f;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.field-tip {
  margin: 6px 0 0;
  font-size: 12px;
  color: #94a3b8;
}

.field-error {
  margin: 6px 0 0;
  font-size: 12px;
  color: #dc2626;
  font-weight: 500;
  line-height: 1.4;
}

.form-field.has-error input {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-field.has-error .field-tip {
  display: none;
}

/* ===== Actions ===== */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 24px;
  height: 44px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #1e3a5f, #2a4a6f);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(30, 58, 95, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #254a75, #1e3a5f);
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.4);
  transform: translateY(-1px);
}

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

.btn-outline {
  background-color: #ffffff;
  color: #475569;
  border-color: #d1d5db;
}

.btn-outline:hover {
  background-color: #f8f9fb;
  border-color: #94a3b8;
}

.btn-sm {
  height: 34px;
  padding: 0 16px;
  font-size: 13px;
  border-radius: 5px;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ===== Alert ===== */
.alert {
  margin-top: 24px;
  padding: 14px 16px;
  border-radius: 6px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  line-height: 1.6;
}

.alert-info {
  background-color: #f0f4fa;
  border: 1px solid #d4dff0;
  color: #1e3a5f;
}

.alert-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-color: #1e3a5f;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-icon svg {
  width: 16px;
  height: 16px;
  color: #c8a45a;
}

.alert-title {
  margin: 0 0 2px;
  font-weight: 700;
  font-size: 13px;
}

.alert-text p {
  margin: 0;
}

/* ===== Loading Card ===== */
.card-loading {
  border-color: #e2e6ed;
}

.loading-body {
  text-align: center;
  padding: 48px 16px;
}

.loading-spinner {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 999px;
  border: 3px solid #e2e6ed;
  border-top-color: #1e3a5f;
  animation: spin 0.8s linear infinite;
}

.loading-title {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 16px;
  color: #1a1a2e;
}

.loading-subtitle {
  margin: 0;
  font-size: 13px;
  color: #94a3b8;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Success Card ===== */
.card-success {
  border-color: #c3dfd0;
  position: relative;
}

.card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.input-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 14px;
  color: #64748b;
}

.input-summary strong {
  color: #1e3a5f;
  font-weight: 600;
}

.success-body {
  padding: 0;
}

.success-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #f0faf4, #e6f7ed);
  border-bottom: 1px solid #c3dfd0;
}

.success-icon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}

.success-icon svg {
  width: 26px;
  height: 26px;
  color: #ffffff;
}

.success-banner h3 {
  margin: 0 0 2px;
  font-size: 18px;
  font-weight: 700;
  color: #15803d;
}

.success-banner p {
  margin: 0;
  font-size: 13px;
  color: #4ade80;
  font-weight: 500;
}

.result-list {
  padding: 24px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.result-row {
  display: flex;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.result-row:last-child {
  border-bottom: none;
}

.result-label {
  width: 120px;
  flex-shrink: 0;
  font-size: 14px;
  color: #94a3b8;
  font-weight: 500;
}

.result-value {
  font-size: 14px;
  color: #1a1a2e;
  font-weight: 600;
}

.result-value-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #b45309;
  font-weight: 700;
}

/* ===== Error Card ===== */
.card-error {
  border-color: #fca5a5;
  border-width: 1px;
}

.error-body {
  text-align: center;
  padding: 40px 24px;
}

.error-icon {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-icon svg {
  width: 32px;
  height: 32px;
  color: #ef4444;
}

.error-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: #dc2626;
}

.error-subtitle {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
}

.error-hint {
  margin: 0;
  font-size: 13px;
  color: #94a3b8;
}

/* ===== Footer ===== */
.footer {
  background-color: #1a1a2e;
  margin-top: auto;
  padding: 14px 0;
}

.footer-inner {
  text-align: center;
}

.footer-inner p {
  margin: 0;
  font-size: 12px;
  color: #5a6070;
}

.beian-links {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.beian-link {
  color: #7b8498;
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.beian-link:hover {
  color: #cbd5e1;
}

.beian-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* ===== Responsive ===== */

/* 平板 (<=768px) */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .header-inner {
    padding: 16px 0;
  }

  .logo-icon {
    width: 44px;
    height: 44px;
  }

  .logo-icon svg {
    width: 22px;
    height: 22px;
  }

  .logo-text h1 {
    font-size: 18px;
  }

  .logo-text p {
    font-size: 11px;
  }

  .main {
    padding: 24px 0 32px;
  }

  .page-title h2 {
    font-size: 19px;
  }

  .page-title-icon {
    width: 38px;
    height: 38px;
  }

  .page-title-icon svg {
    width: 18px;
    height: 18px;
  }

  .card-header {
    padding: 12px 16px;
  }

  .card-body {
    padding: 20px 16px;
  }

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

  .form-field input {
    height: 48px;
    font-size: 16px;
  }

  .btn {
    height: 48px;
    font-size: 15px;
  }

  .btn-sm {
    height: 36px;
    font-size: 13px;
  }

  .result-list {
    padding: 16px 16px 20px;
  }

  .result-label {
    width: 100px;
    font-size: 13px;
  }

  .result-value {
    font-size: 13px;
  }

  .success-banner {
    padding: 16px;
  }

  .success-icon {
    width: 40px;
    height: 40px;
  }

  .success-icon svg {
    width: 22px;
    height: 22px;
  }

  .success-banner h3 {
    font-size: 16px;
  }

  .error-body {
    padding: 32px 16px;
  }

  .error-icon {
    width: 56px;
    height: 56px;
  }

  .error-icon svg {
    width: 28px;
    height: 28px;
  }
}

/* 手机 (<=480px) */
@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .header-inner {
    padding: 12px 0;
  }

  .logo-box {
    gap: 10px;
  }

  .logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 5px;
  }

  .logo-icon svg {
    width: 20px;
    height: 20px;
  }

  .logo-text h1 {
    font-size: 16px;
    letter-spacing: 0.02em;
  }

  .logo-text p {
    display: none;
  }

  .main {
    padding: 16px 0 24px;
  }

  .page-title {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
  }

  .page-title-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .page-title-icon svg {
    width: 16px;
    height: 16px;
  }

  .page-title h2 {
    font-size: 17px;
  }

  .page-title p {
    font-size: 13px;
  }

  .card {
    border-radius: 6px;
    margin-bottom: 16px;
  }

  .card-header {
    padding: 10px 14px;
  }

  .card-header h3 {
    font-size: 14px;
  }

  .card-body {
    padding: 16px 14px;
  }

  .form-grid {
    gap: 14px;
    margin-bottom: 18px;
  }

  .form-field label {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .form-field input {
    height: 48px;
    padding: 0 12px;
    font-size: 16px;
    border-radius: 6px;
  }

  .field-tip {
    font-size: 11px;
  }

  .form-actions {
    flex-direction: column;
    gap: 10px;
  }

  .btn {
    width: 100%;
    height: 48px;
    font-size: 15px;
    border-radius: 6px;
  }

  .btn-sm {
    width: auto;
    height: 34px;
  }

  .alert {
    margin-top: 18px;
    padding: 12px;
    gap: 10px;
    font-size: 12px;
  }

  .alert-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
  }

  .alert-icon svg {
    width: 14px;
    height: 14px;
  }

  .loading-body {
    padding: 32px 12px;
  }

  .loading-spinner {
    width: 48px;
    height: 48px;
  }

  .loading-title {
    font-size: 15px;
  }

  /* 成功卡片 */
  .card-header-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
  }

  .input-summary {
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
  }

  .success-banner {
    padding: 14px;
    gap: 10px;
  }

  .success-icon {
    width: 36px;
    height: 36px;
  }

  .success-icon svg {
    width: 20px;
    height: 20px;
  }

  .success-banner h3 {
    font-size: 15px;
  }

  .success-banner p {
    font-size: 12px;
  }

  .result-list {
    padding: 14px;
  }

  .result-row {
    flex-direction: column;
    gap: 2px;
    padding: 10px 0;
  }

  .result-label {
    width: auto;
    font-size: 12px;
  }

  .result-value {
    font-size: 14px;
  }

  /* 失败卡片 */
  .error-body {
    padding: 28px 14px;
  }

  .error-icon {
    width: 48px;
    height: 48px;
  }

  .error-icon svg {
    width: 24px;
    height: 24px;
  }

  .error-title {
    font-size: 16px;
  }

  .error-subtitle {
    font-size: 13px;
  }

  .error-hint {
    font-size: 12px;
  }

  .footer {
    padding: 12px 0;
  }

  .beian-links {
    gap: 8px;
    flex-direction: column;
  }
}
