:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #687386;
  --line: #dfe5ef;
  --primary: #3568ff;
  --primary-dark: #2451d6;
  --danger: #e64b4b;
  --shadow: 0 18px 50px rgba(30, 49, 90, 0.10);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at top left, #e7edff 0, transparent 34%), var(--bg);
}

button,
input,
select {
  font: inherit;
}

.app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 8px;
  font-size: 20px;
}

.subtitle {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.7;
}

.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.upload-panel {
  padding: 18px;
  margin-bottom: 22px;
}

.drop-zone {
  min-height: 170px;
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  border: 2px dashed #b9c7e8;
  border-radius: 18px;
  background: linear-gradient(135deg, #f9fbff, #eef3ff);
  cursor: pointer;
  transition: 0.18s ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary);
  transform: translateY(-1px);
  background: #eef4ff;
}

.drop-zone input {
  display: none;
}

.drop-icon {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  color: white;
  background: var(--primary);
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
}

.drop-zone small {
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

.list-panel,
.settings-panel {
  padding: 22px;
}

.panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

#photoCount {
  color: var(--muted);
  margin-bottom: 0;
}

.photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.photo-list.empty-state {
  display: grid;
  place-items: center;
  min-height: 240px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
}

.photo-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.thumb-wrap {
  aspect-ratio: 4 / 3;
  background: #edf1f7;
  overflow: hidden;
}

.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-info {
  padding: 12px;
}

.photo-name {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 700;
}

.photo-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.photo-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.photo-actions button,
.ghost-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  padding: 8px 10px;
  transition: 0.16s ease;
}

.photo-actions button:hover,
.ghost-btn:hover {
  border-color: #b8c5df;
  background: #f7f9fd;
}

.photo-actions .delete-btn {
  color: var(--danger);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field span,
.check-field {
  color: var(--muted);
  font-size: 14px;
}

.field input[type="text"],
.field select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.field input[type="range"] {
  width: 100%;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 18px;
}

.primary-btn {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
  cursor: pointer;
  transition: 0.18s ease;
}

.primary-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.status-text {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

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

  .settings-panel {
    order: -1;
  }
}
