/* NineStarPro - Black & White Minimal Card Style */

:root {
  --black: #1a1a1a;
  --dark: #333;
  --gray: #666;
  --light-gray: #999;
  --border: #e5e5e5;
  --bg-light: #f5f5f5;
  --bg-page: #f8f8f8;
  --white: #fff;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-page);
  color: var(--dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-top: 56px;
  padding-bottom: 70px;
}

@media (min-width: 992px) {
  body {
    padding-bottom: 0;
  }
}

a {
  color: var(--dark);
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ====== PC Top Nav ====== */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 56px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.top-nav .nav-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-nav .logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--black);
  white-space: nowrap;
  flex-shrink: 0;
}

.top-nav .nav-center {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 24px;
}

.top-nav .nav-center a {
  font-size: 0.88rem;
  color: var(--gray);
  padding: 8px 16px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.top-nav .nav-center a:hover {
  color: var(--black);
  background: var(--bg-light);
}

.top-nav .nav-center a.active {
  color: var(--black);
  background: var(--bg-light);
  font-weight: 600;
}

.top-nav .nav-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.top-nav .nav-right .icon-btn,
.top-nav .nav-right a.icon-btn {
  background: none;
  border: none;
  color: var(--gray);
  font-size: 1.1rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.top-nav .nav-right .icon-btn:hover,
.top-nav .nav-right a.icon-btn:hover {
  color: var(--black);
  background: var(--bg-light);
}

.top-nav .nav-right .cart-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  background: var(--black);
  color: var(--white);
  font-size: 0.55rem;
  min-width: 15px;
  height: 15px;
  border-radius: 8px;
  padding: 0 4px;
  line-height: 15px;
  text-align: center;
}

/* ====== Mobile Top Bar ====== */
.mobile-top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 56px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.mobile-top-bar .logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-top-bar .right-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.mobile-top-bar .right-actions .icon-btn,
.mobile-top-bar .right-actions a.icon-btn {
  background: none;
  border: none;
  color: var(--gray);
  font-size: 1.1rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-decoration: none;
}

.mobile-top-bar .right-actions .cart-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  background: var(--black);
  color: var(--white);
  font-size: 0.55rem;
  min-width: 15px;
  height: 15px;
  border-radius: 8px;
  padding: 0 4px;
  line-height: 15px;
  text-align: center;
}

/* ====== Mobile Menu ====== */
.mobile-menu {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-menu.open {
  max-height: 80vh;
  overflow-y: auto;
}

.mobile-menu .menu-item {
  display: block;
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--dark);
  border-bottom: 1px solid var(--border);
}

.mobile-menu .menu-item:last-child {
  border-bottom: none;
}

.mobile-menu .menu-item:hover,
.mobile-menu .menu-item.active {
  color: var(--black);
  font-weight: 600;
}

/* ====== Bottom Tab Bar ====== */
.bottom-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 60px;
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
}

.bottom-tab-bar .tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--light-gray);
  cursor: pointer;
  border: none;
  background: none;
  padding: 4px 0;
  font-size: 0.7rem;
  transition: color 0.2s;
}

.bottom-tab-bar .tab-item i {
  font-size: 1.15rem;
}

.bottom-tab-bar .tab-item:hover,
.bottom-tab-bar .tab-item.active {
  color: var(--black);
}

/* ====== Section Title ====== */
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--black);
  border-bottom: 2px solid var(--black);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

/* ====== Goods Grid ====== */
.goods-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

@media (min-width: 992px) {
  .goods-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ====== Goods Card ====== */
.goods-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
}

.goods-card:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.goods-card .card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-light);
}

.goods-card .card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.goods-card .card-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--white);
  background: var(--black);
  padding: 2px 10px;
}

.goods-card .card-body {
  padding: 12px;
}

.goods-card .card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
  margin-bottom: 4px;
}

.goods-card .card-sub {
  font-size: 0.78rem;
  color: var(--light-gray);
  margin-bottom: 6px;
}

.goods-card .card-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--black);
}

.goods-card .card-price .unit {
  font-size: 0.8rem;
}

.goods-card .card-price .original {
  font-size: 0.75rem;
  color: var(--light-gray);
  font-weight: 400;
  text-decoration: line-through;
  margin-left: 6px;
}

.goods-card .card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.goods-card .card-sold {
  font-size: 0.75rem;
  color: var(--light-gray);
}

/* ====== Buttons ====== */
.btn-outline-dark {
  display: inline-block;
  background: var(--white);
  border: 1px solid var(--black);
  color: var(--black);
  border-radius: 4px;
  padding: 6px 16px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
}

.btn-outline-dark:hover {
  background: var(--black);
  color: var(--white);
}

/* ====== Toast ====== */
#toast-container {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  background: var(--black);
  color: var(--white);
  padding: 10px 24px;
  font-size: 0.88rem;
  white-space: nowrap;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  animation: toastIn 0.25s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ====== Order Tabs ====== */
.order-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.order-tabs .tab {
  padding: 10px 16px;
  font-size: 14px;
  color: var(--light-gray);
  cursor: pointer;
  border: none;
  background: none;
  white-space: nowrap;
  transition: color 0.2s;
  position: relative;
}

.order-tabs .tab:hover {
  color: var(--dark);
}

.order-tabs .tab.active {
  color: var(--black);
  font-weight: 600;
}

.order-tabs .tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--black);
}

/* ====== Category Grid ====== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 992px) {
  .category-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.category-grid .cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 12px 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.category-grid .cat-item:hover {
  background: var(--bg-light);
}

.category-grid .cat-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  background: var(--bg-light);
}

.category-grid .cat-item .cat-name {
  font-size: 0.82rem;
  color: var(--dark);
  text-align: center;
}

/* ====== Empty State ====== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--light-gray);
}

.empty-state i {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ====== Carousel ====== */
.carousel-wrap {
  margin-bottom: 24px;
  border-radius: 8px;
  overflow: hidden;
}

.carousel-wrap .carousel-item img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  background: var(--bg-light);
}

@media (max-width: 767px) {
  .carousel-wrap .carousel-item img {
    height: 180px;
  }
}

/* ====== Notice Bar ====== */
.notice-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  margin-bottom: 24px;
}

.notice-bar .notice-label {
  color: var(--black);
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
  letter-spacing: 1px;
}

.notice-bar .notice-text {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.notice-bar .notice-text a {
  color: var(--gray);
}

/* ====== Footer ====== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 40px;
  font-size: 0.85rem;
  color: var(--light-gray);
}

.site-footer .footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer .footer-links {
  display: flex;
  gap: 20px;
}

.site-footer .footer-links a {
  color: var(--gray);
  font-size: 0.85rem;
}

.site-footer .footer-links a:hover {
  color: var(--black);
}

/* ====== Float Actions ====== */
.float-actions {
  position: fixed;
  right: 24px;
  bottom: 80px;
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.float-actions a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  text-decoration: none;
}

.float-actions a:hover {
  border-color: var(--black);
  color: var(--black);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

/* ====== Page Header ====== */
.page-header {
  padding: 20px 0 0;
}

.page-header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--black);
}

/* ====== Utility Classes ====== */
.text-black     { color: var(--black); }
.text-gray      { color: var(--gray); }
.text-light-gray{ color: var(--light-gray); }
.bg-white       { background: var(--white); }
.mt-16          { margin-top: 16px; }
.mb-16          { margin-bottom: 16px; }
