:root {
  --primary: #2f6fed;
  --text: #1f2937;
  --muted: #8a94a6;
  --border: #e5e8ef;
  --bg: #f5f7fb;
  --el-font-size-base: 15px;
}

[v-cloak] {
  display: none;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
}

/* 登录页 */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #14356b;
  padding: 24px;
}

.login-card {
  width: 380px;
  max-width: 100%;
  background: #fff;
  border-radius: 14px;
  padding: 36px 32px 28px;
  box-shadow: 0 18px 50px rgba(15, 34, 78, 0.25);
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.login-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  background: #2f6fed;
  box-shadow: 0 10px 24px rgba(47, 111, 237, 0.3);
  flex-shrink: 0;
}

.login-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 2px;
}

.login-sub {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  margin: 10px 0 26px;
}

.login-btn {
  width: 100%;
  margin-top: 6px;
}

.login-tip {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* 布局 */
.layout {
  min-height: 100vh;
}

.app-header {
  background: #16376f;
  border-bottom: none;
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 0 30px;
  height: 72px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 6px 24px rgba(15, 34, 78, 0.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  white-space: nowrap;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.brand-name {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.15;
}

.nav {
  flex: 1;
  border-bottom: none !important;
  background: transparent !important;
  display: flex;
  justify-content: center;
  --el-menu-text-color: rgba(255, 255, 255, 0.78);
  --el-menu-active-color: #ffffff;
  --el-menu-hover-bg-color: rgba(255, 255, 255, 0.1);
  --el-menu-bg-color: transparent;
  --el-menu-horizontal-height: 72px;
}

.nav .el-menu-item {
  height: 72px;
  line-height: 72px;
  font-size: 15px;
  padding: 0 20px;
  border-bottom: 2px solid transparent !important;
}

.nav .el-menu-item .el-icon {
  margin-right: 6px;
  font-size: 16px;
}

.nav .el-menu-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

.nav .el-menu-item.is-active {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border-bottom-color: #ffffff !important;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  margin-left: auto;
}

.user-name {
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
}

.user-more {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  padding: 4px 6px;
  outline: none;
}

.main {
  padding: 26px 30px 40px;
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
}

/* 快速查询 */
.quick-page {
  padding-top: 2px;
}

.hero {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 32px 22px;
  text-align: center;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(24, 52, 110, 0.05);
}

.hero-inner {
  max-width: 860px;
  margin: 0 auto;
}

.hero-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
}

.hero-search-card {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 18px auto 0;
  padding: 6px;
  border-radius: 14px;
  background: #f6f8fc;
  border: 1px solid var(--border);
}

.hero-input {
  flex: 1;
  min-width: 0;
}

.hero-input .el-input__wrapper {
  height: 46px;
  border-radius: 10px;
  box-shadow: 0 0 0 1px #e2e8f3 inset;
  background: #fff;
  font-size: 15px;
}

.hero-input .el-input__prefix {
  color: #98a4b8;
}

.hero-btn {
  height: 46px;
  border-radius: 10px;
  padding: 0 30px;
  font-size: 15px;
  flex-shrink: 0;
  border: none !important;
  background: var(--primary) !important;
  box-shadow: 0 6px 14px rgba(47, 111, 237, 0.22);
}

.hero-search-card .el-button {
  margin-left: 0;
}

.hero-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin-top: 18px;
}

.hero-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 0 22px;
}

.hero-stat + .hero-stat {
  border-left: 1px solid #e6eaf2;
}

.hero-stat b {
  font-size: 20px;
  font-weight: 700;
  color: #17408f;
  letter-spacing: 0.5px;
}

.hero-stat span {
  font-size: 12px;
  color: var(--muted);
}

.list-panel {
  position: relative;
  z-index: 1;
  padding-top: 18px;
}

.list-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.list-title {
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.list-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.list-actions .el-button {
  margin-left: 0;
}

/* 数据管理 */
.page-hero {
  margin-bottom: 8px;
}

.page-hero-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.page-tabs {
  margin-top: 10px;
}

.page-tabs > .el-tabs__header {
  margin-bottom: 16px;
}

/* 通用面板 */
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 18px;
}

.panel-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}

.panel-desc,
.form-tip {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.panel-desc {
  margin-bottom: 10px;
}

.panel-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.panel-hint {
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar .w420 {
  flex: 1 1 320px;
  width: auto;
  min-width: 240px;
  max-width: 620px;
}

.toolbar-right {
  margin-left: auto;
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.pager {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

/* 数据表格 */
.data-table {
  font-size: 14.5px;
}

.data-table th.el-table__cell {
  background: #f7f9fc;
  color: #4b5563;
  font-size: 14.5px;
  font-weight: 600;
  height: 50px;
}

.data-table td.el-table__cell {
  height: 52px;
}

.w100 { width: 100px; }
.w110 { width: 110px; }
.w120 { width: 120px; }
.w130 { width: 130px; }
.w140 { width: 140px; }
.w150 { width: 150px; }
.w160 { width: 160px; }
.w180 { width: 180px; }
.w200 { width: 200px; }
.w220 { width: 220px; }
.w240 { width: 240px; }
.w260 { width: 260px; }
.w300 { width: 300px; }
.w420 { width: 420px; }

.ml8 { margin-left: 10px; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mb8 { margin-bottom: 8px; }

.muted {
  color: var(--muted);
  font-size: 13px;
}

.model-cell {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 14px;
  color: #1f3a8a;
  cursor: pointer;
  word-break: break-all;
}

.model-cell:hover {
  color: var(--primary);
  text-decoration: underline;
}

.qty-cell {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px;
  padding: 0 !important;
  margin: 0 2px;
  font-size: 17px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.icon-btn:hover {
  background: #eef3ff;
}

/* 导入 */
.import-form .el-form-item {
  margin-bottom: 18px;
}

.import-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.import-advanced {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  border-bottom: none;
}

.import-advanced .el-collapse-item__header {
  font-size: 14px;
  color: #4b5563;
}

.source-box {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  background: #fbfcfe;
}

.source-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.source-desc {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
  line-height: 1.6;
}

.dir-input {
  margin-bottom: 10px;
}

.hidden-input {
  display: none;
}

.file-list {
  margin-top: 10px;
  font-size: 12px;
  color: #4b5563;
  max-height: 130px;
  overflow: auto;
}

.file-item {
  padding: 2px 0;
  word-break: break-all;
}

.template-line {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 10px;
}

.c-add { color: #15803d; }
.c-update { color: #b45309; }
.c-off { color: #b91c1c; }
.c-warn { color: #7c3aed; }

.preview-scope {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
  word-break: break-all;
}

.dialog-line {
  padding: 4px 0;
  font-size: 13px;
}

.el-dialog {
  max-width: 94vw;
}

/* 移动端卡片列表 */
.mobile-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.m-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.m-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.m-model {
  flex: 1;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 14.5px;
  color: #1f3a8a;
  word-break: break-all;
}

.m-card-highlight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f3f6fc;
}

.m-qty-block {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.m-qty-label {
  font-size: 12px;
  color: #6b7688;
}

.m-qty {
  font-size: 24px;
  font-weight: 700;
  color: #1d4ed8;
  line-height: 1;
}

.m-brand-chip {
  max-width: 58%;
  font-size: 13px;
  font-weight: 600;
  color: #0f766e;
  background: #e6f7f3;
  border-radius: 999px;
  padding: 4px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.m-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #eef1f7;
}

.m-card-actions .el-button {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  margin-left: 0 !important;
  border: none !important;
  background: #f4f6fa !important;
  color: #5b6478;
}

.m-card-actions .el-button.el-button--primary {
  color: #1d4ed8;
  background: #eef4ff !important;
}

.m-card-actions .el-button.el-button--warning {
  color: #b45309;
  background: #fff7e8 !important;
}

.m-card-actions .el-button.el-button--success {
  color: #047857;
  background: #e9f9f1 !important;
}

.m-card-actions .m-icon-btn {
  font-size: 17px;
}

.w-full {
  width: 100%;
}

.m-log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.m-log-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fbfcfe;
}

.m-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.m-log-action {
  font-weight: 600;
}

.m-log-qty {
  margin-top: 6px;
  font-size: 14px;
}

.m-log-reason {
  margin-top: 4px;
  font-size: 13px;
  color: #4b5563;
  word-break: break-all;
}

/* 站外行情 */
.external-list {
  margin-top: 10px;
  max-height: 60vh;
  overflow: auto;
}

.external-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fbfcfe;
}

.ext-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ext-site {
  font-weight: 600;
}

.ext-time {
  margin-left: auto;
}

.ext-title {
  margin-top: 6px;
  font-size: 14px;
  color: #1f2937;
  word-break: break-all;
}

.ext-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
}

.ext-field {
  color: #64748b;
}

.ext-value-price {
  font-size: 20px;
  font-weight: 700;
  color: #d4380d;
}

.ext-value-quote {
  font-size: 18px;
  font-weight: 700;
  color: #b45309;
}

.ext-value-qty {
  font-size: 20px;
  font-weight: 700;
  color: #17408f;
}

.ext-value-empty {
  color: var(--muted);
}

.ext-head .el-tag {
  font-weight: 600;
}

.ext-meta a {
  color: var(--primary);
  text-decoration: none;
}

.ext-snippet {
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.6;
  word-break: break-all;
}

.test-row {
  display: flex;
  gap: 10px;
  margin: 12px 0;
}

.ext-search-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.ext-local {
  margin-top: 8px;
  font-size: 13px;
  color: #4b5563;
}

.ext-loading-tip {
  margin-top: 8px;
  font-size: 13px;
}

.ext-summary {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f3f6fc;
  color: #334155;
  font-size: 13px;
  line-height: 1.6;
}

.ext-note {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.ext-tip {
  padding: 18px 10px;
  text-align: center;
}

.table-empty {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.m-time {
  font-size: 12px;
  color: var(--muted);
}

.drawer-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.drawer-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.drawer-actions .el-button {
  flex: 1;
  margin-left: 0 !important;
}

/* 移动端 */
@media (max-width: 768px) {
  /* 输入框字号不小于 16px，避免聚焦输入时浏览器自动放大页面 */
  .el-input__inner,
  .el-textarea__inner,
  .el-select__input {
    font-size: 16px !important;
  }

  .app-header {
    flex-wrap: nowrap;
    height: 56px;
    padding: 0 8px;
    gap: 6px;
  }

  .brand {
    gap: 6px;
    flex-shrink: 0;
  }

  .brand-logo {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 15px;
  }

  .brand-name {
    font-size: 16px;
    letter-spacing: 1px;
  }

  .user-name {
    display: inline-block;
    max-width: 62px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
  }

  .user-area {
    margin-left: auto;
    flex-shrink: 0;
  }

  .nav {
    order: 0;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    height: 56px;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: center;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav .el-menu-item {
    height: 56px;
    line-height: 56px;
    padding: 0 3px;
    font-size: 12px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .nav .el-menu-item .el-icon {
    display: none;
  }

  .main {
    padding: 10px 12px 24px;
  }

  .quick-page {
    padding-top: 0;
  }

  .hero {
    padding: 18px 14px 16px;
    border-radius: 14px;
    margin-bottom: 12px;
  }

  .hero-title {
    font-size: 21px;
    letter-spacing: 0.5px;
  }

  .hero-search-card {
    margin-top: 12px;
    padding: 5px;
    gap: 6px;
    border-radius: 12px;
  }

  .hero-input {
    flex: 1 1 auto;
  }

  .hero-input .el-input__wrapper {
    height: 40px;
    font-size: 16px;
  }

  .hero-btn {
    flex: 0 0 auto;
    padding: 0 16px;
    height: 40px;
    font-size: 14px;
  }

  .hero-stats {
    margin-top: 12px;
  }

  .hero-stat {
    padding: 0 14px;
    gap: 5px;
  }

  .hero-stat b {
    font-size: 17px;
  }

  .hero-stat span {
    font-size: 11px;
  }

  .list-panel {
    padding: 14px;
  }

  .list-title {
    font-size: 15px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .list-actions {
    width: 100%;
    margin-left: 0;
    gap: 8px;
  }

  .page-hero-title {
    font-size: 20px;
  }

  .page-tabs > .el-tabs__header {
    margin-bottom: 12px;
  }

  .panel {
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 12px;
  }

  .panel-title {
    font-size: 15px;
    margin-bottom: 10px;
  }

  .toolbar {
    gap: 8px;
  }

  .toolbar .w420 {
    flex: 1 1 100%;
    min-width: 0;
    max-width: none;
    width: 100% !important;
  }

  .toolbar .el-button {
    margin-left: 0;
  }

  .toolbar-right {
    margin-left: 0;
    width: auto;
    flex-wrap: wrap;
    gap: 8px;
  }

  .toolbar-right .el-button {
    margin-left: 0;
  }

  .pager {
    justify-content: center;
  }

  .preview-summary {
    gap: 10px;
    font-size: 12px;
  }

  .el-dialog {
    width: 94vw !important;
    margin-top: 4vh;
  }

  .el-dialog__body {
    padding: 12px 14px;
  }

  .w420, .w300, .w260, .w240, .w220, .w200, .w180, .w160, .w150, .w140, .w130, .w120, .w110, .w100 {
    width: 100% !important;
  }
}
