/* =============================================
   奇模科技 · 报价系统 — 统一风格样式表
   版本：v1.0 | 规范来源：网页风格统一规范.md
   ============================================= */

/* === 1. 颜色变量 === */
:root {
  --deep-blue: #254364;
  --deep-blue-dark: #1a3050;
  --gold-orange: #f0a030;
  --oasis-white: #fffef8;
  --rock-gray: #4a4a4a;
  --mist-gray: #d0d0d0;
  --sand-white: #f5f5f0;
  --light-blue: #e8f0f8;
  --success-green: #27ae60;
  --warning-amber: #d68910;
  --danger-red: #c0392b;
  --card-shadow: 0 4px 30px rgba(37, 67, 100, 0.08);
  --card-shadow-hover: 0 12px 40px rgba(37, 67, 100, 0.15);
  --text-muted: #888;
  --border-color: #d0d0d0;
}

/* === 2. 基础重置 & 字体 === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--rock-gray);
  background-color: var(--oasis-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* === 3. 页面容器 === */
.page-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* === 4. Header 组件（统一） === */
.header {
  background: linear-gradient(135deg, var(--deep-blue) 0%, var(--deep-blue-dark) 100%);
  color: white;
  padding: 60px 20px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(240, 160, 48, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.header-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  margin-bottom: 16px;
  border: 3px solid rgba(255, 255, 255, 0.15);
}

.header h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 8px;
  position: relative;
}

.header .subtitle {
  font-size: 15px;
  opacity: 0.8;
  font-weight: 400;
  position: relative;
}

.ai-tag {
  display: inline-block;
  background: var(--gold-orange);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

/* === 5. Footer 组件（统一） === */
.footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--mist-gray);
  margin-top: 40px;
}

.footer .brand {
  font-weight: 600;
  color: var(--deep-blue);
}

/* === 6. Card 组件 === */
.card {
  background: white;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 24px;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
}

/* 类型选择卡片 */
.type-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 40px 0;
  max-width: 900px;
  margin: 0 auto;
}

.type-card {
  background: white;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.type-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-4px);
  border-color: var(--deep-blue);
}

.type-card .icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.type-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--deep-blue);
  margin-bottom: 8px;
}

.type-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.type-card .tag {
  display: inline-block;
  background: var(--gold-orange);
  color: white;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
}

/* === 7. 表单组件 === */
.form-section {
  background: white;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 28px;
  margin-bottom: 20px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--deep-blue);
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--light-blue);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .badge {
  background: var(--deep-blue);
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--rock-gray);
}

.form-group label .required {
  color: var(--danger-red);
  margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--mist-gray);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--rock-gray);
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--deep-blue);
  box-shadow: 0 0 0 3px rgba(37, 67, 100, 0.1);
}

.form-group input::placeholder {
  color: #aaa;
}

.form-group .hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.form-group .hint.warning {
  color: var(--warning-amber);
}

.form-group .hint.danger {
  color: var(--danger-red);
}

.form-group .ai-tag-sm {
  font-size: 11px;
  color: var(--success-green);
  margin-top: 2px;
}

/* === 8. 按钮组件 === */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--deep-blue) 0%, var(--deep-blue-dark) 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 36px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 1px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 67, 100, 0.3);
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: white;
  color: var(--deep-blue);
  border: 1.5px solid var(--deep-blue);
  border-radius: 12px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--light-blue);
  transform: translateY(-1px);
}

.btn-center {
  text-align: center;
  padding: 20px 0;
}

/* === 9. 结果展示 === */
.result-section {
  background: linear-gradient(135deg, var(--deep-blue) 0%, var(--deep-blue-dark) 100%);
  border-radius: 16px;
  padding: 32px;
  color: white;
  margin-top: 20px;
  display: none;
}

.result-section.visible {
  display: block;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-price {
  text-align: center;
  margin-bottom: 24px;
}

.result-price .label {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 4px;
}

.result-price .price {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 2px;
}

.result-price .price .currency {
  font-size: 20px;
  opacity: 0.9;
}

.result-price .unit-price {
  font-size: 15px;
  opacity: 0.7;
  margin-top: 4px;
}

/* === 10. 表格样式（统一） === */
.result-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.result-table th {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid rgba(255, 255, 255, 0.25);
  letter-spacing: 1px;
}

.result-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

.result-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.04);
}

.result-table .price-value {
  text-align: right;
  font-weight: 600;
}

.result-table .total-row td {
  font-weight: 700;
  border-top: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(240, 160, 48, 0.1);
}

/* === 11. 页面导航（统一） === */
.page-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  max-width: 900px;
  margin: 0 auto;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--deep-blue);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.2s;
  font-family: inherit;
}

.back-btn:hover {
  background: var(--light-blue);
}

.page-nav .current-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--deep-blue);
}

/* === 12. 上传区域 === */
.upload-area {
  border: 2px dashed var(--mist-gray);
  border-radius: 16px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 20px;
  background: white;
}

.upload-area:hover {
  border-color: var(--deep-blue);
  background: var(--light-blue);
}

.upload-area.dragover {
  border-color: var(--deep-blue);
  background: var(--light-blue);
}

.upload-area .upload-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
}

.upload-area p {
  font-size: 14px;
  color: var(--text-muted);
}

.upload-area .formats {
  font-size: 11px;
  color: #aaa;
  margin-top: 4px;
}

.upload-result {
  background: var(--sand-white);
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
  display: none;
}

.upload-result.visible {
  display: block;
}

.upload-result .ai-recognized {
  font-size: 11px;
  color: var(--success-green);
  margin-bottom: 8px;
}

.upload-result .params {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.upload-result .param-item {
  font-size: 13px;
}

.upload-result .param-item .param-label {
  color: var(--text-muted);
}

.upload-result .param-item .param-value {
  font-weight: 600;
  color: var(--deep-blue);
}

/* === 13. 工具提示 === */
.tooltip-warning {
  background: #fff8e6;
  border: 1px solid var(--gold-orange);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--warning-amber);
  margin-top: 4px;
  display: none;
}

.tooltip-warning.visible {
  display: block;
}

/* === 14. 响应式 === */
@media (max-width: 900px) {
  .type-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .type-cards {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .header {
    padding: 40px 20px 30px;
  }

  .header h1 {
    font-size: 24px;
  }

  .result-price .price {
    font-size: 28px;
  }

  .result-table {
    font-size: 12px;
  }

  .result-table th,
  .result-table td {
    padding: 8px 10px;
  }
}

@media (max-width: 600px) {
  .header {
    padding: 30px 16px 24px;
  }

  .header h1 {
    font-size: 20px;
  }

  .card {
    padding: 16px;
  }

  .form-section {
    padding: 20px;
  }

  .page-container {
    padding: 0 12px;
  }

  .btn-primary {
    width: 100%;
    padding: 14px 20px;
  }
}

/* === 15. 辅助类 === */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }

/* === 16. 价格输入专用 === */
.price-input-wrapper {
  position: relative;
}

.price-input-wrapper input {
  padding-right: 60px;
}

.price-input-wrapper .unit-hint {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-muted);
  pointer-events: none;
}
