:root {
  --bg: #f2f5f6;
  --surface: #ffffff;
  --surface-muted: #f7f9fa;
  --text: #17202a;
  --muted: #687681;
  --line: #dce3e7;
  --line-strong: #c8d2d8;
  --brand: #0d695c;
  --brand-hover: #08584d;
  --brand-soft: #e4f2ef;
  --amber: #a76308;
  --amber-soft: #fff2d6;
  --blue: #28618f;
  --blue-soft: #e5f0f8;
  --red: #b23b3b;
  --red-soft: #fdeaea;
  --green: #287451;
  --green-soft: #e5f4eb;
  --violet: #69519b;
  --violet-soft: #efeafb;
  --shadow: 0 20px 55px rgba(24, 43, 49, 0.13);
  --shadow-soft: 0 7px 24px rgba(24, 43, 49, 0.06);
  --radius: 7px;
}

* { box-sizing: border-box; }
[v-cloak] { display: none !important; }
[hidden] { display: none !important; }

html { min-width: 320px; background: var(--bg); }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, label[for], .icon-button { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }

.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 28px;
  color: var(--text);
  background: #ffffff;
  border-bottom: 3px solid #d5a449;
}

.brand-block, .header-actions, .toolbar, .search-box, .footer-right {
  display: flex;
  align-items: center;
}

.brand-block { gap: 12px; }
.brand-logo {
  display: block;
  width: 218px;
  height: auto;
  object-fit: contain;
  flex: 0 0 auto;
}
.brand-copy { display: flex; align-items: center; min-height: 34px; padding-left: 15px; border-left: 1px solid var(--line-strong); }
.brand-block h1 { margin: 0; font-size: 20px; line-height: 1.2; }
.header-actions { gap: 8px; }
.storage-indicator { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 9px; color: #27675d; background: #edf8f5; border: 1px solid #bfd7d1; border-radius: 5px; font-size: 11px; font-weight: 800; }
.storage-indicator svg { width: 14px; height: 14px; }
.storage-indicator.offline { color: #a2433b; background: #fff1ef; border-color: #e2b7b3; }

.icon-button, .primary-button, .secondary-button, .danger-button {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 5px;
  border: 1px solid transparent;
  font-weight: 650;
}

.icon-button {
  width: 38px;
  padding: 0;
  color: inherit;
  background: transparent;
  border-color: var(--line-strong);
}
.icon-button:hover { background: var(--surface-muted); }
.icon-button svg, button svg, label svg { width: 17px; height: 17px; stroke-width: 1.9; }
.primary-button { padding: 0 15px; color: #fff; background: var(--brand); border-color: var(--brand); }
.primary-button:hover { background: var(--brand-hover); }
.secondary-button { padding: 0 15px; color: var(--text); background: #fff; border-color: var(--line-strong); }
.secondary-button:hover { background: var(--surface-muted); }
.danger-button { padding: 0 14px; color: var(--red); background: #fff; border-color: #e4b8b8; }
.danger-button:hover { background: var(--red-soft); }

main { padding: 22px 28px 36px; }

.summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(112px, 1fr)) minmax(175px, 1.15fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 18px;
  box-shadow: var(--shadow-soft);
}

.summary-item {
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 20px;
  border-right: 1px solid var(--line);
}
.summary-item:last-child { border-right: 0; }
.summary-item span { color: var(--muted); font-size: 12px; }
.summary-item strong { margin-top: 7px; font-size: 24px; line-height: 1; }
.summary-item .summary-date { font-size: 15px; font-weight: 700; }
.summary-priority strong { color: #9a6914; }

.workspace {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.toolbar { gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.search-box {
  flex: 1 1 360px;
  max-width: 520px;
  min-width: 220px;
  height: 38px;
  gap: 9px;
  padding: 0 11px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 5px;
}
.search-box:focus-within { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13, 105, 92, .1); }
.search-box svg { width: 16px; color: var(--muted); }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }

.segmented-control { display: flex; margin-left: auto; border: 1px solid var(--line-strong); border-radius: 5px; overflow: hidden; }
.segmented-control button { height: 36px; padding: 0 12px; color: var(--muted); background: #fff; border: 0; border-right: 1px solid var(--line); }
.segmented-control button:last-child { border-right: 0; }
.segmented-control button:hover { color: var(--text); background: var(--surface-muted); }
.segmented-control button.active { color: #fff; background: #244f55; }
.mobile-filter { display: none; color: var(--text); border-color: var(--line-strong); }

.table-wrap { overflow: auto; min-height: 410px; }
.loading-state { min-height: 410px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-weight: 700; }
.spinner { width: 18px; height: 18px; border: 2px solid #d5e0e2; border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-state { color: #9d3f36; }
table { width: 100%; min-width: 1120px; border-collapse: collapse; table-layout: fixed; }
thead { position: sticky; top: 0; z-index: 2; }
th {
  height: 42px;
  padding: 0 12px;
  color: #52616c;
  background: #eef3f5;
  border-bottom: 1px solid var(--line-strong);
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
th:nth-child(1) { width: 260px; }
th:nth-child(2) { width: 180px; }
th:nth-child(3) { width: 190px; }
th:nth-child(4) { width: 210px; }
th:nth-child(5) { width: 155px; }
th:nth-child(6) { width: 130px; }
th:nth-child(7) { width: 150px; }
th:nth-child(8) { width: 56px; }

td { height: 76px; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { cursor: pointer; transition: background .12s ease; }
tbody tr:hover { background: #f7faf9; }
tbody tr:last-child td { border-bottom: 0; }
.exhibition-group-row { cursor: default; }
.exhibition-group-row:hover { background: transparent; }
.exhibition-group-row td {
  position: relative;
  height: 38px;
  padding: 0 12px;
  color: #3d545a;
  background: #edf2f3;
  border-top: 1px solid #d6e0e3;
  border-bottom: 1px solid #d6e0e3;
}
.exhibition-group-name { display: inline-flex; align-items: center; height: 37px; }
.exhibition-group-name { gap: 7px; font-size: 12px; font-weight: 800; }
.exhibition-group-name svg { width: 14px; height: 14px; color: var(--brand); }
.exhibition-group-count { float: right; line-height: 37px; color: var(--muted); font-size: 11px; font-weight: 600; }
.priority-row { box-shadow: inset 3px 0 0 #d2a343; }
.priority-row:hover { background: #fcfaf4; }
.company-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.company-details, .contact-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.company-details strong, .contact-cell strong { color: var(--text); font-size: 12px; }
.company-details a, .contact-cell a, .contact-cell span { max-width: 190px; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-details a:hover, .contact-cell a:hover { color: var(--brand); }
.exhibition-name { font-size: 11px; font-weight: 700; }
.budget-value { font-size: 11px; font-weight: 700; white-space: nowrap; }
.row-edit-button { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; color: var(--muted); background: transparent; border: 0; cursor: pointer; }
.row-edit-button svg { width: 16px; height: 16px; }
.row-edit-button:hover { color: var(--brand); }
.company-copy { min-width: 0; }
.priority-button {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: #a5afb5;
  background: transparent;
  border: 0;
  border-radius: 50%;
}
.priority-button:hover { color: #a87317; background: #fff5dd; }
.priority-button.active { color: #a87317; background: #fff0ca; }
.priority-button svg { width: 15px; height: 15px; }
.priority-button.active svg { fill: currentColor; }
.company-name { display: block; color: var(--text); font-weight: 750; line-height: 1.35; }
.company-email, .cell-secondary { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-primary { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.booth-details { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; line-height: 1.25; }
.booth-location { color: var(--text); font-weight: 650; overflow-wrap: anywhere; }
.booth-area { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.status-需要跟进 { color: var(--amber); background: var(--amber-soft); }
.status-等待客户 { color: var(--blue); background: var(--blue-soft); }
.status-已报价, .status-设计中 { color: var(--violet); background: var(--violet-soft); }
.status-已成交 { color: var(--green); background: var(--green-soft); }
.status-暂缓, .status-已结束 { color: #66727b; background: #edf0f2; }
.last-follow-up { color: #465760; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-action { color: #60717b; border-color: transparent; }
.row-action:hover { color: var(--brand); background: var(--brand-soft); }

.empty-state { min-height: 410px; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); }
.empty-state svg { width: 30px; height: 30px; margin-bottom: 10px; }
.empty-state h2 { margin: 0; color: var(--text); font-size: 16px; }
.empty-state p { margin: 7px 0 0; }
.table-footer { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 16px; color: var(--muted); background: var(--surface-muted); border-top: 1px solid var(--line); font-size: 12px; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(18, 31, 36, .42); }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  width: min(620px, 96vw);
  height: 100vh;
  background: #fff;
  box-shadow: var(--shadow);
  transform: translateX(102%);
  transition: transform .2s ease;
}
.drawer.open { transform: translateX(0); }
.drawer form { height: 100%; display: grid; grid-template-rows: auto 1fr auto; }
.drawer-header, .drawer-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-header .icon-button { color: var(--text); border-color: var(--line); }
.drawer-header h2 { margin: 3px 0 0; font-size: 21px; }
.eyebrow { color: var(--brand); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.drawer-body { overflow-y: auto; padding: 4px 22px 24px; }
.form-section { padding: 19px 0 20px; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; }
.form-section h3 { margin: 0 0 14px; color: #3d4b53; font-size: 13px; }
.priority-toggle {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 16px;
  padding: 11px 12px;
  background: #faf8f2;
  border: 1px solid #eadfca;
  border-radius: 6px;
  cursor: pointer;
}
.priority-toggle > input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.priority-toggle > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.priority-toggle strong { color: #5e4b28; font-size: 12px; }
.priority-toggle small { color: #81755f; font-size: 11px; }
.toggle-track { position: relative; width: 34px; height: 20px; flex: 0 0 34px; background: #c7cfd3; border-radius: 999px; transition: .15s ease; }
.toggle-track span { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .15s ease; }
.priority-toggle input:checked + .toggle-track { background: #b9801e; }
.priority-toggle input:checked + .toggle-track span { transform: translateX(14px); }
.priority-toggle input:focus-visible + .toggle-track { outline: 3px solid rgba(185, 128, 30, .18); }
.dimension-calculator {
  padding: 12px;
  background: #f6f9f9;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.dimension-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.dimension-heading > span { color: #40545b; font-size: 12px; font-weight: 750; }
.dimension-heading output { color: var(--brand); font-size: 12px; font-weight: 750; text-align: right; }
.dimension-inputs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; }
.dimension-inputs label { display: flex; flex-direction: column; gap: 6px; }
.dimension-inputs label span { color: #687780; font-size: 11px; font-weight: 650; }
.dimension-times { display: grid; place-items: center; height: 39px; color: #7b898f; font-size: 16px; }
.dimension-calculator p { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label, .notes-field { display: flex; flex-direction: column; gap: 6px; }
.form-grid label > span { color: #56656f; font-size: 12px; font-weight: 650; }
.form-grid b { color: var(--red); }
.full-width { grid-column: 1 / -1; }
input, select, textarea {
  width: 100%;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: 0;
}
input, select { height: 39px; padding: 0 10px; }
textarea { resize: vertical; min-height: 150px; padding: 10px; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13, 105, 92, .1); }
.status-select {
  width: auto;
  min-width: 104px;
  height: 30px;
  padding: 0 27px 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  background-position: right 8px center;
}
.status-select:hover { border-color: currentColor; }
.status-select:focus { border-color: currentColor; box-shadow: 0 0 0 3px rgba(49, 92, 99, .1); }
.updated-meta { margin: 16px 0 0; color: var(--muted); font-size: 11px; }
.drawer-footer { border-top: 1px solid var(--line); border-bottom: 0; }
.footer-right { gap: 9px; margin-left: auto; }

.confirm-dialog { width: min(420px, calc(100vw - 32px)); padding: 24px; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; }
.confirm-dialog::backdrop { background: rgba(18, 31, 36, .45); }
.dialog-icon { width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 13px; color: var(--red); background: var(--red-soft); border-radius: 50%; }
.dialog-icon svg { width: 22px; }
.confirm-dialog h2 { margin: 0; font-size: 18px; }
.confirm-dialog p { margin: 9px 0 20px; color: var(--muted); line-height: 1.55; }
.dialog-actions { display: flex; justify-content: center; gap: 9px; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; padding: 10px 14px; color: #fff; background: #24373c; border-radius: 5px; box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, 14px); pointer-events: none; transition: .18s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1020px) {
  .summary-strip { grid-template-columns: repeat(6, minmax(135px, 1fr)); overflow-x: auto; }
  .summary-item { min-width: 135px; }
  .segmented-control { display: none; }
  .mobile-filter { display: inline-flex; }
}

@media (max-width: 680px) {
  .topbar { padding: 11px 14px; }
  .brand-logo { width: 174px; }
  .brand-copy { display: none; }
  .header-actions .icon-button { display: none; }
  .primary-button { padding: 0 12px; }
  main { padding: 12px 10px 24px; }
  .summary-strip { margin-bottom: 12px; }
  .summary-item { min-height: 70px; padding: 11px 14px; }
  .summary-item strong { font-size: 21px; }
  .toolbar { padding: 10px; }
  .search-box { min-width: 0; }
  .table-wrap { min-height: 460px; overflow-x: hidden; }
  table { display: block; min-width: 0; }
  thead { display: none; }
  tbody { display: grid; }
  tbody tr {
    position: relative;
    min-height: 88px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 9px 12px;
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
  }
  tbody tr.exhibition-group-row {
    min-height: 36px;
    display: block;
    padding: 0;
    border-bottom: 0;
  }
  .exhibition-group-row td {
    height: 36px;
    display: block;
    width: 100%;
    padding: 0 12px;
  }
  td { height: auto; min-width: 0; padding: 0; border: 0; }
  td:nth-child(1) { grid-column: 1; grid-row: 1; }
  td:nth-child(3) { grid-column: 1; grid-row: 2; }
  td:nth-child(6) { grid-column: 2; grid-row: 1; text-align: right; }
  td:nth-child(7) { grid-column: 2; grid-row: 2; text-align: right; color: var(--muted); }
  td:nth-child(2), td:nth-child(4), td:nth-child(5), td:nth-child(8) { display: none; }
  .exhibition-group-row td:nth-child(1) { display: block; grid-column: auto; grid-row: auto; }
  .company-cell { gap: 6px; }
  .priority-button { width: 24px; height: 24px; flex-basis: 24px; }
  .status-select { min-width: 96px; height: 28px; padding-left: 9px; font-size: 11px; }
  .last-follow-up { font-size: 12px; }
  .company-name, .company-email, .cell-primary { max-width: 100%; }
  .table-footer { min-height: 40px; }
  .table-footer span:last-child { display: none; }
  .drawer { width: 100vw; }
  .drawer-header, .drawer-footer { padding: 14px; }
  .drawer-body { padding: 4px 14px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
}
