*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --divider: #d1d5db;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #6b7280;
  --secondary-hover: #4b5563;
  --back: #ea580c;
  --back-hover: #c2410c;
  --finish: #059669;
  --finish-hover: #047857;
  --buyer-accent: #3b82f6;
  --seller-accent: #059669;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --max-width: 1100px;
  --radius: 8px;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.app {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 36px;
}

.instructions-panel .instructions-text p {
  margin: 0 0 1em;
}

.instructions-panel .notice-label {
  font-weight: 600;
  margin-bottom: 0.25em;
}

.instructions-panel .notice-list {
  margin: 0 0 1em 1.25em;
  padding: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:not(:disabled):hover {
  background: var(--primary-hover);
}

.btn-back,
.btn-finish {
  background: var(--primary);
  color: #fff;
}

.btn-back:not(:disabled):hover,
.btn-finish:not(:disabled):hover {
  background: var(--primary-hover);
}

.btn-finish:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#btn-next-instructions {
  margin-top: 24px;
}

/* 案例页 */
.dispute-header {
  display: flex;
  gap: 20px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.product-thumb {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 6px;
  background: #eef2f7 center / cover no-repeat;
  border: 1px solid var(--border);
}

.product-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 600;
}

.product-price {
  margin: 0;
  color: #dc2626;
  font-size: 1.1rem;
  font-weight: 600;
}

.dispute-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.party-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 28px;
  min-height: 320px;
}

.party-buyer {
  border-top: 3px solid var(--buyer-accent);
}

.party-seller {
  border-top: 3px solid var(--seller-accent);
}

.party-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #e5e7eb center / 60% no-repeat;
}

.avatar-buyer {
  background-color: #dbeafe;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%233b82f6'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
}

.avatar-seller {
  border-radius: 8px;
  background-color: #d1fae5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23059669'%3E%3Cpath d='M20 4H4v2h16V4zm1 10v-2l-1-5H4l-1 5v2h1v6h10v-6h4v6h2v-6h1zm-9 4H6v-4h6v4z'/%3E%3C/svg%3E");
}

.nickname {
  font-weight: 500;
  color: var(--muted);
}

.statement {
  white-space: pre-wrap;
  font-size: 0.95rem;
  line-height: 1.75;
}

.case-footer {
  margin-top: 24px;
  text-align: center;
}

.countdown-hint {
  color: var(--muted);
  margin: 0 0 12px;
}

.countdown-hint span {
  font-weight: 700;
  color: var(--primary);
}

/* 投票页 */
.vote-panel {
  margin-bottom: 24px;
}

.vote-title {
  margin: 0 0 20px;
  font-size: 1.2rem;
}

.vote-options {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.vote-option {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.vote-option:has(input:checked) {
  border-color: var(--primary);
  background: #eff6ff;
}

.vote-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.reason-label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
}

.reason-text {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  resize: vertical;
}

.reason-text:focus {
  outline: 2px solid #93c5fd;
  border-color: var(--primary);
}

.reason-meta {
  margin: 8px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.vote-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.vote-footer .btn {
  flex: 1;
  max-width: 280px;
}

.done-panel h2 {
  margin-top: 0;
}

.done-lead {
  margin: 0 0 20px;
}

.done-download-wrap {
  display: flex;
  justify-content: center;
  margin: 32px 0 8px;
}

.btn-download-prominent {
  min-height: 56px;
  min-width: 260px;
  padding: 16px 52px;
  font-size: 1.125rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

.btn-download-prominent:hover {
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.credamo-return-hint {
  margin: 28px 0 0;
  padding: 14px 18px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  color: #9a3412;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.65;
}

.entry-links {
  line-height: 2;
  padding-left: 1.25em;
}

.entry-links a {
  color: var(--primary);
  font-weight: 500;
}

.entry-note {
  margin-top: 1.5em;
  color: var(--muted);
  font-size: 0.9rem;
}

.entry-note code {
  font-size: 0.85em;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
}

.data-preview {
  margin-top: 20px;
  padding: 16px;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  overflow-x: auto;
  max-height: 240px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 768px) {
  .dispute-body {
    grid-template-columns: 1fr;
  }

  .vote-footer {
    flex-direction: column;
  }

  .vote-footer .btn {
    max-width: none;
  }
}
