/**
 * CH-SHOP 首页样式文件
 * 从 index.html 中抽离的样式代码
 */

/* CSS变量定义 */
:root {
    --primary-color: #008489;
    --secondary-color: #666;
    --background-color: #f5f5f5;
    --card-background: #ffffff;
    --background-light: #fafafa;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e8e8e8;
}

/* 基础布局样式 */
body {
    background-color: var(--background-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    max-width: 100vw;
}

html {
    overflow-x: hidden;
    max-width: 100vw;
}

.container {
    padding: 15px;
    max-width: 100%;
    box-sizing: border-box;
}

/* 头部样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header .title {
    font-size: 18px;
    font-weight: bold;
    font-style: italic;
    color: #000000;
}

/* 主要内容区域 */
.main-content {
    padding-top: 50px; /* for fixed header */
    padding-bottom: 70px; /* for fixed footer */
}

/* 通用卡片样式 */
.card {
    background-color: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.banner-card {
    padding: 0;
    overflow: hidden;
}

/* ==================== 轮播图样式 ==================== */
.carousel {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-item.active {
    opacity: 1;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 轮播图指示器 */
.carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: #008489;
    transform: scale(1.2);
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* 轮播图控制按钮 */
.carousel-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    z-index: 10;
}

.carousel-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.carousel-btn i {
    color: #666;
    font-size: 16px;
}

.carousel-btn:hover i {
    color: #ff5000;
}

/* ==================== 用户信息卡片 ==================== */
.user-info-card {
    position: relative;
    top: -20px;
    margin-bottom: 0;
    border-radius: 12px 12px 0 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name-section {
    flex: 1;
}

.status-badges {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.status-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.balance-section {
    display: flex;
    justify-content: flex-start;
    padding-top: 8px;
}

.user-info .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #008489;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.user-info .name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* 余额显示样式 */
.user-info .balance {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #FFD700, #FFA500, #FF8C00, #DAA520);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
    position: relative;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 8px;
    animation: goldGlow 2s ease-in-out infinite alternate;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

@keyframes goldGlow {
    0% {
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.3), 0 0 10px rgba(255, 215, 0, 0.2);
    }
    100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.3), 0 0 30px rgba(255, 215, 0, 0.1);
    }
}

.user-info .balance::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.1));
    border-radius: 6px;
    z-index: -1;
}

/* ==================== 状态徽章样式 ==================== */
.status-badge {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    min-width: 40px;
}

/* 认证状态样式 */
.status-unverified {
    background: #fff2f0;
    color: #ff4d4f;
}

.status-verifying {
    background: #fff7e6;
    color: #fa8c16;
}

.status-verified {
    background: #f6ffed;
    color: #52c41a;
}

.status-failed {
    background: #fff2f0;
    color: #ff4d4f;
}

/* 账户设置状态样式 */
.status-incomplete {
    background: #fff7e6;
    color: #fa8c16;
}

.status-complete {
    background: #f6ffed;
    color: #52c41a;
}

/* 可点击状态徽章样式 */
.status-badge.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.status-badge.clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.status-unverified.clickable:hover {
    background: #ffccc7;
}

.status-verifying.clickable:hover {
    background: #ffe7ba;
}

.status-incomplete.clickable:hover {
    background: #ffe7ba;
}

/* ==================== 抓单按钮样式 ==================== */
.grab-order-btn {
    background: #008489;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 132, 137, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.grab-order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 132, 137, 0.4);
    background: #00a8a8;
}

.grab-order-btn i {
    font-size: 18px;
}

/* ==================== 订单详情弹窗样式 ==================== */
.order-detail-modal {
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

.order-content {
    padding: 28px;
    max-height: 70vh;
    overflow-y: auto;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
}

/* 自定义滚动条样式 */
.order-content::-webkit-scrollbar {
    width: 8px;
}

.order-content::-webkit-scrollbar-track {
    background: rgba(241,245,249,0.6);
    border-radius: 8px;
}

.order-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, #FF8A50 100%);
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.order-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #E64A19 0%, #FF7043 100%);
}

/* 订单弹窗样式 */
.order-modal {
    background: var(--card-background);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 8px 24px rgba(0,0,0,0.08);
    overflow: hidden;
    min-width: 340px;
    max-width: 420px;
    border: 1px solid rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 商品信息区域 */
.product-info {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.product-image {
    flex-shrink: 0;
    width: 85px;
    height: 85px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border: 2px solid rgba(255,255,255,0.9);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-details {
    flex: 1;
    min-width: 0;
}

.product-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
    letter-spacing: 0.3px;
}

.product-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    word-wrap: break-word;
    word-break: break-all;
    white-space: pre-wrap;
    text-align: justify;
}

/* 订单信息区域 */
.order-info {
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(248,250,252,0.9) 100%);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid rgba(229, 231, 235, 0.6);
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.value {
    font-size: 14px;
    font-weight: 600;
}

/* 订单总额行样式 */
.order-total-row {
    border-top: 2px solid rgba(22, 119, 255, 0.1);
    padding-top: 16px;
    margin-top: 16px;
    background: linear-gradient(135deg, rgba(22,119,255,0.05) 0%, rgba(64,150,255,0.05) 100%);
    padding: 16px 20px;
    border-radius: 12px;
    margin: 16px -20px 0 -20px;
}

.order-total-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.order-total-amount {
    font-size: 18px;
    font-weight: 800;
    color: #008489;
}

.amount {
    color: var(--primary-color);
}

.commission {
    color: #52c41a;
}

.commission-red {
    color: #ff4d4f;
}

.tax-black {
    color: #000000;
}

/* 状态标签样式 */
.status-tag {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.status-pending {
    background: rgba(255, 80, 0, 0.1);
    color: var(--primary-color);
}

.status-paid {
    background: rgba(82, 196, 26, 0.1);
    color: #52c41a;
}

.status-cancelled {
    background: rgba(245, 34, 45, 0.1);
    color: #f5222d;
}

.status-processing {
    background: rgba(24, 144, 255, 0.1);
    color: #008489;
}

.status-unknown {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
}

/* ==================== 支付按钮样式 ==================== */
.payment-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(255,87,34,0.05) 0%, rgba(255,152,0,0.05) 100%);
    border-radius: 18px;
    box-shadow: 0 6px 20px rgba(255,87,34,0.08);
    border: 1px solid rgba(255,87,34,0.1);
}

.payment-action-separate {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 24px;
    padding: 20px 24px;
}

.payment-action-separate .confirm-payment-btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
}

.confirm-payment-btn {
    background: linear-gradient(135deg, #008489 0%, #00a8a8 100%);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(22,119,255,0.3), 0 2px 8px rgba(22,119,255,0.2);
    border: 1px solid rgba(255,255,255,0.2);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.confirm-payment-btn:hover {
    background: linear-gradient(135deg, #008489 0%, #00a8a8 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(22,119,255,0.4), 0 4px 12px rgba(22,119,255,0.3);
}

.confirm-payment-btn i {
    font-size: 18px;
}

/* ==================== 功能操作区域 ==================== */
.actions-grid {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.action-item .icon-wrapper {
    width: 60px;
    height: 60px;
    background-color: #f5f5f5;
    color: #008489;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 44px;
    border: 2px solid #e8e8e8;
    transition: all 0.3s ease;
}

.action-item .icon-wrapper:hover {
    background-color: #fff;
    border-color: #008489;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 119, 255, 0.2);
}

/* 提款图标加粗样式 */
.action-item .icon-wrapper .layui-icon-download-circle {
    font-weight: 900;
    text-shadow: 0 0 1px currentColor;
}

.action-item .title {
    font-size: 14px;
    color: #333;
}

/* ==================== 统计卡片样式 ==================== */
.summary-grid {
    display: flex;
    gap: 15px;
}

.summary-card {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.summary-card .icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    margin-right: 12px;
}

.summary-card .details .title {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.summary-card .details .amount {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.summary-card.yesterday .icon-wrapper {
    background-color: #1E90FF;
}

.summary-card.today .icon-wrapper {
    background-color: #52c41a;
}

/* ==================== 底部导航样式 ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #fff;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.nav-item {
    text-align: center;
    color: #666;
    flex: 1;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item .layui-icon {
    font-size: 22px;
}

.nav-item .nav-icon {
    width: 22px;
    height: 22px;
    display: inline-block;
}

.nav-item .title {
    font-size: 12px;
    margin-top: 2px;
}

/* ==================== 抓单区域样式 ==================== */
.grab-order-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.order-batch-info {
    background: var(--card-background);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.batch-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
}

.total-count {
    color: var(--primary-color);
}

.grabbed-count {
    color: #52c41a;
}

.remaining-count {
    color: #008489;
}

.withdrawal-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 80, 0, 0.1);
    border-radius: 8px;
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 500;
}

.withdrawal-notice i {
    font-size: 14px;
}

/* ==================== 提款相关样式 ==================== */
.withdrawal-action {
    text-align: center;
    margin-top: 15px;
}

.withdrawal-btn {
    background: #008489;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(22, 119, 255, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.withdrawal-btn:hover {
    background: #00a8a8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(22, 119, 255, 0.4);
}

.withdrawal-btn i {
    font-size: 18px;
}

/* 提现弹窗内的限制提示样式 */
.withdrawal-restriction-alert {
    background: linear-gradient(135deg, #ff9500, #ff6b35);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.withdrawal-restriction-alert .layui-icon {
    font-size: 16px;
}

/* ==================== 提款弹窗样式 ==================== */
.withdrawal-modal {
    background: var(--card-background);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    overflow: hidden;
    min-width: 380px;
    max-width: 520px;
    border: 1px solid rgba(255, 80, 0, 0.1);
}

.withdrawal-content {
    padding: 28px;
}

.withdrawal-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 80, 0, 0.1);
}

.withdrawal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary-color), #ff6b35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.withdrawal-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
}

.withdrawal-form {
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: var(--card-background);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 80, 0, 0.1);
    transform: translateY(-1px);
}

.form-input.error {
    border-color: #f5222d;
    box-shadow: 0 0 0 3px rgba(245, 34, 45, 0.1);
}

.form-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
    line-height: 1.4;
}

.withdrawal-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.btn-cancel {
    background: #f8f9fa;
    color: var(--text-secondary);
    border: 2px solid #e9ecef;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.btn-cancel:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    transform: translateY(-1px);
}

.btn-confirm {
    background: linear-gradient(135deg, #008489, #00a8a8);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    box-shadow: 0 4px 15px rgba(22, 119, 255, 0.3);
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(22, 119, 255, 0.4);
}

.btn-confirm:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==================== 响应式设计 ==================== */

/* 移动端适配 */
@media (max-width: 768px) {
    .carousel {
        height: 160px;
    }
    
    .carousel-btn {
        width: 36px;
        height: 36px;
    }
    
    .carousel-btn i {
        font-size: 14px;
    }
    
    .indicator {
        width: 6px;
        height: 6px;
    }
}

@media (max-width: 480px) {
    .user-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .user-name-section {
        width: 100%;
    }
    
    .status-badges {
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
    }
    
    .status-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .status-label {
        font-size: 10px;
    }
    
    .status-badge {
        font-size: 8px;
        padding: 2px 5px;
        min-width: 35px;
    }
}
