:root {
  color-scheme: light;
  --paper: #f7f8f4;
  --surface: #ffffff;
  --ink: #17242a;
  --muted: #637074;
  --line: #d9dfdc;
  --teal: #114b5f;
  --teal-soft: #d8edf0;
  --amber: #f4a261;
  --amber-soft: #fff1db;
  --rose: #c44536;
  --shadow: 0 18px 50px rgba(17, 75, 95, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body.is-locked .layout {
  display: none;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

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

svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-sprite {
  display: none;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 20px;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brand img {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(17, 75, 95, 0.18);
}

.brand h1,
.brand p,
.panel-heading h2,
.section-heading h2,
.record-card h3,
.empty-state p {
  margin: 0;
}

.brand h1 {
  font-size: clamp(1.2rem, 2.4vw, 1.75rem);
  line-height: 1.1;
}

.brand p,
.section-heading span,
.panel-heading span,
.geo-row span,
.record-meta,
.record-note {
  color: var(--muted);
}

.brand p {
  margin-top: 4px;
  font-size: 0.92rem;
}

.topbar-actions,
.record-meta,
.record-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--teal);
  background: var(--surface);
}

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

.entry-panel,
.records-section {
  min-width: 0;
}

.entry-panel {
  position: sticky;
  top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-heading,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading h2,
.section-heading h2 {
  font-size: 1.05rem;
}

.parking-form {
  display: grid;
  gap: 14px;
}

.photo-drop {
  display: grid;
  min-height: 260px;
  overflow: hidden;
  place-items: center;
  border: 1.5px dashed #aab8b6;
  border-radius: 8px;
  background: linear-gradient(135deg, #f9fbf8, #eef7f5);
}

.photo-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.photo-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--teal);
  font-weight: 700;
}

.photo-empty svg {
  width: 2rem;
  height: 2rem;
}

.photo-drop img {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: cover;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
}

textarea,
input[type="password"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

textarea {
  min-height: 82px;
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}

input[type="password"] {
  min-height: 44px;
  padding: 0 12px;
}

textarea:focus,
input[type="password"]:focus,
.icon-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(17, 75, 95, 0.16);
  outline: none;
}

.geo-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.primary-button,
.secondary-button,
.map-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button {
  border: 1px solid var(--teal);
  color: #fff;
  background: var(--teal);
  font-weight: 800;
}

.secondary-button,
.map-link {
  border: 1px solid var(--line);
  color: var(--teal);
  background: var(--surface);
  font-weight: 700;
}

.secondary-button {
  padding: 0 13px;
}

.map-link {
  min-height: 38px;
  padding: 0 11px;
  font-size: 0.9rem;
}

.records-section {
  padding: 18px 0 0;
}

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

.record-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(23, 36, 42, 0.08);
}

.record-image-wrap {
  aspect-ratio: 4 / 3;
  background: var(--teal-soft);
}

.record-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.record-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.record-meta {
  justify-content: space-between;
  font-size: 0.82rem;
}

.delete-button {
  width: 34px;
  height: 34px;
  color: var(--rose);
}

.record-card h3 {
  display: -webkit-box;
  overflow: hidden;
  min-height: 2.8em;
  font-size: 1rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.record-note {
  display: -webkit-box;
  overflow: hidden;
  min-height: 2.6em;
  font-size: 0.92rem;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.empty-state {
  min-height: 340px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
}

.empty-state svg {
  width: 3rem;
  height: 3rem;
  color: var(--amber);
}

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

  .entry-panel {
    position: static;
  }

  .records-section {
    padding-top: 8px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand img {
    width: 40px;
    height: 40px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .entry-panel {
    padding: 14px;
  }

  .photo-drop {
    min-height: 230px;
  }

  .geo-row {
    grid-template-columns: 1fr;
  }

  .records-list {
    grid-template-columns: 1fr;
  }
}
