:root {
  --green-900: #0d4f3c;
  --green-800: #146b52;
  --green-700: #1a8a68;
  --green-600: #22a07a;
  --green-500: #2db88e;
  --green-400: #4fd1a5;
  --green-300: #8ee4c3;
  --green-100: #e8f8f1;
  --teal-600: #0f9b8e;
  --yellow-accent: #f5d547;
  --purple-accent: #7c5cbf;
  --text-dark: #1a3d32;
  --text-muted: #5a7d72;
  --white: #ffffff;
  --shadow: 0 8px 32px rgba(13, 79, 60, 0.18);
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
}

body {
  background: linear-gradient(165deg, #3db89a 0%, #2a9d82 35%, #1f8a72 70%, #167a65 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
}

/* Wave decoration */
.wave-bg {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.wave-bg::before {
  content: "";
  position: absolute;
  top: 0;
  left: -10%;
  right: -10%;
  height: 280px;
  background:
    radial-gradient(ellipse 60% 80% at 20% 0%, rgba(245, 213, 71, 0.55) 0%, transparent 70%),
    radial-gradient(ellipse 50% 70% at 80% 10%, rgba(124, 92, 191, 0.45) 0%, transparent 65%),
    radial-gradient(ellipse 70% 60% at 50% 30%, rgba(79, 209, 165, 0.35) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.page-shell {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 20px 32px;
  display: flex;
  flex-direction: column;
}

.page-shell.wide {
  max-width: 960px;
}

/* Entry bubbles on home */
.entry-cluster {
  position: relative;
  height: 300px;
  margin: 20px auto 28px;
  width: 100%;
  max-width: 340px;
}

.entry-bubble {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.entry-bubble:hover {
  transform: scale(1.05);
  filter: brightness(1.05);
}

.entry-bubble .label {
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.entry-bubble .circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  font-size: 36px;
}

.entry-bubble.suggest {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.entry-bubble.suggest:hover {
  transform: translateX(-50%) scale(1.05);
}

.entry-bubble.suggest .circle {
  background: linear-gradient(145deg, #d4f5e4, #a8e6c8);
}

.entry-bubble.complaint {
  bottom: 20px;
  left: 8px;
}

.entry-bubble.complaint .circle {
  background: linear-gradient(145deg, #fff0d4, #ffd699);
}

.entry-bubble.consult {
  bottom: 20px;
  right: 8px;
}

.entry-bubble.consult .circle {
  background: linear-gradient(145deg, #d4eeff, #a8d4f5);
}

.intro-card {
  background: rgba(13, 79, 60, 0.88);
  border-radius: var(--radius-lg);
  padding: 20px;
  color: var(--white);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.intro-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.intro-card p {
  font-size: 14px;
  line-height: 1.7;
  opacity: 0.95;
  margin-bottom: 16px;
}

.intro-list {
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.intro-list li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  line-height: 1.6;
}

.intro-list li strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

/* Chat page */
.chat-page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--white);
}

.chat-header {
  background: var(--white);
  padding: 14px 16px;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: #333;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 10;
}

.chat-header .back-btn {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  color: var(--green-700);
  font-size: 14px;
  padding: 6px 8px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.75) 100%),
    url("/static/img/river-bg.svg") center/cover no-repeat;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg-row {
  display: flex;
  gap: 10px;
  max-width: 85%;
}

.msg-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.msg-row.admin .msg-avatar {
  background: var(--teal-600);
  color: var(--white);
}

.msg-row.user .msg-avatar {
  background: var(--green-500);
  color: var(--white);
}

.msg-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.55;
  word-break: break-word;
}

.msg-row.admin .msg-bubble {
  background: var(--teal-600);
  color: var(--white);
  border-bottom-left-radius: 4px;
}

.msg-row.user .msg-bubble {
  background: var(--green-100);
  color: var(--text-dark);
  border-bottom-right-radius: 4px;
}

.msg-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: right;
}

.chat-input-bar {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  background: #f5f5f5;
  border-top: 1px solid #e0e0e0;
}

.chat-input-bar input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 15px;
  outline: none;
}

.chat-input-bar input:focus {
  border-color: var(--green-500);
}

.chat-input-bar button {
  background: var(--teal-600);
  color: var(--white);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
}

.chat-input-bar button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Admin page */
.admin-page {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f4f7f6;
}

.admin-banner {
  position: relative;
  flex-shrink: 0;
  height: auto;
  min-height: calc(26px * 1.5 + 24px);
  background:
    linear-gradient(to bottom, rgba(13, 79, 60, 0.3), rgba(13, 79, 60, 0.7)),
    url("/static/img/river-bg.svg") center/cover;
  display: flex;
  align-items: center;
  padding: 12px 24px;
  color: var(--white);
}

.admin-banner h1 {
  font-size: 26px;
  line-height: 1.5;
  font-weight: 700;
}

.admin-banner .badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 12px;
  margin-left: 10px;
  vertical-align: middle;
}

.admin-tabs {
  flex-shrink: 0;
  display: flex;
  gap: 0;
  background: var(--white);
  border-bottom: 2px solid #e0e0e0;
  padding: 0 24px;
}

.admin-tab {
  padding: 14px 20px;
  font-size: 15px;
  color: var(--text-muted);
  background: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.admin-tab.active {
  color: var(--green-700);
  border-bottom-color: var(--green-600);
  font-weight: 600;
}

.admin-tab .badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #fa5151;
  color: var(--white);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Admin login */
.admin-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(165deg, #3db89a 0%, #1f8a72 100%);
  padding: 24px;
}

.admin-login-card {
  width: 100%;
  max-width: 380px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}

.admin-login-card h2 {
  font-size: 22px;
  color: var(--green-800);
  margin-bottom: 8px;
  text-align: center;
}

.admin-login-card .subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.admin-login-field {
  margin-bottom: 16px;
}

.admin-login-field label {
  display: block;
  font-size: 14px;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.admin-login-field input {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
}

.admin-login-field input:focus {
  border-color: var(--green-500);
}

.admin-login-error {
  color: #e74c3c;
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 18px;
}

.admin-login-btn {
  width: 100%;
  background: var(--green-600);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.admin-login-btn:hover {
  background: var(--green-700);
}

.admin-logout-btn {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}

.admin-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#panel-chat {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.admin-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  background: var(--white);
}

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

.session-list {
  background: var(--white);
  border-right: 1px solid #e8e8e8;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#session-items {
  flex: 1;
  overflow-y: auto;
}

.session-list-header {
  padding: 12px 16px;
  background: var(--green-100);
  font-size: 14px;
  font-weight: 600;
  color: var(--green-800);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.session-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.15s;
}

.session-item:hover,
.session-item.active {
  background: #f8fdfb;
}

.session-item.active {
  border-left: 3px solid var(--green-600);
}

.session-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.session-avatar {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--green-400), var(--green-600));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
}

.session-unread-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #fa5151;
  color: var(--white);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  border-radius: 999px;
  border: 2px solid var(--white);
  box-sizing: content-box;
}

.session-item-body {
  flex: 1;
  min-width: 0;
}

.session-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.session-item .preview {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.session-item .time {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.session-item .snippet {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-item.has-unread .preview,
.session-item.has-unread .snippet {
  color: var(--text-dark);
  font-weight: 500;
}

.session-item .meta {
  display: none;
}

.session-item .unread {
  display: none;
}

.chat-panel {
  background: var(--white);
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.chat-panel-header {
  flex-shrink: 0;
  padding: 12px 20px;
  border-bottom: 1px solid #eee;
  font-weight: 600;
  color: var(--green-800);
  background: var(--white);
}

.chat-panel-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f8fbf9;
}

/* 后台对话：本人（管理员）在右，对方（群众）在左 */
.admin-chat-messages .msg-row {
  display: flex;
  gap: 10px;
  max-width: min(72%, 640px);
}

.admin-chat-messages .msg-row.other {
  align-self: flex-start;
}

.admin-chat-messages .msg-row.self {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.admin-chat-messages .msg-row.other .msg-avatar {
  background: var(--green-500);
  color: var(--white);
}

.admin-chat-messages .msg-row.self .msg-avatar {
  background: var(--teal-600);
  color: var(--white);
}

.admin-chat-messages .msg-row.other .msg-bubble {
  background: var(--white);
  color: var(--text-dark);
  border: 1px solid #e8ecea;
  border-bottom-left-radius: 4px;
}

.admin-chat-messages .msg-row.self .msg-bubble {
  background: var(--green-600);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.admin-chat-messages .msg-row.self .msg-time {
  text-align: left;
}

.chat-panel-input {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #e8e8e8;
  background: var(--white);
  align-items: flex-end;
}

.chat-panel-input textarea {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  resize: none;
  height: 48px;
  max-height: 120px;
  font-family: inherit;
  line-height: 1.5;
}

.chat-panel-input textarea:focus {
  outline: none;
  border-color: var(--green-500);
}

.chat-panel-input button {
  background: var(--green-600);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  height: 48px;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
  font-size: 14px;
}

.external-links {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.external-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  color: var(--green-700);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#panel-forms {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.submissions-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: var(--white);
  border-bottom: 1px solid #e8e8e8;
}

.filter-check {
  font-size: 14px;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-select {
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 14px;
  background: var(--white);
}

.submissions-toolbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-batch-process {
  border: 1px solid var(--green-500);
  background: var(--white);
  color: var(--green-700);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.btn-batch-process:hover:not(:disabled) {
  background: var(--green-100);
}

.btn-batch-process:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: #ccc;
  color: #999;
}

.submissions-total {
  font-size: 13px;
  color: var(--text-muted);
}

.submissions-layout {
  flex: 1;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 5px var(--submission-detail-width, 420px);
}

.submission-splitter {
  cursor: col-resize;
  background: #e8e8e8;
  transition: background 0.15s;
  flex-shrink: 0;
}

.submission-splitter:hover,
.submission-splitter.dragging {
  background: var(--green-500);
}

.submission-list {
  overflow-y: auto;
  background: #f8fbf9;
  border-right: 1px solid #e8e8e8;
}

.submission-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--white);
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.15s;
}

.submission-row-check {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 4px;
  cursor: pointer;
  accent-color: var(--green-600);
}

.submission-row-check-spacer {
  flex-shrink: 0;
  width: 16px;
}

.batch-select-all {
  font-size: 13px;
  color: var(--text-muted);
}

.submission-row:hover,
.submission-row.active {
  background: #f0faf5;
}

.submission-row.pending {
  border-left: 3px solid var(--green-500);
}

.submission-tag {
  flex-shrink: 0;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  margin-top: 2px;
}

.submission-tag.complaint {
  background: #fdecea;
  color: #e53935;
}

.submission-tag.suggestion {
  background: #e0f0ff;
  color: #2563eb;
}

.submission-row-body {
  flex: 1;
  min-width: 0;
}

.submission-snippet {
  font-size: 14px;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.submission-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.submission-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn.done {
  background: #e8f8f1;
  color: var(--green-700);
}

.icon-btn.delete {
  background: #fdecea;
  color: #e74c3c;
}

.submission-detail {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px;
  background: var(--white);
  min-width: 0;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.detail-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
}

.detail-status.pending {
  background: #fff3e0;
  color: #e65100;
}

.detail-status.processed {
  background: #e8f8f1;
  color: var(--green-700);
}

.detail-field {
  margin-bottom: 16px;
}

.detail-field label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.detail-field p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dark);
}

.detail-content {
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-image {
  width: 100%;
  max-width: none;
  aspect-ratio: 1;
  max-height: 180px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid #eee;
  display: block;
}

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

.detail-images a {
  display: block;
  min-width: 0;
}

.detail-image-trigger {
  display: block;
  min-width: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  border-radius: var(--radius-sm);
}

.detail-image-trigger:hover .detail-image {
  border-color: var(--green-500);
  box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.15);
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

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

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: zoom-out;
}

.image-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}

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

.image-lightbox-img {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 1200px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  cursor: default;
}

.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.btn-primary-sm,
.btn-secondary-sm,
.btn-danger-sm {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  border: none;
  cursor: pointer;
}

.btn-primary-sm {
  background: var(--green-600);
  color: var(--white);
}

.btn-secondary-sm {
  background: #f0f0f0;
  color: var(--text-dark);
}

.btn-danger-sm {
  background: #fdecea;
  color: #e74c3c;
}

/* Public form page */
.form-page {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.78)),
    url("/static/img/river-bg.svg") center/cover fixed;
}

.form-page.theme-complaint {
  background:
    linear-gradient(to bottom, rgba(243, 232, 255, 0.9), rgba(255, 255, 255, 0.85)),
    url("/static/img/river-bg.svg") center/cover fixed;
}

.form-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 12px;
  position: relative;
}

.form-back {
  position: absolute;
  left: 16px;
  top: 22px;
  color: var(--green-700);
  font-size: 14px;
}

.form-header-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  margin-left: 48px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.theme-complaint .form-header-icon {
  color: #7c3aed;
}

.theme-suggestion .form-header-icon {
  color: var(--green-600);
}

.form-header h1 {
  font-size: 24px;
  color: var(--text-dark);
}

.form-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.form-card {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

.form-field {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.form-field label {
  width: 88px;
  flex-shrink: 0;
  font-size: 15px;
  color: var(--green-800);
  padding-top: 10px;
  text-align: right;
}

.form-field .req {
  color: #e74c3c;
}

.form-field input,
.form-field textarea {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  background: var(--white);
}

.form-field textarea {
  resize: vertical;
  min-height: 100px;
}

.image-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.image-preview-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.image-preview-item {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.image-preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.image-upload-btn {
  width: 56px;
  height: 56px;
  border: 1px dashed #ccc;
  border-radius: var(--radius-sm);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #999;
  cursor: pointer;
}

.image-preview {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid #eee;
  display: block;
}

.form-hint {
  font-size: 12px;
  color: #999;
  font-weight: normal;
}

.form-msg {
  min-height: 20px;
  font-size: 14px;
  text-align: center;
  margin-bottom: 12px;
}

.form-msg.error {
  color: #e74c3c;
}

.form-msg.success {
  color: var(--green-700);
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}

.btn-primary {
  background: var(--green-600);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 36px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary {
  background: var(--green-600);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-size: 16px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.external-links a:hover {
  background: var(--green-100);
}

/* Home page — mobile / WeChat in-app browser */
.home-page .page-shell {
  min-height: auto;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px));
}

.home-page header {
  flex-shrink: 0;
}

.home-header {
  text-align: center;
  margin-bottom: 8px;
}

.home-title {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.home-subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  margin-top: 6px;
}

@media (max-width: 480px), (max-height: 780px) {
  .home-page .page-shell {
    padding-top: 12px;
  }

  .home-page header h1,
  .home-title {
    font-size: 20px;
  }

  .home-page header p,
  .home-subtitle {
    font-size: 12px;
    margin-top: 4px;
  }

  .home-page .entry-cluster {
    height: 200px;
    margin: 10px auto 14px;
    max-width: 300px;
  }

  .home-page .entry-bubble .circle {
    width: 72px;
    height: 72px;
    font-size: 28px;
  }

  .home-page .entry-bubble .label {
    font-size: 14px;
  }

  .home-page .entry-bubble.complaint,
  .home-page .entry-bubble.consult {
    bottom: 8px;
  }

  .home-page .intro-card {
    padding: 16px;
    flex-shrink: 0;
  }

  .home-page .intro-card p {
    font-size: 13px;
    margin-bottom: 12px;
  }

  .home-page .intro-list li {
    padding: 10px 0;
    font-size: 12px;
  }

  .home-page .intro-list li strong {
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  .home-page .entry-cluster {
    height: 180px;
    max-width: 280px;
  }

  .home-page .entry-bubble .circle {
    width: 64px;
    height: 64px;
    font-size: 24px;
  }
}

/* Splash screen */
.splash-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #8fd0e8;
  position: relative;
}

.splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  transition: opacity 0.35s ease;
}

.splash-overlay.is-hiding {
  opacity: 0;
  pointer-events: none;
}

.splash-sky {
  position: absolute;
  inset: 0 0 42%;
  background: linear-gradient(180deg, #9fdcf0 0%, #7ec8e3 55%, #6ebad9 100%);
  overflow: hidden;
}

.splash-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0.92;
}

.splash-blob-yellow {
  width: 72vw;
  height: 52vw;
  max-width: 360px;
  max-height: 260px;
  top: 18%;
  left: -8%;
  background: radial-gradient(circle at 35% 35%, #ffe566 0%, #f5d547 45%, #e8b82e 100%);
  transform: rotate(-12deg);
}

.splash-blob-purple {
  width: 68vw;
  height: 48vw;
  max-width: 340px;
  max-height: 240px;
  top: 28%;
  right: -12%;
  background: radial-gradient(circle at 60% 40%, #b99ae8 0%, #9b7fd4 50%, #7c5cbf 100%);
  transform: rotate(18deg);
}

.splash-main {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12vh 28px 0;
  text-align: center;
}

.splash-title {
  color: var(--white);
  font-size: clamp(26px, 7.2vw, 34px);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 1px;
  text-shadow:
    0 2px 0 rgba(46, 120, 160, 0.35),
    0 6px 18px rgba(0, 60, 90, 0.22);
}

.splash-scene {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  height: 42vh;
  min-height: 240px;
  background:
    linear-gradient(to bottom, rgba(126, 200, 227, 0.15) 0%, rgba(0, 0, 0, 0.08) 100%),
    url("/static/img/river-bg.svg") center/cover no-repeat;
}

.splash-footer {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.splash-footer-label {
  font-size: 13px;
  color: #666;
  flex-shrink: 0;
}

.splash-footer-logo {
  height: 28px;
  width: auto;
  max-width: min(72vw, 280px);
  object-fit: contain;
  object-position: left center;
}
