:root {
  --bg: #f4f4ef;
  --paper: #fffdf8;
  --text: #1d232f;
  --muted: #5b6474;
  --accent: #0e6d53;
  --accent-strong: #07553f;
  --line: #ddd4c8;
  --error: #9f2f2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 20%, #d2ecd5 0%, rgba(210, 236, 213, 0) 44%),
    radial-gradient(circle at 82% 7%, #f1e0ba 0%, rgba(241, 224, 186, 0) 35%),
    var(--bg);
}

.container {
  width: min(980px, 92vw);
  margin: 3rem auto;
  display: grid;
  gap: 1rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
  box-shadow: 0 10px 26px rgba(13, 31, 27, 0.07);
}

.hero h1 {
  margin: 0 0 0.5rem;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.resolve-form {
  margin-top: 1rem;
  display: grid;
  gap: 0.55rem;
}

.resolve-form label {
  font-weight: 600;
}

.input-row {
  display: flex;
  gap: 0.6rem;
}

input[type='url'] {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.68rem 0.72rem;
  font-size: 0.95rem;
  outline: none;
}

input[type='url']:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 109, 83, 0.14);
}

button {
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  padding: 0.65rem 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

button.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.status {
  min-height: 1.4rem;
  margin-top: 0.8rem;
  color: var(--muted);
}

.status.error {
  color: var(--error);
}

.hidden {
  display: none;
}

.result-header {
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
  align-items: center;
}

.result-header h2 {
  margin: 0;
}

.meta {
  margin: 0.3rem 0 0;
  color: var(--muted);
}

.image-grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.image-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.image-item img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}

.image-item .actions {
  padding: 0.55rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
}

.image-item a {
  text-decoration: none;
  color: var(--accent);
  font-size: 0.85rem;
}

.tips ol {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

code {
  background: #f5f0e6;
  border: 1px solid #e6ddcf;
  padding: 0.08rem 0.3rem;
  border-radius: 6px;
  color: #333;
}

@media (max-width: 700px) {
  .container {
    margin: 1rem auto 2rem;
  }

  .input-row {
    flex-direction: column;
  }

  .result-header {
    flex-direction: column;
    align-items: stretch;
  }

  .result-header .ghost {
    width: 100%;
  }
}
