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

body {
  width: 380px;
  min-height: 200px;
  background-color: #0f1117;
  color: #e2e8f0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid #2d3748;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-title h1 {
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
}

.header-icon {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.settings-btn {
  background: none;
  border: none;
  color: #718096;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  font-size: 18px;
  transition: color 0.2s, background 0.2s;
  line-height: 1;
}

.settings-btn:hover {
  color: #e2e8f0;
  background: #2d3748;
}

/* Search area */
.search-area {
  padding: 16px;
}

.input-wrapper {
  position: relative;
  margin-bottom: 8px;
}

.model-input {
  width: 100%;
  background: #1e2330;
  border: 1px solid #2d3748;
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 16px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s;
  letter-spacing: 0.5px;
}

.model-input::placeholder {
  color: #4a5568;
}

.model-input:focus {
  border-color: #3b82f6;
}

.maker-badge {
  display: none;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #a0aec0;
}

.maker-badge.visible {
  display: flex;
}

.maker-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
}

.maker-badge-text {
  color: #4ade80;
  font-weight: 500;
}

.search-btn {
  width: 100%;
  background: #3b82f6;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.3px;
}

.search-btn:hover {
  background: #2563eb;
}

.search-btn:active {
  transform: scale(0.98);
}

.search-btn:disabled {
  background: #374151;
  color: #6b7280;
  cursor: not-allowed;
  transform: none;
}

/* Loading */
.loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 16px;
}

.loading.visible {
  display: flex;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #2d3748;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: #718096;
  font-size: 13px;
}

/* Error */
.error-area {
  display: none;
  margin: 0 16px 16px;
  padding: 12px 14px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 8px;
  color: #f87171;
  font-size: 13px;
  line-height: 1.5;
}

.error-area.visible {
  display: block;
}

.error-area a {
  color: #60a5fa;
  text-decoration: underline;
  cursor: pointer;
}

/* Result */
.result-area {
  display: none;
  padding: 0 16px 16px;
}

.result-area.visible {
  display: block;
}

.product-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 14px;
  background: #1e2330;
  border: 1px solid #2d3748;
  border-radius: 10px;
}

.product-image-wrap {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  background: #1a2a40;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ac-icon {
  width: 76px;
  height: 76px;
}

.product-info {
  flex: 1;
  min-width: 0;
}

.product-maker {
  font-size: 11px;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.product-model {
  font-size: 18px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 4px;
  word-break: break-all;
}

.product-meta {
  font-size: 12px;
  color: #a0aec0;
}

.product-year {
  display: inline-block;
  background: #3b82f6;
  color: #fff;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
}

/* Size tables */
.size-section {
  margin-bottom: 12px;
}

.size-section-title {
  font-size: 12px;
  font-weight: 600;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.size-section-title .copy-btn:first-of-type {
  margin-left: auto;
}

.copy-btn {
  background: #1e2330;
  border: 1px solid #2d3748;
  border-radius: 5px;
  color: #a0aec0;
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  white-space: nowrap;
}

.copy-btn:hover:not(:disabled) {
  background: #2d3748;
  color: #e2e8f0;
  border-color: #4a5568;
}

.copy-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.copy-btn.copied {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.4);
  color: #4ade80;
}

.size-section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 12px;
  background: #3b82f6;
  border-radius: 2px;
}

.size-table {
  width: 100%;
  border-collapse: collapse;
  background: #1e2330;
  border: 1px solid #2d3748;
  border-radius: 8px;
  overflow: hidden;
}

.size-table th,
.size-table td {
  padding: 9px 12px;
  text-align: center;
  border-bottom: 1px solid #2d3748;
}

.size-table tr:last-child th,
.size-table tr:last-child td {
  border-bottom: none;
}

.size-table thead th {
  background: #252d3d;
  color: #718096;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.size-table tbody td {
  color: #e2e8f0;
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.size-table tbody td .unit {
  font-size: 11px;
  color: #718096;
  margin-left: 1px;
}

.size-null {
  color: #4a5568 !important;
  font-size: 13px !important;
}

/* 区分列 */
.col-kubun {
  text-align: left !important;
  font-size: 11px !important;
  color: #718096 !important;
  font-weight: 500 !important;
  white-space: nowrap;
}

/* Source link */
.source-link-wrap {
  margin-top: 12px;
  text-align: right;
}

.source-link {
  color: #3b82f6;
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.source-link:hover {
  color: #60a5fa;
  text-decoration: underline;
}


/* Options page */
.options-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 24px 20px;
}

.options-title {
  font-size: 18px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 6px;
}

.options-subtitle {
  font-size: 13px;
  color: #718096;
  margin-bottom: 24px;
  line-height: 1.5;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #a0aec0;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: #1e2330;
  border: 1px solid #2d3748;
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.2s;
  font-family: monospace;
  letter-spacing: 0.5px;
}

.form-input:focus {
  border-color: #3b82f6;
}

.form-input::placeholder {
  color: #4a5568;
}

.save-btn {
  width: 100%;
  background: #3b82f6;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 11px;
  cursor: pointer;
  transition: background 0.2s;
}

.save-btn:hover {
  background: #2563eb;
}

.feedback {
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
}

.feedback.success {
  display: block;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #4ade80;
}

.feedback.error {
  display: block;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #f87171;
}

.key-display {
  margin-top: 16px;
  padding: 10px 12px;
  background: #1e2330;
  border: 1px solid #2d3748;
  border-radius: 8px;
  font-size: 12px;
  color: #718096;
}

.key-display span {
  font-family: monospace;
  color: #a0aec0;
}

.options-info {
  margin-top: 20px;
  padding: 12px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  font-size: 12px;
  color: #718096;
  line-height: 1.6;
}

.options-info a {
  color: #3b82f6;
  text-decoration: none;
}

.options-info a:hover {
  text-decoration: underline;
}
