html, body, main, header, footer {
  padding: 0px;
  margin: 0px;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px;
}

#app-header {
  text-align: center;
  margin-bottom: 24px;
}

#app-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 8px 0;
}

#app-subtitle {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

.card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.unit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.unit-row + .unit-row {
  margin-top: 4px;
}

.unit-row-active {
  border-color: #2563eb;
  background-color: #f0f7ff;
}

.unit-label {
  flex: 0 0 auto;
  width: 160px;
  font-size: 0.92rem;
  font-weight: 500;
  color: #475569;
  white-space: nowrap;
}

.input-group {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 8px;
}

.unit-input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  color: #1e293b;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.unit-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: #ffffff;
}

.unit-input.input-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.copy-btn {
  flex: 0 0 auto;
  height: 42px;
  padding: 0 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  color: #475569;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.copy-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.copy-btn.copied {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}

#action-bar {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.action-btn {
  flex: 1;
  height: 44px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

#reference-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 12px 0;
}

#reference-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

#reference-table th,
#reference-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

#reference-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
}

#reference-table td {
  color: #334155;
}

#reference-table tbody tr:hover {
  background: #f8fafc;
}

#__fork {
  text-align: center;
  padding: 16px 0;
}

#__fork button {
  padding: 10px 28px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  color: #64748b;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

#__fork button:hover {
  background: #f1f5f9;
  color: #475569;
}

#features,
#scenarios,
#FAQ {
  max-width: 720px;
  margin: 0 auto 24px auto;
  padding: 0 16px;
}

#features h2,
#scenarios h2,
#FAQ h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 12px 0;
}

#features p {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.7;
  margin: 0;
}

#scenarios ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#scenarios li {
  font-size: 0.93rem;
  color: #475569;
  line-height: 1.7;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
}

#scenarios li:last-child {
  border-bottom: none;
}

#scenarios li strong {
  color: #2563eb;
}

#FAQ dl {
  margin: 0;
}

#FAQ dt {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  margin-top: 12px;
}

#FAQ dd {
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.7;
  margin: 4px 0 0 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.page-info {
  text-align: center;
  font-size: 0.85rem;
  color: #94a3b8;
  padding: 20px 16px;
}

.page-info a {
  color: #64748b;
  text-decoration: none;
}

.page-info a:hover {
  color: #2563eb;
}

@media (max-width: 639px) {
  .unit-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 12px 10px;
  }

  .unit-label {
    width: auto;
    font-size: 0.85rem;
  }

  .input-group {
    flex-direction: row;
  }

  .unit-input {
    height: 44px;
    font-size: 1rem;
  }

  .copy-btn {
    height: 44px;
    padding: 0 14px;
    font-size: 0.8rem;
  }

  #app-title {
    font-size: 1.4rem;
  }

  #action-bar {
    flex-direction: column;
  }

  #reference-table th,
  #reference-table td {
    padding: 8px 6px;
    font-size: 0.8rem;
  }
}
