:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #18212f;
  background: #f3f6fa;
}

* { box-sizing: border-box; }

html, body { max-width: 100%; overflow-x: hidden; }
body { margin: 0; min-width: 320px; }

button, select, input { font: inherit; }

.app-shell { width: min(100% - 32px, 960px); margin: 0 auto; padding: calc(48px + env(safe-area-inset-top)) 0 calc(64px + env(safe-area-inset-bottom)); }
.page-header { margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: #2463b5; font-size: 14px; font-weight: 700; letter-spacing: .08em; }
h1, h2, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(28px, 5vw, 40px); letter-spacing: .02em; }
.subtitle { margin: 12px 0 0; color: #5b6879; }

.control-panel, .results-panel { background: #fff; border: 1px solid #dfe6ef; border-radius: 16px; box-shadow: 0 8px 24px rgba(31, 56, 88, .06); }
.control-panel { padding: 24px; }
.import-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.import-button, .reset-button { border: 0; border-radius: 8px; cursor: pointer; font-weight: 700; transition: background-color .2s, transform .2s; }
.import-button { display: inline-flex; align-items: center; min-height: 42px; padding: 0 18px; color: #fff; background: #2463b5; }
.import-button:hover { background: #174d91; transform: translateY(-1px); }
.clear-data-button { min-height: 42px; padding: 0 16px; color: #9f2d25; background: #fff4f2; border: 1px solid #efc5c0; border-radius: 8px; cursor: pointer; font-weight: 700; }
.clear-data-button:hover:not(:disabled) { background: #fee8e5; }
.clear-data-button:disabled { cursor: not-allowed; opacity: .55; }
.data-info { margin-top: 16px; padding: 14px 16px; border-radius: 9px; background: #f6f9fd; }
.data-status { margin: 0; color: #516071; font-size: 14px; font-weight: 700; }
.data-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 18px; margin: 12px 0 0; }
.data-details div { min-width: 0; }
.data-details dt { color: #68778a; font-size: 12px; }
.data-details dd { margin: 3px 0 0; color: #253248; font-size: 14px; overflow-wrap: anywhere; }
.pwa-status { margin: 12px 0 0; color: #516071; font-size: 13px; }
.update-notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 10px 12px; color: #174d91; background: #eaf2fd; border-radius: 8px; font-size: 14px; font-weight: 700; }
.update-notice button { min-height: 34px; padding: 0 12px; color: #fff; background: #2463b5; border: 0; border-radius: 7px; cursor: pointer; font-weight: 700; }
.filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 16px; align-items: end; margin-top: 22px; }
.field { display: grid; gap: 7px; min-width: 0; color: #344154; font-size: 14px; font-weight: 700; }
select { width: 100%; min-width: 0; height: 42px; padding: 0 34px 0 12px; color: #18212f; background: #fff; border: 1px solid #b9c6d6; border-radius: 8px; }
select:focus, .reset-button:focus-visible, .import-button:focus-visible { outline: 3px solid rgba(36, 99, 181, .25); outline-offset: 2px; }
select:disabled, .reset-button:disabled { cursor: not-allowed; opacity: .55; }
.reset-button { min-height: 42px; padding: 0 16px; color: #2463b5; background: #eaf2fd; }
.reset-button:not(:disabled):hover { background: #dbeafd; }
.message { min-height: 20px; margin: 14px 0 0; color: #b42318; font-size: 14px; }
.message.success { color: #167345; }

.results-panel { margin-top: 20px; overflow: hidden; }
.results-heading { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; padding: 20px 24px; border-bottom: 1px solid #e5ebf2; }
h2 { margin: 0; font-size: 19px; }
#result-summary { margin: 0; color: #5b6879; font-size: 14px; text-align: right; }
.results { padding: 12px 24px 24px; }
.empty-state { padding: 36px 12px; text-align: center; color: #5b6879; }
.empty-state p { margin: 0; }
.empty-state .hint { margin-top: 8px; color: #778497; font-size: 14px; }
.region-group { padding: 20px 0 4px; }
.region-group + .region-group { border-top: 1px solid #e5ebf2; }
.region-name { margin: 0 0 14px; color: #1c4f93; font-size: 20px; }
.store-card { padding: 15px 16px; margin: 0 0 12px; border: 1px solid #e0e7ef; border-radius: 10px; background: #fbfcfe; }
.store-name { margin: 0 0 10px; font-size: 16px; }
.phone-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.phone-number { display: block; color: #253248; font-family: Consolas, "Courier New", monospace; font-size: 15px; letter-spacing: .02em; word-break: break-all; }

@media (max-width: 620px) {
  .app-shell { width: min(100% - 24px, 960px); padding: calc(28px + env(safe-area-inset-top)) 0 calc(40px + env(safe-area-inset-bottom)); }
  .control-panel { padding: 18px; }
  .filters { grid-template-columns: 1fr; gap: 13px; }
  .reset-button { width: 100%; }
  .results-heading { display: block; padding: 18px; }
  #result-summary { margin-top: 7px; text-align: left; }
  .results { padding: 8px 18px 18px; }
  .data-details { grid-template-columns: 1fr 1fr; }
}
