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

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

#app h1 {
  text-align: center;
  font-size: 1.6rem;
  color: #1a1a2e;
  margin-bottom: 24px;
}

#calculator {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  padding: 24px;
}

.input-group {
  margin-bottom: 18px;
}

.input-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}

.input-wrapper {
  display: flex;
  align-items: center;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.input-wrapper:focus-within {
  border-color: #2563eb;
}

.input-wrapper input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 14px;
  font-size: 1rem;
  color: #1a1a2e;
  background: transparent;
  min-width: 0;
}

.input-wrapper .unit {
  flex-shrink: 0;
  padding: 0 14px;
  font-size: 0.9rem;
  color: #666;
  background: #f5f7fa;
  height: 100%;
  display: flex;
  align-items: center;
  min-height: 46px;
}

.term-input {
  padding-right: 0;
}

.term-toggle {
  display: flex;
  flex-shrink: 0;
  margin-right: 2px;
}

.term-btn {
  border: none;
  background: #f0f2f5;
  color: #666;
  padding: 8px 16px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.term-btn:first-child {
  border-radius: 4px 0 0 4px;
}

.term-btn:last-child {
  border-radius: 0 4px 4px 0;
}

.term-btn.active {
  background: #2563eb;
  color: #fff;
}

.term-btn:hover:not(.active) {
  background: #e0e3e8;
}

#btn-group {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.btn-primary {
  flex: 1;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background: #2563eb;
  color: #fff;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-primary:active {
  background: #1e40af;
}

.btn-secondary {
  flex: 1;
  padding: 12px 24px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
  color: #333;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #f5f7fa;
}

.btn-secondary:active {
  background: #e8ebf0;
}

#result-area {
  display: none;
  margin-bottom: 24px;
}

.result-card {
  background: #f8fafc;
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  border: 1px solid #e5e7eb;
}

.result-card.highlight {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: none;
  margin-bottom: 12px;
}

.result-card.highlight .result-label {
  color: rgba(255, 255, 255, 0.85);
}

.result-card.highlight .result-value {
  color: #fff;
}

.result-card.highlight .result-unit {
  color: rgba(255, 255, 255, 0.75);
}

.result-label {
  display: block;
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 6px;
}

.result-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a2e;
}

.result-unit {
  font-size: 1rem;
  color: #666;
  margin-left: 4px;
}

.result-row {
  display: flex;
  gap: 12px;
}

.result-row .result-card {
  flex: 1;
}

.result-row .result-value {
  font-size: 1.4rem;
}

#schedule-area {
  display: none;
}

#schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

#schedule-header h3 {
  font-size: 1.1rem;
  color: #1a1a2e;
  margin: 0;
}

#schedule-header .btn-secondary {
  flex: none;
  padding: 8px 16px;
  font-size: 0.85rem;
}

#schedule-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

#schedule-table thead {
  background: #f0f4ff;
}

#schedule-table th {
  padding: 10px 12px;
  text-align: right;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  border-bottom: 2px solid #2563eb;
}

#schedule-table th:first-child {
  text-align: center;
}

#schedule-table td {
  padding: 8px 12px;
  text-align: right;
  border-bottom: 1px solid #eee;
  white-space: nowrap;
}

#schedule-table td:first-child {
  text-align: center;
  color: #888;
}

#schedule-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

#schedule-table tbody tr:hover {
  background: #f0f4ff;
}

#schedule-table tbody tr:last-child td {
  border-bottom: none;
}

.empty-tip {
  text-align: center !important;
  color: #aaa;
  padding: 32px 12px !important;
}

#schedule-summary {
  text-align: right;
  margin-top: 12px;
  font-size: 0.85rem;
  color: #666;
}

#schedule-summary strong {
  color: #2563eb;
}

#__fork {
  text-align: center;
  margin: 24px 0;
}

#__fork button {
  padding: 10px 28px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  color: #555;
  transition: background 0.2s;
}

#__fork button:hover {
  background: #f5f7fa;
}

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

#features h2,
#scenarios h2,
#FAQ h2 {
  font-size: 1.2rem;
  color: #1a1a2e;
  margin-bottom: 12px;
}

#features p {
  font-size: 0.92rem;
  line-height: 1.7;
  color: #555;
}

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

#scenarios li {
  font-size: 0.92rem;
  line-height: 1.7;
  color: #555;
  margin-bottom: 6px;
}

#FAQ dl {
  margin: 0;
}

#FAQ dt {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
  margin-top: 14px;
}

#FAQ dd {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #666;
  margin-left: 0;
  padding-left: 12px;
  border-left: 3px solid #2563eb;
}

.page-info {
  text-align: center;
  padding: 20px;
  font-size: 0.82rem;
  color: #999;
}

.page-info a {
  color: #2563eb;
  text-decoration: none;
}

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

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

  #app h1 {
    font-size: 1.35rem;
    margin-bottom: 18px;
  }

  #calculator {
    padding: 16px;
    border-radius: 10px;
  }

  .result-row {
    flex-direction: column;
    gap: 8px;
  }

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

  .result-row .result-value {
    font-size: 1.2rem;
  }

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

  #btn-group {
    flex-direction: column;
  }
}
