:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #18211d;
  background: #f2f4f0;
  font-synthesis: none;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select { font: inherit; letter-spacing: 0; }
button, label { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.topbar {
  height: 76px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid #dce2dc;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand > span { width: 40px; height: 40px; display: grid; place-items: center; background: #1f4b38; color: #fff; border-radius: 6px; }
.brand-mark, .icon-text, .upload-mark span { font-weight: 800; font-size: 10px; letter-spacing: .6px; }
.brand h1 { margin: 0; font-size: 18px; font-weight: 700; }
.brand p { margin: 2px 0 0; font-size: 9px; letter-spacing: 1.8px; color: #7a857f; }

.primary-button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #1f4b38;
  color: #fff;
  font-weight: 650;
  transition: background .18s, transform .18s;
}
.primary-button:hover { background: #163a2a; }
.primary-button:active { transform: translateY(1px); }
.button-symbol { font-size: 19px; line-height: 1; }

.empty-main { width: min(920px, calc(100% - 40px)); margin: 8vh auto 0; }
.upload-panel {
  min-height: 390px;
  padding: 56px 24px;
  border: 1px dashed #aab8ae;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: border .18s, background .18s;
}
.upload-panel.dragging { border-color: #1f4b38; background: #f2f8f4; }
.upload-mark { width: 68px; height: 68px; display: grid; place-items: center; border-radius: 50%; background: #e6f1ea; color: #1f4b38; margin-bottom: 20px; }
.upload-mark span { font-size: 17px; }
.upload-panel h2 { margin: 0 0 10px; font-size: 24px; }
.upload-panel p { color: #6f7973; margin: 0 0 28px; font-size: 14px; }
.drop-tip { margin-top: 14px; color: #8a948e; font-size: 12px; }
.rules { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #dce2dc; border-top: 0; background: #fff; }
.rules > div { padding: 24px; display: flex; align-items: center; gap: 14px; border-right: 1px solid #e3e7e3; }
.rules > div:last-child { border-right: 0; }
.rules b { color: #d7a600; font-size: 13px; }
.rules span { display: flex; flex-direction: column; gap: 4px; }
.rules strong { font-size: 13px; }
.rules small { color: #7d8781; font-size: 11px; }

.results-main { padding: 28px clamp(20px, 4vw, 64px) 48px; max-width: 1600px; margin: auto; }
.file-strip { min-height: 62px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; background: #e7f2eb; border-left: 3px solid #2f7954; }
.file-strip > div { display: flex; align-items: center; gap: 12px; min-width: 0; }
.check-symbol { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #2f7954; border-radius: 50%; color: #2f7954; font-size: 13px; flex: 0 0 auto; }
.file-strip span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.file-strip strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-strip small { color: #688071; font-size: 11px; }
.text-button { border: 0; background: transparent; color: #1f5b40; padding: 8px; font-weight: 650; white-space: nowrap; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.metric { min-height: 104px; padding: 18px; display: flex; align-items: center; gap: 15px; background: #fff; border: 1px solid #dde2dd; }
.metric-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 6px; flex: 0 0 auto; }
.icon-text { font-size: 9px; }
.metric-icon.ink { background: #e7ebe8; color: #2f3934; }
.metric-icon.green { background: #e2f1e7; color: #247149; }
.metric-icon.yellow { background: #fff3cc; color: #9b7200; }
.metric-icon.red { background: #fbe5df; color: #b64b36; }
.metric div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.metric small { color: #748078; font-size: 12px; }
.metric strong { font-size: clamp(19px, 2vw, 26px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.warning { display: flex; gap: 9px; align-items: center; margin: -5px 0 18px; padding: 10px 13px; background: #fff5d8; color: #755800; font-size: 12px; }
.warning .symbol { width: 17px; height: 17px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-weight: 750; }

.data-panel { background: #fff; border: 1px solid #dce2dc; }
.panel-top { min-height: 70px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #dce2dc; }
.tabs { align-self: stretch; display: flex; align-items: stretch; gap: 22px; }
.tab { position: relative; padding: 0 2px; border: 0; background: transparent; color: #7c867f; font-weight: 650; white-space: nowrap; }
.tab span { margin-left: 5px; padding: 2px 6px; border-radius: 9px; font-size: 10px; background: #edf0ed; }
.tab.active { color: #1e4936; }
.tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #1f4b38; }
.filters { display: flex; gap: 9px; }
.search { height: 38px; width: min(260px, 28vw); padding: 0 10px; display: flex; align-items: center; gap: 7px; border: 1px solid #cfd6d0; background: #fff; }
.search:focus-within { border-color: #41775c; outline: 2px solid #dcece3; }
.search-symbol { width: 16px; color: #818b84; font-size: 18px; transform: rotate(-20deg); }
.search input { width: 100%; min-width: 0; border: 0; outline: 0; font-size: 12px; }
.search button { width: 24px; height: 24px; border: 0; background: transparent; padding: 3px; color: #6f7973; }
.hidden { display: none !important; }
.filters select { height: 38px; padding: 0 32px 0 10px; border: 1px solid #cfd6d0; background: #fff; font-size: 12px; color: #455049; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { height: 44px; padding: 0 12px; text-align: left; background: #f5f7f5; color: #647069; font-weight: 650; white-space: nowrap; border-bottom: 1px solid #dfe4df; }
td { max-width: 280px; height: 48px; padding: 8px 12px; border-bottom: 1px solid #edf0ed; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
tbody tr:hover { background: #fafcfb; }
td.number { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 10px; font-size: 10px; }
.badge.success { background: #e2f1e7; color: #236944; }
.badge.waiting { background: #fff0c7; color: #826000; }
.badge.danger { background: #fbe5df; color: #a63f2d; }
.no-results { height: 160px; text-align: center; color: #89928c; }
.pagination { min-height: 56px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; color: #76817a; font-size: 11px; }
.pagination > div { display: flex; gap: 6px; }
.icon-button { width: 32px; height: 32px; border: 1px solid #d3d9d4; background: #fff; color: #35433b; font-size: 20px; }
.icon-button:disabled { opacity: .4; cursor: default; }

.toast { position: fixed; z-index: 10; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 11px 16px; background: #1f3028; color: #fff; border-radius: 5px; font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; box-shadow: 0 8px 30px #0003; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #9e3c2d; }

@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .panel-top { padding: 14px; align-items: stretch; flex-direction: column; }
  .tabs { min-height: 42px; }
  .filters { width: 100%; }
  .search { width: 100%; }
  .filters select { max-width: 180px; }
}

@media (max-width: 620px) {
  .topbar { height: 66px; padding: 0 14px; }
  .brand > span { width: 36px; height: 36px; }
  .brand h1 { font-size: 15px; }
  .brand p { display: none; }
  .topbar .primary-button { width: 42px; padding: 0; }
  .topbar .primary-button span { display: none; }
  .empty-main { width: calc(100% - 28px); margin-top: 28px; }
  .upload-panel { min-height: 350px; }
  .rules { grid-template-columns: 1fr; }
  .rules > div { border-right: 0; border-bottom: 1px solid #e3e7e3; }
  .rules > div:last-child { border-bottom: 0; }
  .results-main { padding: 16px 14px 32px; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric { min-height: 90px; padding: 12px; gap: 9px; }
  .metric-icon { width: 34px; height: 34px; }
  .metric strong { font-size: 17px; }
  .filters { flex-direction: column; }
  .filters select { width: 100%; max-width: none; }
}
