/* ===== 成丰货运平台 - 货主PC公共框架样式 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif; background: #f5f6f8; color: #1a1a1a; font-size: 14px; display: flex; height: 100vh; overflow: hidden; }
#app-root { display: flex; width: 100%; }

/* ===== Sidebar ===== */
.sidebar { width: 220px; background: #FFFFFF; color: #666666; display: flex; flex-direction: column; flex-shrink: 0; border-right: 1px solid #eef0f3; height: 100vh; position: sticky; top: 0; }
.logo { padding: 12px 20px; border-bottom: 1px solid #eef0f3; display: flex; align-items: center; min-height: 56px; }
.logo img { height: 28px; width: auto; object-fit: contain; display: block; margin: 0 auto; }
.nav-section { padding: 8px 0; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 24px; color: #666666; cursor: pointer; transition: all 0.15s; font-size: 13px; text-decoration: none; }
.nav-item:hover { background: rgba(1,203,138,0.06); color: #01CB8A; }
.nav-item.active { background: rgba(1,203,138,0.08); color: #01CB8A; }
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover .nav-icon, .nav-item.active .nav-icon { stroke: #01CB8A; }

/* Accordion menu */
.menu-list { padding: 4px 0; }
.menu-group { }
.menu-group-header { display: flex; align-items: center; gap: 10px; padding: 10px 24px; color: #666666; cursor: pointer; transition: all 0.15s; font-size: 13px; user-select: none; }
.menu-group-header:hover { background: rgba(1,203,138,0.06); color: #01CB8A; }
.menu-group-header .menu-icon { width: 16px; height: 16px; flex-shrink: 0; }
.menu-group-header:hover .menu-icon { stroke: #01CB8A; }
.menu-group-header .menu-arrow { margin-left: auto; width: 12px; height: 12px; transition: transform 0.2s; stroke: #bbb; flex-shrink: 0; }
.menu-group-header:hover .menu-arrow { stroke: #01CB8A; }
.menu-group.open > .menu-group-header .menu-arrow { transform: rotate(90deg); stroke: #01CB8A; }
.menu-group.open > .menu-group-header { color: #01CB8A; }
.menu-group.open > .menu-group-header .menu-icon { stroke: #01CB8A; }
.menu-sub { overflow: hidden; max-height: 0; transition: max-height 0.25s ease; }
.menu-group.open > .menu-sub { max-height: 500px; }
.menu-sub-item { display: block; padding: 8px 24px 8px 50px; color: #888; font-size: 13px; cursor: pointer; transition: all 0.15s; white-space: nowrap; text-decoration: none; }
.menu-sub-item:hover { color: #01CB8A; background: rgba(1,203,138,0.04); }
.menu-sub-item.active { color: #01CB8A; font-weight: 500; }
.sidebar-scroll { flex: 1; overflow-y: auto; }
.sidebar-scroll::-webkit-scrollbar { width: 0; }

/* ===== Topbar ===== */
.topbar { background: #fff; height: 56px; display: flex; align-items: center; justify-content: flex-end; border-bottom: 1px solid #eef0f3; padding: 0 24px; gap: 20px; flex-shrink: 0; position: sticky; top: 0; z-index: 50; }
.topbar-links { display: flex; align-items: center; gap: 4px; }
.topbar-link { padding: 8px 12px; font-size: 13px; color: #666; cursor: pointer; border-radius: 6px; transition: all 0.15s; white-space: nowrap; display: flex; align-items: center; gap: 4px; position: relative; }
a.topbar-link { color: #666; text-decoration: none; }
.topbar-link:hover { color: #01CB8A; background: rgba(1,203,138,0.04); }
a.topbar-link:hover { color: #01CB8A; }
.topbar-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.topbar-link .badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 600; display: flex; align-items: center; justify-content: center; line-height: 1; }
.topbar-center { display: flex; align-items: center; gap: 12px; }
.topbar-btn { padding: 8px 24px; border-radius: 8px; border: 1px solid #eef0f3; background: #fff; cursor: pointer; font-size: 13px; font-weight: 500; color: #333; transition: all 0.15s; }
.topbar-btn:hover { border-color: #01CB8A; color: #01CB8A; background: rgba(1,203,138,0.04); }
.topbar-btn.primary { background: #01CB8A; color: #fff; border-color: #01CB8A; }
.topbar-btn.primary:hover { background: #00b87a; color: #fff; }
.topbar-user { display: flex; align-items: center; gap: 10px; position: relative; cursor: pointer; padding: 8px 12px; border-radius: 8px; transition: background 0.15s; }
.topbar-user:hover { background: #f5f6f8; }
.topbar-avatar { width: 32px; height: 32px; background: #01CB8A; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; color: #fff; flex-shrink: 0; }
.topbar-user-name { font-size: 13px; color: #333; font-weight: 500; }
.topbar-user-arrow { width: 12px; height: 12px; stroke: #aaa; transition: transform 0.2s; }
.topbar-user.open .topbar-user-arrow { transform: rotate(180deg); }
.user-dropdown { position: absolute; top: 100%; right: 0; margin-top: 4px; background: #fff; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); min-width: 140px; z-index: 100; display: none; overflow: hidden; }
.user-dropdown.show { display: block; }
.dropdown-item { padding: 10px 16px; font-size: 13px; color: #333; cursor: pointer; transition: background 0.15s; }
.dropdown-item:hover { background: #f5f6f8; }
.dropdown-item.danger { color: #dc2626; }
.dropdown-item.danger:hover { background: #fef2f2; }

/* ===== Main layout ===== */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.content { flex: 1; padding: 20px 24px; overflow-y: auto; }

/* ===== 公共组件 ===== */
/* Toast */
.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.9); background: rgba(0,0,0,0.78); color: #fff; padding: 16px 32px; border-radius: 10px; font-size: 14px; z-index: 9999; opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* Section common */
.section { margin-bottom: 20px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-size: 15px; font-weight: 600; color: #1a1a1a; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ''; width: 3px; height: 16px; background: #01CB8A; border-radius: 2px; }

/* Page title */
.page-title { font-size: 16px; font-weight: 600; color: #1a1a1a; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.page-title::before { content: ''; width: 3px; height: 18px; background: #01CB8A; border-radius: 2px; }

/* Tab bar */
.tab-bar { display: flex; gap: 0; background: #fff; border-radius: 8px 8px 0 0; border: 1px solid #eef0f3; border-bottom: none; overflow: hidden; }
.tab-item { padding: 14px 28px; font-size: 14px; color: #666; cursor: pointer; transition: all 0.15s; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab-item:hover { color: #01CB8A; background: rgba(1,203,138,0.03); }
.tab-item.active { color: #01CB8A; font-weight: 600; border-bottom-color: #01CB8A; background: rgba(1,203,138,0.04); }
.tab-content { background: #fff; border: 1px solid #eef0f3; border-radius: 0 0 8px 8px; padding: 32px; min-height: 400px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Buttons */
.btn { padding: 8px 24px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s; border: 1px solid #e0e0e0; background: #fff; color: #666; }
.btn:hover { border-color: #d9d9d9; color: #333; }
.btn.primary { background: #01CB8A; color: #fff; border-color: #01CB8A; }
.btn.primary:hover { background: #00b87a; }

/* Save bar */
.save-bar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 32px; padding-top: 20px; border-top: 1px solid #eef0f3; }

/* ===== 运价弹出层 ===== */
.price-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.35); z-index: 2000; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.price-overlay.show { opacity: 1; pointer-events: auto; }
.price-panel { position: fixed; top: 0; right: -520px; width: 520px; height: 100vh; background: #fff; z-index: 2001; box-shadow: -4px 0 20px rgba(0,0,0,0.12); transition: right 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94); display: flex; flex-direction: column; }
.price-panel.show { right: 0; }
.price-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid #eef0f3; flex-shrink: 0; }
.price-panel-title { font-size: 16px; font-weight: 600; color: #1a1a1a; }
.price-panel-close { width: 32px; height: 32px; border: none; background: none; cursor: pointer; border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: background 0.15s; }
.price-panel-close:hover { background: #f5f6f8; }
.price-panel-close svg { width: 18px; height: 18px; stroke: #999; }
.price-panel-body { flex: 1; overflow-y: auto; padding: 24px; }
.price-panel-body::-webkit-scrollbar { width: 0; }

/* 查询表单 */
.price-search-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.price-search-label { font-size: 13px; color: #333; white-space: nowrap; width: 70px; text-align: right; flex-shrink: 0; }
.price-search-label .required { color: #ef4444; margin-right: 2px; }
.price-area-selector { position: relative; flex: 1; }
.price-area-input { width: 100%; height: 36px; border: 1px solid #e0e0e0; border-radius: 6px; padding: 0 32px 0 12px; font-size: 13px; color: #333; outline: none; cursor: pointer; background: #fff; transition: border-color 0.15s; }
.price-area-input:focus, .price-area-input.open { border-color: #01CB8A; }
.price-area-input::placeholder { color: #bbb; }
.price-area-arrow { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; stroke: #999; pointer-events: none; transition: transform 0.2s; }
.price-area-input.open + .price-area-arrow { transform: translateY(-50%) rotate(180deg); stroke: #01CB8A; }
.price-area-dropdown { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); z-index: 100; display: none; max-height: 320px; overflow: hidden; }
.price-area-dropdown.show { display: block; }
.price-area-levels { display: flex; height: 100%; }
.price-area-col { flex: 1; border-right: 1px solid #eef0f3; overflow-y: auto; max-height: 320px; }
.price-area-col:last-child { border-right: none; }
.price-area-col-header { padding: 6px 10px; font-size: 11px; color: #999; background: #fafbfc; border-bottom: 1px solid #eef0f3; position: sticky; top: 0; z-index: 1; }
.price-area-option { padding: 6px 10px; font-size: 13px; color: #333; cursor: pointer; transition: background 0.08s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price-area-option:hover { background: rgba(1,203,138,0.08); color: #01CB8A; }
.price-area-option.hover { background: rgba(1,203,138,0.08); color: #01CB8A; font-weight: 500; }
.price-area-col-empty { padding: 20px 10px; text-align: center; font-size: 12px; color: #ccc; }

/* 地址簿按钮 */
.price-addr-btn { width: 36px; height: 36px; border: 1px solid #e0e0e0; border-radius: 6px; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.15s; flex-shrink: 0; position: relative; }
.price-addr-btn:hover { border-color: #01CB8A; background: rgba(1,203,138,0.04); }
.price-addr-btn svg { width: 18px; height: 18px; stroke: #666; }
.price-addr-btn:hover svg { stroke: #01CB8A; }
.price-addr-dropdown { position: absolute; top: calc(100% + 4px); right: 0; width: 340px; background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); z-index: 101; display: none; max-height: 280px; overflow-y: auto; }
.price-addr-dropdown.show { display: block; }
.price-addr-dropdown::-webkit-scrollbar { width: 4px; }
.price-addr-dropdown::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }
.price-addr-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #f5f6f8; transition: background 0.1s; }
.price-addr-item:last-child { border-bottom: none; }
.price-addr-item:hover { background: rgba(1,203,138,0.04); }
.price-addr-item-name { font-size: 13px; font-weight: 500; color: #333; margin-bottom: 3px; }
.price-addr-item-detail { font-size: 12px; color: #999; }
.price-addr-item:hover .price-addr-item-name { color: #01CB8A; }
.price-addr-empty { padding: 24px; text-align: center; font-size: 13px; color: #bbb; }

/* 查询按钮 */
.price-search-btn { width: 100%; height: 40px; border: none; border-radius: 8px; background: #01CB8A; color: #fff; font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.15s; margin-top: 8px; }
.price-search-btn:hover { background: #00b87a; }

/* 查询结果 */
.price-result-area { margin-top: 20px; padding-top: 20px; border-top: 1px solid #eef0f3; display: flex; flex-direction: column; min-height: 200px; }
.price-result-placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #bbb; gap: 8px; min-height: 200px; }
.price-result-placeholder svg { width: 40px; height: 40px; stroke: #ddd; }
.price-result-placeholder span { font-size: 13px; }
.price-result-tabs { width: 100%; display: none; }
.price-result-area.has-data .price-result-tabs { display: block; }
.price-result-area.has-data .price-result-placeholder { display: none; }
.price-tab-bar { display: flex; border-bottom: 2px solid #01CB8A; margin-bottom: 16px; gap: 0; }
.price-tab-item { padding: 10px 20px; font-size: 13px; color: #666; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.15s; white-space: nowrap; }
.price-tab-item:hover { color: #01CB8A; }
.price-tab-item.active { color: #01CB8A; font-weight: 500; border-bottom-color: #01CB8A; }
.price-tab-content { min-height: 200px; }

.price-result-chart { background: #f5f6f8; border: 1px dashed #d0d0d0; border-radius: 8px; padding: 60px 20px; text-align: center; color: #bbb; font-size: 13px; }
.price-result-area.has-data { justify-content: flex-start; }

/* 运价趋势图 */
.trend-period-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.trend-period-btn { padding: 5px 14px; font-size: 12px; color: #666; cursor: pointer; border-radius: 4px; border: 1px solid #e0e0e0; background: #fff; transition: all 0.15s; user-select: none; }
.trend-period-btn:hover { border-color: #01CB8A; color: #01CB8A; }
.trend-period-btn.active { background: #01CB8A; color: #fff; border-color: #01CB8A; }
.trend-chart-wrapper { background: #fff; border: 1px solid #eef0f3; border-radius: 8px; padding: 12px; }
#trendChartContainer { width: 100%; min-height: 200px; }
#trendChartContainer svg { display: block; width: 100%; height: auto; }
.trend-svg-wrap { display: block; }
.trend-svg-wrap svg { display: block; width: 100%; height: auto; }

/* 运价参考卡片列表 */
.price-ref-list { display: flex; flex-direction: column; gap: 10px; }
.price-ref-card { background: #fafbfc; border: 1px solid #eef0f3; border-radius: 8px; padding: 14px 16px; transition: border-color 0.15s; }
.price-ref-card:hover { border-color: #d0d5dd; }
.price-ref-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.price-ref-card-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.price-ref-addr-row { display: flex; align-items: center; gap: 6px; }
.load-badge { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 4px; font-size: 12px; color: #fff; font-weight: 600; flex-shrink: 0; line-height: 1; }
.load-badge.load { background: #01CB8A; }
.load-badge.unload { background: #ef4444; }
.price-ref-location { font-size: 13px; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price-ref-time { font-size: 12px; color: #999; white-space: nowrap; margin-left: 12px; flex-shrink: 0; }
.price-ref-card-stats { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.price-ref-stat { font-size: 12px; color: #888; }
.price-ref-stat strong { color: #ef4444; font-weight: 600; }
.price-ref-stat .stat-label { color: #888; }
.price-ref-stat.sep { color: #ddd; margin: 0 10px; font-size: 12px; }

/* ===== 客服电话弹出层 ===== */
.service-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.service-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.service-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  z-index: 3001;
  width: 400px;
  max-width: 90vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.service-modal.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.service-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eef0f3;
}
.service-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}
.service-modal-close {
  width: 32px; height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.service-modal-close:hover { background: #f5f6f8; }
.service-modal-close svg { width: 18px; height: 18px; stroke: #999; }
.service-modal-body {
  padding: 32px 20px;
  display: flex;
  justify-content: center;
}
.service-phone-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.service-phone-icon {
  width: 28px; height: 28px;
  stroke: #01CB8A;
  flex-shrink: 0;
}
.service-phone-label {
  font-size: 16px;
  color: #333;
}
.service-phone-number {
  font-size: 22px;
  font-weight: 700;
  color: #01CB8A;
  letter-spacing: 1px;
}

/* ===== 业务二维码弹出层 ===== */
.qr-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  z-index: 3001;
  width: 420px;
  max-width: 90vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.qr-modal.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.qr-modal-body {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.qr-code-area {
  width: 200px;
  height: 200px;
  background: #fff;
  border: 2px solid #eef0f3;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.qr-placeholder {
  width: 160px;
  height: 160px;
  background: linear-gradient(135deg, #f0fdf4, #d1fae5);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-placeholder svg {
  width: 60px;
  height: 60px;
  stroke: #01CB8A;
  opacity: 0.4;
}
.qr-company-name {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
}
.qr-slogan {
  font-size: 14px;
  color: #01CB8A;
  font-weight: 500;
}
.qr-logo-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qr-logo-img {
  height: 32px;
  width: auto;
  display: block;
}
.qr-phone {
  font-size: 14px;
  color: #666;
  margin-top: 4px;
}
.qr-desc {
  font-size: 12px;
  color: #999;
  text-align: center;
  line-height: 1.5;
  padding: 8px 12px;
  background: #fafbfc;
  border-radius: 8px;
  width: 100%;
  margin-top: 4px;
}
