:root {
  --bg: #f4f6f8;
  --bg-accent: #e8eef5;
  --ink: #15202b;
  --muted: #6b7785;
  --line: #d9e0e8;
  --card: #ffffff;
  --accent: #1f6feb;
  --accent-soft: #ebf2ff;
  --accent-hover: #1858c7;
  --warn: #c2410c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(21, 32, 43, 0.04), 0 12px 28px rgba(21, 32, 43, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(180deg, var(--bg-accent) 0%, var(--bg) 42%, var(--bg) 100%);
  -webkit-font-smoothing: antialiased;
}

.page {
  width: min(560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.header {
  margin-bottom: 28px;
}

.brand {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: none;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 4vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dropzone {
  padding: 36px 24px 28px;
  text-align: center;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.dragover {
  background: var(--accent-soft);
  outline: none;
}

.dropzone.dragover {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.drop-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
}

.dropzone strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
}

.dropzone p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.file-name {
  margin-top: 14px;
  display: none;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f0f4f8;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  word-break: break-all;
}

.actions {
  padding: 16px 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

button {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  color: var(--ink);
  border-color: #bcc6d1;
  background: #f8fafc;
}

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

.rules {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  overflow: hidden;
}

.rules summary {
  list-style: none;
  cursor: pointer;
  padding: 13px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  user-select: none;
}

.rules summary::-webkit-details-marker { display: none; }

.rules summary::after {
  content: "+";
  float: right;
  color: var(--muted);
  font-weight: 500;
}

.rules[open] summary::after { content: "−"; }

.rules-title {
  margin: 0;
  padding: 0 16px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.rules-title + ul {
  padding-top: 0;
}

.rules ul {
  margin: 0;
  padding: 0 16px 14px 32px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.rules ul + .rules-title {
  padding-top: 4px;
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 32, 0.42);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.modal-mask.show { display: flex; }

.modal {
  width: min(400px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 48px rgba(15, 23, 32, 0.18);
  animation: pop 0.2s ease;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.modal h3 {
  margin: 0 0 6px;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.modal p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.modal label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.modal input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 18px;
  background: #fff;
  color: var(--ink);
}

.modal input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.15);
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.error { color: var(--warn); }

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