/* ========================================
   简易双功能计算器 - 样式表
   ======================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

/* 头部样式 */
.header {
  text-align: center;
  color: white;
  margin-bottom: 30px;
}

.header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header p {
  font-size: 1rem;
  opacity: 0.9;
}

/* 卡片样式 */
.card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
}

/* 输入框样式 */
.input-group {
  margin-bottom: 16px;
}

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

.input-group input {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  transition: all 0.3s ease;
  outline: none;
}

.input-group input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.input-group input.error {
  border-color: #ef4444;
  background-color: #fef2f2;
}

.error-message {
  color: #ef4444;
  font-size: 0.8rem;
  margin-top: 4px;
  display: none;
}

.error-message.show {
  display: block;
}

/* 按钮样式 */
.button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.btn {
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #f5f5f5;
  color: #666;
}

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

.btn-reset {
  background: #fee2e2;
  color: #dc2626;
}

.btn-reset:hover {
  background: #fecaca;
}

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

/* 结果展示样式 */
.result-box {
  margin-top: 20px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-box .placeholder {
  color: #999;
  font-size: 0.95rem;
}

.result-box .result {
  font-size: 1.5rem;
  font-weight: 700;
}

.result-box .result.increase {
  color: #22c55e;
}

.result-box .result.decrease {
  color: #ef4444;
}

.result-box .result.no-change {
  color: #6b7280;
}

.result-box .result .unit {
  font-size: 1rem;
  font-weight: 500;
}

/* 批量输入区域样式 */
.batch-section {
  margin-top: 16px;
}

.batch-group {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  padding: 16px;
  background: #fafafa;
  border-radius: 10px;
  margin-bottom: 12px;
  border: 1px solid #eee;
}

.batch-group-title {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  font-weight: 600;
  color: #667eea;
  margin-bottom: 4px;
}

.batch-group input {
  padding: 10px 12px;
  font-size: 0.9rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.3s ease;
  outline: none;
}

.batch-group input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.batch-group input.error {
  border-color: #ef4444;
  background-color: #fef2f2;
}

.batch-results {
  margin-top: 16px;
}

.batch-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 8px;
}

.batch-result-item .group-label {
  font-weight: 600;
  color: #555;
}

.batch-result-item .result-text {
  font-weight: 600;
}

.batch-result-item .result-text.increase {
  color: #22c55e;
}

.batch-result-item .result-text.decrease {
  color: #ef4444;
}

.batch-result-item .result-text.no-change {
  color: #6b7280;
}

/* Tab 切换样式 */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: #f5f5f5;
  padding: 4px;
  border-radius: 10px;
}

.tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #666;
  transition: all 0.3s ease;
}

.tab.active {
  background: white;
  color: #667eea;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab:hover:not(.active) {
  color: #333;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.batch-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* 响应式布局 */
@media (max-width: 768px) {
  .batch-group {
    grid-template-columns: 1fr;
  }

  .button-group,
  .batch-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}
