:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --text: #202632;
  --muted: #8a94a3;
  --line: #e7eaf0;
  --red: #ff4d55;
  --blue: #1677ff;
  --blue-dark: #0965da;
  --green: #18a846;
  --shadow: 0 18px 55px rgba(31, 54, 88, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 0%, rgba(22, 119, 255, 0.07), transparent 32rem),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

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

.landing-shell,
.upload-shell,
.login-shell {
  width: 100%;
  min-height: 100vh;
  padding: 22px 14px 40px;
}

.landing-card,
.upload-card,
.login-card {
  width: min(100%, 680px);
  margin: 0 auto;
  border: 1px solid rgba(228, 232, 240, 0.85);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.landing-card {
  padding: 20px;
}

.task-banner {
  display: grid;
  gap: 6px;
  margin-bottom: 6px;
  padding: 20px 22px;
  border-left: 4px solid var(--red);
  border-radius: 5px;
  background: #fff1f2;
  color: var(--red);
  text-align: center;
}

.task-banner strong {
  font-size: 18px;
}

.task-banner span {
  font-size: 17px;
  font-weight: 700;
}

.step-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.step-section:last-of-type {
  border-bottom: 0;
}

.step-section h2 {
  margin: 0 0 12px;
  color: #20242b;
  font-size: 19px;
  font-weight: 500;
}

.final-step h2 {
  color: var(--red);
}

.step-section p {
  margin: 11px 0;
  font-size: 16px;
  line-height: 1.75;
}

.copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
  border-top: 1px solid var(--line);
}

.copy-row strong {
  color: var(--red);
  font-size: 16px;
  white-space: pre-wrap;
}

.copy-row button {
  flex: 0 0 auto;
  padding: 10px 16px;
  border: 0;
  border-radius: 5px;
  background: var(--green);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

.example-placeholder {
  display: grid;
  grid-template-columns: 50px 1fr 30px;
  align-items: center;
  gap: 12px;
  min-height: 128px;
  margin-top: 14px;
  padding: 22px 18px;
  border: 1px solid #e4e8ee;
  border-radius: 12px;
  background: #f7f8fa;
}

.example-placeholder .avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #718198, #23334d);
  color: white;
  font-weight: 800;
}

.example-placeholder small {
  color: #a4adba;
}

.example-placeholder p {
  margin: 5px 0;
}

.example-placeholder mark {
  padding: 2px 7px;
  border-radius: 4px;
  background: #f4bb20;
  color: white;
}

.example-placeholder .heart {
  color: #9ba6b5;
  font-size: 34px;
}

.example-image {
  display: block;
  width: 100%;
  max-height: 680px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  object-fit: contain;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  min-height: 56px;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  box-shadow: 0 12px 24px rgba(22, 119, 255, 0.2);
  color: white;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.secondary-button {
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid #dce2eb;
  background: white;
  color: #354155;
}

.muted,
.automation-note {
  color: var(--muted);
}

.automation-note {
  text-align: center;
}

footer {
  padding: 20px 0 4px;
  color: #a5adb9;
  text-align: center;
  font-size: 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  z-index: 20;
  padding: 10px 18px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(22, 27, 36, 0.92);
  color: white;
}

.upload-card {
  padding: 26px;
}

.processing-disclosure,
.admin-disclosure-note {
  display: grid;
  gap: 5px;
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid #f2c46d;
  border-radius: 10px;
  background: #fff8e8;
  color: #694b0f;
  line-height: 1.6;
}

.processing-disclosure strong {
  color: #9a5b00;
}

.upload-card h1,
.login-card h1 {
  margin: 14px 0 8px;
  font-size: clamp(25px, 5vw, 38px);
}

.back-link {
  color: var(--blue);
  text-decoration: none;
}

.notice {
  margin: 0 0 20px;
  color: #6f7a8a;
  line-height: 1.7;
}

.drop-zone {
  display: grid;
  min-height: 180px;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 24px;
  border: 2px dashed #9bc4ff;
  border-radius: 16px;
  background: #f2f7ff;
  color: #6e7c91;
  text-align: center;
  cursor: pointer;
}

.drop-zone strong {
  color: #244a7f;
  font-size: 20px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.preview-grid img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  object-fit: cover;
}

.status-card {
  display: grid;
  gap: 6px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.status-card span {
  color: var(--muted);
}

.progress-track {
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf4;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1677ff, #65a7ff);
  transition: width 0.15s linear;
}

.error-message,
.success-message {
  padding: 12px 15px;
  border-radius: 9px;
  line-height: 1.5;
}

.error-message {
  background: #fff0f1;
  color: #d83745;
}

.success-message {
  background: #eaf8ef;
  color: #177c3d;
}

.login-shell {
  display: grid;
  place-items: center;
}

.login-card {
  display: grid;
  gap: 16px;
  max-width: 460px;
  padding: 34px;
}

.login-card p {
  margin: 0;
  color: #748094;
  line-height: 1.7;
}

.login-card label,
.form-grid label {
  display: grid;
  gap: 7px;
  color: #4f5b6e;
  font-size: 14px;
  font-weight: 700;
}

.login-card input,
.form-grid input,
.form-grid textarea {
  width: 100%;
  border: 1px solid #d9e0ea;
  border-radius: 9px;
  background: white;
  color: #202632;
  outline: none;
}

.login-card input,
.form-grid input {
  min-height: 46px;
  padding: 10px 12px;
}

.form-grid textarea {
  min-height: 92px;
  padding: 12px;
  resize: vertical;
}

.login-card input:focus,
.form-grid input:focus,
.form-grid textarea:focus {
  border-color: #4e96ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.admin-body {
  background: #eef1f6;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px max(24px, calc((100% - 1180px) / 2));
  background: #111b2e;
  color: white;
}

.admin-header h1 {
  margin: 5px 0;
}

.admin-header p {
  margin: 0;
  color: #aab6c9;
}

.admin-actions {
  display: flex;
  gap: 10px;
}

.admin-actions form {
  margin: 0;
}

.admin-shell {
  display: grid;
  gap: 22px;
  width: min(1180px, calc(100% - 28px));
  margin: 24px auto 48px;
}

.admin-panel {
  padding: 24px;
  border: 1px solid #e1e6ee;
  border-radius: 16px;
  background: white;
  box-shadow: 0 12px 35px rgba(39, 55, 79, 0.06);
}

.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.panel-heading h2 {
  margin: 5px 0 0;
}

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

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

.wide-field {
  grid-column: 1 / -1;
}

.admin-save {
  width: auto;
  min-width: 220px;
  margin-top: 20px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.media-card {
  display: grid;
  gap: 13px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.media-card img,
.media-empty {
  width: 100%;
  height: 210px;
  border-radius: 10px;
}

.media-card img {
  border: 1px solid var(--line);
  object-fit: contain;
}

.media-empty {
  display: grid;
  place-items: center;
  background: #f4f6f9;
  color: var(--muted);
}

.file-button {
  display: grid;
  gap: 8px;
  color: #526174;
  font-size: 14px;
  font-weight: 700;
}

.submission-list {
  display: grid;
  gap: 12px;
}

.submission-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fafbfc;
}

.submission-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.submission-card small {
  color: var(--muted);
}

.submission-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.submission-files a {
  padding: 7px 10px;
  border-radius: 7px;
  background: #eaf3ff;
  color: #1168d6;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.empty-state {
  padding: 36px;
  border: 1px dashed #cfd7e2;
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 720px) {
  .landing-shell,
  .upload-shell {
    padding: 0;
  }

  .landing-card,
  .upload-card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .landing-card {
    padding: 22px 20px;
  }

  .upload-card {
    min-height: 100vh;
    padding: 24px 18px;
  }

  .admin-header,
  .panel-heading,
  .submission-card > div:first-child {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-grid,
  .media-grid {
    grid-template-columns: 1fr;
  }

  .wide-field {
    grid-column: auto;
  }

  .admin-save {
    width: 100%;
  }
}
