/* 全局样式 */
body {
    background-color: #f8f9fa;
    color: #333;
}

/* 标题样式 */
h1, h2, h3, h4 {
    font-weight: 600;
}

/* 手机端样式优化 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h4 {
        font-size: 1.2rem;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .input-group {
        margin-bottom: 5px;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.25rem 0.5rem;
    }
}

/* 卡片样式 */
.card {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border: none;
    margin-bottom: 20px;
}

.card-header {
    font-weight: 600;
}

/* 表单样式 */
.form-control:focus, .form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 表格样式 */
.table th {
    background-color: #f2f2f2;
    color: #333 !important;
    font-weight: 600;
}

.table thead th {
    background-color: #e9ecef !important;
    color: #333 !important;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
}

/* 计算页面表格表头特定样式 */
#standardsTable thead th,
#samplesTable thead th,
#referenceStandardsTable thead th {
    background-color: #e9ecef !important;
    color: #333 !important;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    border: 1px solid #dee2e6;
}

/* 按钮样式 */
.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* 结果区域样式 */
#resultsArea {
    padding: 20px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* 分式样式 */
.fraction {
    display: inline-block;
    vertical-align: middle;
    text-align: center;
    font-size: 1.1em;
}

.fraction .numerator {
    border-bottom: 1px solid #000;
    padding: 0 3px;
}

.fraction .denominator {
    padding: 0 3px;
}

/* 计算结果样式 */
.result-box {
    background-color: #f8f9fa;
    border-radius: 5px;
    padding: 15px;
    margin-top: 10px;
    border-left: 4px solid #28a745;
}

.equation {
    font-size: 1.2em;
    margin: 15px 0;
    font-weight: 500;
}

.calculation-step {
    margin-bottom: 10px;
    padding: 10px;
    background-color: #f2f2f2;
    border-radius: 5px;
}

.final-result {
    font-size: 1.3em;
    font-weight: 600;
    color: #28a745;
    margin-top: 20px;
    padding: 10px;
    border: 1px solid #28a745;
    border-radius: 5px;
    background-color: #f2fff7;
}

/* 数据卡片样式 */
.data-card {
  position: relative;
  border: 1px solid rgba(0,0,0,.125);
  border-radius: 0.25rem;
  padding: 16px;
  margin-bottom: 16px;
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

.data-card .card-number {
  position: absolute;
  top: 8px;
  left: 16px;
  font-weight: bold;
  background-color: #f8f9fa;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.data-card .btn-delete-item {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  font-size: 1rem;
  z-index: 10;
}

.data-card .form-group {
  margin-bottom: 12px;
}

.data-card .form-label {
  margin-bottom: 4px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* 移动设备上的表格替代样式 */
@media (max-width: 767.98px) {
  .mobile-cards-container {
    margin-top: 16px;
  }

  .table-responsive {
    display: none;
  }

  .data-cards-container {
    display: block;
  }

  .data-card .input-group {
    width: 100%;
  }

  .data-card .form-control,
  .data-card .form-select {
    font-size: 16px; /* 防止iOS缩放 */
    height: auto;
    padding: 8px 12px;
  }

  .data-card .input-group-text {
    font-size: 16px;
    padding: 8px 12px;
  }

  /* 隐藏桌面端按钮 */
  .desktop-buttons {
    display: none;
  }

  /* 确保移动端卡片容器可见 */
  .mobile-cards-container,
  #standardCards,
  #sampleCards,
  #std1SampleCards,
  #internalSampleCards,
  #refStandardCards {
    display: block !important;
  }

  /* 移动端卡片间距优化 */
  .data-card {
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }

  /* 移动端表单标签样式 */
  .data-card .form-label {
    color: #495057;
    font-weight: 600;
  }

  /* 移动端按钮样式优化 */
  .mobile-buttons {
    padding: 1rem 0;
  }

  .mobile-buttons .btn {
    min-width: 120px;
    font-weight: 600;
  }

  /* 移动端输入框组合样式 */
  .data-card .input-group .form-control {
    border-radius: 0.375rem 0 0 0.375rem;
  }

  .data-card .input-group .form-select {
    border-radius: 0 0.375rem 0.375rem 0;
  }

  /* 移动端卡片删除按钮样式 */
  .data-card .btn-delete-item {
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
}

/* 桌面设备上隐藏卡片 */
@media (min-width: 768px) {
  .data-cards-container {
    display: none;
  }

  .mobile-buttons {
    display: none;
  }
}

/* CDN管理页面移动端样式 */
@media (max-width: 767.98px) {
  /* CDN卡片样式 */
  .cdn-mobile-card {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
  }

  .cdn-mobile-card .card-title {
    font-size: 1rem;
    font-weight: 600;
  }

  .cdn-mobile-card .btn-group-sm .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
  }

  /* 移动端按钮组优化 */
  .cdn-mobile-card .btn-group {
    width: 100%;
  }

  .cdn-mobile-card .btn-group .btn {
    flex: 1;
  }

  /* 移动端表单按钮 */
  .cdn-mobile-card form {
    width: 100%;
  }

  /* 移动端优先级徽章 */
  .cdn-mobile-card .badge {
    font-size: 0.75rem;
  }

  /* 移动端URL显示 */
  .cdn-mobile-card .text-muted {
    font-size: 0.8rem;
    word-break: break-all;
  }
}