/* ========== 品牌色彩变量 ========== */
:root {
    --bg-frame: #2a2a40;
    --bg-content: #FFFFFF;
    --text-primary: #1a1a1a;
    --text-secondary: #888888;
    --text-tertiary: #b0b0b0;
    --text-light: #FFFFFF;
    --text-light-secondary: rgba(255, 255, 255, 0.8);
    --text-light-tertiary: rgba(255, 255, 255, 0.7);
    --brand-warm: #FF9800;
    --brand-warm-glow: rgba(255, 152, 0, 0.4);
    --brand-warm-light: #FFB74D;
    --brand-cool: #00BCD4;
    --brand-cool-glow: rgba(0, 188, 212, 0.3);
    --brand-purple: #7c5cbf;
    --recruit-glow: #FF5722;
    --ai-badge-bg: #1A237E;
    --ai-badge-text: #80DEEA;
    --divider-light: #ece8f3;
    --icon-border: rgba(0, 172, 193, 0.2);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: var(--bg-frame);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-frame);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
}

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

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

button {
    border: none;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.app-container {
    max-width: 750px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: calc(64px + var(--safe-bottom));
    background: var(--bg-frame);
    position: relative;
}

/* ========== 顶部功能栏 ========== */
.top-bar {
    display: flex;
    align-items: center;
    padding: 8px 8px;
    gap: 10px;
    background: rgba(42, 42, 64, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 8px 12px;
    gap: 8px;
    transition: border-color 0.2s, background 0.2s;
}

.search-box:focus-within {
    border-color: rgba(255, 152, 0, 0.4);
    background: rgba(255, 255, 255, 0.13);
}

.search-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.search-input {
    border: none;
    outline: none;
    background: transparent;
    flex: 1;
    font-size: 13px;
    color: #FFFFFF;
    caret-color: var(--brand-warm);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.85);
}

/* ========== 招募按钮 - 边框脉冲闪烁 ========== */
.recruit-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 8px;
    border-radius: 6px;
    background: rgba(255, 112, 67, 0.15);
    border: 1.5px solid rgba(255, 112, 67, 0.5);
    animation: recruitPulse 2.2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.recruit-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 152, 0, 0.2) 0%, transparent 70%);
    animation: recruitGlow 2.2s ease-in-out infinite;
}

.recruit-text {
    font-size: 12px;
    font-weight: 700;
    color: #FFCC80;
    letter-spacing: 0;
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

@keyframes recruitPulse {
    0%, 100% { 
        border-color: rgba(255, 112, 67, 0.4);
        box-shadow: 0 0 6px rgba(255, 112, 67, 0.15);
    }
    50% { 
        border-color: rgba(255, 152, 0, 0.7);
        box-shadow: 0 0 18px rgba(255, 152, 0, 0.35), 0 0 4px rgba(255, 112, 67, 0.5);
    }
}

@keyframes recruitGlow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.75; transform: scale(1.12); }
}

/* ========== 品牌头图 ========== */
.hero-area {
    background: var(--bg-frame);
}

.hero-img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    display: block;
}

/* ========== 分类切换标签（三个栏目，等分，字号14px） ========== */
.category-tabs {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    padding: 10px 6px 8px;
    background: rgba(35, 32, 64, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: relative;
    -webkit-text-size-adjust: 100%;
}

.category-tabs__glow-bar {
    position: absolute;
    top: 0;
    left: 14px;
    right: 14px;
    height: 2px;
    background: var(--brand-cool);
    border-radius: 0 0 1px 1px;
    opacity: 0.9;
    transition: background 0.3s ease;
}

.category-tab {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 2px;
    gap: 4px;
    border-radius: 10px;
    background: transparent;
    border: none;
    color: var(--text-light-secondary);
    transition: all 0.25s ease;
    cursor: pointer;
    white-space: nowrap;
    -webkit-text-size-adjust: 100%;
}

.category-tab .tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.25s ease;
}

.category-tab .tab-label {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    transition: color 0.25s ease;
    -webkit-text-size-adjust: 100%;
    color: rgba(255, 255, 255, 0.85);
}

.category-tab--active {
    background: rgba(255, 152, 0, 0.12);
    border-color: rgba(255, 152, 0, 0.3);
    color: var(--brand-warm);
    box-shadow: 0 0 14px rgba(255, 152, 0, 0.12);
}

.category-tab--active .tab-label {
    color: var(--brand-warm-light);
    font-weight: 700;
    font-size: 14px;
}

.category-tab:not(.category-tab--active):active {
    background: rgba(255, 255, 255, 0.04);
}

/* ========== 产品列表区域 ========== */
.product-section {
    background: var(--bg-content);
    padding: 4px 0 0;
}

.product-list {
    padding: 0;
}

/* ========== 产品列表项 ========== */
.product-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    gap: 12px;
    border-bottom: 1px solid var(--divider-light);
    transition: background 0.15s ease;
}

.product-item:active {
    background: #f9f8fb;
}

.product-item__icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f7fc;
    border: 1px solid var(--icon-border);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

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

.product-item__icon-fallback {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
}

.product-item__icon img[style*="display: none"] + .product-item__icon-fallback {
    display: flex;
}

.product-item__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-decoration: none;
    color: inherit;
}

.product-item__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-item__desc {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.product-item__meta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 1px;
}

/* 安装按钮 */
.product-item__install {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-warm);
    background: rgba(255, 152, 0, 0.12);
    border: 1px solid rgba(255, 152, 0, 0.25);
    border-radius: 16px;
    padding: 7px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
}

.product-item__install:active {
    background: rgba(255, 152, 0, 0.25);
    border-color: rgba(255, 152, 0, 0.5);
    box-shadow: 0 0 12px var(--brand-warm-glow);
}

.product-item__install:disabled {
    color: var(--text-tertiary);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
    cursor: not-allowed;
    box-shadow: none;
}

.product-item__install--disabled {
    color: var(--text-tertiary);
    background: #f0f0f0;
    cursor: not-allowed;
    box-shadow: none;
}

.product-item__install--disabled:active {
    background: #f0f0f0;
    box-shadow: none;
}

/* ========== 底部导航 ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 750px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(42, 42, 64, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 100;
    padding: 4px 0 calc(4px + var(--safe-bottom));
}

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2px 0;
    gap: 5px;
    color: var(--text-light-tertiary);
    transition: color 0.25s ease;
}

.bottom-nav__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    transition: all 0.25s ease;
}

/* ===== AI徽章（芯片引脚造型） ===== */
.ai-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 18px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    position: relative;
    transition: all 0.25s ease;
}

/* 芯片左侧引脚（三个短横线） */
.ai-badge::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 3px;
    width: 2px;
    height: 3px;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 0 0 rgba(255, 255, 255, 0.5),
                0 8px 0 0 rgba(255, 255, 255, 0.5);
}

/* 芯片右侧引脚 */
.ai-badge::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 3px;
    width: 2px;
    height: 3px;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 0 0 rgba(255, 255, 255, 0.5),
                0 8px 0 0 rgba(255, 255, 255, 0.5);
}

/* 激活状态下的芯片与引脚颜色 */
.bottom-nav__item--active .ai-badge {
    color: #FFFFFF;
    background: var(--brand-warm);
    border-color: var(--brand-warm-light);
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
}

.bottom-nav__item--active .ai-badge::before,
.bottom-nav__item--active .ai-badge::after {
    background: var(--brand-warm-light);
    box-shadow: 0 4px 0 0 var(--brand-warm-light),
                0 8px 0 0 var(--brand-warm-light);
}

.bottom-nav__label {
    font-size: 10px;
    font-weight: 600;
    transition: color 0.25s ease;
    color: rgba(255, 255, 255, 0.75);
}

.bottom-nav__item--active {
    color: var(--brand-warm-light);
}

.bottom-nav__item--active .bottom-nav__icon svg {
    stroke: var(--brand-warm-light);
    filter: drop-shadow(0 0 5px rgba(255, 152, 0, 0.4));
}

.bottom-nav__item--active .bottom-nav__label {
    color: var(--brand-warm-light);
    font-weight: 700;
}

/* ========== 响应式微调 ========== */
@media screen and (min-width: 420px) {
    .category-tab .tab-label {
        font-size: 14px;
    }
    .product-item__title {
        font-size: 16px;
    }
}

/* 极窄屏适配：保证三个栏目文字完整显示 */
@media screen and (max-width: 360px) {
    .category-tab {
        padding: 6px 1px;
    }
    .category-tab .tab-label {
        font-size: 12px;
        letter-spacing: 0;
    }
    .category-tab--active .tab-label {
        font-size: 12px;
    }
}

@media screen and (min-width: 600px) {
    .top-bar {
        padding: 10px 12px;
    }
    .category-tabs {
        padding: 14px 20px 10px;
    }
    .product-item {
        padding: 16px 20px;
    }
}