:root {
  --paper: #f6f3ec;
  --ink: #1d2b22;
  --muted: #5b6a60;
  --line: #ddd8cb;
  --card: #e9e6da;
  --accent: #e7633a;
  --accent-soft: #ffd9c7;
  --sky-top: #cfe8dd;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; }

a { -webkit-tap-highlight-color: transparent; }

[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.site-header {
  align-items: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(246, 243, 236, 0.88);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  height: 60px;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 6;
}

.brand { align-items: center; color: inherit; display: inline-flex; gap: 10px; text-decoration: none; }

.brand-logo {
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(22, 32, 25, 0.25);
  height: 32px;
  width: 32px;
}

.wordmark { font-size: 17px; font-weight: 800; letter-spacing: 0.06em; }

.upload-button {
  align-items: center;
  background: var(--ink);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 14px;
  font-weight: 600;
  gap: 6px;
  line-height: 1;
  padding: 8px 16px 8px 12px;
  text-decoration: none;
  transition: background 0.18s ease, transform 0.18s ease;
}

.upload-button .plus { font-size: 18px; line-height: 0.8; }

.upload-button:hover, .upload-button:focus-visible { background: var(--accent); transform: translateY(-1px); }

.hero { background: linear-gradient(180deg, var(--sky-top) 0%, var(--paper) 78%); border-bottom: 1px solid var(--line); overflow: hidden; position: relative; }

.hero-inner {
  align-items: center;
  display: flex;
  gap: 28px;
  margin: 0 auto;
  max-width: 1100px;
  padding: 44px 24px 44px;
}

.hero-badge {
  border-radius: 50%;
  box-shadow: 0 10px 26px rgba(231, 99, 58, 0.35);
  flex: 0 0 auto;
  height: 84px;
  width: 84px;
}

.hero-copy h1 { font-size: clamp(28px, 5vw, 42px); letter-spacing: 0.04em; line-height: 1.15; margin: 0 0 8px; }

.hero-copy p { color: var(--muted); font-size: 15px; line-height: 1.7; margin: 0 0 18px; max-width: 34em; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  gap: 6px;
  padding: 10px 20px;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn-primary { background: var(--accent); box-shadow: 0 6px 16px rgba(231, 99, 58, 0.35); color: #fff; }
.btn-primary:hover, .btn-primary:focus-visible { box-shadow: 0 10px 22px rgba(231, 99, 58, 0.4); transform: translateY(-2px); }

.btn-ghost { background: rgba(255, 255, 255, 0.45); border: 1.5px solid rgba(29, 43, 34, 0.35); color: var(--ink); }
.btn-ghost:hover, .btn-ghost:focus-visible { background: #fff; border-color: var(--ink); }

button { font: inherit; cursor: pointer; }

.copy-helper { position: fixed; top: 0; left: -9999px; }

main { margin: 0 auto; max-width: 1200px; padding: 26px 20px 44px; }

.section-title { color: var(--muted); font-size: 14px; font-weight: 700; letter-spacing: 0.14em; margin: 0 0 14px; }

.gallery { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }

.work {
  aspect-ratio: 4 / 3;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(22, 32, 25, 0.05);
  margin: 0;
  min-width: 0;
  overflow: hidden;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.work:hover { box-shadow: 0 12px 28px rgba(22, 32, 25, 0.15); transform: translateY(-3px); }

.work-frame { background: #e4e6dd; border: 0; display: block; height: 100%; width: 100%; }

.work-meta {
  align-items: center;
  background: linear-gradient(180deg, rgba(246, 243, 236, 0), rgba(246, 243, 236, 0.95) 55%);
  bottom: 0;
  display: flex;
  gap: 8px;
  left: 0;
  padding: 26px 12px 9px;
  position: absolute;
  right: 0;
}

.work-title { flex: 1 1 auto; font-size: 14px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.work-model {
  background: rgba(29, 43, 34, 0.08);
  border-radius: 999px;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 11.5px;
  padding: 3px 9px;
  white-space: nowrap;
}

.work-open {
  align-items: center;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 13px;
  height: 26px;
  justify-content: center;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  width: 26px;
}

.work-open:hover, .work-open:focus-visible { background: var(--accent); border-color: var(--accent); color: #fff; }

.empty-state { align-items: center; color: var(--muted); display: flex; flex-direction: column; gap: 14px; padding: 60px 0 30px; text-align: center; }
.empty-logo { height: 84px; opacity: 0.9; width: 84px; }
.empty-state p { margin: 0; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 18px 16px 26px; text-align: center; }
.site-footer p { margin: 0; }
.site-footer a { color: inherit; font-weight: 600; }
.site-footer code { background: rgba(29, 43, 34, 0.07); border-radius: 4px; padding: 1px 5px; }

.toast {
  align-items: center;
  background: var(--ink);
  border-radius: 999px;
  bottom: 18px;
  box-shadow: 0 6px 18px rgba(22, 32, 25, 0.25);
  color: #fff;
  display: flex;
  font-size: 14px;
  gap: 12px;
  left: 50%;
  padding: 10px 18px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 7;
}

.toast a { color: var(--accent-soft); font-weight: 600; }

@keyframes publish-pulse {
  0% { box-shadow: 0 0 0 0 rgba(231, 99, 58, 0.9); }
  100% { box-shadow: 0 0 0 14px rgba(231, 99, 58, 0); }
}

.work.just-published { animation: publish-pulse 1.2s ease-out 3; }

#gallery { scroll-margin-top: 72px; }

button:focus-visible, a:focus-visible { outline: 3px solid #8db9a1; outline-offset: 2px; }

@media (max-width: 900px) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-inner { flex-direction: column; align-items: flex-start; padding-top: 30px; }
  .hero-badge { height: 64px; width: 64px; }
}
@media (max-width: 460px) {
  .gallery { grid-template-columns: 1fr; }
  .site-header { padding: 0 12px; }
  main { padding: 18px 12px 36px; }
  .upload-button { padding: 8px; }
  .upload-text { display: none; }
  .upload-button .plus { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .work { transition: none; }
}
