:root {
  --bg: #1a1512;
  --bg-soft: #241e1a;
  --surface: #2c241f;
  --text: #f5ebe0;
  --text-muted: #b9a99a;
  --accent: #d4a574;
  --accent-soft: rgba(212, 165, 116, 0.18);
  --line: rgba(245, 235, 224, 0.08);
  --danger: #e8a0a0;
  --radius: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "Outfit", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

body {
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, #3a2c24 0%, transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 40%, rgba(212, 165, 116, 0.08) 0%, transparent 50%),
    var(--bg);
}

.page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 12px calc(88px + var(--safe-bottom));
  position: relative;
}

/* 悬浮联系按钮 */
.contact-fab {
  position: fixed;
  right: max(16px, calc(50% - 224px));
  bottom: calc(22px + var(--safe-bottom));
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px 12px 14px;
  border: 1px solid rgba(212, 165, 116, 0.35);
  border-radius: 999px;
  background: linear-gradient(135deg, #d4a574, #b8895a);
  color: #1a1512;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease;
}

.contact-fab:active {
  transform: scale(0.96);
}

.contact-fab svg {
  display: block;
  flex-shrink: 0;
}

/* 联系方式弹窗 */
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.contact-modal[hidden] {
  display: none;
}

.contact-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  animation: fadeIn 0.25s ease;
}

.contact-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--bg-soft);
  border-radius: 18px 18px 0 0;
  border: 1px solid var(--line);
  border-bottom: none;
  animation: sheetUp 0.32s ease;
  padding-bottom: var(--safe-bottom);
}

.contact-panel {
  padding: 22px 18px 24px;
}

.contact-panel h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.contact-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.contact-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.contact-row:active {
  border-color: rgba(212, 165, 116, 0.45);
  background: #332920;
}

.contact-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-icon.whatsapp {
  background: rgba(37, 211, 102, 0.18);
  color: #25d366;
}

.contact-icon.wechat {
  background: rgba(7, 193, 96, 0.18);
  color: #07c160;
}

.contact-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.contact-text strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.contact-text em {
  font-style: normal;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.contact-copy {
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 6px;
  flex-shrink: 0;
}

.contact-toast {
  text-align: center;
  margin-top: 8px;
  font-size: 13px;
  color: var(--accent);
}

.header {
  padding: 22px 4px 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(26, 21, 18, 0.96) 60%, rgba(26, 21, 18, 0));
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-sub {
  margin-top: 6px;
  margin-left: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Boot overlay — slow load feel */
.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 14, 12, 0.92);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.boot-overlay.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-card {
  width: min(78vw, 280px);
  text-align: center;
}

.boot-spinner,
.spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 14px;
  border: 3px solid rgba(212, 165, 116, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

.boot-text {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.boot-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(245, 235, 224, 0.1);
  overflow: hidden;
}

.boot-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #b8895a, var(--accent));
  border-radius: inherit;
  transition: width 0.35s ease;
}

.boot-pct {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--accent);
}

/* Masonry gallery */
.gallery {
  column-count: 2;
  column-gap: 10px;
}

@media (min-width: 420px) {
  .gallery {
    column-count: 2;
    column-gap: 12px;
  }
}

.card {
  break-inside: avoid;
  margin-bottom: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  animation: cardIn 0.5s ease forwards;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:active {
  transform: scale(0.985);
}

.card-media {
  position: relative;
  width: 100%;
  background: var(--bg-soft);
  overflow: hidden;
}

.card-media img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
  object-fit: cover;
}

.card-media.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.card-info {
  padding: 10px 11px 12px;
}

.card-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.card-skill {
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tag {
  display: inline-block;
  margin-top: 8px;
  font-size: 10px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: 4px;
}

.load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 0 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.load-more .spinner {
  width: 22px;
  height: 22px;
  margin: 0;
  border-width: 2px;
}

.end-tip {
  text-align: center;
  padding: 18px 0 6px;
  font-size: 12px;
  color: rgba(185, 169, 154, 0.55);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal[hidden] {
  display: none;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  animation: fadeIn 0.25s ease;
}

.modal-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  background: var(--bg-soft);
  border-radius: 18px 18px 0 0;
  border: 1px solid var(--line);
  border-bottom: none;
  overflow: hidden;
  animation: sheetUp 0.32s ease;
  padding-bottom: var(--safe-bottom);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-body {
  overflow-y: auto;
  max-height: 88vh;
  -webkit-overflow-scrolling: touch;
}

.modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  color: var(--text-muted);
  font-size: 14px;
  gap: 6px;
}

.modal-loading[hidden] {
  display: none !important;
}

.modal-loading-hint {
  font-size: 12px;
  opacity: 0.7;
}

.modal-content[hidden] {
  display: none !important;
}

.load-more[hidden],
.end-tip[hidden],
.contact-toast[hidden] {
  display: none !important;
}

.modal-hero {
  width: 100%;
  max-height: 52vh;
  object-fit: contain;
  background: #000;
  display: block;
}

.modal-detail {
  padding: 16px 18px 28px;
}

.modal-detail h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.modal-meta span {
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 8px;
  border-radius: 4px;
}

.modal-skill-title {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.modal-skill {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}

.modal-desc {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes cardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheetUp {
  from { transform: translateY(40%); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

body.modal-open {
  overflow: hidden;
}
