/* 定制平台 - 公共样式 */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    min-height: 100vh;
    -webkit-overflow-scrolling: touch;
}

a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
    height: auto;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    padding: 10px 24px;
    background: #ff6b9d;
    color: #fff;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
    background: #ff4d8a;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    display: inline-block;
    padding: 10px 24px;
    background: #fff;
    color: #ff6b9d;
    border: 1px solid #ff6b9d;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s;
    cursor: pointer;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.btn-secondary:hover {
    background: #fff0f5;
}

/* Header */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 12px;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    color: #ff6b9d;
    white-space: nowrap;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav a {
    color: #666;
    font-size: 14px;
    transition: color 0.3s;
    white-space: nowrap;
}

.nav a:hover, .nav a.active {
    color: #ff6b9d;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-btn, .register-btn {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 13px;
    white-space: nowrap;
}

.login-btn {
    color: #666;
}

.register-btn {
    background: #ff6b9d;
    color: #fff;
}

.user-info {
    color: #ff6b9d;
    font-size: 13px;
}

.logout {
    color: #999;
    font-size: 12px;
}

.cart-btn {
    position: relative;
    padding: 6px 12px;
    background: #fff0f5;
    border-radius: 15px;
    color: #ff6b9d;
    font-size: 13px;
}

.orders-btn {
    padding: 6px 12px;
    background: #fff0f5;
    border-radius: 15px;
    color: #ff6b9d;
    font-size: 13px;
}

.orders-btn.active {
    background: #ff6b9d;
    color: #fff;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    background: #ff6b9d;
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Menu Button */
.menu-btn {
    display: none;
    width: 32px;
    height: 32px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
}

.menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: #333;
    transition: all 0.3s;
}

/* Footer */
.footer {
    background: #fff;
    padding: 24px 0;
    margin-top: 40px;
    text-align: center;
    color: #999;
    font-size: 12px;
}

/* Section Title */
.section-title {
    font-size: 20px;
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #ff6b9d;
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 17px;
    font-weight: bold;
}

.modal-close {
    font-size: 24px;
    cursor: pointer;
    color: #999;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    margin-top: 16px;
}

.modal-body {
    padding: 0;
}

/* Toast */
.toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: #333;
    color: #fff;
    border-radius: 8px;
    z-index: 2000;
    animation: fadeIn 0.3s;
    font-size: 14px;
    max-width: 90%;
    text-align: center;
}

.toast.success {
    background: #52c41a;
}

.toast.error {
    background: #ff4d4d;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Loading */
.loading {
    text-align: center;
    padding: 30px;
    color: #999;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state .icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.empty-state p {
    margin-bottom: 16px;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    .header-content {
        height: 50px;
        padding: 0 10px;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .nav {
        display: none;
        position: absolute;
        top: 50px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        gap: 0;
        padding: 10px 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    
    .nav.show {
        display: flex;
    }
    
    .nav a {
        padding: 12px 16px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .menu-btn {
        display: flex;
    }
    
    .header-right {
        gap: 8px;
    }
    
    .login-btn, .register-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .cart-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .orders-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .user-info {
        font-size: 12px;
        max-width: 50px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .section-title {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .modal-content {
        padding: 16px;
        margin: 10px;
        border-radius: 8px;
    }
    
    .modal-title {
        font-size: 16px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-control {
        padding: 10px;
        font-size: 14px;
    }
}

/* Small Mobile */
@media screen and (max-width: 375px) {
    html {
        font-size: 14px;
    }
    
    .logo {
        font-size: 16px;
    }
    
    .login-btn, .register-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}
