/* ===== 菜菜电竞 · 咖啡馆主题 ===== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
    --primary: #6F4E37;
    --primary-light: #8B6914;
    --accent: #D4A574;
    --accent-light: #F5DEB3;
    --bg: #FAF7F2;
    --bg-card: #FFFFFF;
    --text: #2C1810;
    --text-light: #8B7355;
    --danger: #C0392B;
    --success: #27AE60;
    --shadow: 0 2px 16px rgba(0,0,0,.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.1);
    --radius: 12px;
    --transition: all .25s cubic-bezier(.4,0,.2,1);
}

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

body {
    font-family: 'Noto Sans SC', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    max-width: 100%;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

/* ===== 导航栏 ===== */
.navbar {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 8px rgba(0,0,0,.06);
    padding: 0 24px;
}
.navbar-container {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.navbar-logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 22px; font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.navbar-logo img { width: 36px; height: 36px; border-radius: 50%; }
.navbar-menu { display: flex; list-style: none; gap: 0; flex-wrap: nowrap; align-items: center; }
.nav-link {
    padding: 5px 10px; border-radius: 20px;
    font-size: 13px; font-weight: 500; color: var(--text-light);
    transition: var(--transition);
    white-space: nowrap;
    line-height: 1;
}
.nav-link:hover { background: var(--accent-light); color: var(--primary); }
.nav-link.active { background: var(--primary); color: #fff; }

/* ===== Banner Slider ===== */
.banner-swiper { width: 100%; max-width: 1200px; margin: 24px auto; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg); }
.banner-swiper .swiper-slide { height: 420px; }
.banner-swiper .swiper-slide img { width: 100%; height: 100%; object-fit: cover; }
.banner-swiper .swiper-pagination-bullet-active { background: var(--primary); }
@media (max-width: 768px) { .banner-swiper .swiper-slide { height: 240px; } }

/* ===== Section ===== */
.section { max-width: 1200px; margin: 0 auto; padding: 48px 24px; }
.section-header { text-align: center; margin-bottom: 36px; }
.section-title {
    font-size: 32px; font-weight: 700; color: var(--text);
    position: relative; display: inline-block;
}
.section-title::after {
    content: ''; display: block;
    width: 48px; height: 4px; border-radius: 2px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    margin: 12px auto 0;
}
.section-subtitle { color: var(--text-light); font-size: 15px; margin-top: 8px; }

/* ===== Product Cards ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}
.product-card {
    background: var(--bg-card); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow);
    transition: var(--transition); cursor: pointer;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-card-img {
    height: 220px; overflow: hidden; background: #f0ebe3;
    display: flex; align-items: center; justify-content: center;
}
.product-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.product-card:hover .product-card-img img { transform: scale(1.06); }
.product-card-body { padding: 16px 20px 20px; }
.product-card-name { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.product-card-category {
    display: inline-block; font-size: 12px; padding: 3px 10px;
    border-radius: 12px; background: var(--accent-light); color: var(--primary);
    margin-bottom: 10px;
}
.product-card-footer { display: flex; align-items: center; justify-content: space-between; }
.product-card-price { font-size: 22px; font-weight: 700; color: var(--primary); }
.product-card-price span { font-size: 14px; }
.product-card-btn {
    padding: 8px 20px; border: none; border-radius: 20px;
    background: var(--primary); color: #fff; font-size: 14px;
    cursor: pointer; transition: var(--transition); font-weight: 500;
}
.product-card-btn:hover { background: var(--primary-light); transform: scale(1.05); }
.product-tags { font-size: 12px; color: var(--text-light); margin-top: 8px; }

/* ===== News Cards ===== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}
.news-card {
    background: var(--bg-card); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow);
    transition: var(--transition); display: flex;
    color: inherit; text-decoration: none;
}
.news-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.news-card-img { width: 140px; min-height: 160px; overflow: hidden; flex-shrink: 0; }
.news-card-img img { width: 100%; height: 100%; object-fit: cover; }
.news-card-body {
    padding: 16px 20px; display: flex; flex-direction: column; justify-content: center;
}
.news-card-title { font-size: 16px; font-weight: 600; line-height: 1.4; margin-bottom: 8px; }
.news-card-summary { font-size: 13px; color: var(--text-light); margin-bottom: 10px; line-height: 1.5; }
.news-card-meta { font-size: 12px; color: var(--text-light); display: flex; gap: 12px; }

/* ===== Home News Section ===== */
.news-home-section { background: #fff; padding: 48px 24px; max-width: 100%; }
.news-home-section .section-header { max-width: 1200px; margin: 0 auto 36px; }
.news-home-section .news-grid { max-width: 1200px; margin: 0 auto; }

/* ===== Activity Cards ===== */
.activity-card {
    background: var(--bg-card); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow); transition: var(--transition);
}
.activity-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.activity-card-img { height: 200px; overflow: hidden; }
.activity-card-img img { width: 100%; height: 100%; object-fit: cover; }
.activity-card-body { padding: 20px; text-align: center; }
.activity-card-name { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.activity-card-intro { font-size: 14px; color: var(--text-light); margin-bottom: 16px; }
.activity-card-price { font-size: 28px; font-weight: 700; color: var(--primary); }
.activity-card-price s { font-size: 16px; color: #ccc; margin-left: 8px; }
.activity-card-badge {
    display: inline-block; padding: 4px 14px; border-radius: 12px;
    font-size: 12px; font-weight: 600; margin-bottom: 12px;
}
.badge-active { background: #e8f5e9; color: var(--success); }
.badge-upcoming { background: #fff3e0; color: #e65100; }
.badge-ended { background: #f5f5f5; color: #999; }
.badge-unpaid { background: #FFEBEE; color: #C62828; }
.badge-done { background: #E8F5E9; color: #2E7D32; }
.badge-paid { background: #E3F2FD; color: #1976D2; }
.badge-time { background: #F5F5F5; color: #999; font-size: 11px; }
.badge-hero { background: #FFF0E6; color: #E8803A; }

/* ===== Category Nav ===== */
.category-nav {
    max-width: 1200px; margin: 0 auto; padding: 16px 24px;
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: 10px;
}
.category-nav .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.category-nav a {
    padding: 8px 20px; border-radius: 20px;
    background: #fff; font-size: 14px; font-weight: 500;
    color: var(--text-light); box-shadow: var(--shadow);
    transition: var(--transition);
}
.category-nav a:hover, .category-nav a.active { background: var(--primary); color: #fff; }
.cart-link { display: flex; align-items: center; gap: 6px; position: relative; }
.cart-icon { width: 24px; height: 24px; }
.cart-badge {
    position: absolute; top: -6px; right: -6px;
    background: var(--danger); color: #fff; width: 18px; height: 18px;
    border-radius: 50%; font-size: 11px; font-weight: 700;
    display: none; align-items: center; justify-content: center;
}

/* ===== Product Detail ===== */
.detail-container {
    max-width: 1000px; margin: 32px auto; padding: 0 24px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
}
.detail-image { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.detail-image img { width: 100%; }
.detail-info { display: flex; flex-direction: column; gap: 16px; }
.detail-name { font-size: 28px; font-weight: 700; }
.detail-price { font-size: 36px; font-weight: 700; color: var(--primary); }
.detail-meta { display: flex; gap: 12px; flex-wrap: wrap; }
.detail-tag {
    padding: 4px 14px; border-radius: 16px; font-size: 13px;
    background: var(--accent-light); color: var(--primary);
}
.detail-btn {
    margin-top: 16px; padding: 14px 32px; border: none; border-radius: 28px;
    background: var(--primary); color: #fff; font-size: 18px; font-weight: 600;
    cursor: pointer; transition: var(--transition); width: fit-content;
}
.detail-btn:hover { background: var(--primary-light); transform: scale(1.03); }

/* ===== Login Page ===== */
.login-container {
    max-width: 440px; margin: 60px auto; padding: 40px;
    background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.login-container h2 { font-size: 28px; text-align: center; margin-bottom: 32px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; color: var(--text-light); margin-bottom: 6px; }
.form-group input {
    width: 100%; padding: 12px 16px; border: 2px solid #eee; border-radius: 10px;
    font-size: 16px; transition: var(--transition); font-family: inherit;
}
.form-group input:focus { outline: none; border-color: var(--primary); }
.btn {
    display: inline-block; padding: 12px 28px; border: none; border-radius: 24px;
    font-size: 16px; font-weight: 600; cursor: pointer; transition: var(--transition);
    font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--primary-light); }
.btn-outline { background: #fff; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.flash-msg { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.flash-error { background: #fdeaea; color: var(--danger); }
.flash-success { background: #e8f5e9; color: var(--success); }
.flash-info { background: #e3f2fd; color: #1976d2; }

/* ===== Mine Page ===== */
.mine-container {
    max-width: 800px; margin: 32px auto; padding: 0 24px;
}
.user-card {
    background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 36px; text-align: center; margin-bottom: 24px;
}
.user-avatar {
    width: 80px; height: 80px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px; font-size: 32px; color: #fff; font-weight: 700;
}
.user-name { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.user-phone { font-size: 14px; color: var(--text-light); }
.order-card {
    background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 20px; margin-bottom: 16px; transition: var(--transition);
}
.order-card:hover { box-shadow: var(--shadow-lg); }
.order-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.order-id { font-weight: 600; font-size: 15px; }
.order-status { padding: 4px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; }
.status-paid { background: #e8f5e9; color: var(--success); }
.status-unpaid { background: #fff3e0; color: #e65100; }
.status-done { background: #e3f2fd; color: #1565c0; }
.order-meta { font-size: 13px; color: var(--text-light); display: flex; gap: 16px; }

/* ===== Admin ===== */
.admin-header {
    background: var(--text); color: #fff; padding: 0 24px;
    position: sticky; top: 0; z-index: 1000;
}
.admin-header-inner {
    max-width: 1200px; margin: 0 auto; height: 56px;
    display: flex; align-items: center; justify-content: space-between;
}
.admin-header a { color: rgba(255,255,255,.85); margin-left: 20px; font-size: 14px; transition: var(--transition); }
.admin-header a:hover { color: #fff; }
.admin-container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card {
    background: var(--bg-card); border-radius: var(--radius); padding: 28px;
    text-align: center; box-shadow: var(--shadow);
}
.stat-num { font-size: 42px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 14px; color: var(--text-light); margin-top: 4px; }
.admin-table {
    width: 100%; background: var(--bg-card); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow);
}
.admin-table th, .admin-table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid #f0ebe3; }
.admin-table th { background: #faf7f2; font-weight: 600; font-size: 13px; text-transform: uppercase; color: var(--text-light); }
.admin-table tr:hover td { background: #fdfaf6; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 16px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-success { background: var(--success); color: #fff; }

/* ===== Cart Sidebar ===== */
.cart-page {
    position: fixed; top: 0; right: -360px; width: 360px; height: 100%;
    background: #fff; box-shadow: -4px 0 24px rgba(0,0,0,.15);
    transition: right .3s cubic-bezier(.4,0,.2,1);
    z-index: 2000; display: flex; flex-direction: column;
}
.cart-page.open { right: 0; }
.cart-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid #eee;
}
.cart-close { font-size: 28px; cursor: pointer; color: #999; }
.cart-close:hover { color: var(--danger); }
.cart-items { flex: 1; overflow-y: auto; padding: 16px 24px; }
.cart-item { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.cart-item img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 14px; }
.cart-item-price { font-size: 13px; color: var(--primary); font-weight: 500; }
.cart-item-qty { display: flex; align-items: center; gap: 8px; }
.cart-item-qty button {
    width: 28px; height: 28px; border-radius: 50%; border: 2px solid #ddd;
    background: #fff; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.cart-total { padding: 20px 24px; border-top: 1px solid #eee; font-size: 20px; font-weight: 700; }
.checkout-btn {
    margin: 0 24px 24px; padding: 16px; border: none; border-radius: var(--radius);
    background: var(--primary); color: #fff; font-size: 18px; font-weight: 600;
    cursor: pointer; transition: var(--transition);
}
.checkout-btn:hover { background: var(--primary-light); }

/* ===== Footer ===== */
footer {
    background: var(--text); color: rgba(255,255,255,.7);
    padding: 40px 24px; margin-top: 60px;
    font-size: 14px; line-height: 2;
}
.footer-inner { max-width: 1200px; margin: 0 auto; text-align: center; }
footer a { color: rgba(255,255,255,.85); margin: 0 12px; transition: var(--transition); }
footer a:hover { color: #fff; }

/* ===== Flash msgs (top of page) ===== */
.flash-container { max-width: 1200px; margin: 12px auto; padding: 0 24px; }
.flash-item { padding: 14px 20px; border-radius: 10px; margin-bottom: 8px; font-size: 14px; font-weight: 500; }
.flash-item.success { background: #e8f5e9; color: var(--success); border-left: 4px solid var(--success); }
.flash-item.error { background: #fdeaea; color: var(--danger); border-left: 4px solid var(--danger); }
.flash-item.warning { background: #fff8e1; color: #f57c00; border-left: 4px solid #f57c00; }
.flash-item.info { background: #e3f2fd; color: #1976d2; border-left: 4px solid #1976d2; }

/* ===== Navbar Cart ===== */
.nav-cart {
  position: relative;
  overflow: visible !important;
}
.cart-badge-nav {
  position: absolute;
  top: -4px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  background: var(--danger, #E64340);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 16px;
  white-space: nowrap;
  pointer-events: none;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .detail-container { grid-template-columns: 1fr; gap: 20px; }
    .news-card { flex-direction: column; }
    .news-card-img { width: 100%; height: 180px; }
    .navbar-menu .nav-link { font-size: 13px; padding: 6px 14px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .section-title { font-size: 24px; }
    .cart-page { width: 100%; right: -100%; }
}
@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr; }
    .news-grid { grid-template-columns: 1fr; }
    .navbar-logo { font-size: 16px; }
}
