* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f4f7fb;
  color: #1f2937;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans JP",
    sans-serif;
}

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 60px;
}

/* ===== ヘッダー ===== */

.hero {
  text-align: center;
  padding: 35px 20px 30px;
}

.logo-mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 34px;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.22);
}

.hero h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: 0.02em;
  color: #111827;
}

.hero .subtitle {
  margin: 12px 0 0;
  color: #64748b;
  font-size: 16px;
}

/* ===== 説明イラスト ===== */

.flow {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin: 25px auto 30px;
  color: #2563eb;
}

.flow-item {
  width: 100px;
  height: 85px;
  background: white;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.05);
}

.flow-icon {
  font-size: 30px;
  margin-bottom: 5px;
}

.flow-label {
  font-size: 12px;
  color: #64748b;
}

.flow-arrow {
  font-size: 22px;
  color: #94a3b8;
}

/* ===== カード ===== */

.card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 22px;
  margin-top: 18px;
  box-shadow: 0 5px 20px rgba(15, 23, 42, 0.05);
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

input[type="file"] {
  flex: 1;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

/* ===== ボタン ===== */

button {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  background: #e2e8f0;
  color: #1e293b;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  opacity: 0.88;
}

button.primary {
  background: #2563eb;
  color: white;
}

button.primary:hover {
  background: #1d4ed8;
}

/* ===== OCR画面 ===== */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spacer {
  flex: 1;
}

.hint {
  color: #64748b;
  font-size: 14px;
  line-height: 1.7;
}

.pdf-viewer {
  position: relative;
  margin-top: 15px;
  overflow: auto;
  background: #e2e8f0;
  border-radius: 8px;
}

#pdfCanvas,
#selectionCanvas {
  display: block;
}

#selectionCanvas {
  position: absolute;
  top: 0;
  left: 0;
}

/* ===== 使い方 ===== */

.info-section {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 25px;
  margin-top: 25px;
  box-shadow: 0 5px 20px rgba(15, 23, 42, 0.04);
}

.info-section h2 {
  margin-top: 0;
  text-align: center;
  font-size: 22px;
}

.info-section ol {
  max-width: 650px;
  margin: 20px auto;
  padding-left: 28px;
  line-height: 2;
}

.notice {
  max-width: 700px;
  margin: 20px auto 0;
  padding: 15px 18px;
  border-radius: 9px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  line-height: 1.7;
}

.small-text {
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

/* ===== テーブル ===== */

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  font-size: 14px;
}

th {
  background: #f8fafc;
}

/* ===== その他 ===== */

.message {
  margin-top: 10px;
}

.hidden {
  display: none;
}

footer {
  text-align: center;
  margin-top: 30px;
  color: #64748b;
  font-size: 14px;
}

footer a {
  color: #2563eb;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.copyright {
  margin-top: 10px;
  font-size: 12px;
  color: #94a3b8;
}

/* ===== スマホ ===== */

@media (max-width: 700px) {
  .container {
    width: calc(100% - 20px);
    padding-top: 20px;
  }

  .hero h1 {
    font-size: 25px;
  }

  .row {
    flex-direction: column;
    align-items: stretch;
  }

  .row button {
    width: 100%;
  }

  .flow {
    gap: 7px;
  }

  .flow-item {
    width: 82px;
    height: 75px;
  }

  .flow-icon {
    font-size: 25px;
  }

  .flow-arrow {
    font-size: 16px;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .toolbar .spacer {
    display: none;
  }
}

