:root {
  --primary: #139655;
  --primary-hover: #0f7a45;
  --primary-light: #e8f5ee;
  --primary-border: #a3e0be;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg-body: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px -2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text-main);
  background: 
    radial-gradient(circle at 12% 18%, rgba(186, 230, 253, 0.65) 0%, transparent 40%),
    radial-gradient(circle at 88% 12%, rgba(244, 214, 255, 0.6) 0%, transparent 38%),
    radial-gradient(circle at 85% 75%, rgba(254, 205, 211, 0.5) 0%, transparent 35%),
    radial-gradient(circle at 10% 80%, rgba(216, 180, 254, 0.55) 0%, transparent 42%),
    linear-gradient(135deg, #dbeafe 0%, #f3e8ff 45%, #fce7f3 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navbar */
.navbar-acg {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 4px 20px -2px rgba(100, 116, 139, 0.05);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
}

.brand-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #139655 0%, #10b981 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  font-weight: bold;
  box-shadow: 0 4px 10px rgba(19, 150, 85, 0.25);
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  color: #139655;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

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

.search-box {
  position: relative;
  width: 240px;
}

.search-input {
  width: 100%;
  padding: 8px 16px 8px 36px;
  background: #f1f5f9;
  border: 1px solid transparent;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s;
}

.search-input:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(19, 150, 85, 0.15);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 14px;
}

.btn-admin {
  background: #f8fafc;
  color: #475569;
  border: 1px solid var(--border-color);
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-admin:hover {
  background: #f1f5f9;
  color: var(--primary);
  border-color: var(--primary-border);
}

/* Card Panel */
.panel {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 20px -2px rgba(100, 116, 139, 0.08), 0 2px 6px -1px rgba(100, 116, 139, 0.04);
  margin-bottom: 24px;
  overflow: hidden;
  transition: box-shadow 0.25s ease;
}

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(250, 251, 252, 0.85);
}

.panel-header .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 16px;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.panel-body {
  padding: 20px;
}

/* Announcement Board */
.announcement-body {
  font-size: 14px;
  line-height: 1.8;
  color: #334155;
}

.announcement-body a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.announcement-body a:hover {
  text-decoration: underline;
}

.announcement-body hr {
  margin: 14px 0;
  border: none;
  border-top: 1px dashed #cbd5e1;
}

/* Category Filter Chips */
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 24px;
  background: #f1f5f9;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.chip:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.chip.active {
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.chip-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.chip-count {
  font-size: 11px;
  opacity: 0.85;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
}

.chip.active .chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.product-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px -4px rgba(99, 102, 241, 0.12), 0 6px 12px -2px rgba(0, 0, 0, 0.04);
  border-color: #c7d2fe;
}

.product-cover-wrap {
  width: 100%;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 12px;
  border-bottom: 1px solid #f8fafc;
}

.product-cover {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.35s ease;
}

.product-card:hover .product-cover {
  transform: scale(1.04);
}

.product-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.badge-soft {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-soft-success {
  background: #dcfce7;
  color: #16a34a;
}

.badge-soft-recommend {
  background: #ede9fe;
  color: #6366f1;
}

.product-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 40px;
}

.product-price-box {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 2px;
}

.price-currency {
  font-size: 14px;
  font-weight: 800;
  color: #f43f5e;
}

.price-value {
  font-size: 22px;
  font-weight: 800;
  color: #f43f5e;
  letter-spacing: -0.5px;
}

.price-original {
  font-size: 12px;
  color: #94a3b8;
  text-decoration: line-through;
  margin-left: 6px;
}

.product-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #64748b;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #f8fafc;
}

.stat-stock {
  color: #64748b;
}

.stat-sold {
  color: #94a3b8;
}

/* Empty or Loading State */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  color: #94a3b8;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 800px;
  overflow: hidden;
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafbfc;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-close:hover {
  color: #0f172a;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

/* Detail Modal Specifics */
.detail-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

.detail-cover-box {
  width: 100%;
  height: 240px;
  border-radius: 12px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.detail-cover-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-main);
  background: #ffffff;
  outline: none;
  transition: all 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(19, 150, 85, 0.15);
}

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-btn {
  background: #f8fafc;
  border: none;
  width: 38px;
  height: 38px;
  font-size: 16px;
  font-weight: bold;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s;
}

.qty-btn:hover {
  background: #e2e8f0;
}

.qty-input {
  width: 50px;
  height: 38px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  font-weight: 600;
  outline: none;
}

/* Pay Options */
.pay-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.pay-option {
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  background: #ffffff;
  user-select: none;
}

.pay-option:hover {
  border-color: #94a3b8;
}

.pay-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* Product Detail HTML Content Area */
.rich-content {
  font-size: 14px;
  line-height: 1.8;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  margin-top: 16px;
}

.rich-content h4 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

/* Order Query Section */
.query-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 30px;
  max-width: 650px;
  margin: 20px auto;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.order-result-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.order-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 12px;
}

.card-secret-box {
  background: #0f172a;
  color: #38bdf8;
  font-family: Consolas, Monaco, "Courier New", monospace;
  padding: 14px;
  border-radius: 8px;
  margin: 10px 0;
  font-size: 14px;
  word-break: break-all;
  white-space: pre-wrap;
  position: relative;
  border: 1px solid #1e293b;
}

.copy-btn {
  background: #2563eb;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.copy-btn:hover {
  background: #1d4ed8;
}

/* Toast message */
.toast-msg {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  padding: 10px 22px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  animation: toastFade 0.25s ease;
}

@keyframes toastFade {
  from { opacity: 0; transform: translate(-50%, 15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Admin Panel Specific Styling */
.admin-layout {
  display: flex;
  min-height: calc(100vh - 68px);
}

.admin-sidebar {
  width: 230px;
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  padding: 20px 0;
  flex-shrink: 0;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}

.admin-nav-item:hover {
  background: #f8fafc;
  color: var(--primary);
}

.admin-nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
}

.admin-content {
  flex-grow: 1;
  padding: 30px;
  background: #f8fafc;
  overflow-y: auto;
}

/* Admin Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-val {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background: #f8fafc;
  padding: 12px 14px;
  font-weight: 600;
  color: #475569;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.data-table tr:hover td {
  background: #fafbfc;
}

/* Form Helper */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.img-preview-box {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f8fafc;
  margin-top: 6px;
}

.img-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Button styles */
.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #e2e8f0;
  color: #475569;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #cbd5e1;
}

.btn-danger {
  background: #ef4444;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border-color);
  margin-top: 40px;
  background: #ffffff;
}

/* Payment Cashier Styles */
.cashier-card {
  max-width: 540px !important;
}
.cashier-body {
  text-align: center;
  padding: 24px;
}
.cashier-amount-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}
.cashier-qr-wrap {
  display: inline-block;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  margin-bottom: 16px;
}
.cashier-qr-wrap img {
  display: block;
  width: 220px;
  height: 220px;
  object-fit: contain;
}
.btn-web3 {
  background: linear-gradient(135deg, #f6851b 0%, #e2761b 100%);
  color: #ffffff;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-shadow: 0 4px 12px rgba(246, 133, 27, 0.25);
  transition: all 0.2s;
}
.btn-web3:hover {
  background: linear-gradient(135deg, #e2761b 0%, #cd6512 100%);
  transform: translateY(-1px);
}
.copy-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-family: monospace;
  font-size: 12px;
  word-break: break-all;
  margin-bottom: 12px;
  text-align: left;
}

