/* 全局样式 */
:root {
    --brand-ice: #6eb6d8;
    --brand-sky: #d7eaf5;
    --brand-mist: #f3f8fb;
    --brand-ink: #24313a;
    --brand-muted: #5d6b75;
    --brand-line: rgba(36, 49, 58, 0.1);
    --brand-accent: #3f8fb5;
    --app-max: 480px;
    --nav-height: 56px;
    --app-height: 100svh;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top, rgba(110, 182, 216, 0.28), transparent 42%),
        linear-gradient(180deg, #e7f3f9 0%, #f5f8fa 42%, #eef2f4 100%);
    color: var(--brand-ink);
    line-height: 1.55;
    height: var(--app-height);
    overflow: hidden;
}

html {
    height: var(--app-height);
    overflow: hidden;
}

.app-container {
    max-width: var(--app-max);
    margin: 0 auto;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(255,255,255,0.98) 100%);
    height: var(--app-height);
    max-height: var(--app-height);
    position: relative;
    padding-bottom: 0;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 底部导航栏：fixed + 安全区，避免手机浏览器底栏把它顶出屏幕 */
.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--app-max);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--brand-line);
    display: flex;
    justify-content: space-around;
    padding: 6px 0 calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 2000;
    min-height: var(--nav-height);
    box-sizing: border-box;
}

.nav-item {
    text-decoration: none;
    color: #8a969e;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex: 1;
    gap: 1px;
}

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

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
}

.nav-text {
    font-size: 11px;
    font-weight: 500;
}

/* 页面容器 */
.page-container {
    padding: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.page {
    display: none;
    animation: none;
    height: 100%;
}

.page.active {
    display: block;
}

#home-page.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
}

#products-page.active,
#profile-page.active {
    display: block;
    height: 100%;
    overflow-y: auto;
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 首页样式：一屏铺满，不上下滚动 */
.logo-section {
    padding: 0;
    margin: 0;
    text-align: center;
    background: linear-gradient(180deg, #8ec8e4 0%, #d7eaf5 55%, #eef6fb 100%);
    width: 100%;
    overflow: hidden;
    flex: 0 0 18%;
    max-height: 120px;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-image {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
}

/* 图片轮播：淡入淡出切换 */
.image-carousel {
    margin: 0;
    background-color: #111;
    overflow: hidden;
    flex: 0 0 30%;
    min-height: 120px;
    max-height: 200px;
    width: 100%;
    height: auto;
    position: relative;
    border-radius: 0;
}

.carousel-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
    animation: none;
}

.carousel-track .carousel-slide {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100%;
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
    padding: 0;
}

.carousel-track .carousel-slide.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

.carousel-track .carousel-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #222;
}

.image-carousel:hover .carousel-track {
    animation-play-state: unset;
}

/* 三段品牌文案循环轮播 */
.culture-carousel {
    margin: 8px 10px 8px;
    padding: 12px 14px 10px;
    border-radius: 12px;
    background:
        linear-gradient(160deg, rgba(255,255,255,0.95) 0%, rgba(232,244,251,0.95) 100%);
    border: 1px solid rgba(110, 182, 216, 0.28);
    box-shadow: 0 8px 20px rgba(63, 143, 181, 0.08);
    position: relative;
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.culture-carousel::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #8fc7e0, #3f8fb5 50%, #c9e6f4);
}

.culture-viewport {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.culture-track {
    position: relative;
    height: 100%;
}

.culture-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    overflow: hidden;
}

.culture-slide.is-active {
    position: absolute;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.culture-kicker {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.16em;
    color: var(--brand-accent);
    font-weight: 700;
    margin-bottom: 6px;
}

.culture-title {
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: clamp(16px, 4.6vw, 20px);
    line-height: 1.3;
    color: var(--brand-ink);
    font-weight: 700;
    margin-bottom: 6px;
}

.culture-lead {
    font-size: 12px;
    color: var(--brand-muted);
    margin-bottom: 8px;
}

.culture-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.culture-body p {
    font-size: 12px;
    color: #3d4b54;
    line-height: 1.55;
}

.culture-body strong {
    color: var(--brand-ink);
    font-weight: 700;
}

.culture-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-top: 8px;
    flex: 0 0 auto;
}

.culture-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    border: none;
    padding: 0;
    background: rgba(63, 143, 181, 0.25);
    cursor: pointer;
    transition: width 0.25s ease, background 0.25s ease;
}

.culture-dot.is-active {
    width: 16px;
    background: var(--brand-accent);
}

/* 产品页面 */
.products-container {
    padding: 20px;
    text-align: center;
}

.empty-state {
    padding: 40px 20px;
}

.empty-text {
    font-size: 16px;
    color: #666;
    line-height: 1.8;
}

/* 我的页面 */
.profile-section {
    padding: 20px;
}

.section-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

/* 登录区域 */
.login-section {
    text-align: center;
    margin-bottom: 30px;
}

.btn-primary {
    background-color: #1890ff;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    max-width: 300px;
}

.btn-primary:hover {
    background-color: #40a9ff;
}

/* 已登录用户信息 */
.user-info-section {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

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

.user-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.verified-badge {
    background-color: #52c41a;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
}

.logout-btn {
    background-color: #ff4d4f;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.user-account p {
    color: #666;
    font-size: 14px;
    margin: 5px 0;
}

.balance-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.balance-info {
    display: flex;
    flex-direction: column;
}

.balance-label {
    font-size: 12px;
    color: #666;
}

.balance-amount {
    font-size: 24px;
    font-weight: bold;
    color: #1890ff;
}

.withdraw-btn {
    background-color: #52c41a;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

/* 银行卡区域 */
.bank-section {
    margin-bottom: 20px;
}

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

.add-card-btn {
    background-color: #1890ff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.bank-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bank-card {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #1890ff;
}

.bank-card-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.bank-card-number {
    color: #666;
    font-size: 14px;
}

/* 提现记录 */
.records-section {
    margin-bottom: 20px;
}

.records-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.record-item {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.record-info {
    flex: 1;
}

.record-amount {
    font-weight: bold;
    color: #1890ff;
}

.record-time {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.record-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.record-status.pending {
    background-color: #faad14;
    color: white;
}

.record-status.completed {
    background-color: #52c41a;
    color: white;
}

.record-status.rejected {
    background-color: #ff4d4f;
    color: white;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.close-btn:hover {
    color: #333;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1890ff;
}

.available-balance {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.security-tip {
    background-color: #fffbe6;
    border: 1px solid #ffe58f;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.security-tip p {
    font-size: 12px;
    color: #faad14;
    margin: 0;
}

.switch-form {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

.switch-form a {
    color: #1890ff;
    text-decoration: none;
}

.switch-form a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .app-container {
        max-width: 100%;
    }
    
    .bottom-nav {
        max-width: 100%;
    }
}

@media (max-height: 700px) {
    .logo-section {
        flex-basis: 15%;
        max-height: 96px;
        min-height: 64px;
    }

    .image-carousel {
        flex-basis: 26%;
        min-height: 100px;
        max-height: 160px;
    }

    .culture-title {
        font-size: 16px;
    }

    .culture-body p,
    .culture-lead {
        font-size: 11px;
        line-height: 1.45;
    }
}