/* settlement-view.css - 结算价 H5 页，参考小程序样式 */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.container {
  padding: 10px 20px;
  max-width: 750px;
  margin: 0 auto;
}

/* 头部 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title {
  font-size: 20px;
  font-weight: 500;
  color: #333;
}

/* 日期按钮（点击弹出自定义选择器，兼容微信 WebView） */
.btn-date {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #f5f5f5;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn-date-icon {
  display: block;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px;
}

/* 自定义日期选择器弹层 */
.date-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.date-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.date-picker-box {
  position: relative;
  width: 100%;
  max-width: 340px;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.date-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.date-picker-arrow {
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: #f5f5f5;
  border-radius: 8px;
  font-size: 24px;
  line-height: 1;
  color: #333;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.date-picker-arrow:active {
  background: #e8e8e8;
}

.date-picker-month-title {
  font-size: 17px;
  font-weight: 600;
  color: #333;
}

.date-picker-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 12px;
  color: #999;
  margin-bottom: 8px;
}

.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.date-picker-grid .cal-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #333;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.date-picker-grid .cal-cell.other {
  color: #ccc;
}

.date-picker-grid .cal-cell.today {
  background: #e8f0fe;
  color: #4080ff;
  font-weight: 600;
}

.date-picker-grid .cal-cell.selected {
  background: #4080ff;
  color: #fff;
  font-weight: 600;
}

.date-picker-grid .cal-cell:not(.other):not(.empty):active {
  background: #e0e8f5;
}

.date-picker-grid .cal-cell.future {
  color: #ccc;
  cursor: default;
}

/* 一级导航 */
.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-start;
  margin-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 4px;
}

.nav-item {
  padding: 12px 16px;
  font-size: 15px;
  color: #666;
  cursor: pointer;
  position: relative;
  border: none;
  background: none;
  font-family: inherit;
}

.nav-item:hover {
  color: #333;
}

.nav-item.active {
  color: #333;
  font-weight: bold;
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background-color: #4080ff;
  border-radius: 2px;
}

/* 二级导航 */
.sub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.sub-item {
  padding: 8px 20px;
  font-size: 14px;
  border-radius: 20px;
  color: #333;
  cursor: pointer;
  border: 1px solid #e0e0e0;
  background: #fff;
  font-family: inherit;
}

.sub-item:hover {
  border-color: #4080ff;
  color: #4080ff;
}

.sub-item.active-brand {
  background-color: #4080ff;
  color: #fff;
  border-color: #4080ff;
}

/* 无二级类目 */
.no-sub-category {
  text-align: center;
  padding: 32px 0;
  color: #999;
  font-size: 14px;
}

/* 表格 - 名称/价格支持长文本换行与自适应 */
.price-table {
  border: 1px solid #ccc;
  font-size: 14px;
  color: #333;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}

.table-header {
  display: flex;
  background-color: #fafafa;
  font-weight: bold;
  border-bottom: 1px solid #ccc;
}

.th {
  padding: 14px 12px;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

.col-name {
  flex: 1;
  min-width: 0;
  border-right: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.col-price {
  min-width: 80px;
  width: 120px;
  max-width: 45%;
  flex-shrink: 0;
  padding: 14px 10px;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

.table-body .tr {
  display: flex;
  border-bottom: 1px solid #eee;
  align-items: stretch;
}

/* 隔行底色，方便看清每一行 */
.table-body .tr:nth-child(odd):not(.tr-empty):not(.loading) {
  background-color: #f8f9fa;
}

.table-body .tr:nth-child(even):not(.tr-empty):not(.loading) {
  background-color: #fff;
}

.table-body .tr:hover:not(.tr-empty):not(.loading) {
  background-color: #e8f0fe;
}

.table-body .tr:last-child {
  border-bottom: none;
}

.table-body .td {
  padding: 5px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

.table-body .col-name {
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
  text-align: left;
  padding-left: 16px;
}

.table-body .col-price {
  min-width: 80px;
  width: 120px;
  max-width: 45%;
  flex-shrink: 0;
  text-align: left;
}

.tr-empty .td {
  color: #999;
  font-size: 13px;
}

.table-body .tr.loading .td {
  color: #999;
}
