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

#app {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px;
}

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

#calc-title {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
  text-align: center;
  margin: 0 0 6px 0;
}

#calc-subtitle {
  font-size: 14px;
  color: #888;
  text-align: center;
  margin: 0 0 24px 0;
}

.tabs {
  display: flex;
  background: #f0f2f5;
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 20px;
}

.tabs.sub-tabs {
  margin-bottom: 16px;
  background: #f7f8fa;
}

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #666;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: #333;
}

.tab-btn.active {
  background: #2196F3;
  color: #fff;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.calc-panel {
  display: none;
}

.calc-panel.active {
  display: block;
}

.sub-panel {
  display: none;
}

.sub-panel.active {
  display: block;
}

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

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

.input-group input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  color: #333;
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.input-group input:focus {
  border-color: #2196F3;
}

.input-group input::placeholder {
  color: #bbb;
}

.btn-calc {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #2196F3, #1976D2);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 20px;
}

.btn-calc:hover {
  background: linear-gradient(135deg, #1E88E5, #1565C0);
  box-shadow: 0 4px 14px rgba(33, 150, 243, 0.35);
  transform: translateY(-1px);
}

.btn-calc:active {
  transform: translateY(0);
}

#result-area {
  background: #f8fafc;
  border: 1px solid #e8ecf1;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  margin-bottom: 24px;
}

#result-label {
  font-size: 13px;
  color: #999;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#result-value {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
  word-break: break-all;
  margin-bottom: 8px;
  min-height: 36px;
  line-height: 1.3;
}

#result-notation {
  font-size: 13px;
  color: #777;
  margin-bottom: 14px;
  min-height: 18px;
}

.btn-copy {
  padding: 8px 20px;
  border: 2px solid #2196F3;
  border-radius: 6px;
  background: transparent;
  color: #2196F3;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy:hover {
  background: #2196F3;
  color: #fff;
}

#history-area {
  border-top: 1px solid #e8ecf1;
  padding-top: 20px;
}

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

#history-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.btn-clear {
  padding: 6px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: #999;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-clear:hover {
  background: #ff5252;
  border-color: #ff5252;
  color: #fff;
}

#history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 240px;
  overflow-y: auto;
}

.history-item {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f2f5;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  transition: background 0.15s ease;
  word-break: break-all;
}

.history-item:hover {
  background: #f0f7ff;
}

.history-item:last-child {
  border-bottom: none;
}

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-8px);
}

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

#__fork button {
  padding: 10px 24px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#__fork button:hover {
  background: #f5f5f5;
  color: #333;
}

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

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

#features p {
  font-size: 15px;
  color: #555;
  line-height: 1.8;
}

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

#scenarios li {
  font-size: 15px;
  color: #555;
  line-height: 1.8;
  margin-bottom: 6px;
}

#FAQ dl {
  margin: 0;
}

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

#FAQ dd {
  font-size: 14px;
  color: #666;
  line-height: 1.7;
  margin-left: 0;
  margin-bottom: 8px;
}

@media (max-width: 480px) {
  #calculator {
    padding: 20px 16px;
    border-radius: 8px;
  }

  #calc-title {
    font-size: 22px;
  }

  #result-value {
    font-size: 22px;
  }

  .tab-btn {
    font-size: 13px;
    padding: 8px 10px;
  }

  .input-group input {
    font-size: 14px;
    padding: 10px 12px;
  }

  .btn-calc {
    padding: 12px 20px;
    font-size: 15px;
  }
}
