/* 热交换器计算器样式表 */

* {
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #333;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
  min-height: 100vh;
}

/* 头部样式 */
header {
  background-color: white;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo img {
  height: 50px;
  width: auto;
}

.logo h1 {
  margin: 0;
  color: #2196F3;
  font-size: 24px;
}

.logo small {
  display: block;
  color: #666;
  font-size: 12px;
  margin-top: 2px;
}

/* 导航样式 */
nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 20px;
}

nav > ul > li {
  position: relative;
}

nav a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 4px;
  transition: background-color 0.3s;
  display: block;
}

nav a:hover {
  background-color: #f0f0f0;
}

/* 下拉菜单样式 */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  min-width: 220px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  border-radius: 8px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  list-style: none;
  border: 1px solid #e0e0e0;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li {
  margin: 0;
}

.dropdown-menu a {
  color: #333;
  padding: 12px 20px;
  border-radius: 0;
  font-weight: 400;
  border-bottom: 1px solid #f5f5f5;
}

.dropdown-menu a:hover {
  background: #f8f9fa;
  color: #2196F3;
}

.dropdown-menu li:last-child a {
  border-bottom: none;
}

/* 语言选择器样式 */
.language-selector {
  position: relative;
}

.dropdown {
  position: relative;
}

.dropdown-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  font-size: 14px;
}

.dropdown-btn:hover {
  background-color: #f9f9f9;
}

.dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  min-width: 200px;
  z-index: 1000;
  display: none;
}

.dropdown-content.show {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  text-decoration: none;
  color: #333;
  border-bottom: 1px solid #eee;
}

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

.dropdown-item:hover {
  background-color: #f9f9f9;
}

.dropdown-item.active {
  background-color: #e3f2fd;
  color: #2196F3;
}

/* 底部样式 */
footer {
  background-color: #333;
  color: white;
  margin-top: 50px;
  padding: 40px 0 20px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-section h3 {
  color: #2196F3;
  margin-bottom: 15px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid #555;
  margin-top: 30px;
  padding-top: 20px;
  text-align: center;
  color: #ccc;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

.footer-meta {
  margin-top: 10px;
  font-size: 14px;
}

.logo {
  height: 60px;
  margin-right: 20px;
}

h1 {
  margin: 0;
  color: #2196F3;
}

.version {
  position: absolute;
  right: 0;
  top: 10px;
  font-size: 14px;
  color: #666;
  background-color: #f0f0f0;
  padding: 3px 8px;
  border-radius: 4px;
}

.info-box {
  background-color: #e3f2fd;
  border-left: 4px solid #2196F3;
  padding: 10px 15px;
  margin-bottom: 20px;
  font-size: 14px;
  color: #333;
  border-radius: 0 4px 4px 0;
}

/* Tooltip styles removed to prevent getBoundingClientRect errors */

/* 主容器布局 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.calculator-container {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

.input-section, .results-section {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.input-section {
  flex: 1;
  min-width: 300px;
}

.results-section {
  flex: 2;
  min-width: 500px;
}

.section-title {
  color: #2196F3;
  margin-bottom: 20px;
  font-size: 20px;
}

.form-group {
  margin-bottom: 15px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

input, select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.fluid-params {
  display: flex;
  gap: 10px;
}

.fluid-params > div {
  flex: 1;
}

.buttons {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}

#calculate {
  background-color: #2196F3;
  color: white;
}

#calculate:hover {
  background-color: #0b7dda;
}

#reset {
  background-color: #f44336;
  color: white;
}

#reset:hover {
  background-color: #d32f2f;
}

.results-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.result-group {
  flex: 1;
  min-width: 200px;
  background-color: #f9f9f9;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.result-group h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #2196F3;
  font-size: 16px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
}

.result-item {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
}

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

.result-label {
  font-weight: bold;
  margin-right: 10px;
  flex: 1;
}

/* 可视化部分样式 */
.visualization-container {
  margin-top: 30px;
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tabs-container {
  margin-top: 20px;
}

.tab-buttons {
  display: flex;
  border-bottom: 1px solid #ddd;
  margin-bottom: 20px;
  gap: 5px;
}

.tab-button {
  padding: 12px 20px;
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  background-color: #f5f5f5;
  color: #666;
  font-size: 14px;
  transition: all 0.3s;
}

.tab-button:hover {
  background-color: #e9e9e9;
  color: #333;
}

.tab-button.active {
  background-color: white;
  border-color: #ddd;
  border-bottom-color: white;
  margin-bottom: -1px;
  color: #2196F3;
  font-weight: 500;
}

.tab-content {
  display: none;
  padding: 20px;
  background-color: #fafafa;
  border-radius: 4px;
  min-height: 300px;
}

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

.tab-content h4 {
  text-align: center;
  color: #666;
  margin: 50px 0;
  font-size: 16px;
}

#3d-view, #flow-diagram, #performance-chart {
  width: 100%;
  min-height: 400px;
}

.model-container, .diagram-container, .chart-container, .profile-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.model-image, .diagram-image, .chart-image, .profile-image {
  width: 100%;
  max-width: 600px;
  margin-bottom: 20px;
}

.model-info, .chart-description, .profile-description {
  width: 100%;
  max-width: 600px;
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 4px;
  border-left: 4px solid #2196F3;
}

.profile-description {
  font-size: 14px;
  line-height: 1.5;
}

.svg-model {
  width: 100%;
  height: 300px;
}

.tooltip-popup {
  position: absolute;
  background-color: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 1000;
  max-width: 250px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.tooltip-popup::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 10px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid #333;
}

/* 手动面积输入样式 */
.manual-area-input {
  margin-top: 20px;
  padding: 15px;
  background-color: #f0f8ff;
  border: 1px solid #2196F3;
  border-radius: 4px;
}

.manual-area-input .form-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.manual-area-input label {
  margin-bottom: 0;
  white-space: nowrap;
}

.manual-area-input input {
  flex: 1;
  max-width: 150px;
}

.manual-area-input button {
  background-color: #4CAF50;
  color: white;
  padding: 8px 16px;
  font-size: 14px;
}

.manual-area-input button:hover {
  background-color: #45a049;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  nav ul {
    justify-content: center;
  }
  
  .calculator-container {
    flex-direction: column;
  }
  
  .input-section, .results-section {
    width: 100%;
    min-width: auto;
  }
  
  .results-container {
    flex-direction: column;
  }
  
  .result-group {
    width: 100%;
  }
  
  .fluid-params {
    flex-direction: column;
  }
  
  .tab-buttons {
    flex-wrap: wrap;
  }
  
  .tab-button {
    flex: 1;
    min-width: 120px;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 20px;
  }
  
  .manual-area-input .form-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .manual-area-input input {
    max-width: none;
  }
}

/* 错误处理和加载状态 */
.loading {
  text-align: center;
  padding: 20px;
  color: #666;
}

.error {
  background-color: #ffebee;
  color: #c62828;
  padding: 10px;
  border-radius: 4px;
  border-left: 4px solid #f44336;
  margin: 10px 0;
}

.success {
  background-color: #e8f5e8;
  color: #2e7d32;
  padding: 10px;
  border-radius: 4px;
  border-left: 4px solid #4caf50;
  margin: 10px 0;
}

/* 隐藏不必要的元素 */
.language-links {
  display: none !important;
}
