/* ===== 全局重置 & 基础 ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fafafa;
    color: #1e293b;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; outline: none; }

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

/* ===== 配色变量 ===== */
:root {
    --primary: #f97316;
    --primary-dark: #ea580c;
    --primary-light: #ffedd5;
    --secondary: #0ea5e9;
    --accent: #f59e0b;
    --bg-light: #ffffff;
    --bg-gray: #f1f5f9;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 10px 25px -5px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 40px -12px rgba(0,0,0,0.15);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: all 0.25s ease;
}

/* ===== 头部导航 ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    z-index: 1000;
    transition: var(--transition);
}
.site-header.scrolled {
    box-shadow: var(--shadow-sm);
    background: rgba(255,255,255,0.96);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}
.logo i { font-size: 1.6rem; }

.main-nav {
    display: flex;
    gap: 28px;
}
.main-nav a {
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
    padding: 4px 0;
    border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav a.active {
    color: var(--primary-dark);
    border-bottom-color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.admin-btn {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 8px 18px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}
.admin-btn:hover {
    background: var(--primary);
    color: white;
}
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--text-dark);
    padding: 4px;
}

/* ===== Hero ===== */
.hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    min-height: 80vh;
    display: flex;
    align-items: center;
}
.hero-content {
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}
.hero-text {
    flex: 1 1 500px;
}
.hero-text h1 {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
}
.hero-text h1 span {
    color: var(--primary);
    background: linear-gradient(135deg, #f97316, #ea580c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-text p {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 28px;
    max-width: 480px;
}
.search-box {
    display: flex;
    background: white;
    border-radius: 60px;
    box-shadow: var(--shadow-md);
    padding: 6px 6px 6px 20px;
    align-items: center;
    max-width: 520px;
    transition: var(--transition);
}
.search-box:focus-within {
    box-shadow: 0 0 0 3px rgba(249,115,22,0.3);
}
.search-box i {
    color: var(--text-muted);
    font-size: 1.1rem;
}
.search-box input {
    flex: 1;
    border: none;
    padding: 12px 12px;
    font-size: 1rem;
    background: transparent;
}
.search-box button {
    background: var(--primary);
    border: none;
    color: white;
    padding: 10px 28px;
    border-radius: 40px;
    font-weight: 600;
    transition: var(--transition);
}
.search-box button:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}
.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}
.tag {
    background: white;
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary-dark);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(249,115,22,0.2);
}
.hero-image {
    flex: 1 1 300px;
    text-align: center;
}
.hero-image img {
    max-width: 380px;
    margin: 0 auto;
    filter: drop-shadow(0 20px 30px rgba(249,115,22,0.25));
}

/* ===== 分类 ===== */
.categories {
    padding: 80px 0;
    background: white;
}
.section-title {
    text-align: center;
    margin-bottom: 40px;
}
.section-title h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.section-title p {
    color: var(--text-muted);
}
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 20px;
}
.category-card {
    background: var(--bg-gray);
    padding: 24px 12px;
    border-radius: var(--radius);
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}
.category-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    background: white;
}
.category-card i {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 10px;
}
.category-card h4 {
    font-weight: 600;
    font-size: 1rem;
}

/* ===== 热销商品 ===== */
.hot-products {
    padding: 80px 0;
    background: var(--bg-gray);
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}
.product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
}
.product-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: var(--shadow-lg);
}
.product-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #fff0e0;
}
.product-info {
    padding: 16px 18px 20px;
}
.product-info h4 {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 6px;
}
.product-info .price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}
.product-info .price small {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}
.product-info .rating {
    color: var(--accent);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ===== 商家 ===== */
.shops {
    padding: 80px 0;
    background: white;
}
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.shop-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-gray);
    padding: 20px;
    border-radius: var(--radius);
    transition: var(--transition);
}
.shop-card:hover {
    background: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}
.shop-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}
.shop-details h4 {
    font-weight: 600;
    margin-bottom: 4px;
}
.shop-details p {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.shop-details .stars {
    color: var(--accent);
}

/* ===== 下载 ===== */
.download-app {
    padding: 80px 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
}
.download-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
}
.download-text h2 {
    font-size: 2rem;
    margin-bottom: 12px;
}
.download-text p {
    color: #94a3b8;
    margin-bottom: 24px;
    max-width: 400px;
}
.download-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.btn-app {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
}
.btn-app:hover {
    background: var(--primary);
    border-color: var(--primary);
}
.download-qr .qr-placeholder {
    width: 160px;
    height: 160px;
    background: white;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    font-weight: 500;
    gap: 8px;
    font-size: 2.5rem;
}
.qr-placeholder span {
    font-size: 0.9rem;
}

/* ===== 页脚 ===== */
.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 60px 0 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}
.footer-col h4, .footer-col h5 {
    color: white;
    margin-bottom: 16px;
}
.footer-col h4 i { color: var(--primary); margin-right: 6px; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { color: #94a3b8; transition: var(--transition); }
.footer-col ul li a:hover { color: white; }
.footer-bottom {
    border-top: 1px solid #1e293b;
    padding: 20px 0;
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
}

/* ===== 回到顶部 ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.2rem;
    box-shadow: var(--shadow-md);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: var(--transition);
}
.back-to-top.show {
    display: flex;
}
.back-to-top:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .main-nav {
        position: fixed;
        top: 64px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 20px;
        gap: 16px;
        box-shadow: var(--shadow-md);
        transform: translateY(-120%);
        transition: transform 0.3s ease;
    }
    .main-nav.open {
        transform: translateY(0);
    }
    .menu-toggle {
        display: block;
    }
    .hero-text h1 {
        font-size: 2rem;
    }
    .hero {
        padding-top: 100px;
    }
    .hero-content {
        flex-direction: column;
    }
    .download-inner {
        flex-direction: column;
        text-align: center;
    }
    .download-text p {
        margin: 0 auto 24px;
    }
    .download-buttons {
        justify-content: center;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .header-inner {
        height: 56px;
    }
    .admin-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    .hero-text h1 {
        font-size: 1.7rem;
    }
    .product-grid {
        grid-template-columns: 1fr;
    }
    .shop-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   后台管理样式
   ============================================================ */
.admin-body {
    background: #f1f5f9;
    min-height: 100vh;
}
.admin-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    padding: 20px;
}
.login-card {
    background: white;
    border-radius: var(--radius);
    padding: 40px 32px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}
.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo i {
    font-size: 2.5rem;
    color: var(--primary);
}
.login-logo h2 {
    margin: 12px 0 4px;
    font-weight: 700;
}
.login-form .form-group {
    margin-bottom: 18px;
}
.login-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--text-dark);
}
.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
}
.login-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.15);
}
.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
}
.btn-login:hover {
    background: var(--primary-dark);
}
.login-error {
    color: #dc2626;
    text-align: center;
    margin-top: 12px;
    font-size: 0.9rem;
    min-height: 24px;
}

/* 后台面板 */
.admin-panel {
    min-height: 100vh;
}
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 0 24px;
    height: 64px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}
.admin-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}
.admin-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.btn-logout {
    background: transparent;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 500;
    transition: var(--transition);
}
.btn-logout:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.admin-container {
    display: flex;
    min-height: calc(100vh - 64px);
}
.admin-sidebar {
    width: 220px;
    background: white;
    border-right: 1px solid #e2e8f0;
    padding: 20px 0;
    flex-shrink: 0;
}
.admin-sidebar nav a {
    display: block;
    padding: 12px 24px;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}
.admin-sidebar nav a:hover {
    background: var(--bg-gray);
    color: var(--text-dark);
}
.admin-sidebar nav a.tab-active {
    color: var(--primary);
    border-left-color: var(--primary);
    background: var(--primary-light);
}
.admin-main {
    flex: 1;
    padding: 30px;
    overflow-x: auto;
}
.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.btn-primary {
    background: var(--primary);
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}
.table-wrapper {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}
.admin-table th {
    background: #f8fafc;
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-bottom: 2px solid #e2e8f0;
}
.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}
.admin-table tr:hover td {
    background: #f8fafc;
}
.btn-edit, .btn-delete {
    padding: 6px 14px;
    border: none;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.8rem;
    transition: var(--transition);
    margin-right: 6px;
}
.btn-edit {
    background: #e0f2fe;
    color: #0369a1;
}
.btn-edit:hover {
    background: #bae6fd;
}
.btn-delete {
    background: #fee2e2;
    color: #b91c1c;
}
.btn-delete:hover {
    background: #fecaca;
}

/* 弹窗 */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}
.modal-card {
    background: white;
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.modal-header h3 {
    font-weight: 700;
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-muted);
    transition: var(--transition);
}
.modal-close:hover {
    color: var(--text-dark);
    transform: rotate(90deg);
}
.modal-card .form-group {
    margin-bottom: 16px;
}
.modal-card label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 0.9rem;
}
.modal-card input, .modal-card select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
}
.modal-card input:focus, .modal-card select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}

@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 0;
        display: flex;
        overflow-x: auto;
    }
    .admin-sidebar nav {
        display: flex;
        gap: 0;
    }
    .admin-sidebar nav a {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 14px 20px;
    }
    .admin-sidebar nav a.tab-active {
        border-left: none;
        border-bottom-color: var(--primary);
    }
    .admin-container {
        flex-direction: column;
    }
    .admin-main {
        padding: 20px 16px;
    }
}