:root {
  --primary: #0b5ed7;
  --primary-dark: #084298;
  --dark: #1a1a2e;
  --gray: #6c757d;
  --border: #e5e7eb;
  --bg: #f8fafc;
}
* { box-sizing: border-box; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #1f2937; line-height: 1.6; margin: 0; background: #fff;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}
/* 宽屏 / 带鱼屏：适度加宽，避免两侧空过大，也不拉满整屏 */
@media (min-width: 1440px) {
  .container { max-width: 1320px; padding: 0 28px; }
}
@media (min-width: 1800px) {
  .container { max-width: 1480px; padding: 0 36px; }
}
@media (min-width: 2400px) {
  .container { max-width: 1600px; padding: 0 48px; }
}

.header {
  background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { font-size: 1.45rem; font-weight: 700; color: var(--dark); }
.logo span { color: var(--primary); }
.nav { display: flex; gap: 28px; align-items: center; }
.nav a { color: #374151; font-weight: 500; font-size: 15px; }
.nav a:hover { color: var(--primary); }

.hero {
  background: linear-gradient(135deg, #0b5ed7 0%, #1e3a8a 100%);
  color: #fff; padding: 72px 0 64px; text-align: center;
}
.hero h1 { font-size: 2.3rem; margin: 0 0 14px; font-weight: 700; }
.hero p { font-size: 1.1rem; opacity: .92; max-width: 680px; margin: 0 auto 28px; }
.hero .btn {
  display: inline-block; padding: 12px 28px; background: #fff; color: var(--primary);
  border-radius: 6px; font-weight: 600; font-size: 15px;
}
.hero .btn:hover { background: #f0f7ff; text-decoration: none; }

.section { padding: 56px 0; }
.section-title { font-size: 1.5rem; margin: 0 0 28px; text-align: center; font-weight: 700; color: var(--dark); }
.section-title::after {
  content: ''; display: block; width: 48px; height: 3px;
  background: var(--primary); margin: 12px auto 0; border-radius: 2px;
}
.about-strip { background: var(--bg); padding: 48px 0; text-align: center; }
.about-strip p { max-width: 720px; margin: 0 auto; color: #4b5563; font-size: 15px; }

.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px;
}
.product-card {
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  transition: box-shadow .2s, transform .2s; background: #fff;
}
.product-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); transform: translateY(-3px); }
.product-card .img {
  height: 170px; background: #f1f5f9; display: flex; align-items: center;
  justify-content: center; color: #94a3b8; font-size: 13px;
}
.product-card .img img { max-width: 90%; max-height: 90%; object-fit: contain; }
.product-card .body { padding: 16px; }
.product-card h3 {
  font-size: 14px; margin: 0 0 8px; height: 40px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-weight: 600;
}
.product-card .cas { font-size: 13px; color: var(--gray); margin-bottom: 12px; font-family: ui-monospace, monospace; }
.product-card .btn {
  display: inline-block; padding: 6px 14px; background: var(--primary);
  color: #fff; border-radius: 5px; font-size: 13px; font-weight: 500;
}
.product-card .btn:hover { background: var(--primary-dark); text-decoration: none; }

.search-bar { display: flex; gap: 10px; margin-bottom: 28px; flex-wrap: wrap; }
.search-bar input {
  flex: 1; min-width: 200px; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: 7px; font-size: 15px;
}
.search-bar button {
  padding: 11px 26px; background: var(--primary); color: #fff;
  border: none; border-radius: 7px; cursor: pointer; font-size: 15px; font-weight: 500;
}
.search-bar button:hover { background: var(--primary-dark); }

.main-layout { display: grid; grid-template-columns: 210px 1fr; gap: 28px; }
.sidebar { background: var(--bg); border-radius: 10px; padding: 18px; }
.sidebar h4 { margin: 0 0 12px; font-size: 14px; font-weight: 600; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li a {
  display: block; padding: 8px 10px; color: #374151; border-radius: 6px; font-size: 14px;
}
.sidebar li a:hover, .sidebar li a.active {
  background: var(--primary); color: #fff; text-decoration: none;
}

.form-box {
  max-width: 560px; margin: 0 auto; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; padding: 32px;
}
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 14px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 15px;
}
.form-group textarea { min-height: 110px; resize: vertical; }
.btn-primary {
  display: inline-block; padding: 11px 28px; background: var(--primary);
  color: #fff; border: none; border-radius: 6px; font-size: 15px; cursor: pointer; font-weight: 500;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-sm {
  padding: 7px 14px; background: #059669; color: #fff; border: none;
  border-radius: 5px; font-size: 13px; cursor: pointer;
}

.footer {
  background: var(--dark); color: #94a3b8; padding: 48px 0 24px; margin-top: 60px; font-size: 14px;
}
.footer a { color: #94a3b8; }
.footer strong { color: #fff; }
.footer-bottom {
  border-top: 1px solid #334155; margin-top: 28px; padding-top: 18px;
  text-align: center; font-size: 13px;
}

.admin-header {
  background: var(--dark); color: #fff; padding: 12px 24px;
  display: flex; justify-content: space-between; align-items: center;
}
.admin-nav a { color: #cbd5e1; margin-right: 16px; font-size: 14px; }
.admin-nav a:hover { color: #fff; }
.admin-content {
  width: 100%;
  padding: 24px 20px;
  max-width: 1100px;
  margin: 0 auto;
  box-sizing: border-box;
}
@media (min-width: 1440px) {
  .admin-content { max-width: 1280px; padding: 28px 28px; }
}
@media (min-width: 1800px) {
  .admin-content { max-width: 1480px; padding: 28px 36px; }
}
@media (min-width: 2400px) {
  .admin-content { max-width: 1680px; }
}
/* 宽表在后台可横向滚动，不撑破页面 */
.admin-content .table,
.admin-content table.table {
  width: 100%;
}
.admin-content .table-wrap,
.admin-content .bill-detail-block {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-content .item-table {
  min-width: 900px;
}
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td {
  border: 1px solid var(--border); padding: 10px 12px; text-align: left; font-size: 13px;
}
.table th { background: var(--bg); font-weight: 600; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.pager { margin-top: 24px; text-align: center; }
.pager a, .pager span {
  display: inline-block; padding: 6px 12px; margin: 0 3px;
  border: 1px solid var(--border); border-radius: 4px; font-size: 14px;
}
.pager .cur { background: var(--primary); color: #fff; border-color: var(--primary); }

@media (max-width: 768px) {
  .main-layout { grid-template-columns: 1fr; }
  .nav { gap: 14px; font-size: 14px; }
  .hero h1 { font-size: 1.6rem; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}


/* ===== 响应式补充（手机 / 平板 / 带鱼屏） ===== */
img, video { max-width: 100%; height: auto; }

.header-inner { gap: 12px; }
.nav { flex-wrap: wrap; }

@media (max-width: 900px) {
  .header-inner { height: auto; min-height: 60px; padding: 10px 0; flex-wrap: wrap; }
  .nav { gap: 14px 18px; width: 100%; justify-content: flex-start; }
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 1.7rem; }
  .section { padding: 40px 0; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
}

@media (max-width: 768px) {
  .container { padding: 0 14px; }
  .admin-content { padding: 16px 12px; }
  .hero h1 { font-size: 1.45rem; }
  .hero p { font-size: 15px; }
  .search-bar { flex-direction: column; }
  .search-bar input, .search-bar button, .search-bar select { width: 100%; }
  .product-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .product-card .img { height: 140px; }
  .table { display: block; overflow-x: auto; width: 100%; }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
  .nav { gap: 10px 14px; font-size: 14px; }
}

/* 打印页（发票/装箱/COA）屏幕预览：居中，不随带鱼屏拉宽 */
.page {
  max-width: 210mm;
  margin-left: auto;
  margin-right: auto;
}


/* ===== 前台 Logo 再加大 ===== */
.header .header-inner,
.header-inner {
  height: auto !important;
  min-height: 110px !important;
  padding: 12px 0 !important;
  align-items: center !important;
}
.header a.logo,
a.logo {
  display: flex !important;
  align-items: center !important;
  max-width: min(560px, 62vw) !important;
  height: auto !important;
  flex-shrink: 1 !important;
}
.header a.logo img,
a.logo img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-height: 100px !important;
  max-width: 100% !important;
  object-fit: contain !important;
  object-position: left center !important;
}
@media (min-width: 1440px) {
  .header-inner { min-height: 120px !important; }
  a.logo { max-width: min(640px, 48vw) !important; }
  a.logo img { max-height: 112px !important; }
}
@media (min-width: 1800px) {
  a.logo img { max-height: 120px !important; }
}
@media (max-width: 900px) {
  .header-inner { min-height: 84px !important; }
  a.logo { max-width: min(340px, 60vw) !important; }
  a.logo img { max-height: 72px !important; }
}
@media (max-width: 480px) {
  a.logo img { max-height: 56px !important; }
}
