:root {
  --primary: #059669;
  --primary-deep: #047857;
  --secondary: #10b981;
  --cta: #f97316;
  --cta-deep: #ea580c;
  --bg: #ecfdf5;
  --bg-soft: #d1fae5;
  --text: #064e3b;
  --muted: #6b8f80;
  --surface: #ffffff;
  --line: rgba(6, 78, 59, 0.12);
  --danger: #dc2626;
  --shadow: 0 12px 40px rgba(4, 120, 87, 0.12);
  --radius: 18px;
  --font: "Noto Sans SC", "PingFang SC", sans-serif;
  --display: "Outfit", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(120% 80% at 10% -10%, #a7f3d0 0%, transparent 55%),
    radial-gradient(90% 60% at 100% 0%, #fde68a 0%, transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, #f0fdf4 40%, #fff7ed 100%);
}

body {
  padding: 0 0 48px;
}

.page {
  max-width: 440px;
  margin: 0 auto;
  padding: 20px 16px 0;
}

.hero {
  padding: 12px 8px 20px;
  animation: rise 0.5s ease both;
}

.brand {
  margin: 0;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}

.hero h1 {
  margin: 8px 0 6px;
  font-family: var(--display);
  font-size: clamp(2rem, 8vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.sub {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.sheet {
  background: var(--surface);
  border-radius: 24px;
  padding: 20px 16px 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.8);
  animation: rise 0.55s 0.08s ease both;
}

.block {
  margin-bottom: 22px;
}

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.block h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.hint {
  font-size: 12px;
  color: var(--muted);
}

textarea,
input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: #f8fffb;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}

textarea:focus,
input[type="text"]:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.opinion-zh-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px dashed rgba(4, 120, 87, 0.22);
}

.opinion-zh-box[hidden] {
  display: none !important;
}

.opinion-zh-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-deep);
  margin-bottom: 4px;
}

.opinion-zh {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.lang-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.lang-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8fffb;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s, background 0.2s;
}

.lang-opt:has(input:checked) {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.12);
  color: var(--primary-deep);
  font-weight: 600;
}

.lang-opt input {
  accent-color: var(--primary);
}

.hold-btn {
  margin-top: 12px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.35);
}

.hold-btn:active,
.hold-btn.recording {
  transform: scale(0.98);
  background: linear-gradient(135deg, var(--cta) 0%, var(--cta-deep) 100%);
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.4);
}

.hold-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.hold-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
}

.hold-icon svg {
  width: 100%;
  height: 100%;
}

.photo-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.photo-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.5px dashed rgba(5, 150, 105, 0.35);
  background:
    linear-gradient(135deg, rgba(236, 253, 245, 0.9), rgba(255, 247, 237, 0.9));
  transition: border-color 0.2s;
}

.photo-box.has-photo {
  border-style: solid;
}

.photo-box:hover {
  border-color: var(--primary);
}

.photo-hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  cursor: pointer;
}

.photo-box.has-photo .photo-hit {
  display: none;
}

/* 关键透明 input，避免 display:none 在微信/iOS 无法唤起相册 */
.photo-file {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
  z-index: 3;
}

.photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: zoom-in;
}

.photo-box img[hidden] {
  display: none !important;
}

.photo-box.has-photo img {
  display: block;
}

.rephoto-btn {
  align-self: flex-end;
}

.photo-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}

.photo-placeholder svg {
  width: 36px;
  height: 36px;
  color: var(--primary);
}

.history-list img.zoomable {
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(6, 30, 22, 0.88);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox img {
  max-width: min(100%, 920px);
  max-height: calc(100vh - 80px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.lightbox-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.loc-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.coords {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.link-btn {
  border: none;
  background: none;
  color: var(--primary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.link-btn:hover {
  color: var(--primary-deep);
}

.submit-btn {
  width: 100%;
  min-height: 54px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--cta) 0%, var(--cta-deep) 100%);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(234, 88, 12, 0.32);
  transition: transform 0.15s, opacity 0.2s;
}

.submit-btn:hover {
  transform: translateY(-1px);
}

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

.toast {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1px solid rgba(5, 150, 105, 0.25);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.toast.error {
  background: #fef2f2;
  border-color: rgba(220, 38, 38, 0.25);
  color: #991b1b;
}

.history {
  margin-top: 28px;
  padding: 0 4px 8px;
  animation: rise 0.6s 0.12s ease both;
}

.history h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-list li {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.history-list .meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.history-list .opinion {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.history-list .opinion-zh-hist {
  margin: -4px 0 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--primary-deep);
  white-space: pre-wrap;
  word-break: break-word;
}

.history-list .addr {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.history-list img {
  margin-top: 10px;
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 12px;
}

.history-list .empty {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 24px 8px;
  border: none;
  background: transparent;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
