:root {
  color-scheme: light;
  --bg: #f5f7f9;
  --panel: #ffffff;
  --line: #dde3ea;
  --text: #17202a;
  --muted: #637083;
  --primary: #1f6feb;
  --primary-strong: #185abc;
  --ok: #0f8a5f;
  --warn: #b26a00;
  --bad: #b42318;
  --soft: #eef4ff;
  --radius: 8px;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

input[type="checkbox"] {
  width: auto;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background: var(--primary-strong);
}

button.secondary {
  background: #e9eef5;
  color: var(--text);
}

button.secondary:hover {
  background: #dce5f0;
}

button.danger {
  background: var(--bad);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 74px;
  resize: vertical;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 12px 28px rgba(12, 25, 48, 0.08);
}

.login-panel h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.login-panel p {
  margin: 0 0 22px;
  color: var(--muted);
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}

.sidebar {
  background: #101828;
  color: #e8eef6;
  padding: 18px 14px;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  margin: 8px 8px 18px;
}

.user-box {
  margin: 0 8px 16px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #d7e2ef;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  background: transparent;
  color: #d7e2ef;
  text-align: left;
  padding: 10px 12px;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.main {
  padding: 22px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e5484d;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

h2 {
  margin: 0;
  font-size: 22px;
}

h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.item-header {
  color: var(--muted);
  font-size: 13px;
  padding: 0 2px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.inquiry-form {
  display: grid;
  gap: 14px;
}

.inquiry-section {
  padding: 18px 20px;
}

.inquiry-entry-section {
  border-color: #9eb7d8;
  background: #fbfdff;
}

.inquiry-entry-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
  gap: 14px;
  align-items: stretch;
}

.inquiry-entry-layout textarea {
  min-height: 150px;
}

.entry-result label {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.entry-result pre {
  margin: 0;
  min-height: 150px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  padding: 12px;
  color: var(--text);
  white-space: pre-wrap;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.section-title h3 {
  margin: 0;
}

.inquiry-items-section {
  border-color: #b9c7d8;
  box-shadow: inset 4px 0 0 var(--primary);
}

.inquiry-items-grid {
  gap: 10px;
}

.inquiry-items-grid .grid.cols-4 {
  grid-template-columns: minmax(180px, 1.1fr) minmax(160px, 1fr) minmax(90px, 0.45fr) minmax(220px, 1.1fr);
}

.lookup-result-block {
  margin-top: 14px;
}

.lookup-result-block label {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.lookup-result-block pre {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  padding: 12px;
  color: var(--text);
  max-height: 280px;
  overflow: auto;
}

.inquiry-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.metric .label {
  color: var(--muted);
  margin-bottom: 8px;
}

.metric .value {
  font-size: 26px;
  font-weight: 700;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

table.quote-table {
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f0f4f8;
  color: #344054;
  font-weight: 600;
}

tr:last-child td {
  border-bottom: 0;
}

.quote-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.quote-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  white-space: nowrap;
}

.quote-quality {
  font-weight: 700;
}

.quote-price {
  color: var(--primary);
  font-weight: 700;
}

.quote-meta {
  color: var(--muted);
  font-size: 12px;
}

.quote-separator {
  color: var(--muted);
}

.quote-internal {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef2f7;
  color: #344054;
  font-size: 12px;
}

.tag.ok {
  background: #e7f8f0;
  color: var(--ok);
}

.tag.warn {
  background: #fff4df;
  color: var(--warn);
}

.tag.bad {
  background: #feeceb;
  color: var(--bad);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.brand-picker {
  align-self: start;
}

.brand-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.brand-choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel-soft);
  cursor: pointer;
}

.brand-choice input {
  margin: 0;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
}

.message {
  margin: 10px 0 0;
  color: var(--bad);
}

.notification-panel {
  margin-bottom: 16px;
  border-left: 4px solid var(--primary);
}

.notification-list {
  display: grid;
  gap: 8px;
}

.notification-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.notification-item.unread {
  background: #fff7ed;
  border-color: #fed7aa;
}

.notification-item.read {
  opacity: 0.76;
}

.drawer {
  margin-top: 14px;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    display: block;
  }

  .inquiry-entry-layout {
    grid-template-columns: 1fr;
  }

  .inquiry-items-grid .grid.cols-4 {
    grid-template-columns: 1fr;
  }
}
