/* ===================================
   变量与重置 (淘宝风)
   =================================== */
:root {
    --tb-orange: #ff5000;
    --tb-orange-deep: #f04b00;
    --tb-bg: #f4f4f4;
    --tb-card: #ffffff;
    --tb-text: #333333;
    --tb-sub: #666666;
    --tb-muted: #999999;
    --tb-line: #eeeeee;
    --tb-soft: #fff0e8;
    --tb-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
    --tb-orange-rgb: 255, 80, 0;
    --tb-orange-light-rgb: 255, 120, 50;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
    background: radial-gradient(circle at top right, rgba(var(--tb-orange-light-rgb), 0.08), transparent 24%), linear-gradient(180deg, #fbfbfd 0%, var(--tb-bg) 140px, var(--tb-bg) 100%);
    color: var(--tb-text); -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
ul, li { list-style: none; }
.container { width: 1200px; max-width: calc(100% - 32px); margin: 0 auto; }

/* 强制覆盖原导航栏为绝对白底，配合截图 */
.glass-nav {
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(14px) !important; -webkit-backdrop-filter: blur(14px) !important;
    border-bottom: none !important; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05) !important;
    padding: 20px 0 !important; position: sticky; top: 0; z-index: 30;
}

/* ===================================
   首页专属样式 (从截图完整提取)
   =================================== */
.page-shell { min-height: calc(100vh - 240px); }
.home-wrap { padding: 24px 0 68px; }

.shop-card {
    background: var(--tb-card); border-radius: 22px; padding: 20px 24px;
    display: flex; justify-content: space-between; align-items: center; gap: 24px;
    margin-bottom: 20px; box-shadow: var(--tb-shadow); border: 1px solid rgba(var(--tb-orange-rgb), 0.08);
    background: linear-gradient(135deg, #ffffff 0%, #fffaf6 100%); position: relative; overflow: hidden;
}
.shop-card::after {
    content: ""; position: absolute; right: -48px; top: -52px; width: 180px; height: 180px;
    border-radius: 50%; background: radial-gradient(circle, rgba(var(--tb-orange-rgb), 0.12) 0%, rgba(var(--tb-orange-rgb), 0) 70%); pointer-events: none;
}
.shop-info-left { display: flex; align-items: center; gap: 22px; min-width: 0; }
.shop-logo { width: 82px; height: 82px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; transform: rotate(45deg); flex-shrink: 0; }
.shop-logo div { border-radius: 6px; }
.shop-logo .c1 { background: #f7b500; } .shop-logo .c2 { background: #fa6400; }
.shop-logo .c3 { background: #86d739; } .shop-logo .c4 { background: #2d8cf0; }
.shop-details h1 { font-size: 22px; font-weight: 700; color: #333; margin-bottom: 10px; }
.shop-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; font-size: 12px; color: var(--tb-sub); }
.tag-gold { background: #d89f3c; color: #fff; padding: 4px 9px; border-radius: 6px; font-size: 12px; }
.diamonds { color: #4da1ff; letter-spacing: 2px; }
.stat-item span { color: var(--tb-orange); font-weight: 700; }
.shop-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.btn { min-width: 94px; height: 44px; border-radius: 24px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; transition: all 0.2s ease; padding: 0 20px; text-decoration: none; color: #333; }
.btn-cs { background: #fff; border-color: #e5e5e5; color: #333; }
.btn-cs:hover { border-color: var(--tb-orange); color: var(--tb-orange); }
.btn-entry { background: linear-gradient(90deg, var(--tb-orange-light) 0%, var(--tb-orange) 100%); border-color: transparent; color: #fff; font-weight: 700; box-shadow: 0 12px 22px rgba(var(--tb-orange-rgb), 0.16); }
.btn-entry:hover { background: var(--tb-orange-deep); }

.main-layout { display: flex; gap: 20px; align-items: flex-start; }
.sidebar { width: 220px; background: #fff; border-radius: 20px; padding: 10px 0; box-shadow: var(--tb-shadow); flex-shrink: 0; border: 1px solid rgba(226, 232, 240, 0.9); }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 14px 18px; font-size: 14px; color: #333; cursor: pointer; transition: all 0.2s ease; }
.nav-item.no-icon { gap: 0; }
.nav-item:hover { color: var(--tb-orange); }
.nav-item.active { background: var(--tb-soft); color: var(--tb-orange); font-weight: 700; border-radius: 12px; margin: 0 12px; box-shadow: 0 10px 18px rgba(var(--tb-orange-rgb), 0.08); }

.content-area { flex: 1; background: #fff; border-radius: 22px; padding: 22px 24px 28px; box-shadow: var(--tb-shadow); min-width: 0; border: 1px solid rgba(226, 232, 240, 0.9); }
.tabs { display: flex; gap: 36px; align-items: center; margin-bottom: 24px; border-bottom: 1px solid var(--tb-line); padding-bottom: 14px; }
.tab-item { font-size: 14px; color: var(--tb-sub); cursor: pointer; position: relative; }
.tab-item.active { color: var(--tb-orange); font-weight: 700; }
.tab-item.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -15px; height: 2px; border-radius: 999px; background: linear-gradient(90deg, var(--tb-orange-light), var(--tb-orange)); }

.product-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px 16px; align-items: start; }
.product-card {
    cursor: pointer; transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    width: 100%; padding: 2px; border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 250, 245, 0.98) 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05); border: 1px solid rgba(226, 232, 240, 0.88);
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 18px 36px rgba(15, 23, 42, 0.1); border-color: rgba(var(--tb-orange-rgb), 0.18); }
.product-img { width: 100%; aspect-ratio: 1 / 1; border-radius: 14px; background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%); margin-bottom: 12px; display: flex; align-items: center; justify-content: center; text-align: center; position: relative; overflow: hidden; padding: 12px; }
.product-img-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 10px; background: #fff; }
.product-img-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; color: #fff; text-align: center; font-weight: 700; }
.img-title-large { font-size: 18px; margin-bottom: 6px; line-height: 1.3; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); }
.img-sub { font-size: 12px; opacity: 0.92; }
.product-title { padding: 0 10px; font-size: 13px; line-height: 1.4; color: #333; min-height: 32px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-bottom: 4px; }
.product-price-row { display: flex; align-items: center; flex-wrap: nowrap; gap: 0 3px; padding: 0 10px 5px; }
.price-symbol { font-size: 12px; color: var(--tb-orange); }
.price-value { font-size: 18px; color: var(--tb-orange); font-weight: 700; }
.price-buy-btn { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; border: 0; height: 26px; min-width: 54px; padding: 0 10px; border-radius: 999px; background: linear-gradient(90deg, #ff872c 0%, #ef524b 100%); color: #fff; font-size: 11px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 14px rgba(239, 82, 75, 0.2); }
.price-buy-btn:hover { transform: translateY(-1px); }

.fixed-tools { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); background: #fff; border-radius: 24px; box-shadow: 0 20px 44px rgba(15, 23, 42, 0.08); display: flex; flex-direction: column; align-items: stretch; z-index: 15; border: 1px solid rgba(226, 232, 240, 0.88); overflow: hidden; width: 96px; }
.tool-item { border: 0; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 108px; padding: 16px 10px; font-size: 13px; font-weight: 600; color: #4b5563; cursor: pointer; text-align: center; transition: background 0.2s ease, color 0.2s ease; border-bottom: 1px solid #eef1f5; width: 100%; font-family: inherit; }
.tool-item:last-child { border-bottom: none; }
.tool-item:hover { background: #fff8f3; color: var(--tb-orange); }
.tool-icon { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; color: inherit; }
.tool-icon svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.empty-state { grid-column: 1 / -1; text-align: center; padding: 90px 20px; color: var(--tb-muted); font-size: 14px; }

/* ===================================
   通用组件与兼容 (保留后台及防报错)
   =================================== */
.badge { display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 2px; font-size: 12px; }
.badge-green { background: #e8f5e9; color: #2e7d32; } .badge-yellow { background: #fff9c4; color: #f57f17; }
.badge-red { background: #ffebee; color: #c62828; } .badge-blue { background: #e3f2fd; color: #1565c0; } .badge-gray { background: #f5f5f5; color: #757575; }

.toast-container { position: fixed; top: 80px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 10px 16px; border-radius: 4px; color: #fff; font-size: 13px; transform: translateX(120%); opacity: 0; transition: all 0.3s ease; max-width: 300px; display: flex; align-items: center; gap: 8px; background: #333; }
.toast.show { transform: translateX(0); opacity: 1; }
.toast.success { border-left: 4px solid #22c55e; } .toast.error { border-left: 4px solid #ef4444; } .toast.info { border-left: 4px solid #3b82f6; }

.pulse-dot { width: 8px; height: 8px; background: #22c55e; border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 2px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.page-view { display: none; opacity: 0; } .page-view.active { display: block; opacity: 1; animation: none; }
.fade-up { opacity: 0; transform: none; transition: none; } .fade-up.visible { opacity: 1; transform: none; }
.cat-pill { transition: all 0.2s; cursor: pointer; } .cat-pill:hover { background: #f1f5f9; } .cat-pill.active { background: #0f172a; color: #fff; }
.pay-option { transition: all 0.2s; cursor: pointer; } .pay-option:hover { border-color: #c7d2fe; } .pay-option.selected { border-color: #6366f1; background: #eef2ff; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }
.qty-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: 1px solid #ddd; background: #f5f5f5; cursor: pointer; font-size: 16px; color: #666; user-select: none; } .qty-btn:hover { background: #eee; }
.copy-btn { transition: all 0.2s; cursor: pointer; background: none; border: none; } .copy-btn:hover { color: #ff5000; }
.line-clamp-1 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.line-clamp-2 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.mobile-menu { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999; display: none; opacity: 0; transition: opacity 0.3s; }
.mobile-menu.show { display: block; opacity: 1; }
.mobile-menu-panel { position: absolute; right: 0; top: 0; bottom: 0; width: 260px; background: #fff; padding: 20px; transform: translateX(100%); transition: transform 0.3s ease; }
.mobile-menu.show .mobile-menu-panel { transform: translateX(0); }

/* 后台管理样式 (绝对不动) */
.admin-nav-item { transition: all 0.2s; cursor: pointer; } .admin-nav-item:hover { background: #f1f5f9; } .admin-nav-item.active { background: #eef2ff; color: #6366f1; border-right: 3px solid #6366f1; }
.stat-card-1 { background: linear-gradient(135deg, #6366f1, #818cf8); } .stat-card-2 { background: linear-gradient(135deg, #06b6d4, #22d3ee); } .stat-card-3 { background: linear-gradient(135deg, #f59e0b, #fbbf24); } .stat-card-4 { background: linear-gradient(135deg, #10b981, #34d399); }
.admin-table { width: 100%; border-collapse: separate; border-spacing: 0; } .admin-table thead th { background: #f8fafc; padding: 10px 14px; text-align: left; font-size: 12px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid #e2e8f0; } .admin-table tbody td { padding: 12px 14px; font-size: 13px; border-bottom: 1px solid #f1f5f9; color: #334155; } .admin-table tbody tr:hover { background: #f8fafc; }
.toggle-on { width: 40px; height: 24px; background: #22c55e; border-radius: 12px; position: relative; cursor: pointer; } .toggle-on .toggle-dot { width: 18px; height: 18px; background: #fff; border-radius: 50%; position: absolute; right: 3px; top: 3px; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.toggle-off { width: 40px; height: 24px; background: #cbd5e1; border-radius: 12px; position: relative; cursor: pointer; } .toggle-off .toggle-dot { width: 18px; height: 18px; background: #fff; border-radius: 50%; position: absolute; left: 3px; top: 3px; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }

@media (max-width: 960px) {
    .shop-card, .main-layout { flex-direction: column; }
    .sidebar { width: 100%; overflow: hidden; padding: 10px 0; }
    .sidebar ul { display: flex; gap: 10px; padding: 0 12px 8px; overflow-x: auto; scrollbar-width: none; }
    .sidebar ul::-webkit-scrollbar { display: none; }
    .nav-item, .nav-item.active { margin: 0; width: 88px; min-width: 88px; flex-direction: column; justify-content: flex-start; gap: 8px; text-align: center; border-radius: 22px; padding: 12px 8px 10px; }
    .nav-text { font-size: 12px; }
    .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .fixed-tools { display: none; }
}
@media (max-width: 640px) {
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .product-card { border-radius: 18px; }
}