/* =========================================================
   NEXORA · ASP.NET Core 版本扩展样式
   在 base.css / site.css / admin.css 之后加载
   ========================================================= */

/* ---------- 页头搜索 ---------- */
.header-search {
  display: flex; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: #fff; padding: 2px 2px 2px 14px;
  width: 200px; transition: width .25s var(--ease), border-color .2s;
}
.header-search:focus-within { width: 260px; border-color: var(--navy-600); }
.header-search-input {
  flex: 1; min-width: 0; border: 0; outline: none;
  font-size: 13px; height: 32px; background: transparent;
}
.header-search .header-icon { width: 32px; height: 32px; border-radius: 99px; }

/* ---------- 页脚五列 ---------- */
.footer-main { grid-template-columns: 1.5fr .7fr .8fr .8fr 1.2fr; }
.footer-contact p {
  display: flex; gap: 9px; align-items: flex-start;
  padding-block: 6px; line-height: 1.55; color: #93a7bb;
}
.footer-contact svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 3px; color: var(--accent); }
.footer-contact h4 { margin-bottom: 10px; }

/* ---------- 通用 ---------- */
.section-head--left { align-items: flex-start; flex-direction: column; gap: 0; }
.pager-note { font-size: 13px; color: var(--muted); }
.product-card { position: relative; }
.link-plain { color: var(--navy-700); font-weight: 600; }
.link-plain:hover { color: var(--accent); }
.spec-note { font-size: 12.5px; color: var(--muted); }
.badge-lg { height: 28px; font-size: 12.5px; }

/* 表单两列在窄屏塌陷 */
@media (max-width: 900px) {
  .header-search { display: none; }
  .footer-main { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 720px) {
  .footer-main { grid-template-columns: 1fr; }
}

/* ---------- 目录侧栏提示 ---------- */
.filter-note {
  margin-top: 22px; border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 16px; background: var(--bg-soft);
}

/* ---------- 关于我们 ---------- */
.about-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.about-hero img { width: 100%; border-radius: var(--radius-lg); aspect-ratio: 4 / 3; object-fit: cover; }
.about-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.about-stats > div { background: #fff; padding: 30px 24px; }
.about-stats .num { font-family: var(--font-head); font-weight: 800; font-size: 34px; color: var(--navy-900); letter-spacing: -.03em; }
.about-stats .lbl { font-size: 12px; color: var(--muted); letter-spacing: .07em; text-transform: uppercase; margin-top: 4px; }
.timeline { position: relative; padding-inline-start: 26px; }
.timeline::before { content: ""; position: absolute; inset-block: 6px; inset-inline-start: 6px; width: 2px; background: var(--line); }
.timeline-item { position: relative; padding-block: 0 26px; }
.timeline-item::before {
  content: ""; position: absolute; inset-inline-start: -26px; inset-block-start: 6px;
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  border: 3px solid var(--accent);
}
.timeline-item .yr { font-family: var(--font-head); font-weight: 800; font-size: 18px; color: var(--navy-900); }
.timeline-item p { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.value-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.value-card { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 26px; background: #fff; }
.value-card .ic {
  width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-600); margin-bottom: 14px;
}
.value-card h3 { font-size: 16px; margin-bottom: 6px; }
.value-card p { font-size: 13px; color: var(--muted); }
.cert-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.cert-card {
  border: 1px solid var(--line); border-radius: var(--radius-md); padding: 20px 16px;
  text-align: center; background: #fff; font-size: 13px; font-weight: 600;
}
.cert-card .seal {
  width: 40px; height: 40px; margin: 0 auto 10px; border-radius: 50%;
  background: var(--green-soft); color: var(--green); display: grid; place-items: center;
}

/* ---------- 联系我们 ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.contact-card { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 22px; background: #fff; }
.contact-card .row { gap: 12px; padding-block: 10px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.contact-card .row:last-child { border-bottom: 0; }
.contact-card svg { color: var(--accent); flex-shrink: 0; }
.map-embed { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--line); margin-top: 18px; }
.map-embed img { width: 100%; height: 240px; object-fit: cover; }

/* ---------- 新闻详情 ---------- */
.news-hero {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: #fff;
}
.news-hero-media { min-height: 320px; }
.news-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.news-hero-body { padding: 38px; display: flex; flex-direction: column; justify-content: center; }
.news-hero-body h2 { font-size: clamp(20px, 2vw, 27px); margin-top: 10px; }
.news-hero-body p { margin-top: 12px; font-size: 13.5px; }
.article-layout { display: grid; grid-template-columns: 1fr 320px; gap: 52px; align-items: start; }
.article-cover { border-radius: var(--radius-md); overflow: hidden; margin-top: 26px; border: 1px solid var(--line); }
.article-cover img { width: 100%; max-height: 460px; object-fit: cover; }
.article-aside { position: sticky; inset-block-start: calc(var(--header-h) + 24px); display: flex; flex-direction: column; gap: 10px; }
.aside-title { font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); }
.article-mini { display: flex; gap: 12px; padding-block: 10px; border-bottom: 1px solid var(--line-2); align-items: center; }
.article-mini img { width: 66px; height: 52px; border-radius: var(--radius-xs); object-fit: cover; flex-shrink: 0; }
.article-mini .news-title { font-size: 12.5px; font-weight: 600; line-height: 1.45; display: block; }

@media (max-width: 1180px) {
  .about-hero, .contact-grid, .article-layout, .news-hero { grid-template-columns: 1fr; }
  .value-grid { grid-template-columns: 1fr 1fr; }
  .cert-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .about-stats { grid-template-columns: 1fr 1fr; }
  .value-grid, .cert-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   后台 · 选项卡框架
   ========================================================= */
.tab-strip {
  display: flex; align-items: stretch;
  background: #fff; border-bottom: 1px solid var(--admin-line);
  padding-inline: 6px;
  position: sticky; inset-block-start: 62px; z-index: 80;
  gap: 2px;
}
.tab-scroll {
  flex: 1; min-width: 0;
  display: flex; align-items: stretch; gap: 2px;
  overflow-x: auto; overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.tab-scroll::-webkit-scrollbar { display: none; }
.tab-arrow {
  width: 30px; flex-shrink: 0; align-self: center;
  border: 0; background: transparent; color: var(--admin-muted);
  font-size: 20px; line-height: 1; cursor: pointer;
  border-radius: 5px; transition: background .15s, color .15s;
}
.tab-arrow:hover { background: var(--bg-soft); color: var(--navy-900); }
.tab-arrow--prev { margin-inline-end: 2px; }
.tab-arrow--next { margin-inline-start: 2px; }

.tab-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 4px 0 12px;
  border-bottom: 2px solid transparent;
  color: var(--admin-muted); font-size: 13px; font-weight: 500;
  white-space: nowrap; flex-shrink: 0;
  cursor: pointer;
  transition: color .16s, border-color .16s, background .16s;
}
.tab-chip:hover { color: var(--navy-900); background: #f6f8fb; }
.tab-chip.is-active {
  color: var(--navy-900); font-weight: 700;
  border-bottom-color: var(--accent); background: #fbfcfe;
  box-shadow: inset 0 1px 0 rgba(0,0,0,.03);
}
.tab-chip .tab-ico { display: inline-flex; align-items: center; }
.tab-chip .tab-ico svg { width: 15px; height: 15px; opacity: .7; }
.tab-chip.is-active .tab-ico svg { opacity: 1; color: var(--accent); }
.tab-chip .tab-close {
  width: 20px; height: 20px; border-radius: 4px;
  display: grid; place-items: center; color: var(--muted-2);
  opacity: 0; transition: opacity .15s, background .15s, color .15s;
}
.tab-chip:hover .tab-close, .tab-chip.is-active .tab-close { opacity: 1; }
.tab-chip .tab-close:hover { background: var(--red-soft); color: var(--red); }
.tab-chip .tab-close svg { width: 12px; height: 12px; }

.tab-strip-tools {
  display: flex; align-items: center; gap: 4px;
  padding-inline: 6px; flex-shrink: 0;
}
.tab-count {
  font-size: 11px; color: var(--admin-muted);
  background: var(--bg-soft); border-radius: var(--radius-pill);
  padding: 2px 8px; font-weight: 600; margin-inline-end: 2px;
}
.tab-tool {
  width: 28px; height: 28px; border-radius: 5px; display: grid; place-items: center;
  color: var(--admin-muted); border: 1px solid transparent;
  transition: background .15s, color .15s;
}
.tab-tool:hover { background: var(--bg-soft); color: var(--navy-900); }
.tab-tool svg { width: 14px; height: 14px; }

/* 标签右键菜单 */
.tab-context-menu {
  position: fixed; z-index: 9999; display: none;
  min-width: 150px; background: #fff;
  border: 1px solid var(--admin-line); border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(14,26,38,.14);
  padding: 4px;
}
.tab-context-menu.is-open { display: block; animation: fadeIn .12s ease; }
.tab-context-menu button {
  width: 100%; text-align: start; padding: 8px 12px;
  font-size: 13px; color: var(--ink-2);
  border: 0; background: transparent; border-radius: 4px; cursor: pointer;
}
.tab-context-menu button:hover { background: var(--bg-soft); color: var(--navy-900); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } }

.tab-panes { position: relative; }
.tab-pane { display: none; }
.tab-pane.is-active { display: block; animation: paneIn .22s var(--ease); }
@keyframes paneIn { from { opacity: 0; transform: translateY(6px); } }
.tab-pane-loading { padding: 60px; text-align: center; color: var(--admin-muted); font-size: 13px; }
.tab-pane-loading::after {
  content: ""; display: block; width: 22px; height: 22px; margin: 14px auto 0;
  border: 2px solid var(--admin-line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 表单页签（新增 / 编辑） ---------- */
.tab-chip--form .tab-ico { color: var(--accent); }
.form-page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.form-page-head h2 { font-size: 19px; font-weight: 700; color: var(--navy-900); }
.form-page-body {
  background: #fff; border: 1px solid var(--admin-line);
  border-radius: var(--radius-md); padding: 24px 26px;
}
.admin-form--wide .form-grid,
.admin-form--wide .sku-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* 详情页签：详情内容铺在页签内，宽屏下按两列排布 */
@media (min-width: 1180px) {
  .detail-page-body { column-count: 2; column-gap: 18px; }
  .detail-page-body > .detail-block { break-inside: avoid; }
}
@media (max-width: 1280px) {
  .admin-form--wide .form-grid,
  .admin-form--wide .sku-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .admin-form--wide .form-grid,
  .admin-form--wide .sku-grid { grid-template-columns: 1fr; }
}

/* ---------- 侧边栏折叠 ---------- */
.side-toggle {
  width: 38px; height: 38px; border: 0; background: transparent;
  border-radius: 7px; cursor: pointer;
  display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
  transition: background .15s;
}
.side-toggle:hover { background: var(--bg-soft); }
.side-toggle span {
  display: block; width: 18px; height: 2px; background: var(--ink-2); border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

.admin-side.is-collapsed { width: 64px; }
.admin-side.is-collapsed .brand {
  padding: 16px 0; display: flex; align-items: center; justify-content: center;
}
.admin-side.is-collapsed .brand > span:last-child { display: none; }
.admin-side.is-collapsed .side-group-label { display: none; }
.admin-side.is-collapsed .side-link {
  justify-content: center; padding: 11px 0; position: relative;
}
.admin-side.is-collapsed .side-link > span { display: none; }
.admin-side.is-collapsed .side-link .badge-dot {
  position: absolute; inset-block-start: 6px; inset-inline-end: 8px;
  margin: 0; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px;
}
.admin-side.is-collapsed .admin-side-foot { padding: 12px 8px; text-align: center; }
.admin-side.is-collapsed .admin-side-foot .user,
.admin-side.is-collapsed .admin-side-foot > div:not(.row),
.admin-side.is-collapsed .admin-side-foot .row { display: none; }

.admin-side.is-collapsed .side-link:hover::after {
  content: attr(data-title);
  position: absolute; inset-inline-start: calc(100% + 10px); inset-block-start: 50%;
  transform: translateY(-50%);
  background: var(--navy-900); color: #fff;
  padding: 5px 10px; border-radius: 5px; font-size: 12.5px; white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0,0,0,.2); z-index: 200;
}
.admin-main.is-expanded { margin-inline-start: 64px; }

/* 后台页签内的次级卡片 */
.admin-body { padding: 20px 26px 56px; }
.pane-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; margin-bottom: 18px; flex-wrap: wrap;
}
.pane-head h2 { font-size: 19px; }
.pane-head p { font-size: 12.5px; color: var(--admin-muted); margin-top: 4px; }
.pane-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 抽屉表单 */
.drawer { display: none; }
.drawer.is-open { display: flex; }
.drawer-mask { display: none; }
.drawer-mask.is-open { display: block; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid--3 .span-2 { grid-column: span 2; }
.form-grid--3 .span-3 { grid-column: span 3; }
.drawer .field { margin-bottom: 0; }
.drawer-foot .btn { height: 40px; font-size: 13px; }
.drawer-body .form-grid { gap: 14px; }
.drawer-err { color: var(--red); font-size: 12.5px; margin-inline-end: auto; align-self: center; }

@media (max-width: 720px) {
  .form-grid--3 { grid-template-columns: 1fr; }
  .form-grid--3 .span-2, .form-grid--3 .span-3 { grid-column: auto; }
}

/* ---------- 后台表格与表单补充 ---------- */
.cell-sub { font-size: 11.5px; color: var(--admin-muted); margin-top: 2px; }
.thumb-64 {
  display: block; width: 64px; height: 48px; border-radius: 5px;
  overflow: hidden; background: var(--bg-soft); border: 1px solid var(--admin-line);
}
.thumb-64 img { width: 100%; height: 100%; object-fit: cover; }
.stock-low { color: var(--red); font-weight: 600; }

.link-btn {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--navy-700); font-weight: 600; font-size: inherit;
  text-decoration: none; transition: color .16s;
}
.link-btn:hover { color: var(--accent); text-decoration: underline; }

.admin-pager { display: flex; gap: 6px; padding: 18px 2px 0; flex-wrap: wrap; }
.page-btn {
  min-width: 32px; height: 32px; padding-inline: 9px;
  border: 1px solid var(--admin-line); border-radius: var(--radius-xs);
  background: #fff; color: var(--ink-2); font-size: 12.5px; font-weight: 600;
}
.page-btn:hover { border-color: var(--navy-700); color: var(--navy-900); }
.page-btn.is-active { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }

.select--xs { min-height: 30px; height: 30px; padding-inline: 8px; font-size: 12px; }

.admin-form h4 {
  font-size: 13px; font-weight: 700; color: var(--navy-900);
  margin: 4px 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--admin-line);
}
.admin-form h4:not(:first-child) { margin-top: 26px; }
.admin-form .field { margin-bottom: 14px; }
.admin-form .form-grid .field { margin-bottom: 0; }
.form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--admin-line);
}
.field-hint { font-size: 11.5px; color: var(--admin-muted); margin-top: 5px; line-height: 1.6; }

/* ---------- 后台二级选项卡 ---------- */
.subtab-strip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px; margin-bottom: 18px; max-width: 100%;
  background: var(--bg-soft); border: 1px solid var(--admin-line);
  border-radius: var(--radius-md); overflow-x: auto;
}
.subtab {
  height: 34px; padding: 0 16px; border: 0; background: transparent;
  border-radius: 6px; color: var(--admin-muted);
  font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .16s, color .16s, box-shadow .16s;
}
.subtab:hover { color: var(--navy-900); background: rgba(255,255,255,.7); }
.subtab.is-active {
  background: #fff; color: var(--navy-900); font-weight: 700;
  box-shadow: 0 1px 3px rgba(16,24,40,.1);
}
.subtab-count {
  min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(16,24,40,.06); border-radius: 9px;
  font-size: 11px; font-weight: 600; color: var(--admin-muted);
}
.subtab.is-active .subtab-count { background: var(--accent-soft); color: var(--accent-600); }

/* ---------- 多语言翻译编辑器 ---------- */
.tr-editor { margin-top: 6px; }
.tr-lang-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; background: var(--admin-bg-soft);
  border: 1px solid var(--admin-line); border-radius: var(--radius-md);
  margin-bottom: 14px;
}
.tr-lang-bar .select { width: 120px; flex-shrink: 0; }
.tr-hint { font-size: 12px; color: var(--admin-muted); }
.tr-panel {
  padding: 14px; border: 1px solid var(--admin-line);
  border-radius: var(--radius-md); background: #fff;
}
.tr-panel .muted { color: var(--admin-muted); font-weight: 400; }

.tier-row {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; margin-bottom: 10px;
}
.switch {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span {
  width: 38px; height: 22px; border-radius: 99px;
  background: var(--bg-soft-2); position: relative; transition: background .18s;
}
.switch span::after {
  content: ""; position: absolute; inset-block-start: 3px; inset-inline-start: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.18); transition: transform .18s;
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
[dir="rtl"] .switch input:checked + span::after { transform: translateX(-16px); }

.detail-block h3 {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--navy-900);
  margin-bottom: 12px;
}
.detail-block h3 svg { width: 15px; height: 15px; color: var(--accent); }
.detail-block .mini-table { border: 1px solid var(--admin-line); border-radius: var(--radius-sm); overflow: hidden; }
.detail-block > .row { margin-top: 14px; }

@media (max-width: 1100px) {
  .two-col { grid-template-columns: 1fr; }
}
