/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4CAF50;
    --primary-hover: #45a049;
    --secondary-color: #2196F3;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --success-color: #4CAF50;
    --dark-color: #333;
    --gray-color: #666;
    --light-color: #f5f5f5;
    --border-color: #ddd;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 100%),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23f0f0f0"/><circle cx="75" cy="75" r="1" fill="%23f0f0f0"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    min-height: 100vh;
    color: var(--dark-color);
    line-height: 1.6;
}

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

/* 导航栏 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: bold;
}

.navbar-brand i {
    margin-right: 10px;
    font-size: 1.8rem;
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.navbar-toggle span {
    width: 25px;
    height: 3px;
    background: var(--dark-color);
    margin: 3px 0;
    border-radius: 3px;
    transition: 0.3s;
}

.navbar-collapse {
    display: flex;
    align-items: center;
    gap: 30px;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: var(--gray-color);
    text-decoration: none;
    border-radius: var(--radius);
    transition: 0.3s;
}

.nav-link:hover {
    color: var(--primary-color);
    background: rgba(76, 175, 80, 0.1);
}

.nav-link i {
    margin-right: 8px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--light-color);
    border-radius: 25px;
    padding: 8px 15px;
}

.search-box i {
    color: var(--gray-color);
    margin-right: 10px;
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    width: 200px;
    font-size: 0.9rem;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: 0.3s;
    white-space: nowrap;
}

.btn i {
    margin-right: 6px;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

/* 面板 */
.panel {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
}

.panel-header .icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.panel-header .icon i {
    font-size: 0.9rem;
}

.panel-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.panel-body {
    padding: 20px;
}

/* 分类标签 */
.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    background: var(--light-color);
    border: 2px solid transparent;
    border-radius: 30px;
    text-decoration: none;
    color: var(--dark-color);
    font-size: 0.95rem;
    cursor: pointer;
    transition: 0.3s;
}

.chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.chip.is-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
}

.chip-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 商品列表 */
.item-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.item-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--gray-color);
}

.product-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: 0.3s;
    position: relative;
}

.product-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.15);
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.product-desc {
    font-size: 0.85rem;
    color: var(--gray-color);
    margin-bottom: 15px;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.product-price .retail {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-color);
}

.product-price .wholesale {
    font-size: 0.85rem;
    color: var(--warning-color);
    text-decoration: line-through;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
}

.modal.is-active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlide 0.3s ease;
}

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

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

.modal-header h3 {
    font-size: 1.2rem;
    color: var(--dark-color);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--light-color);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.3s;
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

/* 产品信息 */
.product-info {
    background: var(--light-color);
    padding: 15px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.price-info {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.price-label {
    color: var(--gray-color);
}

.price-value {
    font-weight: bold;
    color: var(--primary-color);
}

.price-value.wholesale {
    color: var(--warning-color);
}

.total-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.total-amount {
    font-size: 1.5rem;
    font-weight: bold;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 100px;
    right: 20px;
    background: white;
    padding: 15px 25px;
    border-radius: var(--radius);
    box-shadow: 0 5px 30px rgba(0,0,0,0.15);
    display: none;
    z-index: 3000;
}

.toast.show {
    display: block;
    animation: toastSlide 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

@keyframes toastSlide {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--gray-color);
    font-size: 0.9rem;
}

/* 响应式 */
@media (max-width: 768px) {
    .navbar-toggle {
        display: flex;
    }

    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: white;
        padding: 20px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.1);
        display: none;
    }

    .navbar-collapse.is-active {
        display: flex;
    }

    .navbar-nav {
        flex-direction: column;
        width: 100%;
    }

    .nav-link {
        width: 100%;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        flex: 1;
    }

    .item-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
