/* Hallmark · app screen · illustrated field index */
/* The source art anchors each entry; card numbers remain legible at every width. */
:root {
  --shadow: #0003;
  --ink: #202a25;
  --paper: #fafbf7;
  --line: #ced4ca;
  --soft: #ecf0e7;
  --muted: #515e53;
  --lime: #d9f382;
  --leaf: #e8f0dc;
  --fire: #f7e8dd;
  --water: #e3edf0;
  --earth: #eee8dc;
  --volt: #f6efcf;
  --dark: #ede6ef;
  --white: #fff;
  --font: "DM Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "STSong", serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  overflow-x: clip;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--font);
}
a {
  color: inherit;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
select:focus-visible {
  outline: 3px solid var(--muted);
  outline-offset: 3px;
}
header {
  border-bottom: 1px solid var(--line);
}
nav,
main,
footer {
  width: min(1280px, 92%);
  margin: auto;
}
nav {
  height: 70px;
  display: flex;
  align-items: center;
  gap: 32px;
}
nav a,
.tile {
  text-decoration: none;
}
.brand {
  font-weight: 800;
  font-size: 21px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.mark {
  background: var(--ink);
  color: var(--lime);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  font: bold 23px var(--serif);
}
.navlink,
.adminlink {
  font-size: 14px;
}
.adminlink {
  margin-left: auto;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 265px;
  padding: 32px clamp(24px, 5vw, 72px);
  margin: 28px 0;
  background: var(--lime);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.project {
  font-size: 15px;
  font-weight: bold;
  margin: 0 0 9px;
}
.intro h1,
h1 {
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 70px);
  line-height: 1.12;
  margin: 0.15em 0;
  overflow-wrap: break-word;
  min-width: 0;
}
.stats {
  margin: 18px 0 0;
}
.stats b:nth-child(2) {
  margin-left: 18px;
}
.fan {
  display: flex;
  align-items: center;
  align-self: stretch;
  position: relative;
  width: 40%;
  justify-content: center;
}
.fan img {
  width: 33%;
  max-height: 235px;
  object-fit: contain;
  filter: drop-shadow(0 6px 5px var(--shadow));
  transform: rotate(-10deg);
}
.fan img:nth-child(2) {
  transform: translateY(-4px) rotate(3deg);
  margin-left: -6%;
  z-index: 1;
}
.fan img:nth-child(3) {
  transform: rotate(14deg);
  margin-left: -6%;
}
.filters,
.manage form {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.filters {
  padding: 8px 0 24px;
}
.filters label,
.manage label {
  display: flex;
  gap: 8px;
  align-items: center;
}
input,
select,
button {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--white);
  color: var(--ink);
}
button {
  background: var(--ink);
  color: var(--white);
  cursor: pointer;
}
button:disabled {
  background: var(--soft);
  color: var(--muted);
  cursor: not-allowed;
}
button:active {
  transform: translateY(1px);
}
h1,
h2 {
  text-wrap: balance;
}
.search input {
  width: min(295px, 60vw);
}
.grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 28px 20px;
}
.tile {
  min-width: 0;
}
.plate {
  background: var(--soft);
  position: relative;
  border-radius: 9px;
  display: grid;
  place-items: center;
}
.grid .plate {
  aspect-ratio: 1.27;
}
.plate small {
  position: absolute;
  top: 9px;
  left: 12px;
  font-weight: 650;
  color: var(--muted);
}
.plate img {
  width: 76%;
  height: 75%;
  position: absolute;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.element-草 {
  background: var(--leaf);
}
.element-水 {
  background: var(--water);
}
.element-火 {
  background: var(--fire);
}
.element-土 {
  background: var(--earth);
}
.element-电 {
  background: var(--volt);
}
.element-暗 {
  background: var(--dark);
}
.caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 12px 0;
}
.caption h2,
.card h2 {
  margin: 0;
  font-size: 21px;
}
.caption p,
.caption span {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}
.tile:hover h2 {
  text-decoration: underline;
}
.back {
  display: inline-block;
  margin: 24px 0;
}
.detail,
.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  align-items: center;
  gap: clamp(20px, 5vw, 72px);
}
.detail {
  border-bottom: 1px solid var(--line);
  padding-bottom: 28px;
}
.portrait {
  aspect-ratio: 1.25;
}
.section-title {
  margin: 32px 0;
}
.section-title small {
  color: var(--muted);
}
.card {
  background: var(--soft);
  padding: 24px;
  border-radius: 10px;
  margin-bottom: 20px;
}
.artworks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.artworks a {
  width: min(100%, 150px);
}
.artworks img {
  width: 100%;
  display: block;
}
.manage {
  max-width: 800px;
  margin: 40px auto;
}
.manage h1 {
  font-size: 44px;
}
.manage h2 {
  margin: 36px 0 8px;
}
.manage form {
  margin: 16px 0;
}
.manage li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
details {
  margin: 12px 0;
}
summary {
  cursor: pointer;
}
dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
  white-space: pre-wrap;
}
footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  margin-top: 52px;
  padding: 20px 0;
  color: var(--muted);
  font-size: 14px;
}
@media (max-width: 950px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .intro {
    min-height: 170px;
    padding: 20px;
  }
  .intro h1 {
    font-size: 32px;
  }
  .fan {
    width: 33%;
  }
  .fan img {
    width: 60%;
  }
  .fan img:nth-child(3) {
    display: none;
  }
  .filters {
    gap: 12px;
  }
  .search {
    width: 100%;
  }
  .search input {
    flex: 1;
  }
  .detail,
  .card {
    grid-template-columns: minmax(0, 1fr);
  }
  nav {
    gap: 16px;
  }
  .caption {
    align-items: start;
    flex-wrap: wrap;
  }
  .caption h2 {
    font-size: 18px;
  }
  .stats {
    font-size: 14px;
  }
  .manage form {
    align-items: start;
    flex-direction: column;
  }
}

.login { max-width: 390px; margin: clamp(48px, 10vh, 100px) auto; }
.login h1 { font-size: 38px; margin-bottom: 32px; }
.login form, .login label { display: grid; gap: 8px; }
.login form { gap: 20px; }
.login button { margin-top: 8px; }
nav form { margin-left: auto; }
nav .adminlink + form { margin-left: 0; }
