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

#app {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: 24px;
}

#calc-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a73e8;
  margin: 0 0 20px 0;
}

.input-section {
  margin-bottom: 20px;
}

#input-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 8px;
}

.value-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1.5rem;
  font-family: Consolas, "Courier New", monospace;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.value-input:focus {
  border-color: #1a73e8;
}

.value-input.error {
  border-color: #d93025;
}

.error-text {
  display: block;
  color: #d93025;
  font-size: 0.82rem;
  min-height: 20px;
  margin-top: 4px;
  text-align: center;
}

.unit-section {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 20px;
}

.unit-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.unit-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.unit-select {
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: #333;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  min-height: 44px;
  appearance: auto;
}

.unit-select:focus {
  border-color: #1a73e8;
}

.swap-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 2px;
}

.swap-btn {
  width: 44px;
  height: 44px;
  border: 2px solid #e0e0e0;
  border-radius: 50%;
  background: #fff;
  font-size: 1.3rem;
  color: #1a73e8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  min-height: 44px;
}

.swap-btn:hover {
  border-color: #1a73e8;
  background: #f0f5ff;
  transform: rotate(180deg);
}

.result-section {
  background: #f8faff;
  border: 1px solid #e8edf5;
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  margin-bottom: 16px;
}

#result-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.result-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: #1a73e8;
  font-family: Consolas, "Courier New", monospace;
  word-break: break-all;
  min-height: 42px;
  line-height: 1.3;
}

.result-expression {
  display: block;
  font-size: 0.85rem;
  color: #777;
  margin-top: 6px;
  font-family: Consolas, "Courier New", monospace;
  word-break: break-all;
}

.precision-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

#precision-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
}

.precision-select {
  flex: 1;
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: #333;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  min-height: 44px;
  appearance: auto;
}

.precision-select:focus {
  border-color: #1a73e8;
}

.action-section {
  display: flex;
  justify-content: center;
}

.secondary-btn {
  padding: 10px 32px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: #555;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}

.secondary-btn:hover {
  border-color: #d93025;
  color: #d93025;
}

#reference-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
  margin: 0 0 14px 0;
}

.reference-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.reference-table th {
  text-align: left;
  padding: 10px 12px;
  background: #f5f7fa;
  color: #555;
  font-weight: 600;
  border-bottom: 2px solid #e0e0e0;
}

.reference-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
}

.reference-table tr:last-child td {
  border-bottom: none;
}

.ref-relation {
  font-family: Consolas, "Courier New", monospace;
  color: #333;
  font-weight: 500;
}

.ref-note {
  color: #888;
  font-size: 0.82rem;
}

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

#features h2, #scenarios h2, #FAQ h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
  margin: 0 0 8px 0;
}

#features p, #scenarios li, #FAQ dd {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.7;
}

#scenarios ul {
  padding-left: 20px;
  margin: 0;
}

#scenarios li {
  margin-bottom: 8px;
}

#FAQ dl {
  margin: 0;
}

#FAQ dt {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  margin-top: 12px;
}

#FAQ dd {
  margin: 4px 0 0 0;
}

#__fork {
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 16px;
  text-align: center;
}

@media (max-width: 768px) {
  #app {
    padding: 12px;
    gap: 12px;
  }

  .card {
    padding: 16px;
    border-radius: 8px;
  }

  #calc-title {
    font-size: 1.3rem;
    margin-bottom: 16px;
  }

  .value-input {
    font-size: 1.3rem;
    padding: 12px 14px;
  }

  .result-value {
    font-size: 1.6rem;
  }

  .unit-section {
    gap: 8px;
  }

  .unit-select {
    font-size: 0.88rem;
    padding: 8px 10px;
  }
}
