/* 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 8px 0;
}

#app-subtitle {
  text-align: center;
  font-size: 14px;
  color: #5f6368;
  margin: 0 0 24px 0;
}

/* 换算网格 */
.converter-grid {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

.converter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.converter-row:last-of-type {
  margin-bottom: 0;
}

.unit-group {
  flex: 1;
  min-width: 0;
}

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

.unit-group input {
  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;
}

.unit-group input:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}

.unit-group input::placeholder {
  color: #9aa0a6;
  font-size: 13px;
}

/* 行内交换图标 */
.swap-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #5f6368;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
  margin-top: 22px;
  user-select: none;
}

.swap-icon:hover {
  background: #e8f0fe;
  color: #1a73e8;
}

/* 操作按钮栏 */
.action-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.action-btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clear-btn {
  background: #f1f3f4;
  color: #5f6368;
}

.clear-btn:hover {
  background: #e8eaed;
  color: #333333;
}

.swap-all-btn {
  background: #1a73e8;
  color: #ffffff;
}

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

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

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

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

  #app-subtitle {
    font-size: 13px;
    margin-bottom: 16px;
  }

  .converter-grid {
    padding: 14px;
  }

  .converter-row {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
  }

  .swap-icon {
    margin-top: 0;
    transform: rotate(90deg);
  }

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

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

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

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

  .converter-grid {
    padding: 16px;
  }

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