/* Google风格浅色主题 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
  background: #f8f9fa;
  color: #202124;
  font-size: 14px;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 顶部导航 */
.navbar {
  background: #fff;
  border-bottom: 1px solid #dadce0;
  height: 64px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.navbar-brand {
  font-size: 20px;
  font-weight: 500;
  color: #1a73e8;
  text-decoration: none;
}

.navbar-menu {
  display: flex;
  gap: 8px;
  align-items: center;
}

.navbar-menu a {
  color: #5f6368;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  transition: background 0.2s;
}

.navbar-menu a:hover,
.navbar-menu a.active {
  background: #e8f0fe;
  color: #1a73e8;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #5f6368;
}

.navbar-user .logout-btn {
  color: #d93025;
  cursor: pointer;
  text-decoration: none;
}

/* 卡片 */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 2px 0 rgba(60,64,67,0.1), 0 1px 3px 1px rgba(60,64,67,0.08);
  padding: 24px;
  margin-bottom: 24px;
}

.card-title {
  font-size: 18px;
  font-weight: 500;
  color: #202124;
  margin-bottom: 20px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 24px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: #1a73e8;
  color: #fff;
}

.btn-primary:hover {
  background: #1765cc;
  box-shadow: 0 1px 2px 0 rgba(60,64,67,0.15), 0 1px 3px 1px rgba(60,64,67,0.1);
}

.btn-secondary {
  background: #fff;
  color: #1a73e8;
  border: 1px solid #dadce0;
}

.btn-secondary:hover {
  background: #f1f3f4;
}

.btn-danger {
  background: #d93025;
  color: #fff;
}

.btn-danger:hover {
  background: #c5221f;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 13px;
}

/* 表单 */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #202124;
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  font-size: 14px;
  transition: border 0.2s;
  background: #fff;
}

.form-control:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26,115,232,0.2);
}

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 200px;
}

/* 表格 */
table {
  width: 100%;
  border-collapse: collapse;
}

table th,
table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e8eaed;
}

table th {
  font-weight: 500;
  color: #5f6368;
  background: #f8f9fa;
  font-size: 13px;
}

/* 金额列右对齐：单价、小计 */
table td:nth-child(7),
table th:nth-child(7),
table td:nth-child(8),
table th:nth-child(8) {
  text-align: right;
}

/* 数量列右对齐 */
table td:nth-child(6),
table th:nth-child(6) {
  text-align: right;
}

/* 序号、单位列居中 */
table td:nth-child(1),
table th:nth-child(1),
table td:nth-child(5),
table th:nth-child(5) {
  text-align: center;
}

table tbody tr:hover {
  background: #f8f9fa;
}

/* 表格内输入框 */
table td input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  font-size: 13px;
}

table td input:focus {
  outline: none;
  border-color: #1a73e8;
}

/* 筛选区域 */
.filter-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 20px;
}

.filter-bar .form-group {
  margin-bottom: 0;
  flex: 0 0 auto;
}

.filter-bar .form-control {
  width: 180px;
}

/* 标签徽章 */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge-admin {
  background: #e8f0fe;
  color: #1a73e8;
}

.badge-strategic {
  background: #e6f4ea;
  color: #137333;
}

.badge-core {
  background: #fef7e0;
  color: #b06000;
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-dialog {
  background: #fff;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e8eaed;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 500;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #5f6368;
  cursor: pointer;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e8eaed;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* 大模态框 */
.modal-lg {
  max-width: 1200px;
}

/* 提示信息 */
.alert {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.alert-error {
  background: #fce8e6;
  color: #c5221f;
  border: 1px solid #fad2cf;
}

.alert-success {
  background: #e6f4ea;
  color: #137333;
  border: 1px solid #ceead6;
}

/* 价格对比 */
.price-compare {
  background: #fef7e0;
  border-radius: 8px;
  padding: 16px 24px;
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-compare .label {
  font-weight: 500;
  color: #b06000;
}

.price-compare .value {
  font-size: 24px;
  font-weight: 600;
  color: #d93025;
}

/* 方案标题 */
.plan-title {
  font-size: 16px;
  font-weight: 500;
  color: #1a73e8;
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e8f0fe;
}

.plan-total {
  text-align: right;
  font-size: 16px;
  font-weight: 500;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 4px;
  margin-top: 12px;
}

.plan-total .amount {
  color: #d93025;
  font-size: 20px;
}

/* 备注 */
.remark {
  margin-top: 12px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 4px;
  font-size: 13px;
  color: #5f6368;
  line-height: 1.6;
}

/* 操作按钮组 */
.action-buttons {
  display: flex;
  gap: 8px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #5f6368;
}

/* 打印样式 */
@page {
  size: A4 portrait;
  margin: 10mm;
}

@media print {
  .navbar,
  .filter-bar,
  .action-buttons,
  .no-print {
    display: none !important;
  }
  
  body {
    background: #fff;
    font-size: 10px;
    line-height: 1.3;
  }
  
  .container {
    max-width: 100%;
    padding: 0;
  }
  
  h2 {
    font-size: 14px;
    margin: 0 0 8px 0;
  }
  
  h3 {
    font-size: 12px;
    margin: 0 0 6px 0;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #dadce0;
    padding: 6px 10px;
    margin-bottom: 8px;
    page-break-inside: avoid;
  }
  
  .card-title {
    font-size: 12px;
    margin-bottom: 6px;
  }
  
  /* 竖向打印：两个方案上下排列 */
  #quote-result {
    display: flex;
    flex-direction: column;
  }
  
  .plans-row {
    display: block;
    margin-bottom: 0;
  }
  
  #plan1-card,
  #plan2-card {
    width: 100%;
    margin-bottom: 8px;
  }
  
  .plan-title {
    font-size: 11px;
    margin: 0 0 6px 0;
    padding-bottom: 3px;
    border-bottom: 1px solid #e8f0fe;
  }
  
  table {
    font-size: 9px;
    width: 100% !important;
    border-collapse: collapse;
    table-layout: fixed !important;
  }
  
  table th,
  table td {
    padding: 3px 5px;
    border-bottom: 1px solid #e8eaed;
    border-right: 1px solid #e8eaed;
    text-align: left;
    vertical-align: top;
    word-wrap: break-word;
    word-break: break-all;
  }
  
  table th:last-child,
  table td:last-child {
    border-right: none;
  }
  
  table th {
    font-size: 9px;
    font-weight: 600;
    padding: 4px 5px;
    background: #f8f9fa;
    white-space: nowrap;
  }
  
  /* 序号列 5% */
  table td:nth-child(1),
  table th:nth-child(1) {
    width: 5% !important;
    text-align: center;
    white-space: nowrap;
  }
  
  /* 产品名称列 15% */
  table td:nth-child(2),
  table th:nth-child(2) {
    width: 15% !important;
  }
  
  /* 品牌型号列 15% */
  table td:nth-child(3),
  table th:nth-child(3) {
    width: 15% !important;
  }
  
  /* 参数描述列 35% */
  table td:nth-child(4),
  table th:nth-child(4) {
    width: 35% !important;
  }
  
  /* 单位列 5% */
  table td:nth-child(5),
  table th:nth-child(5) {
    width: 5% !important;
    text-align: center;
    white-space: nowrap;
  }
  
  /* 数量列 5% */
  table td:nth-child(6),
  table th:nth-child(6) {
    width: 5% !important;
    text-align: right;
    white-space: nowrap;
  }
  
  /* 单价列 10% */
  table td:nth-child(7),
  table th:nth-child(7) {
    width: 10% !important;
    text-align: right;
    white-space: nowrap;
  }
  
  /* 小计列 10% */
  table td:nth-child(8),
  table th:nth-child(8) {
    width: 10% !important;
    text-align: right;
    white-space: nowrap;
  }
  
  .plan-total {
    font-size: 10px;
    padding: 4px 8px;
    margin-top: 4px;
    text-align: right;
  }
  
  .plan-total .amount {
    font-size: 13px;
    font-weight: 600;
  }
  
  .remark {
    margin-top: 4px;
    padding: 4px 8px;
    font-size: 9px;
    line-height: 1.4;
    background: #f8f9fa;
    border-radius: 3px;
  }
  
  .price-compare {
    padding: 6px 12px;
    margin-top: 4px;
    text-align: center;
  }
  
  .price-compare .label {
    font-size: 10px;
  }
  
  .price-compare .value {
    font-size: 14px;
  }
  
  /* 打印表头 */
  #print-header {
    margin-bottom: 10px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid #1a73e8 !important;
  }
  
  #print-header h2 {
    font-size: 16px;
    margin-bottom: 10px !important;
    text-align: center;
  }
  
  #print-header p {
    margin: 2px 0;
    font-size: 10px;
  }
}

/* 响应式 */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-bar .form-control {
    width: 100%;
  }
  
  .navbar-menu {
    display: none;
  }
}
