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

/* App 容器 */
#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px;
  box-sizing: border-box;
}

#app-title {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: #1a73e8;
  margin: 0 0 24px 0;
}

/* 输入区域 */
.input-area {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

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

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

.input-group input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #dadce0;
  border-radius: 8px;
  font-size: 16px;
  font-family: Consolas, Monaco, monospace;
  color: #333333;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
  outline: none;
}

.input-group input[type="number"]:focus {
  border-color: #1a73e8;
}

.input-group input[type="number"]::placeholder {
  color: #9aa0a6;
  font-size: 14px;
}

/* 选项快捷标签 */
.option-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  background: #f0f0f0;
  border-radius: 10px;
  padding: 4px;
}

.option-tab {
  flex: 1;
  padding: 10px 6px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #5f6368;
  transition: all 0.25s ease;
}

.option-tab:hover {
  color: #1a73e8;
}

.option-tab.active {
  background: #ffffff;
  color: #1a73e8;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* 自定义输入行 */
.custom-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.custom-input-row input[type="number"] {
  flex: 1;
  padding: 10px 12px;
  border: 2px solid #dadce0;
  border-radius: 8px;
  font-size: 15px;
  font-family: Consolas, Monaco, monospace;
  color: #333333;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
  outline: none;
}

.custom-input-row input[type="number"]:focus {
  border-color: #1a73e8;
}

.custom-input-row input[type="number"]::placeholder {
  color: #9aa0a6;
  font-size: 13px;
}

.custom-input-row label {
  font-size: 14px;
  color: #5f6368;
  white-space: nowrap;
  margin-bottom: 0;
}

.custom-input-row span {
  font-size: 14px;
  color: #5f6368;
  white-space: nowrap;
}

/* 辅助显示 */
.aux-display {
  display: block;
  font-size: 14px;
  color: #5f6368;
  margin-top: 6px;
}

.aux-display span {
  color: #1a73e8;
  font-weight: 600;
  font-family: Consolas, Monaco, monospace;
}

.aux-info {
  display: block;
  font-size: 12px;
  color: #9aa0a6;
  margin-top: 4px;
}

.aux-info.user-edited {
  color: #e37400;
}

/* 错误提示 */
.error-text {
  display: block;
  color: #d93025;
  font-size: 12px;
  margin-top: 4px;
}

/* 计算按钮 */
.calc-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: #1a73e8;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calc-btn:hover {
  background: #1557b0;
  transform: scale(1.01);
}

.calc-btn:active {
  transform: scale(0.99);
}

/* 结果区域 */
.result-area {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.result-item {
  display: flex;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid #e8eaed;
  gap: 8px;
}

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

.result-item-primary {
  background: #e8f0fe;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
  border-bottom: none;
}

.result-label {
  font-size: 14px;
  color: #5f6368;
  white-space: nowrap;
}

.result-item-primary .result-label {
  font-size: 16px;
  font-weight: 600;
  color: #333333;
}

.result-value {
  font-size: 28px;
  font-weight: 700;
  color: #1a73e8;
  font-family: Consolas, Monaco, monospace;
  margin-left: auto;
}

.result-value-secondary {
  font-size: 18px;
  font-weight: 600;
  color: #333333;
  font-family: Consolas, Monaco, monospace;
  margin-left: auto;
}

.result-unit {
  font-size: 13px;
  color: #9aa0a6;
  white-space: nowrap;
}

.result-item-primary .result-unit {
  font-size: 14px;
  color: #5f6368;
}

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

.copy-btn:hover {
  background: #e8f0fe;
}

.copy-feedback {
  margin-left: 12px;
  color: #188038;
  font-size: 14px;
  font-weight: 500;
}

/* 历史记录区域 */
.history-area {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

#history-title {
  font-size: 16px;
  font-weight: 600;
  color: #333333;
  margin: 0 0 12px 0;
}

.history-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px 0;
}

.history-item {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  border-radius: 8px;
  transition: background 0.2s ease;
  font-size: 14px;
}

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

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

.history-expr {
  color: #5f6368;
}

.history-equals {
  margin: 0 4px;
  color: #333333;
  font-weight: 600;
}

.history-value {
  color: #1a73e8;
  font-weight: 600;
  font-family: Consolas, Monaco, monospace;
}

.clear-history-btn {
  padding: 6px 16px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  background: #ffffff;
  color: #9aa0a6;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

/* 工具类 */
.hidden {
  display: none;
}

/* 响应式设计 */
@media (max-width: 480px) {
  #app {
    padding: 16px 12px;
  }

  #app-title {
    font-size: 22px;
    margin-bottom: 16px;
  }

  .option-tabs {
    gap: 2px;
    padding: 3px;
  }

  .option-tab {
    padding: 8px 4px;
    font-size: 12px;
  }

  .input-area {
    padding: 14px;
  }

  .input-group input[type="number"] {
    padding: 10px 12px;
    font-size: 15px;
  }

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

  .result-value {
    font-size: 24px;
  }

  .result-value-secondary {
    font-size: 16px;
  }

  .result-item-primary {
    padding: 10px 12px;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  #app {
    padding: 20px 16px;
  }

  #app-title {
    font-size: 24px;
  }

  .option-tab {
    font-size: 13px;
    padding: 9px 6px;
  }
}
