* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f5f5;
  color: #1a1a1a;
}

.hidden {
  display: none !important;
}

.performance-admin { overflow-x: auto; }
.performance-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.performance-toolbar strong { min-width: 140px; text-align: center; }
.admin-select { position: relative; min-width: 180px; margin-left: auto; }
.admin-select-trigger { width: 100%; height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; color: #222; background: #fff; border: 1px solid #bbb; border-radius: 0; font-size: 13px; cursor: pointer; }
.admin-select-trigger:hover, .admin-select-trigger:focus { border-color: #111; outline: none; }
.admin-select-menu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20; padding: 6px; background: #fff; border: 1px solid #bbb; box-shadow: 0 10px 24px rgba(0,0,0,.1); }
.admin-select-menu button { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 10px; color: #222; background: #fff; border: 0; text-align: left; cursor: pointer; }
.admin-select-menu button:hover { color: #fff; background: #111; }
.admin-select-menu small { margin-left: 12px; color: #999; }
.admin-select-menu button:hover small { color: #bbb; }
.period-buttons { display: flex; gap: 8px; }
.period-btn.active { color: #fff; background: #111; border-color: #111; }
.performance-toolbar .period-nav {
  min-width: 92px;
  color: #222;
  background: #fff;
  border: 1px solid #aaa;
  font-weight: 500;
}
.performance-toolbar .period-nav:hover {
  color: #fff;
  background: #111;
  border-color: #111;
}
.admin-summary-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; margin-bottom: 34px; }
.admin-summary-card { padding: 24px; border: 1px solid #e1e1e1; }
.admin-summary-card span, .admin-summary-card strong { display: block; }
.admin-summary-card span { color: #999; font-size: 13px; }
.admin-summary-card strong { margin-top: 12px; font-size: 28px; }
.admin-summary-card.dark { color: #fff; background: #111; border-color: #111; }
.admin-summary-card.dark span { color: #aaa; }
.admin-section-title { margin: 30px 0 14px; font-size: 18px; }

/* 登录页 */
.login-view {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
}

.login-card {
  width: 320px;
  background: #fff;
  padding: 40px 32px;
  border-radius: 4px;
  text-align: center;
}

.login-card h1 {
  margin: 0 0 4px;
  font-size: 22px;
  letter-spacing: 2px;
}

.login-sub {
  margin: 0 0 24px;
  color: #888;
  font-size: 13px;
}

.login-card input {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid #ddd;
  border-radius: 2px;
  font-size: 14px;
}

.login-card button {
  width: 100%;
  padding: 12px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 2px;
  font-size: 14px;
  cursor: pointer;
}

.login-card button:hover {
  background: #333;
}

.error-text {
  color: #c0392b;
  font-size: 13px;
  min-height: 18px;
  margin: 8px 0 0;
}

/* 主界面 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: #111;
  color: #fff;
}

.topbar-title h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 1px;
}

.topbar-sub {
  font-size: 12px;
  color: #999;
}

.topbar-nav {
  display: flex;
  gap: 16px;
  margin-top: 10px;
}

.nav-link {
  font-size: 12px;
  color: #888;
  text-decoration: none;
  letter-spacing: 1px;
}

.nav-link.active,
.nav-link:hover {
  color: #fff;
}

.cb-inline {
  display: inline-flex !important;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #333 !important;
  margin-bottom: 0 !important;
  width: auto;
  white-space: nowrap;
}

.cb-inline input[type="checkbox"] {
  width: auto !important;
  flex: 0 0 auto;
  padding: 0;
  margin: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-actions input {
  padding: 8px 12px;
  border: 1px solid #444;
  border-radius: 2px;
  background: #222;
  color: #fff;
  font-size: 13px;
  width: 200px;
}

.btn {
  padding: 8px 16px;
  border-radius: 2px;
  border: 1px solid transparent;
  font-size: 13px;
  cursor: pointer;
}

.btn.primary {
  background: #fff;
  color: #111;
}

.btn.primary:hover {
  background: #ddd;
}

.btn.ghost {
  background: transparent;
  color: #fff;
  border-color: #555;
}

.btn.ghost:hover {
  border-color: #fff;
}

/* 表单弹层背景为白色，ghost/primary 按钮需要换成深色系配色，
   否则会和顶部导航栏一样用白字/白底，导致在白色背景上不可见。 */
.form-footer .btn.ghost {
  color: #333;
  border-color: #ccc;
}

.form-footer .btn.ghost:hover {
  border-color: #111;
  background: #f5f5f5;
}

.form-footer .btn.primary {
  background: #111;
  color: #fff;
}

.form-footer .btn.primary:hover {
  background: #333;
}

.content {
  padding: 24px 32px;
}

.product-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.product-table th,
.product-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  font-size: 13px;
  vertical-align: top;
}

.product-table th {
  color: #888;
  font-weight: 500;
  border-bottom: 1px solid #ddd;
}

.tag-pill {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px 4px 2px 0;
  background: #f0f0f0;
  border-radius: 10px;
  font-size: 12px;
  color: #555;
}

.row-actions button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: #333;
  margin-right: 12px;
}

.row-actions button.danger {
  color: #c0392b;
}

.row-actions button:hover {
  text-decoration: underline;
}

.empty-tip {
  text-align: center;
  color: #999;
  padding: 60px 0;
}

/* 表单弹层 */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.form-panel {
  width: 560px;
  max-height: 86vh;
  background: #fff;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
}

.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}

.form-header h2 {
  margin: 0;
  font-size: 16px;
}

.btn-close {
  border: none;
  background: none;
  font-size: 22px;
  cursor: pointer;
  color: #999;
  line-height: 1;
}

.form-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.form-row {
  margin-bottom: 16px;
}

.form-row label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 6px;
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 2px;
  font-size: 13px;
  font-family: inherit;
}

.multiselect {
  position: relative;
}

.multiselect-trigger {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 2px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
  color: #1a1a1a;
}

.multiselect-trigger.placeholder {
  color: #999;
}

.multiselect-trigger::after {
  content: "▾";
  float: right;
  color: #999;
}

.multiselect-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 10;
  max-height: 220px;
  overflow-y: auto;
}

.ms-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  font-size: 13px;
  cursor: pointer;
}

.ms-option:hover {
  background: #f5f5f5;
}

.ms-option input[type="checkbox"] {
  width: auto;
  flex: 0 0 auto;
  padding: 0;
  margin: 0;
}

.chip-input {
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 8px 10px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.chip-list:empty {
  margin-bottom: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  background: #f0f0f0;
  border-radius: 12px;
  font-size: 12px;
  color: #333;
}

.chip button {
  border: none;
  background: none;
  cursor: pointer;
  color: #999;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

.chip button:hover {
  color: #c0392b;
}

.chip-input input {
  border: none;
  padding: 4px 2px;
  font-size: 13px;
  width: 100%;
}

.chip-input input:focus {
  outline: none;
}

.price-ton-input {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 2px;
  overflow: hidden;
}

.price-ton-input .prefix,
.price-ton-input .suffix {
  padding: 10px 12px;
  background: #f5f5f5;
  color: #666;
  font-size: 13px;
  white-space: nowrap;
}

.price-ton-input input {
  flex: 1;
  border: none;
  border-radius: 0;
  min-width: 0;
}

.price-ton-input input:focus {
  outline: none;
}

.internal-label {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  color: #a23b32;
  background: #fff2f0;
  border-radius: 2px;
  font-size: 11px;
}

.floor-price-input {
  border-color: #e4c4c0;
}

.floor-price-hint {
  margin-top: 6px;
  color: #a06b64;
}

.hint {
  font-size: 12px;
  color: #999;
  margin: -2px 0 8px;
}

.price-calc-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 10px;
  padding: 9px 10px;
  background: #f7f7f7;
  border: 1px solid #e8e8e8;
}

.price-calc-toolbar .btn.small {
  padding: 6px 10px;
  background: #fff;
  color: #222;
  border-color: #ccc;
}

.price-calc-status {
  margin-left: auto;
  color: #777;
  font-size: 12px;
}

hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 20px 0;
}

.price-grid table {
  width: 100%;
  border-collapse: collapse;
}

.price-grid th,
.price-grid td {
  border: 1px solid #eee;
  padding: 6px;
  font-size: 12px;
  text-align: center;
}

.price-grid input {
  width: 100%;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 2px;
  font-size: 12px;
  text-align: center;
}

.price-grid .empty {
  color: #999;
  font-size: 12px;
  padding: 8px 0;
}

.floor-price-grid .calculated-price {
  display: block;
  min-height: 30px;
  padding: 6px;
  background: #f7f7f7;
  border: 1px solid #e4e4e4;
  color: #333;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #eee;
}

.form-footer .error-text {
  margin: 0;
  margin-right: auto;
}
