/* 成人用品电商系统 - 公共样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    vertical-align: middle;
}

ul, ol {
    list-style: none;
}

input, button, textarea, select {
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 顶部导航 */
.header {
    background: white;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
}

.logo img {
    height: 40px;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav a {
    color: #666;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.nav a:hover, .nav a.active {
    color: #667eea;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart-btn {
    position: relative;
    font-size: 1.3rem;
    color: #666;
    transition: color 0.3s;
}

.cart-btn:hover {
    color: #667eea;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #ff4757;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.admin-link {
    color: #999;
    font-size: 0.9rem;
}

.admin-link:hover {
    color: #667eea;
}

/* 移动端底部导航 */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 15px rgba(0,0,0,0.1);
    z-index: 100;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

.mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: #999;
    font-size: 0.75rem;
}

.mobile-nav a i {
    font-size: 1.2rem;
}

.mobile-nav a.active {
    color: #667eea;
}

@media (max-width: 768px) {
    .nav { display: none; }
    .admin-link { display: none; }
    .mobile-nav { display: flex; justify-content: space-around; }
    .header { margin-bottom: 0; }
    body { padding-bottom: 70px; }
}

/* 商品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 1024px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .container { padding: 0 10px; }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr; }
}

/* 商品卡片 */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.product-card .tags {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    z-index: 1;
}

.product-card .tag {
    padding: 3px 8px;
    font-size: 0.7rem;
    border-radius: 3px;
    color: white;
}

.tag-hot { background: #ff4757; }
.tag-new { background: #2ed573; }
.tag-recommend { background: #ffa502; }

.product-card .product-image {
    position: relative;
    padding-top: 100%;
    background: #f8f9fa;
    overflow: hidden;
}

.product-card .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-card .product-info {
    padding: 15px;
}

.product-card .product-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    height: 2.8em;
}

.product-card .product-subtitle {
    color: #999;
    font-size: 0.85rem;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-card .product-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.product-card .current-price {
    font-size: 1.3rem;
    color: #ff4757;
    font-weight: 700;
}

.product-card .original-price {
    font-size: 0.85rem;
    color: #999;
    text-decoration: line-through;
}

.product-card .product-meta {
    display: flex;
    justify-content: space-between;
    color: #999;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.product-card .product-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.product-card .btn-buy-taobao {
    flex: 1;
    padding: 10px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
    display: block;
}

.product-card .btn-buy-taobao:hover {
    background: linear-gradient(135deg, #ee5a5a, #dd4949);
    color: white;
}

.product-card .btn-view-detail {
    padding: 10px 12px;
    background: #f5f6f7;
    color: #666;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: block;
    text-align: center;
}

.product-card .btn-view-detail:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 页脚 */
.footer {
    background: #1a1a2e;
    color: rgba(255,255,255,0.8);
    padding: 50px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.footer-section p {
    color: rgba(255,255,255,0.6);
    line-height: 1.8;
}

.footer-section ul li {
    margin-bottom: 10px;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: color 0.3s;
}

.footer-section ul li:hover {
    color: white;
}

.contact-list p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.contact-list i {
    font-size: 1.1rem;
    color: #667eea;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.4);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* 客服悬浮窗 */
.service-float {
    position: fixed;
    right: 20px;
    bottom: 100px;
    z-index: 99;
}

.service-float a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #07c160, #06ad56);
    color: white;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(7, 193, 96, 0.4);
    transition: all 0.3s;
}

.service-float a:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(7, 193, 96, 0.5);
}

.service-float a i {
    font-size: 1.5rem;
    margin-top: 8px;
}

.service-float a span {
    font-size: 0.7rem;
}

@media (max-width: 768px) {
    .service-float {
        right: 15px;
        bottom: 80px;
    }
    
    .service-float a {
        width: 50px;
        height: 50px;
    }
}

/* 支付弹窗 */
.payment-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.payment-modal.active {
    display: flex;
}

.payment-modal-content {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
}

.payment-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.payment-method {
    padding: 25px;
    border: 2px solid #eee;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-method:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.payment-method img {
    width: 70px;
    height: 70px;
    margin-bottom: 10px;
}

.payment-method-name {
    font-weight: 600;
    color: #333;
}

/* 按钮样式 */
.btn-primary {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    color: white;
}

.btn-secondary {
    display: inline-block;
    padding: 12px 30px;
    background: #f5f7fa;
    color: #666;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-secondary:hover {
    background: #e9ecef;
    color: #666;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 12px;
}

.empty-state i {
    font-size: 5rem;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #666;
    margin-bottom: 10px;
}

.empty-state p {
    color: #999;
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 20px;
}

.breadcrumb a {
    color: #666;
}

.breadcrumb a:hover {
    color: #667eea;
}

.breadcrumb span {
    color: #667eea;
}

/* 工具类 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #999; }
.text-danger { color: #ff4757; }
.text-primary { color: #667eea; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
