/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -webkit-user-select: none;
    user-select: none;
}

/* 京东顶部导航栏 */
.jd-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: #E4393C;
    color: white;
    display: flex;
    align-items: center;
    padding: 0 15px;
    z-index: 1000;
}

.back-btn,
.close-btn {
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jd-header h1 {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-weight: 500;
}

.header-right {
    width: 30px;
}

.header-icons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.cart-icon,
.more-icon {
    font-size: 20px;
    cursor: pointer;
}

/* Tab切换栏 */
.jd-tabs {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    height: 45px;
    background: white;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-bottom: 1px solid #eee;
    z-index: 999;
}

.tab-item {
    flex: 1;
    text-align: center;
    font-size: 15px;
    color: #666;
    padding: 8px 0;
    cursor: pointer;
    position: relative;
}

.tab-item.active {
    color: #333;
    font-weight: 600;
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: #E4393C;
    border-radius: 2px;
}

.tab-highlight {
    color: #E4393C !important;
}

/* 主内容区域 */
.jd-main {
    margin-top: 95px;
    padding-bottom: 60px;
    background: #f5f5f5;
}

.product-list {
    padding: 0;
}

/* 商品列表空状态（用于Tab无数据） */
.empty-products {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-products .empty-icon {
    font-size: 70px;
    margin-bottom: 18px;
    opacity: 0.25;
}

.empty-products p {
    font-size: 16px;
    color: #999;
}

/* 京东商品卡片 */
.jd-product-card {
    background: white;
    margin-bottom: 10px;
    padding: 15px;
    display: flex;
    gap: 12px;
}

.product-left {
    position: relative;
    flex-shrink: 0;
}

.product-img {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    object-fit: cover;
    background: #f0f0f0;
}

.product-tag {
    position: absolute;
    top: 0;
    left: 0;
    background: #E4393C;
    color: white;
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 4px 0 4px 0;
}

.product-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-title {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 5px;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}

.rating-badge {
    background: linear-gradient(90deg, #FF6600 0%, #FF3300 100%);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

.rating-icon {
    font-size: 14px;
}

.new-user-badge {
    width: fit-content;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF4757 100%);
    color: white;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 0 10px 10px 0;
    position: relative;
    margin-bottom: 8px;
}

.new-user-badge::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 8px 11px 0;
    border-color: transparent #FF6B6B transparent transparent;
}

.new-user-badge::after {
    content: '';
    position: absolute;
    left: -8px;
    bottom: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 11px 8px;
    border-color: transparent transparent #FF4757 transparent;
}

.product-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.product-price-box {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.price-symbol {
    color: #E4393C;
    font-size: 14px;
    font-weight: bold;
}

.price-value {
    color: #E4393C;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
}

.price-label {
    color: #999;
    font-size: 12px;
    margin-left: 5px;
}

.buy-btn {
    background: linear-gradient(135deg, #FF6B6B 0%, #E4393C 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.buy-btn:active {
    transform: scale(0.95);
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    -webkit-user-select: none;
    user-select: none;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #999;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.nav-item.active {
    color: #E4393C;
}

.nav-icon {
    font-size: 22px;
    margin-bottom: 2px;
    -webkit-user-select: none;
    user-select: none;
}

.nav-text {
    font-size: 11px;
    -webkit-user-select: none;
    user-select: none;
}

.cart-badge {
    position: absolute;
    top: 2px;
    right: 25%;
    background: #E4393C;
    color: white;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.cart-badge.show {
    display: flex;
}

/* 购物车页面 */
.cart-content {
    padding-top: 50px;
    padding-bottom: 120px;
    background: #f5f5f5;
}

/* 我的页面 */
.me-content {
    padding-top: 50px;
    padding-bottom: 60px;
    min-height: 100vh;
    background: #f5f5f5;
}

.me-card {
    margin: 15px;
    background: white;
    border-radius: 14px;
    padding: 18px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.me-avatar {
    width: 48px;
    height: 48px;
    border-radius: 24px;
    background: linear-gradient(135deg, #FF6B6B 0%, #E4393C 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.me-info {
    flex: 1;
}

.me-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.me-sub {
    font-size: 12px;
    color: #999;
}

.me-list {
    margin: 10px 15px 0;
    background: white;
    border-radius: 14px;
    overflow: hidden;
}

.me-item {
    padding: 14px 16px;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f2f2f2;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.me-item:last-child {
    border-bottom: none;
}

.me-item:active {
    background: #fafafa;
}

.me-logout-btn {
    width: calc(100% - 30px);
    margin: 16px 15px 0;
    height: 46px;
    border: 1px solid #eee;
    border-radius: 12px;
    background: white;
    color: #E4393C;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.me-logout-btn:active {
    transform: scale(0.98);
}

.me-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.me-empty-icon {
    font-size: 70px;
    opacity: 0.25;
    margin-bottom: 16px;
}

.me-empty p {
    font-size: 16px;
    color: #999;
    margin-bottom: 20px;
}

/* 京东购物车商品卡片 */
.jd-cart-item {
    background: white;
    margin-bottom: 10px;
    padding: 15px;
    display: flex;
    gap: 12px;
    position: relative;
}

.cart-item-left {
    flex-shrink: 0;
}

.cart-item-img {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
    background: #f0f0f0;
}

.cart-item-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-item-title {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

.cart-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-item-price {
    font-size: 20px;
    font-weight: bold;
    color: #E4393C;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:active {
    background: #f5f5f5;
}

.qty-value {
    min-width: 30px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
}

.delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border: none;
    background: #f5f5f5;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 购物车底部栏 */
.cart-footer {
    position: fixed;
    bottom: 50px;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.cart-total {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.cart-total span:first-child {
    font-size: 14px;
    color: #666;
}

.total-price {
    font-size: 24px;
    font-weight: bold;
    color: #E4393C;
}

.btn-checkout {
    background: linear-gradient(135deg, #FF6B6B 0%, #E4393C 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

.btn-checkout:active {
    transform: scale(0.95);
}

/* 空购物车 */
.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-cart p {
    font-size: 16px;
    color: #999;
    margin-bottom: 30px;
}

.btn-primary {
    background: linear-gradient(135deg, #FF6B6B 0%, #E4393C 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

/* 登录页面 */
.jd-login-content {
    padding-top: 50px;
    padding-bottom: 60px;
    height: 100vh;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.jd-login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo-icon {
    font-size: 60px;
    display: block;
    margin-bottom: 10px;
}

.login-logo h2 {
    font-size: 26px;
    font-weight: 600;
    color: #E4393C;
}

.jd-login-form {
    background: white;
    padding: 30px 20px;
    border-radius: 12px;
}

.jd-form-group {
    margin-bottom: 20px;
}

.jd-form-input {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.2s;
    -webkit-user-select: auto;
    user-select: auto;
}

.jd-form-input:focus {
    outline: none;
    border-color: #E4393C;
}

.jd-form-input::placeholder {
    color: #ccc;
}

.jd-login-btn {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, #FF6B6B 0%, #E4393C 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 10px;
}

.jd-login-btn:active {
    transform: scale(0.98);
}

.jd-form-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.jd-form-row .jd-form-input {
    flex: 1;
}

.jd-send-code-btn {
    height: 50px;
    min-width: 110px;
    padding: 0 12px;
    border: 1px solid #f0c0c0;
    border-radius: 4px;
    background: #fff5f5;
    color: #E4393C;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.jd-send-code-btn:active {
    transform: scale(0.98);
}

.jd-send-code-btn:disabled {
    border-color: #eee;
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    transform: none;
}

.jd-phone-row {
    display: flex;
    align-items: center;
    height: 50px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 0 12px;
    background: white;
}

.jd-country-code {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #333;
    font-size: 14px;
    white-space: nowrap;
    padding-right: 12px;
    border-right: 1px solid #eee;
}

.jd-country-code .arrow {
    color: #999;
    font-size: 16px;
    margin-top: -1px;
}

.jd-phone-input {
    border: none;
    height: 48px;
    padding: 0 0 0 12px;
}

.jd-phone-input:focus {
    border-color: transparent;
}

.login-agreement {
    margin: 5px 0 10px;
    font-size: 12px;
    color: #666;
    line-height: 1.6;
    -webkit-user-select: auto;
    user-select: auto;
}

.agreement-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.agreement-label input[type="checkbox"] {
    margin-top: 3px;
}

.login-agreement a {
    color: #2f6feb;
    text-decoration: none;
}

.login-agreement a:active {
    opacity: 0.8;
}

.jd-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9998;
}

.jd-modal.show {
    display: flex;
}

.jd-modal-card {
    width: 100%;
    max-width: 360px;
    background: white;
    border-radius: 14px;
    padding: 18px 16px 16px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.jd-modal-close {
    position: absolute;
    top: 8px;
    left: 10px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jd-modal-title {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 6px;
}

.jd-modal-desc {
    font-size: 12px;
    color: #999;
    text-align: center;
    margin-bottom: 14px;
}

.jd-modal-input {
    width: 100%;
    margin-bottom: 14px;
    text-align: center;
    letter-spacing: 4px;
    font-weight: 600;
}

.jd-modal-confirm-btn {
    margin-top: 0;
}

.jd-modal-tip {
    margin-top: 10px;
    font-size: 12px;
    color: #999;
    text-align: center;
    line-height: 1.6;
}

.login-tips {
    text-align: center;
    margin-top: 30px;
    font-size: 12px;
    color: #999;
    line-height: 1.8;
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    transition: transform 0.2s;
}

.toast.show {
    transform: translate(-50%, -50%) scale(1);
}
