/* ============================================================
   AGC 鉴真 H5 - Mobile Styles
   ============================================================ */
:root {
  --ink-900: #050b1a;
  --ink-800: #0a1530;
  --ink-700: #0e1f3f;
  --ink-600: #152b56;
  --ink-500: #1e3a72;
  --ink-400: #2a4d8f;
  --gold-100: #fbf3d9;
  --gold-200: #f1de9f;
  --gold-300: #e6c870;
  --gold-400: #d4af37;
  --gold-500: #b8902a;
  --gold-600: #8c6c1d;
  --silver-100: #f0f2f7;
  --silver-200: #d8dde9;
  --silver-300: #b3bccf;
  --silver-400: #8a96ad;
  --surface-0: #f7f8fc;
  --text-primary: #0a1530;
  --text-secondary: #4a5878;
  --text-muted: #8a96ad;
  --success: #2d8a6b;
  --danger: #c43d4b;
  --warning: #d98c2b;
  --shadow-sm: 0 2px 8px rgba(10,21,48,0.06);
  --shadow-md: 0 8px 24px rgba(10,21,48,0.10);
  --shadow-lg: 0 20px 50px rgba(10,21,48,0.16);
  --shadow-gold: 0 8px 30px rgba(212,175,55,0.28);
}

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

html, body {
  font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #000;
}

body { min-height: 100vh; min-height: 100dvh; }

.app {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--ink-800);
}

/* ============================================================
   HOME PAGE
   ============================================================ */
.h5-home {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--ink-800);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  color: white;
  display: flex;
  flex-direction: column;
}

.h5-home::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10,21,48,0.7) 0%, rgba(10,21,48,0.85) 100%),
    radial-gradient(ellipse at 30% 20%, rgba(212,175,55,0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(30,58,114,0.4) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.h5-home::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, transparent 0, transparent 40px, rgba(212,175,55,0.04) 40px, rgba(212,175,55,0.04) 41px),
    repeating-linear-gradient(-45deg, transparent 0, transparent 40px, rgba(255,255,255,0.02) 40px, rgba(255,255,255,0.02) 41px);
  pointer-events: none;
  z-index: 0;
}

.home-bg-emblem {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 360px;
  height: 360px;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

.home-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 64px 28px 40px;
  width: 100%;
}

.home-brand {
  text-align: center;
  margin-top: 30px;
  margin-bottom: 8px;
}

.home-brand-shield {
  width: 64px;
  height: 76px;
  margin: 0 auto 20px;
  position: relative;
  filter: drop-shadow(0 4px 16px rgba(212,175,55,0.4));
}
.home-brand-shield svg { width: 100%; height: 100%; }

.home-brand-cn {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: white;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.home-brand-en {
  font-family: 'Cormorant Garamond', serif;
  font-size: 10px;
  font-style: italic;
  letter-spacing: 0.4em;
  color: var(--gold-300);
  margin-bottom: 16px;
  text-transform: uppercase;
}

.home-brand-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}
.home-brand-divider::before,
.home-brand-divider::after {
  content: '';
  width: 24px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-400));
}
.home-brand-divider::after { background: linear-gradient(to left, transparent, var(--gold-400)); }
.home-brand-divider .gem {
  width: 6px;
  height: 6px;
  background: var(--gold-400);
  transform: rotate(45deg);
}

.home-tagline {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.3em;
  color: var(--silver-200);
  text-align: center;
  margin-bottom: 60px;
}
.home-tagline .accent { color: var(--gold-300); font-weight: 500; }

.home-search-area { margin-top: auto; margin-bottom: auto; }

.search-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0.3em;
  color: var(--gold-300);
  text-transform: uppercase;
  margin-bottom: 14px;
  padding-left: 6px;
}
.search-label::before {
  content: '◆';
  font-style: normal;
  color: var(--gold-400);
  font-size: 8px;
}

.search-box {
  background: linear-gradient(135deg, rgba(255,255,255,0.96) 0%, rgba(248,249,253,0.92) 100%);
  border-radius: 16px;
  padding: 6px 6px 6px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.3),
              inset 0 1px 0 rgba(255,255,255,0.6),
              0 0 0 1px rgba(212,175,55,0.3);
  position: relative;
}
.search-box::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, var(--gold-300), transparent 30%, transparent 70%, var(--gold-300));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  font-weight: 400;
  color: var(--ink-800);
  letter-spacing: 0.05em;
  height: 48px;
  min-width: 0;
}
.search-box input::placeholder {
  color: var(--text-muted);
  font-weight: 300;
}
.search-icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ink-700) 0%, var(--ink-800) 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-300);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
  position: relative;
  flex-shrink: 0;
}
.search-icon-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  border: 1px solid rgba(212,175,55,0.4);
}
.search-icon-btn:active { transform: scale(0.96); }

.search-hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--silver-300);
  text-align: center;
  letter-spacing: 0.1em;
}
.search-hint::before { content: '· '; color: var(--gold-400); }
.search-hint::after { content: ' ·'; color: var(--gold-400); }

.home-footer-mark {
  margin-top: 60px;
  text-align: center;
  position: relative;
  z-index: 2;
}
.home-footer-mark .ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}
.home-footer-mark .line {
  width: 60px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-400));
}
.home-footer-mark .line:last-child { background: linear-gradient(to left, transparent, var(--gold-400)); }
.home-footer-mark .diamond {
  width: 8px;
  height: 8px;
  border: 1px solid var(--gold-400);
  transform: rotate(45deg);
}
.home-footer-mark .cn {
  font-size: 12px;
  color: var(--silver-200);
  letter-spacing: 0.4em;
}
.home-footer-mark .en {
  font-family: 'Cormorant Garamond', serif;
  font-size: 9px;
  font-style: italic;
  color: var(--gold-300);
  letter-spacing: 0.3em;
  margin-top: 4px;
  text-transform: uppercase;
}

.home-corner-deco {
  position: absolute;
  width: 80px;
  height: 80px;
  pointer-events: none;
  opacity: 0.6;
  z-index: 1;
}
.home-corner-deco.tl { top: 50px; left: 20px; }
.home-corner-deco.tr { top: 50px; right: 20px; transform: scaleX(-1); }
.home-corner-deco.bl { bottom: 50px; left: 20px; transform: scaleY(-1); }
.home-corner-deco.br { bottom: 50px; right: 20px; transform: scale(-1, -1); }

/* ============================================================
   DETAIL PAGE
   ============================================================ */
.h5-detail {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ink-800);
  color: white;
}

.detail-hero {
  position: relative;
  min-height: 420px;
  background-color: var(--ink-800);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  padding: 56px 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.detail-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10,21,48,0.55) 0%, rgba(10,21,48,0.92) 100%),
    radial-gradient(ellipse at top, rgba(30,58,114,0.5) 0%, transparent 70%);
  z-index: 0;
}
.detail-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, transparent 0, transparent 30px, rgba(212,175,55,0.05) 30px, rgba(212,175,55,0.05) 31px);
  z-index: 0;
}

.detail-back {
  position: absolute;
  top: 50px;
  left: 20px;
  z-index: 5;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  text-decoration: none;
  transition: transform 0.15s;
}
.detail-back:active { transform: scale(0.92); }

.detail-grade-badge {
  position: relative;
  z-index: 5;
  width: 78px;
  height: 84px;
  margin: 0 auto 10px;
  filter: drop-shadow(0 6px 18px rgba(212,175,55,0.4));
}
.detail-grade-badge svg { width: 100%; height: 100%; display: block; }

.detail-title-wrap {
  text-align: center;
  position: relative;
  z-index: 5;
  margin-bottom: 14px;
  padding: 0 8px;
}
.detail-title-cn {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  margin-bottom: 6px;
  line-height: 1.3;
  word-break: break-word;
}
.detail-title-en {
  font-family: 'Cormorant Garamond', serif;
  font-size: 11px;
  font-style: italic;
  letter-spacing: 0.4em;
  color: var(--gold-300);
  text-transform: uppercase;
}

.detail-title-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 20px;
}
.detail-title-ornament::before,
.detail-title-ornament::after {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--gold-400);
}
.detail-title-ornament .gem {
  width: 5px;
  height: 5px;
  background: var(--gold-400);
  transform: rotate(45deg);
}

.detail-thumbs {
  display: flex;
  justify-content: center;
  gap: 18px;
  position: relative;
  z-index: 5;
  padding: 0 0 16px;
}
.detail-thumb {
  width: 118px;
  height: 166px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f1de9f 0%, #d4af37 30%, #8c6c1d 70%, #d4af37 100%);
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4), 0 0 0 1px rgba(212,175,55,0.4);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
}
.detail-thumb:active { transform: scale(0.96); }
.detail-thumb img {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-0);
}
.detail-thumb-placeholder {
  position: absolute;
  inset: 8px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(248,243,230,0.95) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-800);
  font-size: 10px;
  text-align: center;
  padding: 8px;
}
.detail-thumb-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--silver-300);
  letter-spacing: 0.15em;
  white-space: nowrap;
}

.detail-body {
  background: var(--ink-800);
  padding: 50px 24px 40px;
  position: relative;
}

.detail-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(212,175,55,0.2);
}
.detail-section-head .bar {
  width: 4px;
  height: 18px;
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
  border-radius: 1px;
}
.detail-section-head .cn {
  font-size: 16px;
  font-weight: 600;
  color: white;
  letter-spacing: 0.1em;
}
.detail-section-head .en {
  font-family: 'Cormorant Garamond', serif;
  font-size: 10px;
  font-style: italic;
  color: var(--gold-300);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-left: auto;
}

.detail-fields {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: rgba(212,175,55,0.15);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.detail-field {
  background: linear-gradient(135deg, rgba(20,35,75,0.9) 0%, rgba(14,26,56,0.9) 100%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}
.detail-field-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(212,175,55,0.15) 0%, rgba(212,175,55,0.05) 100%);
  border: 1px solid rgba(212,175,55,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-300);
  flex-shrink: 0;
}
.detail-field-content { flex: 1; min-width: 0; }
.detail-field-label {
  font-size: 11px;
  color: var(--gold-300);
  letter-spacing: 0.15em;
  margin-bottom: 2px;
}
.detail-field-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--gold-200);
  letter-spacing: 0.02em;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-field-value .mono {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  letter-spacing: 0.05em;
  color: var(--gold-100);
}

.detail-footnote {
  margin-top: 24px;
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 10px;
  font-style: italic;
  color: var(--text-muted);
  letter-spacing: 0.3em;
  opacity: 0.7;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.h5-empty {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(10,21,48,0.95) 0%, rgba(14,31,63,0.95) 100%),
    radial-gradient(ellipse at center, rgba(30,58,114,0.3) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
  color: white;
}
.empty-icon-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 40px;
}
.empty-icon-ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 50%;
}
.empty-icon-ring.inner {
  inset: 18px;
  border-color: rgba(212,175,55,0.5);
  border-style: dashed;
}
.empty-icon-search {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ink-700), var(--ink-800));
  border: 1px solid var(--gold-400);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-300);
}
.empty-title {
  font-size: 22px;
  font-weight: 600;
  color: white;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.empty-desc {
  font-size: 13px;
  color: var(--silver-300);
  line-height: 1.8;
  margin-bottom: 40px;
  letter-spacing: 0.05em;
}
.empty-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--gold-400) 0%, var(--gold-500) 100%);
  color: var(--ink-800);
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(212,175,55,0.4);
  letter-spacing: 0.1em;
  text-decoration: none;
  transition: transform 0.15s;
}
.empty-back-btn:active { transform: scale(0.96); }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 6, 18, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 20px;
}
.lightbox.show { display: flex; }
.lightbox-img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  transform: scale(0.9);
  transition: transform 0.25s;
}
.lightbox.show .lightbox-img { transform: scale(1); }
.lightbox-caption {
  margin-top: 16px;
  color: var(--gold-300);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-align: center;
}
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(212,175,55,0.2);
  border: 1px solid var(--gold-400);
  color: var(--gold-300);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 200;
  background: rgba(10,21,48,0.95);
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  border: 1px solid var(--gold-400);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  font-size: 14px;
  max-width: 280px;
  text-align: center;
  letter-spacing: 0.05em;
  display: none;
  animation: toast-in 0.2s ease;
}
.toast.show { display: block; }
.toast .toast-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gold-300);
  margin-bottom: 4px;
}
.toast .toast-desc {
  font-size: 12px;
  color: var(--silver-200);
  line-height: 1.6;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--gold-300);
  font-size: 12px;
  letter-spacing: 0.2em;
}
.loading.show { display: flex; }
.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(212,175,55,0.2);
  border-top-color: var(--gold-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
