:root {
  --bg-main: #0e0f12;
  --bg-alt: #14171d;
  --bg-card: #16181d;
  --bg-card-soft: #1b1f27;
  --text-main: #f5f5f5;
  --text-muted: #b9b9b9;
  --text-light: #8a8a8a;
  --line: #2e3038;
  --gold: #d4af37;
  --gold-dark: #b8962e;
  --gold-soft: rgba(212, 175, 55, 0.16);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(212, 175, 55, 0.18) 0%, rgba(212, 175, 55, 0) 65%),
    radial-gradient(800px 400px at 95% 120%, rgba(212, 175, 55, 0.08) 0%, rgba(212, 175, 55, 0) 50%),
    linear-gradient(180deg, var(--bg-alt) 0%, var(--bg-main) 40%, #0a0b0f 100%);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  filter: blur(44px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
  animation: orbFloat 14s ease-in-out infinite alternate;
}

.bg-orb-1 {
  top: -90px;
  right: -70px;
  background: rgba(212, 175, 55, 0.45);
}

.bg-orb-2 {
  bottom: -120px;
  left: -90px;
  background: rgba(92, 125, 201, 0.33);
  animation-delay: -5s;
}

.analysis-log-page {
  position: relative;
  z-index: 1;
  width: min(1080px, 94vw);
  margin: 0 auto;
  padding: 48px 0 44px;
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 36px;
  background: linear-gradient(135deg, #1a1d24 0%, #16181d 45%, #111319 100%);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(212, 175, 55, 0.1) 35%, transparent 68%);
  transform: translateX(-100%);
  animation: sheen 6s ease-in-out infinite;
  pointer-events: none;
}

.back-link {
  display: inline-block;
  color: #e6d7a8;
  text-decoration: none;
  margin-bottom: 12px;
}

.back-link:hover {
  color: #fff4cf;
}

.hero-eyebrow {
  display: inline-flex;
  padding: 6px 10px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 999px;
  font-size: 12px;
  color: #f0cf71;
  background: rgba(212, 175, 55, 0.08);
  margin: 0 0 10px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 4.3vw, 46px);
  line-height: 1.05;
}

.hero-lead {
  margin: 14px 0 0;
  max-width: 760px;
  color: #d2d8e4;
  line-height: 1.6;
}

.hero-points {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-points span {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
  color: #e9edf7;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.workflow-mobile-hint {
  display: none;
  margin: 0 0 8px;
  color: #9aa5bd;
  font-size: 12px;
}

.workflow-card {
  background: linear-gradient(145deg, #181c24, #141820);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
}

.workflow-card h2 {
  margin: 0;
  font-size: 18px;
  color: #f6d576;
}

.workflow-card p {
  margin: 8px 0 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.card {
  background: linear-gradient(180deg, rgba(27, 31, 39, 0.95) 0%, rgba(19, 23, 30, 0.98) 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.analysis-log-form {
  display: grid;
  gap: 12px;
}

.form-header h2 {
  margin: 0;
  color: #ffe6a0;
}

.form-header p {
  margin: 6px 0 0;
  color: var(--text-muted);
}

.analysis-log-form label {
  font-weight: 700;
  color: #eceff6;
}

.analysis-log-form input[type="file"],
.analysis-log-form textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: #e5e7eb;
  padding: 11px 12px;
}

.analysis-log-form textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

.analysis-log-preview {
  width: 100%;
  max-height: 230px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.36);
  cursor: zoom-in;
}

.hidden {
  display: none;
}

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

.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.btn-primary {
  background: linear-gradient(180deg, #e1bd4d, #cda533);
  color: #1b1a13;
}

.btn-ghost {
  background: #222632;
  color: #e5e7eb;
}

.btn-small {
  padding: 7px 10px;
  font-size: 0.85rem;
}

.status {
  margin: 0;
  color: #aeb7c9;
}

.list-header {
  margin: 18px 0 10px;
}

.list-header h2 {
  margin: 0;
  color: #f2d37b;
}

.list-header p {
  margin: 6px 0 0;
  color: var(--text-muted);
}

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

.analysis-log-item {
  display: grid;
  gap: 10px;
}

.analysis-log-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.analysis-log-thumb {
  width: 100%;
  height: 150px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.34);
  cursor: zoom-in;
}

.analysis-log-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.analysis-log-item-date {
  margin: 0;
  color: #9ca3af;
  font-size: 0.88rem;
}

.analysis-log-item p {
  margin: 0;
}

.analysis-log-comment-wrap {
  position: relative;
}

.analysis-log-comment {
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.analysis-log-comment-wrap.is-collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.7em;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(22, 24, 29, 0), rgba(22, 24, 29, 1));
}

.analysis-log-comment.is-expanded {
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
  display: block;
}

.analysis-log-comment-wrap.is-expanded::after {
  display: none;
}

.analysis-log-toggle {
  margin-top: 4px;
}

.analysis-log-inline-form {
  margin-top: 6px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(212, 175, 55, 0.06);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.analysis-log-inline-form h4 {
  margin: 0;
  color: #f6d576;
  font-size: 0.98rem;
}

.analysis-log-inline-form input[type="file"],
.analysis-log-inline-form textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  color: #e5e7eb;
  padding: 10px;
}

.analysis-log-inline-form textarea {
  resize: vertical;
  min-height: 90px;
}

.analysis-log-inline-preview {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.32);
}

.image-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.image-lightbox.hidden {
  display: none;
}

.image-lightbox-panel {
  position: relative;
  width: min(1200px, 96vw);
  max-height: 92vh;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #11141c;
}

#lightboxImage {
  width: 100%;
  max-height: calc(92vh - 20px);
  object-fit: contain;
  border-radius: 10px;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes sheen {
  0%, 100% {
    transform: translateX(-110%);
  }
  55% {
    transform: translateX(130%);
  }
}

@keyframes orbFloat {
  0% {
    transform: translateY(0px) scale(1);
  }
  100% {
    transform: translateY(-18px) scale(1.08);
  }
}

@media (max-width: 920px) {
  .workflow {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 24px 20px;
  }
}

@media (max-width: 640px) {
  .analysis-log-page {
    width: 92vw;
    padding-top: 22px;
  }

  .workflow-mobile-hint {
    display: block;
  }

  .workflow {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 10px;
    scroll-snap-type: x mandatory;
  }

  .workflow::-webkit-scrollbar {
    display: none;
  }

  .workflow-card {
    min-width: 82vw;
    padding: 12px;
    scroll-snap-align: start;
  }

  .workflow-card h2 {
    font-size: 16px;
  }

  .workflow-card p {
    font-size: 13px;
    line-height: 1.38;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .analysis-log-preview,
  .analysis-log-thumb {
    max-height: 160px;
  }

  .analysis-log-images {
    grid-template-columns: 1fr;
  }

  .image-lightbox-panel {
    width: 98vw;
    padding: 8px;
  }
}
