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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: #f8f6f3;
  color: #2c2c2c;
  line-height: 1.6;
}

.container { max-width: 780px; margin: 0 auto; padding: 40px 20px; }

/* Header */
.header { text-align: center; margin-bottom: 40px; }
.logo { font-size: 48px; margin-bottom: 8px; }
.header h1 { font-size: 28px; font-weight: 800; color: #1a1a1a; }
.subtitle { font-size: 15px; color: #777; margin-top: 4px; }

/* Cards */
.card {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed #ddd;
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #fafaf8;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: #ff9900;
  background: #fff8f0;
}
.upload-icon { font-size: 40px; margin-bottom: 12px; }
.upload-text { font-size: 17px; color: #444; }
.upload-hint { font-size: 14px; color: #999; margin-top: 4px; }
.upload-hint a { color: #ff9900; text-decoration: none; font-weight: 600; }
.upload-hint a:hover { text-decoration: underline; }

/* Steps */
.steps { margin-top: 24px; }
.step {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; font-size: 14px; color: #555;
  border-bottom: 1px solid #f0f0f0;
}
.step:last-child { border-bottom: none; }
.step-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: #ff9900; color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.step code {
  background: #f0f0f0; padding: 2px 6px; border-radius: 4px;
  font-size: 12px; color: #666;
}

/* Results */
.results-card { display: none; }
.results-header { margin-bottom: 24px; }
.results-header h2 { font-size: 20px; }
#highlight-count { color: #888; font-size: 14px; margin-top: 2px; }
.results-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px;
}
.btn {
  padding: 10px 20px; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.btn-export {
  background: #ff9900; color: #fff;
}
.btn-export:hover { background: #e88a00; transform: translateY(-1px); }
.btn-small {
  padding: 8px 16px; font-size: 13px; background: #f0f0f0; color: #555;
  margin-top: 8px;
}
.btn-small:hover { background: #e0e0e0; }

/* Book List */
.book-item {
  border: 1px solid #eee;
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}
.book-header {
  padding: 14px 18px;
  background: #fafaf8;
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; font-size: 15px;
}
.book-header:hover { background: #f5f3f0; }
.book-count { font-weight: 400; color: #999; font-size: 13px; }
.book-body { padding: 0 18px 18px; display: none; }
.book-item.open .book-body { display: block; }

/* Highlight Card */
.highlight-card {
  padding: 14px 0; border-bottom: 1px solid #f0f0f0;
}
.highlight-card:last-child { border-bottom: none; }
.highlight-text {
  font-size: 14px; color: #333; line-height: 1.7;
  padding: 8px 12px; background: #fffdf5; border-left: 3px solid #ffd700;
  border-radius: 4px; margin-bottom: 6px;
}
.highlight-meta { font-size: 12px; color: #999; display: flex; gap: 12px; flex-wrap: wrap; }
.highlight-note {
  margin-top: 6px; font-size: 13px; color: #555;
  padding: 6px 10px; background: #f0f8ff; border-radius: 4px;
}
.highlight-note::before { content: "📝 "; }

/* Example Card */
.example-card { text-align: center; }
.example-text { font-size: 14px; color: #888; margin-bottom: 12px; }
.btn-sample {
  padding: 10px 24px; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  background: #f0f0f0; color: #555; transition: all .15s;
}
.btn-sample:hover { background: #e0e0e0; transform: translateY(-1px); }

/* Footer */
.footer { text-align: center; padding: 32px 0 16px; }
.footer p { font-size: 13px; color: #bbb; }
.footer-small { font-size: 12px; color: #ddd; margin-top: 4px; }

/* Back link */
.back-link { font-size: 13px; margin-top: 8px; }
.back-link a { color: #ff9900; text-decoration: none; }
.back-link a:hover { text-decoration: underline; }

/* PRO Card */
.pro-card { background: linear-gradient(135deg, #fef3c7, #fde68a); border: 1px solid #f59e0b; display: block; }
.pro-header { display: flex; align-items: center; gap: 12px; }
.pro-badge-large {
  background: #f59e0b; color: #fff; font-weight: 800; font-size: 12px;
  padding: 4px 10px; border-radius: 6px; letter-spacing: .5px;
}
.pro-header span:nth-child(2) { flex: 1; font-size: 14px; color: #92400e; font-weight: 500; }
.btn-pro { background: #f59e0b; color: #fff; }
.btn-pro:hover { background: #d97706; }

/* Free hint */
.free-hint { font-size: 12px; color: #999; margin-top: 8px; }
.free-hint a { color: #f59e0b; text-decoration: none; font-weight: 600; cursor: pointer; }

/* Modal */
.modal-overlay {
  position: fixed; top:0; left:0; right:0; bottom:0;
  background: rgba(0,0,0,.4); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: #fff; border-radius: 16px; padding: 32px;
  width: 480px; max-width: 90vw; position: relative;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; font-size: 20px; cursor: pointer; color: #999;
}
.modal h2 { font-size: 20px; margin-bottom: 16px; }
.compare-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 13px; }
.compare-table th { background: #f9fafb; padding: 8px 12px; }
.compare-table td { padding: 8px 12px; border-bottom: 1px solid #f3f4f6; }
.pro-price { font-size: 24px; font-weight: 800; color: #f59e0b; text-align: center; margin-bottom: 12px; }
.pro-price-sub { font-size: 14px; font-weight: 400; color: #999; }
.license-row { display: flex; gap: 8px; }
.license-row input {
  flex: 1; padding: 10px 14px; border: 1px solid #d0d5dd; border-radius: 8px;
  font-size: 14px; outline: none;
}
.license-row input:focus { border-color: #f59e0b; }
.pro-hint { font-size: 12px; color: #aaa; text-align: center; margin-top: 8px; }
.pro-hint a { color: #f59e0b; }

/* Status Messages */
.loading { text-align: center; color: #888; padding: 20px; }
.error { color: #d32f2f; background: #fef2f2; padding: 12px; border-radius: 8px; margin: 12px 0; }
.success { color: #2e7d32; background: #f1f9f1; padding: 12px; border-radius: 8px; }
