/* ===================================================================
   membercheck — 共享设计系统
   版本: 1.0  |  风格: Refined Minimal / Institutional Trust
   字体: 系统字体堆栈（零外部依赖，国内秒开）
   主色: #1e3a5f (深海蓝) / 强调: #2563eb / 背景: #f8fafc
   =================================================================== */

/* ─── CSS Variables ─────────────────────────────────────────────── */
:root {
  --brand-deep:   #10B981;
  --brand-mid:    #34D399;
  --brand-light:  #3b82f6;
  --brand-pale:   #a7f3d0;
  --brand-tint:   #ecfdf5;
  --accent:       #FACC15;

  --text-primary:   #0f1c2e;
  --text-secondary: #4b5e78;
  --text-muted:     #8a9ab5;
  --text-inverse:   #f0f6ff;

  --surface:        #ffffff;
  --surface-raised: #f8fafc;
  --surface-border: #e2eaf5;

  --success-bg:   #f0fdf4;
  --success-bdr:  #86efac;
  --success-text: #14532d;

  --error-bg:     #fff1f2;
  --error-bdr:    #fda4af;
  --error-text:   #9f1239;

  --warn-bg:      #fffbeb;
  --warn-bdr:     #fcd34d;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;

  --shadow-sm:  0 1px 3px rgba(16,185,129,0.08), 0 1px 2px rgba(16,185,129,0.04);
  --shadow-md:  0 4px 12px rgba(16,185,129,0.10), 0 2px 4px rgba(16,185,129,0.06);
  --shadow-lg:  0 8px 24px rgba(16,185,129,0.12), 0 4px 8px rgba(16,185,129,0.06);

  --transition: 160ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ─── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--surface-raised);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ─── Layout Shell ──────────────────────────────────────────────── */
.page-wrapper {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ─── Page Header (top bar) ─────────────────────────────────────── */
.page-header {
  background: var(--brand-deep);
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(16,185,129,0.25);
}

.page-header-inner {
  max-width: 480px;
  margin: 0 auto;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-inverse);
  letter-spacing: 0.03em;
  text-decoration: none;
}

.header-badge {
  font-size: 11px;
  color: var(--brand-pale);
  letter-spacing: 0.05em;
  opacity: 0.75;
}

/* ─── Typography ────────────────────────────────────────────────── */
h1 {
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--brand-deep);
  letter-spacing: 0.05em;
}

h2 {
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--brand-deep);
  line-height: 1.4;
}

.lead {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.caption {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.88em;
  background: var(--surface-border);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--brand-mid);
}

/* ─── Form Elements ─────────────────────────────────────────────── */
label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.field {
  margin-bottom: 20px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="file"] {
  width: 100%;
  padding: 12px 14px;
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--surface);
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 3px rgba(52,211,153,0.12);
}

input[type="file"] {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}

input::placeholder {
  color: var(--text-muted);
  font-weight: 300;
}

.field-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.field-hint a {
  color: var(--brand-mid);
  text-decoration: none;
}

.field-hint a:hover {
  text-decoration: underline;
}

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), opacity var(--transition);
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.03em;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition);
}

.btn:active::after {
  background: rgba(255,255,255,0.12);
}

.btn-primary {
  background: #10B981;
  color: #ffffff !important;
  border: none;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  padding: 14px 24px;
  font-weight: 600;
  font-size: 17px;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #34D399;
  box-shadow: 0 6px 16px rgba(52, 211, 153, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.btn-secondary {
  background: var(--surface);
  color: var(--brand-mid);
  border: 1.5px solid var(--brand-pale);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--brand-tint);
  border-color: var(--brand-light);
}

.btn-ghost {
  background: transparent;
  color: var(--brand-mid);
  border: 1.5px solid transparent;
  padding: 10px 16px;
  font-size: 14px;
}

.btn-ghost:hover {
  background: var(--brand-tint);
}

.btn-sm {
  padding: 9px 16px;
  font-size: 13px;
  width: auto;
  display: inline-block;
}

/* ─── Cards ─────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.card-accent {
  border-left: 3px solid var(--brand-mid);
}

/* ─── Alert / Status Boxes ──────────────────────────────────────── */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.6;
  border-width: 1px;
  border-style: solid;
}

.alert-success {
  background: var(--success-bg);
  border-color: var(--success-bdr);
  color: var(--success-text);
}

.alert-error {
  background: var(--error-bg);
  border-color: var(--error-bdr);
  color: var(--error-text);
}

.alert-warn {
  background: var(--warn-bg);
  border-color: var(--warn-bdr);
  color: #78350f;
}

.alert-info {
  background: var(--brand-tint);
  border-color: var(--brand-pale);
  color: #1e40af;
}

/* ─── Result Display ────────────────────────────────────────────── */
.result-box {
  margin-top: 24px;
  padding: 24px 20px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-md);
}

.result-box .result-label {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.result-box .result-number {
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  font-size: 40px;
  font-weight: 700;
  color: var(--brand-mid);
  letter-spacing: 0.12em;
  line-height: 1.2;
}

/* Link result box (upload page) */
.link-result-box {
  margin-top: 24px;
  padding: 20px;
  background: var(--success-bg);
  border: 1px solid var(--success-bdr);
  border-radius: var(--radius-lg);
}

.link-result-box .link-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--success-text);
  margin-bottom: 10px;
}

.link-result-box .link-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.link-result-box input[type="text"] {
  flex: 1;
  font-size: 13px;
  padding: 10px 12px;
  border-color: var(--success-bdr);
  background: var(--surface);
  color: var(--text-secondary);
}

.link-result-box .btn-copy {
  flex-shrink: 0;
  padding: 10px 16px;
  font-size: 13px;
  white-space: nowrap;
}

.link-result-box .link-warn {
  margin-top: 10px;
  font-size: 12px;
  color: #166534;
  line-height: 1.5;
}

/* ─── Section Divider ───────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--surface-border);
  margin: 24px 0;
}

/* ─── Footer ────────────────────────────────────────────────────── */
.page-footer {
  margin-top: auto;
  padding: 16px 20px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--surface-border);
  background: var(--surface-raised);
  letter-spacing: 0.04em;
}

/* ─── Utility ───────────────────────────────────────────────────── */
.mt-4  { margin-top: 4px;  }
.mt-8  { margin-top: 8px;  }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

.text-center { text-align: center; }
.text-right  { text-align: right;  }

.hidden { display: none !important; }

/* ─── Page Animations ───────────────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.animate-in {
  animation: fadeSlideUp 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.animate-in-delay-1 { animation-delay: 0.08s; }
.animate-in-delay-2 { animation-delay: 0.16s; }
.animate-in-delay-3 { animation-delay: 0.24s; }
.animate-in-delay-4 { animation-delay: 0.32s; }
.animate-in-delay-5 { animation-delay: 0.40s; }

/* ─── Responsive ────────────────────────────────────────────────── */
@media (min-width: 600px) {
  .page-wrapper {
    padding: 0 24px;
  }

  h1 {
    font-size: 28px;
  }
}

@media (max-width: 390px) {
  h1 {
    font-size: 22px;
  }

  .result-box .result-number {
    font-size: 34px;
  }
}
