/* 
   Concrete Calculator Pro - Main Stylesheet
   Modern, responsive design with clean interface
   Optimized for readability and usability
*/

:root {
  --primary-color: #2c6fbd;
  --primary-dark: #1b5195;
  --primary-light: #4b8ed9;
  --secondary-color: #34c759;
  --text-color: #333333;
  --text-light: #666666;
  --light-gray: #f5f5f7;
  --medium-gray: #e0e0e0;
  --dark-gray: #555555;
  --white: #ffffff;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
  
  /* Material-specific colors */
  --cement-color: #a9a9a9;
  --sand-color: #deb887;
  --aggregate-color: #8b4513;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-gray);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-color);
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
}

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

ul {
  list-style: none;
}

/* Buttons */
.btn-primary, .btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border: none;
  border-radius: 5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  color: var(--white);
}

.btn-secondary {
  background-color: var(--medium-gray);
  color: var(--text-color);
}

.btn-secondary:hover {
  background-color: var(--dark-gray);
  color: var(--white);
}

/* Header */
header {
  background-color: var(--white);
  box-shadow: var(--shadow);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo h1 {
  font-size: 1.5rem;
  margin: 0;
  color: var(--primary-color);
  display: flex;
  align-items: center;
}

.logo a {
  text-decoration: none;
  color: inherit;
}

.logo i {
  margin-right: 10px;
}

nav ul {
  display: flex;
}

nav ul li {
  margin-left: 1.5rem;
}

nav ul li a {
  color: var(--text-color);
  font-weight: 500;
  padding: 5px 0;
  position: relative;
}

nav ul li a:hover, nav ul li a.active {
  color: var(--primary-color);
}

nav ul li a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: var(--transition);
}

nav ul li a:hover::after, nav ul li a.active::after {
  width: 100%;
}

/* 移动端导航菜单 */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--primary-color);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 4px;
}

.mobile-nav-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.mobile-nav-toggle:focus {
  outline: none;
}

.mobile-nav-toggle i {
  pointer-events: none;
}

@media (max-width: 767px) {
  .mobile-nav-toggle {
    display: block;
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
  }
  
  header .container {
    position: relative;
    justify-content: flex-start;
    padding-right: 50px; /* 为按钮留出空间 */
  }
  
  .logo {
    margin-right: auto;
  }
  
  nav {
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
  }
  
  nav ul {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    flex-direction: column;
    background-color: var(--white);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 0;
    margin: 0;
    border-radius: 5px;
    overflow: hidden;
  }
  
  header .container {
    flex-direction: row;
    align-items: center;
  }
  
  nav ul.show {
    display: flex;
  }
  
  nav ul li {
    margin: 0;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid var(--light-gray);
  }
  
  nav ul li:last-child {
    border-bottom: none;
  }
  
  nav ul li a {
    display: block;
    padding: 12px 20px;
  }
}

/* Hero Section */
.hero {
  background-color: var(--primary-color);
  background-image: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--white);
  padding: 3rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--white);
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.features {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 10px;
}

.features span {
  margin: 0 5px;
  padding: 6px 15px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  font-size: 0.9rem;
  display: inline-block;
  transition: all 0.2s ease;
}

/* Trust Badges */
.trust-badges {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.badge {
  background-color: rgba(255, 255, 255, 0.15);
  padding: 8px 15px;
  border-radius: 50px;
  color: white;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}

.badge i {
  margin-right: 8px;
  font-size: 1rem;
}

.btn-primary {
  display: inline-block;
  padding: 12px 28px;
  border: none;
  border-radius: 5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
  background-color: var(--secondary-color);
  color: var(--white);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary i {
  margin-left: 8px;
  transition: transform 0.2s ease;
}

.btn-primary:hover i {
  transform: translateX(3px);
}

/* Calculator Section */
.calculator-section {
  padding: 4rem 0;
  background-color: var(--white);
}

/* Shape Selector */
.shape-selector {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
  gap: 10px;
}

.shape-btn {
  padding: 8px 16px;
  border: 1px solid var(--medium-gray);
  border-radius: 5px;
  background-color: var(--white);
  cursor: pointer;
  transition: var(--transition);
}

.shape-btn:hover {
  background-color: var(--light-gray);
}

.shape-btn.active {
  background-color: var(--primary-light);
  color: var(--white);
  border-color: var(--primary-color);
}

/* Updated calculator layout */
#calculator-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

/* Updated Input Fields */
.calculator-form-container {
  background-color: #f5f7fa;
  border-radius: 8px;
  padding: 20px;
}

.shape-selector {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
  gap: 8px;
}

.shape-btn {
  padding: 8px 16px;
  border: 1px solid #dce0e6;
  border-radius: 4px;
  background-color: #fff;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.shape-btn:hover {
  background-color: #f0f2f5;
}

.shape-btn.active {
  background-color: #2c6fbd;
  color: #fff;
  border-color: #2c6fbd;
}

.calculator-form {
  max-width: 100%;
}

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

.input-field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #333;
}

/* 修改集成输入框样式，让输入框和选择框各占一半 */
.integrated-input {
  display: flex;
  width: 100%;
}

.integrated-input input {
  width: 50%;
  padding: 10px 12px;
  border: 1px solid #dce0e6;
  border-radius: 4px 0 0 4px;
  font-size: 15px;
  background-color: #fff;
}

.integrated-input input:focus {
  outline: none;
  border-color: #2c6fbd;
  box-shadow: 0 0 0 2px rgba(44, 111, 189, 0.1);
}

.unit-selector {
  width: 50%;
  display: flex;
}

.unit-selector select {
  width: 100%;
  padding: 0 10px;
  border: 1px solid #dce0e6;
  border-left: none;
  background-color: #f0f2f5;
  border-radius: 0 3px 3px 0;
  color: #555;
  font-size: 14px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6' viewBox='0 0 8 6'%3E%3Cpath fill='%23666' d='M0 0h8L4 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 25px;
}

.unit-selector select:focus {
  outline: none;
}

/* Density Selection */
.density-selection {
  margin: 24px 0;
}

.density-selection > label {
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
}

.radio-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.radio-option {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 4px 0;
}

.radio-option input[type="radio"] {
  margin-right: 8px;
}

.custom-density {
  margin-top: 8px;
  padding-left: 24px;
  display: flex;
  align-items: center;
}

.custom-density input {
  width: 80px;
  padding: 6px 8px;
  border: 1px solid #dce0e6;
  border-radius: 4px;
  margin-right: 6px;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn-primary, .btn-secondary {
  padding: 10px 20px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: #2c6fbd;
  color: white;
}

.btn-primary:hover {
  background-color: #2462a8;
}

.btn-secondary {
  background-color: #e6e9ed;
  color: #333;
}

.btn-secondary:hover {
  background-color: #d9dde3;
}

#results-section {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid var(--medium-gray);
}

#results-section h3 {
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Form Styles */
.shape-fields {
  display: none;
}

.shape-fields.active {
  display: block;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

/* 更新input-with-unit样式与integrated-input保持一致 */
.input-with-unit {
  display: flex;
  width: 100%;
}

.input-with-unit input {
  width: 50%;
  padding: 10px;
  border: 1px solid var(--medium-gray);
  border-radius: 5px 0 0 5px;
  font-size: 1rem;
}

.input-with-unit select, .input-with-unit span {
  width: 50%;
  padding: 10px;
  background-color: var(--medium-gray);
  border: 1px solid var(--medium-gray);
  border-left: none;
  border-radius: 0 5px 5px 0;
  font-size: 1rem;
  text-align: center;
}

input[type="number"], select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--medium-gray);
  border-radius: 5px;
  font-size: 1rem;
}

/* Radio Groups */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0.5rem;
}

.radio-group label {
  display: flex;
  align-items: center;
  margin-bottom: 0;
  cursor: pointer;
}

.radio-group input[type="radio"] {
  margin-right: 5px;
}

.custom-density, .custom-bag-size, .custom-ratio {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--medium-gray);
}

/* Results & Analysis */
.results-container {
  padding: 2rem;
  background-color: var(--light-gray);
  border-radius: 10px;
}

.results-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 2rem;
}

.result-card {
  background-color: var(--white);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.result-card:hover {
  transform: translateY(-5px);
}

.result-icon {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.result-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  line-height: 1;
}

.result-label {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.result-title {
  font-weight: 600;
}

/* Analysis Charts */
.analysis-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.chart-container {
  background-color: var(--white);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.chart-container h3 {
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Material Bars */
.material-item, .cost-item {
  margin-bottom: 1rem;
}

.material-label, .cost-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.material-bar-container, .cost-bar-container {
  height: 25px;
  background-color: var(--light-gray);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.material-bar, .cost-bar {
  height: 100%;
  position: relative;
}

.cement-bar {
  background-color: var(--cement-color);
}

.sand-bar {
  background-color: var(--sand-color);
}

.aggregate-bar {
  background-color: var(--aggregate-color);
}

.cement-cost-bar {
  background-color: #4682b4;
}

.sand-cost-bar {
  background-color: #3cb371;
}

.aggregate-cost-bar {
  background-color: #ff7f50;
}

.material-value, .cost-value {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-color);
  font-weight: 500;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.7);
}

/* Tips Section */
.tips-section {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 4rem 0;
}

.tips-section h2 {
  color: var(--white);
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.tip-card {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
}

.tip-card:hover {
  transform: translateY(-5px);
  background-color: rgba(255, 255, 255, 0.2);
}

.tip-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.tip-card h3 {
  color: var(--white);
  margin-bottom: 1rem;
}

.tip-card p {
  opacity: 0.9;
}

/* About Section */
.about-section {
  padding: 4rem 0;
  background-color: var(--white);
}

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

.about-content ul {
  list-style-type: disc;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

/* Features Section */
.features-section {
  padding: 4rem 0;
  background-color: var(--light-gray);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.feature-card {
  background-color: var(--white);
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

/* How To Use */
.how-to-section {
  padding: 4rem 0;
  background-color: var(--white);
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
}

.step {
  text-align: center;
  position: relative;
}

.step-number {
  width: 40px;
  height: 40px;
  background-color: var(--primary-color);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-weight: 700;
}

/* FAQ Section */
.faq-section {
  padding: 4rem 0;
  background-color: var(--light-gray);
}

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

.faq-item {
  background-color: var(--white);
  border-radius: 10px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.faq-question {
  padding: 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-question h3 {
  margin: 0;
  font-size: 1.1rem;
}

.faq-toggle {
  transition: var(--transition);
}

.faq-answer {
  padding: 0 1.5rem 1.5rem;
  border-top: 1px solid var(--medium-gray);
}

.faq-answer ul {
  list-style-type: disc;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

/* Contact Section */
.contact-section {
  padding: 4rem 0;
  background-color: var(--white);
  text-align: center;
}

.contact-info {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 2rem;
}

.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-item i {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* Footer */
footer {
  background-color: #2a2a2a;
  color: var(--white);
  padding: 4rem 0 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  margin-bottom: 2rem;
}

.footer-logo h2 {
  color: var(--white);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.footer-logo p {
  color: #aaa;
}

.footer-links h3 {
  color: var(--white);
  margin-bottom: 1rem;
}

.footer-links ul li {
  margin-bottom: 0.5rem;
}

.footer-links ul li a {
  color: #aaa;
}

.footer-links ul li a:hover {
  color: var(--white);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #444;
  color: #aaa;
}

/* Subtitle */
.subtitle {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: -1rem;
  margin-bottom: 1.5rem;
}

/* Responsive Styles */
@media (max-width: 992px) {
  #calculator-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .form-actions {
    flex-direction: column;
    gap: 15px;
  }
  
  .form-actions button {
    width: 100%;
  }
  
  .shape-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    align-items: stretch;
  }
  
  .shape-btn {
    width: 100%;
    max-width: none;
    padding: 10px 5px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .radio-group {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 576px) {
  .calculator-tabs {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  
  .tab-btn {
    width: 100%;
    text-align: center;
  }
  
  .results-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .analysis-charts {
    grid-template-columns: 1fr;
  }
  
  header .container {
    flex-direction: row; /* 保持为行布局 */
    padding-right: 50px; /* 为按钮留出空间 */
  }
  
  .logo h1 {
    font-size: 1.2rem; /* 减小logo大小，确保适应小屏幕 */
  }
  
  nav ul {
    justify-content: center;
  }
  
  nav ul li {
    margin: 0 10px;
  }
  
  .hero {
    padding: 2.5rem 0;
  }
  
  .hero h1 {
    font-size: 2rem;
    line-height: 1.3;
  }
  
  .hero p {
    font-size: 1rem;
    padding: 0 10px;
  }
  
  .features {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.5rem;
    padding: 0 15px;
  }
  
  .features span {
    margin: 4px;
    font-size: 0.85rem;
    white-space: nowrap;
    padding: 6px 12px;
  }
  
  .btn-primary {
    width: 80%;
    max-width: 250px;
    padding: 12px 20px;
    font-size: 1rem;
  }
  
  .trust-badges {
    margin-top: 1.5rem;
    gap: 10px;
    padding: 0 15px;
  }
  
  .badge {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
  
  .badge i {
    margin-right: 5px;
  }
  
  .contact-info {
    flex-direction: column;
  }
  
  #calculator-container {
    padding: 0 10px;
  }
  
  .calculator-form-container {
    padding: 15px;
    border-radius: 6px;
  }
  
  /* 优化移动端输入控件 */
  .form-group {
    margin-bottom: 1.2rem;
  }
  
  .input-with-unit input,
  .input-with-unit select,
  .input-with-unit span {
    padding: 12px 10px;
    font-size: 16px; /* 避免iOS上自动缩放 */
  }
  
  input[type="number"], 
  select {
    padding: 12px 10px;
    font-size: 16px;
    height: 46px;
  }
  
  .radio-group label {
    padding: 8px 0;
  }
  
  .radio-option {
    padding: 8px 0;
  }
  
  .shape-btn {
    padding: 10px 15px;
    margin-bottom: 5px;
    min-height: 44px;
  }
  
  /* 提高表单按钮的可触摸性 */
  .form-actions button {
    padding: 12px 10px;
    font-size: 16px;
    min-height: 46px;
  }
}

@media (max-width: 480px) {
  .shape-selector {
    grid-template-columns: 1fr 1fr;
  }
  
  .hero h1 {
    font-size: 1.8rem;
  }
  
  /* 优化页面内间距 */
  .container {
    padding: 0 15px;
  }
  
  .results-cards .result-card {
    padding: 10px;
  }
  
  .result-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
  }
  
  .result-value {
    font-size: 1.6rem;
  }
  
  .result-label {
    font-size: 0.8rem;
  }
  
  .result-title {
    font-size: 0.9rem;
  }
}

/* Material Costs Compact Style */
.material-costs-container {
  margin-bottom: 1.5rem;
}

.cost-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}

.cost-item {
  flex: 1;
  min-width: 180px;
}

.cost-item label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.cost-input-group {
  display: flex;
}

.cost-input-group input {
  flex: 1;
  border-radius: 4px 0 0 4px;
  border: 1px solid var(--medium-gray);
  padding: 8px 12px;
  font-size: 0.95rem;
}

.cost-input-group select {
  width: 80px;
  border-radius: 0 4px 4px 0;
  border: 1px solid var(--medium-gray);
  border-left: none;
  padding: 8px;
  background-color: var(--light-gray);
}

.total-cost-row {
  display: flex;
  margin-top: 5px;
}

.total-cost-row .cost-item {
  flex-grow: 0;
}

.total-cost-row select {
  padding: 8px;
  border: 1px solid var(--medium-gray);
  border-radius: 4px;
  min-width: 80px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .cost-row {
    flex-direction: column;
    gap: 15px;
  }
  
  .cost-item {
    width: 100%;
  }
} 

/* Compact Materials Costs */
.materials-costs-compact {
  background-color: #f8f9fa;
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.materials-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-bottom: 8px;
}

.materials-row:last-child {
  margin-bottom: 0;
}

.material-input {
  flex: 1;
  min-width: 0;
}

.material-input label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 3px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.input-currency-group {
  display: flex;
  width: 100%;
}

.input-currency-group input {
  flex: 1;
  padding: 6px;
  border: 1px solid #ced4da;
  border-right: none;
  border-radius: 4px 0 0 4px;
  min-width: 0;
  font-size: 0.9rem;
}

.input-currency-group select {
  width: auto;
  padding: 6px;
  border: 1px solid #ced4da;
  border-radius: 0 4px 4px 0;
  background-color: white;
  min-width: 60px;
  font-size: 0.9rem;
}

#display-currency {
  width: 100%;
  padding: 6px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* Media query to stack on small screens */
@media (max-width: 768px) {
  .materials-row {
    flex-wrap: wrap;
  }
}

@media (max-width: 576px) {
  .material-input {
    width: 100%;
    flex-basis: 100%;
  }
} 

/* 形状测量示意图样式 */
.shape-diagram {
  width: 100%;
  max-width: 220px;
  height: 150px;
  margin: 10px auto 20px;
  border: 1px solid #dce0e6;
  background-color: #f8f9fa;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: visible; /* 确保SVG内容不被裁剪 */
  -webkit-transform: translateZ(0); /* iOS Safari渲染优化 */
}

.shape-diagram svg {
  max-width: 90%;
  max-height: 90%;
  width: 90%; /* 添加固定宽度比例 */
  height: 90%; /* 添加固定高度比例 */
}

.shape-diagram .dimension-line {
  stroke: #333;
  stroke-width: 1;
}

.shape-diagram .dimension-arrow {
  fill: #333;
}

.shape-diagram .dimension-text {
  font-size: 10px;
  fill: #333;
  text-anchor: middle;
}

.shape-diagram .dimension-label {
  font-size: 11px;
  fill: var(--primary-color);
  font-weight: 500;
}

/* 标注文本 */
.diagram-label {
  position: absolute;
  font-size: 10px;
  color: #333;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 2px 4px;
  border-radius: 2px;
} 

/* iOS设备特定优化 */
@supports (-webkit-touch-callout: none) {
  .shape-diagram {
    height: auto;
    min-height: 150px;
    padding: 10px 0;
  }
  
  .shape-diagram svg {
    width: 85%;
    height: 85%;
    display: block;
  }
  
  .shape-diagram .dimension-label {
    font-weight: 600; /* 增加字体粗细提高可见度 */
    font-size: 12px; /* 增大字体 */
  }
}

/* 移动端额外优化 */
@media (max-width: 768px) {
  .shape-diagram {
    max-width: 180px;
    min-height: 130px;
  }
}

@media (max-width: 576px) {
  .shape-diagram {
    max-width: 160px;
    min-height: 110px;
  }
} 