:root {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  color: #172338;
  background: #f5f7fb;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body { margin: 0; }

a { color: inherit; }

button, input, select { font: inherit; }

button { cursor: pointer; }

.home-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 20% 20%, #e1edff, transparent 36%), #f5f7fb;
}

.welcome {
  width: min(100%, 640px);
  padding: clamp(36px, 7vw, 70px);
  text-align: center;
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(39, 65, 108, .08);
}

.eyebrow {
  color: #3162c7;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.welcome h1 {
  margin: 16px 0 12px;
  font-size: clamp(1.8rem, 5vw, 2.65rem);
  line-height: 1.3;
}

.welcome p, .page-heading p, .panel-heading p {
  color: #64748b;
  line-height: 1.7;
}

.welcome p { margin: 0 0 32px; }
.home-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }

.primary-link, .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid #2858bc;
  border-radius: 10px;
  background: #2858bc;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}

.primary-link:hover, .primary-button:hover { background: #1d489f; transform: translateY(-1px); }
.secondary-link { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px; border: 1px solid #c9d9f5; border-radius: 10px; color: #2858bc; background: #f1f6ff; font-weight: 700; text-decoration: none; }
.secondary-link:hover { background: #e3edff; }

.site-header { background: #fff; border-bottom: 1px solid #e5eaf1; }

.header-inner {
  width: min(100% - 40px, 1280px);
  min-height: 66px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { color: #2355b5; font-size: 1.25rem; font-weight: 800; text-decoration: none; }
.header-links { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; }
.header-links a { color: #52637d; font-size: .9rem; text-decoration: none; }
.header-links a:hover { color: #1748a5; text-decoration: underline; }
.back-link { color: #52637d; font-size: .9rem; text-decoration: none; }
.back-link:hover, .card-actions a:hover { color: #1748a5; text-decoration: underline; }

.page-shell { width: min(100% - 40px, 1280px); margin: 0 auto; padding: 42px 0 72px; }
.page-heading { margin-bottom: 28px; }
.page-heading h1 { margin: 8px 0 8px; font-size: clamp(1.8rem, 4vw, 2.4rem); }
.page-heading p { margin: 0; }
.page-heading .scoring-disclaimer { display: inline-block; margin-top: 12px; padding: 9px 12px; border: 1px solid #d9e5f6; border-radius: 8px; background: #edf4ff; color: #41618b; font-size: .84rem; }

.workspace { display: grid; grid-template-columns: minmax(300px, 390px) minmax(0, 1fr); gap: 22px; align-items: start; }
.panel { min-width: 0; padding: 26px; background: #fff; border: 1px solid #e5eaf1; border-radius: 18px; box-shadow: 0 8px 28px rgba(24, 44, 78, .035); }
.panel-heading h2 { margin: 0; font-size: 1.2rem; }
.panel-heading p { margin: 5px 0 0; font-size: .88rem; }
.product-form { display: grid; gap: 18px; margin-top: 24px; }
.field { min-width: 0; display: grid; gap: 8px; }
.field label { font-size: .88rem; font-weight: 700; }
.field label span { color: #df5262; }
.field input, .field select {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #d8e0eb;
  border-radius: 9px;
  background: #fff;
  color: #172338;
  outline: none;
}
.field input:focus, .field select:focus { border-color: #3b6fd1; box-shadow: 0 0 0 3px rgba(59, 111, 209, .14); }
.field input::placeholder { color: #9aa8bb; }
.field textarea { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid #d8e0eb; border-radius: 9px; background: #fff; color: #172338; outline: none; resize: vertical; font: inherit; }
.field textarea:focus { border-color: #3b6fd1; box-shadow: 0 0 0 3px rgba(59, 111, 209, .14); }
.price-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-with-prefix { position: relative; }
.input-with-prefix span { position: absolute; top: 11px; left: 12px; color: #7e8ca2; }
.input-with-prefix input { padding-left: 27px; }
.primary-button { width: 100%; margin-top: 4px; }

.message { margin-bottom: 20px; padding: 13px 16px; border-radius: 10px; font-size: .9rem; }
.message.success { border: 1px solid #bdebd0; background: #ecfaf2; color: #13603a; }
.message.error { margin: 20px 0 0; border: 1px solid #f2c9c9; background: #fff3f2; color: #9c2b2b; }
.message ul { margin: 8px 0 0; padding-left: 20px; }

.list-heading { display: flex; justify-content: space-between; align-items: start; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.filter { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid #e2e8f2; border-radius: 999px; color: #52637d; font-size: .86rem; font-weight: 700; text-decoration: none; }
.filter span { color: #8b9ab0; }
.filter:hover { border-color: #8eabe5; color: #2858bc; }
.filter.active { background: #eaf1ff; border-color: #b9d0fb; color: #2355b5; }
.filter.active span { color: #2355b5; }

.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.product-card { min-width: 0; padding: 18px; border: 1px solid #e6ebf2; border-radius: 13px; background: #fff; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.type-badge { padding: 5px 9px; border-radius: 6px; background: #eaf1ff; color: #2858bc; font-size: .75rem; font-weight: 800; }
.type-badge.main-type { background: #e8f7ef; color: #188153; }
.platform { color: #75849b; font-size: .8rem; }
.product-card h3 { margin: 14px 0 5px; overflow-wrap: anywhere; font-size: 1.03rem; }
.category { margin: 0; color: #64748b; font-size: .84rem; overflow-wrap: anywhere; }
.prices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 12px; padding: 14px 0 0; border-top: 1px solid #edf0f5; }
.prices div { display: grid; gap: 6px; min-width: 0; }
.prices span { color: #7b8a9f; font-size: .76rem; }
.prices strong { font-size: 1rem; overflow-wrap: anywhere; }
.combined-panel { padding: 15px; border: 1px solid #c9daf8; border-radius: 10px; background: #edf4ff; }
.combined-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #2355b5; font-size: .84rem; font-weight: 800; }
.combined-top strong { font-size: 1.6rem; line-height: 1.1; text-align: right; }
.combined-top small { font-size: .75rem; }
.combined-top .pending-score { font-size: .86rem; }
.score-breakdown, .market-brief { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 11px; color: #4f6381; font-size: .78rem; }
.market-brief { padding-top: 10px; border-top: 1px solid #d6e3fa; font-weight: 700; }
.score-panel { padding: 14px; border-radius: 10px; background: #f6f8fc; }
.combined-panel + .score-panel { margin-top: 10px; }
.score-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.score-top > div { display: grid; gap: 5px; }
.score-top span { color: #74839a; font-size: .76rem; }
.score-top strong { font-size: 1.36rem; line-height: 1.2; }
.score-top small { font-size: .75rem; }
.grade-wrap { text-align: right; }
.grade-badge { padding: 5px 8px; border-radius: 6px; background: #fff0d9; color: #99620d; font-size: .78rem !important; white-space: nowrap; }
.grade-badge.grade-good { background: #e4f6eb; color: #16804f; }
.grade-badge.grade-low { background: #f1f2f5; color: #667085; }
.score-panel p { margin: 12px 0 0; color: #5c6b80; font-size: .8rem; line-height: 1.6; overflow-wrap: anywhere; }
.score-panel p strong { color: #34455e; }
.card-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.card-actions a { color: #2858bc; font-size: .84rem; font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.card-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.card-links .market-update-link { padding: 6px 9px; border-radius: 7px; background: #eaf1ff; }
.card-links .market-update-link:hover { background: #dce9ff; text-decoration: none; }
.action-buttons { display: flex; align-items: center; gap: 14px; }
.rescore-button { padding: 5px 0; border: 0; background: none; color: #2858bc; font-size: .84rem; font-weight: 700; }
.rescore-button:hover { color: #1748a5; text-decoration: underline; }
.delete-button { padding: 5px 0 5px 12px; border: 0; background: none; color: #aa4150; font-size: .84rem; }
.delete-button:hover { color: #842c38; text-decoration: underline; }

.empty-state { display: grid; place-items: center; padding: 64px 12px; text-align: center; border: 1px dashed #dbe3ee; border-radius: 13px; background: #fbfcff; }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #eaf1ff; color: #2858bc; font-size: 1.7rem; }
.empty-state h3 { margin: 16px 0 5px; font-size: 1rem; }
.empty-state p { margin: 0; color: #7b8a9f; font-size: .86rem; }

.detail-heading { margin-bottom: 24px; }
.detail-heading h1 { overflow-wrap: anywhere; }
.detail-external-link { display: inline-block; margin-top: 12px; color: #2858bc; font-size: .86rem; font-weight: 700; text-decoration: none; }
.detail-external-link:hover { text-decoration: underline; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.summary-card { padding: 22px; border: 1px solid #e5eaf1; border-radius: 14px; background: #fff; }
.summary-card > span { display: block; color: #65758b; font-size: .86rem; font-weight: 700; }
.summary-card strong { display: block; margin: 10px 0 4px; font-size: 2rem; line-height: 1.1; }
.summary-card strong small { font-size: .8rem; }
.summary-card p { margin: 0; color: #7b8a9f; font-size: .78rem; line-height: 1.5; }
.summary-card .summary-pending { font-size: 1.12rem; }
.featured-summary { border-color: #bbd0f5; background: #edf4ff; color: #2355b5; }
.featured-summary > span, .featured-summary p { color: #4c6793; }
.detail-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 390px); gap: 20px; align-items: start; }
.detail-list { display: grid; gap: 0; margin: 20px 0 0; }
.detail-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid #edf0f5; }
.detail-list dt { color: #68788e; font-size: .88rem; }
.detail-list dd { margin: 0; text-align: right; font-size: .92rem; font-weight: 700; }
.analysis-explanation { margin: 20px 0 0; line-height: 1.7; color: #34455e; font-size: .88rem; overflow-wrap: anywhere; }
.analysis-note { margin: 16px 0 0; color: #7b8a9f; font-size: .8rem; line-height: 1.7; }
.field-help { color: #7b8a9f; font-size: .76rem; line-height: 1.5; }
.legacy-detail { margin-top: 20px; }
.legacy-detail-content { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 16px; }
.legacy-detail-content > div { display: grid; gap: 4px; min-width: 120px; }
.legacy-detail-content > div strong { font-size: 1.35rem; }
.legacy-detail-content > div span { color: #65758b; font-size: .83rem; }
.legacy-detail-content p { flex: 1 1 280px; margin: 0; color: #5c6b80; font-size: .83rem; line-height: 1.6; }
.secondary-button { padding: 9px 13px; border: 1px solid #c9d9f5; border-radius: 8px; background: #f1f6ff; color: #2858bc; font-size: .84rem; font-weight: 700; }
.secondary-button:hover { background: #e3edff; }

.pool-workspace { grid-template-columns: minmax(300px, 390px) minmax(0, 1fr); }
.pool-forms { display: grid; gap: 18px; min-width: 0; }
.compact-form { margin-top: 18px; }
.wide-button { width: 100%; }
.form-hint { margin: 18px 0 0; color: #7b8a9f; font-size: .84rem; line-height: 1.6; }
.pool-error { margin-top: 0 !important; margin-bottom: 20px !important; }
.optional-market { padding: 12px 14px; border: 1px solid #dce5f3; border-radius: 10px; background: #f9fbff; }
.optional-market summary { color: #2858bc; font-size: .86rem; font-weight: 700; cursor: pointer; }
.optional-market p { margin: 10px 0 0; color: #728199; font-size: .78rem; line-height: 1.6; }
.optional-fields { display: grid; gap: 15px; margin-top: 18px; }
.pool-list { display: grid; gap: 13px; }
.pool-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, 170px); gap: 15px; padding: 20px; border: 1px solid #e6ebf2; border-radius: 13px; background: #fff; }
.pool-card-main { min-width: 0; }
.pool-card-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.status-badge { display: inline-block; padding: 5px 9px; border-radius: 6px; background: #eaf1ff; color: #2858bc; font-size: .75rem; font-weight: 800; }
.status-badge.status-focus { background: #e4f6eb; color: #16804f; }
.status-badge.status-rejected { background: #f1f2f5; color: #667085; }
.pool-card h3 { margin: 14px 0 8px; font-size: 1.06rem; overflow-wrap: anywhere; }
.pool-card h3 a { text-decoration: none; }
.pool-card h3 a:hover { color: #2858bc; text-decoration: underline; }
.pool-discovered { margin: 0; color: #7b8a9f; font-size: .79rem; line-height: 1.6; }
.pool-card-score { display: grid; align-content: start; justify-items: end; gap: 5px; text-align: right; }
.pool-card-score > span { color: #6d7d94; font-size: .78rem; }
.pool-card-score strong { color: #2355b5; font-size: 1.65rem; line-height: 1.2; }
.pool-card-score strong small { font-size: .75rem; }
.pool-card-score .pool-pending { color: #75849b; font-size: .9rem; }
.status-form { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-top: 14px; border-top: 1px solid #edf0f5; }
.status-form label { margin-right: auto; color: #66778e; font-size: .8rem; font-weight: 700; }
.status-form select { min-height: 36px; padding: 0 10px; border: 1px solid #d8e0eb; border-radius: 8px; background: #fff; color: #172338; }
.status-form .secondary-button { min-height: 36px; padding: 6px 11px; }

.monitor-workspace { grid-template-columns: minmax(290px, 390px) minmax(0, 1fr); }
.monitor-main { display: grid; gap: 18px; min-width: 0; }
.monitor-schedule-form { display: flex; align-items: end; flex-wrap: wrap; gap: 14px; margin-top: 20px; }
.monitor-schedule-form .field { flex: 1 1 170px; }
.monitor-switch { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; font-size: .9rem; font-weight: 700; cursor: pointer; }
.monitor-switch input { width: 18px; height: 18px; accent-color: #2858bc; }
.monitor-trigger { margin-left: auto; color: #52637d; font-size: .78rem; font-weight: 700; }
.monitor-heading-row { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 16px; }
.monitor-check-button { width: auto; margin: 0; white-space: nowrap; }
.monitor-status-list { display: grid; gap: 0; margin: 18px 0 0; }
.monitor-status-list > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 13px 0; border-top: 1px solid #edf0f5; }
.monitor-status-list dt { color: #68788e; font-size: .86rem; }
.monitor-status-list dd { margin: 0; font-size: .9rem; font-weight: 700; overflow-wrap: anywhere; }
.monitor-task-list { display: grid; gap: 10px; margin-top: 20px; }
.monitor-task { padding: 15px; border: 1px solid #e6ebf2; border-radius: 10px; background: #fbfcff; }
.monitor-task-top { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.monitor-task p { margin: 10px 0; color: #34455e; font-size: .88rem; line-height: 1.6; }
.monitor-task small { color: #718096; line-height: 1.6; }
.monitor-empty { margin-top: 20px; padding: 35px 12px; }
.monitor-error { margin: 0 0 20px !important; }
.monitor-priority-note { margin-top: 12px !important; color: #4c6793 !important; font-size: .86rem; }
.monitor-priority-note a { color: #2858bc; font-weight: 700; }
.monitor-matches { padding-top: 10px; border-top: 1px solid #e8edf5; }
.monitor-matches summary { color: #2858bc; font-size: .82rem; font-weight: 700; cursor: pointer; }
.monitor-matches ol { display: grid; gap: 8px; margin: 12px 0 0; padding-left: 24px; }
.monitor-matches li { line-height: 1.6; font-size: .84rem; overflow-wrap: anywhere; }
.monitor-matches li span { margin-left: 10px; color: #52637d; }
.monitor-matches .priority-badge { padding: 3px 7px; border-radius: 6px; background: #e4f6eb; color: #16804f; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.categories-workspace { grid-template-columns: minmax(290px, 390px) minmax(0, 1fr); }
.main-category-list { display: grid; margin-top: 18px; }
.main-category-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 15px 0; border-top: 1px solid #edf0f5; }
.main-category-row strong, .main-category-row small { display: block; overflow-wrap: anywhere; }
.main-category-row small { margin-top: 6px; color: #7b8a9f; }
.main-category-row form { flex: none; }
.category-empty { margin-top: 18px; padding: 35px 12px; }
.category-error { margin: 0 0 20px !important; }
.main-match, .pool-main-match, .detail-main-match { margin: 5px 0 0; color: #52637d; font-size: .84rem; }
.main-match strong, .pool-main-match strong, .detail-main-match strong { color: #2355b5; }
.pool-main-match { margin-bottom: 7px; }

.notification-shell { max-width: 1020px; }
.notification-list { display: grid; gap: 14px; }
.notification-card { min-width: 0; padding: 20px; border: 1px solid #e5eaf1; border-radius: 13px; background: #fff; }
.notification-unread { border-color: #b9d0fb; background: #fbfdff; }
.notification-top, .notification-top > div { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.notification-top { justify-content: space-between; }
.notification-score { color: #2355b5; font-size: 1.5rem; }
.notification-score small { font-size: .8rem; }
.notification-card h3 { margin: 12px 0; font-size: 1.08rem; overflow-wrap: anywhere; }
.notification-details { display: grid; gap: 0; margin: 0; }
.notification-details > div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid #edf0f5; }
.notification-details dt { color: #68788e; font-size: .84rem; }
.notification-details dd { margin: 0; color: #34455e; font-size: .87rem; line-height: 1.6; overflow-wrap: anywhere; }
.notification-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 14px; color: #718096; font-size: .8rem; }
.notification-actions .secondary-button { min-height: 36px; }
.notification-empty { padding: 40px 12px; }
.notification-empty a { color: #2858bc; }
.source-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.source-card-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.source-card-heading h2 { margin: 0; font-size: 1.18rem; }
.source-card-heading p { margin: 7px 0 0; color: #64748b; font-size: .84rem; }
.source-card-heading a { color: #2858bc; font-weight: 700; }
.source-form { gap: 14px; margin-top: 18px; }
.source-form-row { display: grid; grid-template-columns: minmax(130px, 180px) minmax(0, 1fr); gap: 12px; }
.source-save-button { width: auto; justify-self: start; }
.source-error { margin: 0 0 20px !important; }
.source-filters { margin-top: -10px; }

.discovery-workspace { grid-template-columns: minmax(300px, 390px) minmax(0, 1fr); }
.discovery-list { display: grid; gap: 14px; }
.discovery-card { min-width: 0; padding: 19px; border: 1px solid #e5eaf1; border-radius: 13px; background: #fff; }
.discovery-card-top { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: #64748b; font-size: .82rem; }
.discovery-card h3 { margin: 12px 0; font-size: 1.08rem; overflow-wrap: anywhere; }
.discovery-details { display: grid; gap: 0; margin: 0; }
.discovery-details > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid #edf0f5; }
.discovery-details dt { color: #68788e; font-size: .83rem; }
.discovery-details dd { margin: 0; color: #34455e; font-size: .86rem; line-height: 1.6; overflow-wrap: anywhere; }
.discovery-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 15px; }
.discovery-actions a { color: #2858bc; font-size: .84rem; font-weight: 700; text-decoration: none; }
.discovery-actions a:hover { text-decoration: underline; }
.discovery-promote-form { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.discovery-promote-form label { color: #52637d; font-size: .8rem; }
.discovery-promote-form select { min-height: 36px; padding: 0 8px; border: 1px solid #d8e0eb; border-radius: 8px; background: #fff; }
.discovery-muted { color: #75849b; font-size: .84rem; }
.discovery-empty { padding: 34px 12px; }

.collection-workspace { grid-template-columns: minmax(300px, 350px) minmax(0, 1fr); }
.collection-main { display: grid; gap: 18px; min-width: 0; }
.collection-task-list { display: grid; gap: 12px; margin-top: 20px; }
.collection-card { min-width: 0; padding: 18px; border: 1px solid #e5eaf1; border-radius: 12px; background: #fff; }
.collection-card-heading { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.collection-card-heading h3 { margin: 0; font-size: 1.03rem; overflow-wrap: anywhere; }
.collection-details { margin: 12px 0 0; }
.collection-details > div { display: grid; grid-template-columns: 115px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid #edf0f5; }
.collection-details dt { color: #68788e; font-size: .83rem; }
.collection-details dd { margin: 0; color: #34455e; font-size: .86rem; overflow-wrap: anywhere; }
.collection-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 15px; }
.collection-actions .secondary-button:disabled { opacity: .5; cursor: not-allowed; }
.collection-running-note { color: #64748b; font-size: .84rem; }
.collection-empty { padding: 34px 12px; }
.collection-history { display: grid; margin-top: 18px; }
.collection-history-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px 100px; gap: 10px; align-items: center; padding: 11px 0; border-top: 1px solid #edf0f5; font-size: .83rem; }
.collection-history-row strong, .collection-history-row small { display: block; overflow-wrap: anywhere; }
.collection-history-row small { margin-top: 5px; color: #75849b; }

.api-clear-key { display: flex; align-items: center; gap: 8px; color: #52637d; font-size: .84rem; cursor: pointer; }
.api-clear-key input { width: 16px; height: 16px; accent-color: #2858bc; }
.api-sync-value { min-height: 40px; display: flex; align-items: center; padding: 8px 12px; border: 1px solid #e5eaf1; border-radius: 9px; background: #f8faff; color: #52637d; font-size: .85rem; }

.inventory-workspace { grid-template-columns: minmax(300px, 370px) minmax(0, 1fr); }
.inventory-main { display: grid; gap: 18px; min-width: 0; }
.inventory-error { margin: 0 0 20px !important; }
.inventory-list { display: grid; gap: 14px; margin-top: 20px; }
.inventory-card { min-width: 0; padding: 20px; border: 1px solid #e5eaf1; border-radius: 13px; background: #fff; }
.inventory-card-heading { display: flex; align-items: start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.inventory-card-heading h3 { margin: 7px 0 0; font-size: 1.06rem; overflow-wrap: anywhere; }
.inventory-sku { color: #64748b; font-size: .79rem; font-weight: 700; overflow-wrap: anywhere; }
.inventory-low-badge { padding: 5px 9px; border-radius: 6px; background: #fff1e8; color: #aa4f20; font-size: .75rem; font-weight: 800; }
.inventory-numbers { display: flex; gap: 24px; flex-wrap: wrap; margin: 17px 0 10px; }
.inventory-numbers > div { display: flex; align-items: baseline; gap: 5px; }
.inventory-numbers span { color: #64748b; font-size: .8rem; }
.inventory-numbers strong { color: #2355b5; font-size: 1.55rem; }
.inventory-numbers small { color: #64748b; }
.inventory-safety-form { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.inventory-safety-form label { color: #52637d; font-size: .8rem; font-weight: 700; }
.inventory-safety-form input { width: 95px; min-height: 36px; padding: 0 9px; border: 1px solid #d8e0eb; border-radius: 8px; }
.inventory-safety-form .secondary-button { min-height: 36px; padding: 6px 11px; }
.inventory-link-note { margin: 0 0 15px; color: #64748b; font-size: .82rem; }
.inventory-link-note a { color: #2858bc; font-weight: 700; text-decoration: none; }
.inventory-link-note a:hover { text-decoration: underline; }
.inventory-movement-form { display: grid; grid-template-columns: minmax(90px, 140px) minmax(140px, 1fr) auto; align-items: end; gap: 10px; padding-top: 15px; border-top: 1px solid #edf0f5; }
.inventory-movement-form .field { gap: 6px; }
.inventory-movement-buttons { display: flex; gap: 7px; flex-wrap: wrap; }
.inventory-movement-buttons button { min-height: 44px; }
.inventory-out-button { padding: 9px 13px; border: 1px solid #e8c5be; border-radius: 8px; background: #fff7f4; color: #a94731; font-size: .84rem; font-weight: 700; }
.inventory-out-button:hover { background: #ffede7; }
.inventory-empty { padding: 36px 12px; }
.inventory-history-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.inventory-history-filter label { color: #52637d; font-size: .84rem; font-weight: 700; }
.inventory-history-filter select { flex: 1 1 180px; min-width: 0; min-height: 38px; padding: 0 10px; border: 1px solid #d8e0eb; border-radius: 8px; background: #fff; }
.inventory-history { display: grid; margin-top: 18px; }
.inventory-history-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px 90px 90px; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid #edf0f5; font-size: .83rem; }
.inventory-history-row strong, .inventory-history-row small { display: block; overflow-wrap: anywhere; }
.inventory-history-row small { margin-top: 5px; color: #75849b; }
.inventory-history-row p { grid-column: 1 / -1; margin: 0; color: #52637d; overflow-wrap: anywhere; }
.inventory-move-type { color: #16804f; font-weight: 700; }
.inventory-move-type.is-out { color: #a94731; }

.order-workspace { grid-template-columns: minmax(300px, 370px) minmax(0, 1fr); }
.order-error { margin: 0 0 20px !important; }
.order-list { display: grid; gap: 14px; margin-top: 20px; }
.order-card { min-width: 0; padding: 20px; border: 1px solid #e5eaf1; border-radius: 13px; background: #fff; }
.order-card-heading { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 12px; }
.order-card-heading h3 { margin: 7px 0 4px; font-size: 1.06rem; overflow-wrap: anywhere; }
.order-card-heading small { color: #64748b; }
.order-number { color: #2858bc; font-size: .82rem; font-weight: 800; overflow-wrap: anywhere; }
.order-source-line { margin-top: 8px; color: #64748b; font-size: .8rem; }
.order-source-line strong { color: #2858bc; }
.order-status { padding: 5px 9px; border-radius: 6px; background: #edf2fb; color: #355988; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.order-status-shipped { background: #eaf2ff; color: #2858bc; }
.order-status-completed { background: #e7f6ef; color: #16804f; }
.order-status-cancelled { background: #f4f4f5; color: #667085; }
.order-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0 0; padding-top: 15px; border-top: 1px solid #edf0f5; }
.order-details dt { color: #68788e; font-size: .78rem; }
.order-details dd { margin: 5px 0 0; color: #34455e; font-size: .88rem; font-weight: 700; overflow-wrap: anywhere; }
.order-platform-meta { display: grid; gap: 5px; margin-top: 13px; color: #64748b; font-size: .8rem; overflow-wrap: anywhere; }
.order-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 18px; }
.order-actions button { min-height: 40px; }
.order-empty { margin-top: 20px; padding: 36px 12px; }

.channel-workspace { grid-template-columns: minmax(300px, 370px) minmax(0, 1fr); }
.channel-error { margin: 0 0 20px !important; }
.channel-list { display: grid; gap: 14px; margin-top: 18px; }
.channel-card { min-width: 0; padding: 19px; border: 1px solid #e5eaf1; border-radius: 13px; background: #fff; }
.channel-card-heading { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.channel-card-heading h3 { margin: 0; font-size: 1.06rem; }
.channel-card-heading p { margin: 7px 0 0; color: #64748b; font-size: .82rem; }
.channel-state { padding: 5px 9px; border-radius: 6px; background: #e7f6ef; color: #16804f; font-size: .75rem; font-weight: 800; }
.channel-state.is-disabled { background: #f4f4f5; color: #667085; }
.channel-actions { display: flex; align-items: end; gap: 9px; flex-wrap: wrap; margin-top: 17px; padding-top: 16px; border-top: 1px solid #edf0f5; }
.channel-name-form { display: flex; align-items: end; gap: 9px; flex: 1 1 300px; flex-wrap: wrap; }
.channel-name-form label { flex: 0 0 100%; color: #52637d; font-size: .8rem; font-weight: 700; }
.channel-name-form input { flex: 1 1 160px; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid #d8e0eb; border-radius: 8px; }
.channel-actions button { min-height: 40px; }

.sales-shell { max-width: 1100px; }
.sales-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.sales-summary-card { min-width: 0; padding: 22px; border: 1px solid #e5eaf1; border-radius: 13px; background: #fff; }
.sales-summary-card span, .sales-summary-card small { display: block; color: #64748b; font-size: .82rem; }
.sales-summary-card strong { display: block; margin: 12px 0 6px; color: #2355b5; font-size: clamp(1.4rem, 2.5vw, 2rem); overflow-wrap: anywhere; }
.sales-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.sales-filter label { color: #52637d; font-size: .88rem; font-weight: 700; }
.sales-filter select { min-width: 190px; min-height: 40px; padding: 7px 11px; border: 1px solid #d8e0eb; border-radius: 8px; background: #fff; }
.sales-filter button { min-height: 40px; }
.sales-status-panel, .sales-channel-panel, .sales-charts-panel { margin-bottom: 20px; }
.sales-status-grid, .sales-channel-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.sales-status-grid > div, .sales-channel-card { min-width: 0; padding: 16px; border: 1px solid #e5eaf1; border-radius: 10px; background: #f8faff; }
.sales-status-grid span, .sales-status-grid small { display: block; color: #64748b; font-size: .8rem; }
.sales-status-grid strong { display: block; margin: 10px 0 6px; color: #2355b5; font-size: 1.18rem; overflow-wrap: anywhere; }
.sales-channel-card h3 { margin: 0 0 12px; font-size: 1rem; }
.sales-channel-card > div { display: flex; justify-content: space-between; gap: 8px; padding: 9px 0; border-top: 1px solid #e5eaf1; font-size: .8rem; }
.sales-channel-card span { color: #64748b; }
.sales-channel-card strong { color: #34455e; text-align: right; overflow-wrap: anywhere; }
.sales-no-data { margin: 18px 0 0; color: #64748b; font-size: .85rem; }
.sales-chart-block { margin-top: 20px; padding-top: 18px; border-top: 1px solid #edf0f5; }
.sales-chart-block h3 { margin: 0 0 14px; font-size: .96rem; }
.sales-chart-viewport { max-width: 100%; overflow-x: auto; padding-bottom: 8px; }
.sales-chart { display: grid; gap: 8px; align-items: end; }
.sales-chart-seven { grid-template-columns: repeat(7, minmax(55px, 1fr)); min-width: 490px; }
.sales-chart-thirty { grid-template-columns: repeat(30, minmax(30px, 1fr)); min-width: 1130px; }
.sales-chart-column { min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.sales-chart-value { min-height: 20px; color: #52637d; font-size: .68rem; white-space: nowrap; }
.sales-chart-plot { width: 100%; height: 130px; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid #d8e0eb; }
.sales-chart-bar { width: min(70%, 28px); border-radius: 5px 5px 0 0; background: #4b7be3; }
.sales-count-chart .sales-chart-bar { background: #21a67a; }
.sales-chart-column small { margin-top: 6px; color: #718096; font-size: .67rem; white-space: nowrap; }
.sales-ranking-list { display: grid; margin-top: 14px; }
.sales-ranking-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 17px 0; border-top: 1px solid #edf0f5; }
.sales-rank-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #edf2fb; color: #2858bc; font-size: .83rem; font-weight: 800; }
.sales-rank-product strong, .sales-rank-product small, .sales-rank-total strong, .sales-rank-total small { display: block; overflow-wrap: anywhere; }
.sales-rank-product strong { color: #25354b; font-size: .94rem; }
.sales-rank-product small, .sales-rank-total small { margin-top: 5px; color: #718096; font-size: .78rem; }
.sales-rank-track { height: 6px; margin-top: 10px; overflow: hidden; border-radius: 6px; background: #edf2fb; }
.sales-rank-track span { display: block; height: 100%; border-radius: inherit; background: #4b7be3; }
.sales-rank-total { text-align: right; }
.sales-rank-total strong { color: #2355b5; font-size: 1rem; }
.sales-empty { margin-top: 18px; padding: 36px 12px; }
.order-finance-summary { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 7px 14px; margin-top: 15px; padding: 12px 14px; border-radius: 9px; background: #f1f6ff; }
.order-finance-summary strong { color: #2355b5; font-size: .88rem; }
.order-finance-summary small { color: #64748b; font-size: .76rem; }
.order-finance-details { margin-top: 12px; border-top: 1px solid #edf0f5; padding-top: 12px; }
.order-finance-details summary { color: #2858bc; font-size: .84rem; font-weight: 700; cursor: pointer; }
.order-finance-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.order-finance-form .field input { min-width: 0; }
.order-finance-form button { grid-column: 1 / -1; justify-self: start; }
.profit-negative { background: #d85c55 !important; }
.profit-comparison { display: grid; gap: 0; max-height: 500px; overflow: auto; padding-right: 5px; }
.profit-comparison-row { display: grid; grid-template-columns: 55px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid #edf0f5; }
.profit-comparison-row time { color: #64748b; font-size: .76rem; }
.profit-comparison-bars { display: grid; gap: 4px; }
.profit-comparison-bars > div { display: grid; grid-template-columns: 28px minmax(0, 1fr) 90px; align-items: center; gap: 7px; color: #52637d; font-size: .74rem; }
.profit-comparison-bars i { height: 9px; min-width: 0; border-radius: 5px; background: #4b7be3; }
.profit-comparison-bars strong { text-align: right; overflow-wrap: anywhere; }
.profit-ranking-list { display: grid; gap: 12px; margin-top: 18px; }
.profit-ranking-card { padding: 16px; border: 1px solid #e5eaf1; border-radius: 11px; background: #fff; }
.profit-ranking-card h3 { margin: 0; color: #25354b; font-size: .97rem; overflow-wrap: anywhere; }
.profit-ranking-card p { margin: 6px 0 12px; color: #64748b; font-size: .79rem; overflow-wrap: anywhere; }
.profit-ranking-card dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.profit-ranking-card dt { color: #64748b; font-size: .76rem; }
.profit-ranking-card dd { margin: 4px 0 0; color: #2355b5; font-size: .9rem; font-weight: 700; overflow-wrap: anywhere; }

@media (max-width: 1050px) {
  .sales-status-grid, .sales-channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace { grid-template-columns: 330px minmax(0, 1fr); }
  .product-grid { grid-template-columns: 1fr; }
  .detail-workspace { grid-template-columns: 1fr 330px; }
  .pool-workspace { grid-template-columns: 330px minmax(0, 1fr); }
  .monitor-workspace { grid-template-columns: 330px minmax(0, 1fr); }
  .categories-workspace { grid-template-columns: 330px minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .header-inner, .page-shell { width: min(100% - 28px, 1280px); }
  .page-shell { padding: 28px 0 48px; }
  .workspace { grid-template-columns: 1fr; gap: 16px; }
  .panel { padding: 20px; }
  .product-grid { grid-template-columns: 1fr; }
  .summary-grid, .detail-workspace { grid-template-columns: 1fr; }
  .pool-workspace { grid-template-columns: 1fr; }
  .monitor-workspace { grid-template-columns: 1fr; }
  .categories-workspace { grid-template-columns: 1fr; }
  .source-grid { grid-template-columns: 1fr; }
  .discovery-workspace { grid-template-columns: 1fr; }
  .collection-workspace { grid-template-columns: 1fr; }
  .inventory-workspace { grid-template-columns: 1fr; }
  .order-workspace { grid-template-columns: 1fr; }
  .channel-workspace { grid-template-columns: 1fr; }
  .sales-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-summary-card { padding: 16px; }
  .profit-ranking-card dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-finance-form { grid-template-columns: 1fr; }
  .inventory-movement-form { grid-template-columns: 1fr 1fr; }
  .inventory-movement-buttons { grid-column: 1 / -1; }
  .inventory-history-row { grid-template-columns: 1fr 1fr 1fr; }
  .inventory-history-row > div { grid-column: 1 / -1; }
  .header-inner { align-items: start; flex-wrap: wrap; gap: 8px; padding: 14px 0; }
  .header-links { gap: 8px 15px; }
}

@media (max-width: 390px) {
  .sales-summary { gap: 9px; }
  .sales-summary-card { padding: 15px; }
  .sales-ranking-row { gap: 9px; }
  .price-fields { grid-template-columns: 1fr; }
  .prices { gap: 6px; }
  .pool-card { grid-template-columns: 1fr; }
  .pool-card-score { justify-items: start; text-align: left; }
  .monitor-status-list > div { grid-template-columns: 1fr; gap: 5px; }
  .notification-details > div { grid-template-columns: 1fr; gap: 3px; }
  .source-form-row { grid-template-columns: 1fr; }
  .discovery-details > div { grid-template-columns: 1fr; gap: 3px; }
  .collection-details > div { grid-template-columns: 1fr; gap: 3px; }
  .collection-history-row { grid-template-columns: 1fr 1fr; }
  .collection-history-row > div { grid-column: 1 / -1; }
  .inventory-movement-form { grid-template-columns: 1fr; }
  .inventory-movement-buttons { grid-column: auto; }
  .inventory-history-row { grid-template-columns: 1fr 1fr; }
  .order-details { grid-template-columns: 1fr 1fr; }
}
/* Account and employee management */
.auth-card { max-width: 520px; width: min(92vw, 520px); }
.auth-card .product-form { text-align: left; margin-top: 1.5rem; }
.auth-card .primary-button { width: 100%; }
.logout-form { display: inline-flex; align-items: center; margin: 0; }
.logout-form button { border: 1px solid currentColor; border-radius: 8px; padding: .45rem .7rem; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.home-logout { margin-top: 1.4rem; }
.employee-list { display: grid; gap: 1rem; margin-top: 1rem; }
.employee-card { border: 1px solid #dde5e7; border-radius: 12px; padding: 1rem; }
.employee-card .product-form { margin-top: 1rem; }
.grant-list { display: grid; gap: .45rem; border: 1px solid #dde5e7; border-radius: 10px; padding: .8rem; max-height: 210px; overflow: auto; }
.grant-list label { display: block; }
