/* ============================================================
   Appick 新版 UI —— 浅色 / 深色双主题，移动优先，PC 自适应
   ============================================================ */

/* ---------- 主题变量（浅色默认） ---------- */
:root {
    --bg: #f5f5f6;
    --surface: #ffffff;
    --surface-2: #fafafa;
    --border: rgba(0, 0, 0, 0.06);
    --text: #333333;
    --text-2: #666666;
    --text-3: #999999;
    --primary: #ff5722;
    --primary-grad: linear-gradient(135deg, #ff4b2b, #ff8c42);
    --secondary: #00bfa5;
    --secondary-grad: linear-gradient(135deg, #00c9a7, #00b3e6);
    --hot: #ff4444;
    --banner-grad: linear-gradient(120deg, #ff4b2b, #ff8c42);
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.05);
    --header-bg: rgba(255, 255, 255, 0.92);
    --link: #999999;
    --link-active: #ff5722;
    --footer-text: #999999;
    --ok: #4caf50;
}

/* ---------- 深色主题 ---------- */
[data-theme="dark"] {
    --bg: #0f0f1a;
    --surface: #1e1e2e;
    --surface-2: #24243a;
    --border: rgba(255, 255, 255, 0.06);
    --text: #ffffff;
    --text-2: #b0b0c0;
    --text-3: #88889a;
    --primary: #ff5722;
    --primary-grad: linear-gradient(135deg, #ff4b2b, #ff8c42);
    --secondary: #00bcd4;
    --secondary-grad: linear-gradient(135deg, #00c9a7, #00b3e6);
    --hot: #ff4444;
    --banner-grad: linear-gradient(120deg, #e53935, #ff6d00);
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
    --header-bg: rgba(18, 18, 30, 0.92);
    --link: #9e9eae;
    --link-active: #ff7043;
    --footer-text: #9e9eae;
    --ok: #4caf50;
}

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

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
        "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- 顶部导航 ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    box-shadow: 0 1px 0 var(--border);
}

.topbar-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.brand .flame {
    width: 22px;
    height: 22px;
    flex: none;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 14px;
}

.nav a {
    padding: 6px 10px;
    border-radius: 16px;
    color: var(--link);
    white-space: nowrap;
    transition: color 0.2s;
}

.nav a.active {
    color: var(--link-active);
    font-weight: 600;
    background: color-mix(in srgb, var(--link-active) 12%, transparent);
}

.theme-btn {
    flex: none;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
    transition: background-color 0.2s, color 0.2s;
}

.theme-btn:hover {
    background: var(--surface-2);
}

/* ---------- Banner ---------- */
.banner {
    margin: 16px 0;
    background: var(--banner-grad);
    border-radius: 14px;
    padding: 22px 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.banner::after {
    content: "";
    position: absolute;
    right: -30px;
    top: -40px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.banner::before {
    content: "";
    position: absolute;
    right: 40px;
    bottom: -50px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.banner-title {
    font-size: 18px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.banner-sub {
    margin-top: 8px;
    font-size: 13px;
    opacity: 0.92;
    position: relative;
    z-index: 1;
}

/* ---------- 分区标题 ---------- */
.section {
    margin-top: 20px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0 12px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

.section-title::before {
    content: "";
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: var(--primary-grad);
}

.section-title.is-teal::before {
    background: var(--secondary-grad);
}

.section-more {
    font-size: 13px;
    color: var(--text-3);
    white-space: nowrap;
}

.section-more:hover {
    color: var(--link-active);
}

/* ---------- 应用卡片 ---------- */
.app-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.app-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.app-card:active {
    transform: scale(0.99);
}

.app-icon {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    object-fit: cover;
    flex: none;
    background: var(--surface-2);
}

.app-main {
    flex: 1;
    min-width: 0;
}

.app-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.app-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-tag {
    flex: none;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 4px;
    background: var(--hot);
    color: #fff;
}

.app-desc {
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-3);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.app-side {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.app-count {
    text-align: right;
}

.app-count .num {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

.app-count .unit {
    font-size: 11px;
    color: var(--text-3);
}

.app-cta {
    display: inline-block;
    padding: 7px 16px;
    border-radius: 20px;
    background: var(--primary-grad);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(255, 87, 34, 0.3);
}

.app-card .app-cta.is-teal {
    background: var(--secondary-grad);
    box-shadow: 0 2px 8px rgba(0, 191, 165, 0.3);
}

/* ---------- 底部 ---------- */
.footer {
    margin: 24px 0 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 16px;
    text-align: center;
    box-shadow: var(--shadow-card);
}

.footer-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
}

.footer-desc {
    margin-top: 10px;
    font-size: 12px;
    color: var(--footer-text);
    text-align: left;
    line-height: 1.8;
}

.footer-warn {
    margin-top: 12px;
    font-size: 13px;
    color: var(--hot);
    font-weight: 500;
}

.footer-addr {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-2);
}

.footer-addr a {
    color: var(--ok);
    font-weight: 600;
}

/* ---------- 微信提示 / 加载遮罩 ---------- */
.wechat-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #333;
    overflow: auto;
}

.wechat-overlay img {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
}

.loading-box {
    background: var(--surface);
    padding: 22px 28px;
    border-radius: 12px;
    text-align: center;
    color: var(--text-2);
    font-size: 13px;
    box-shadow: var(--shadow);
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 10px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- 二维码（PC 端） ---------- */
.qr-wrap {
    position: fixed;
    top: 50%;
    right: 36px;
    transform: translateY(-50%);
    z-index: 200;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    display: none;
}

.qr-wrap img {
    width: 140px;
    height: 140px;
}

.qr-wrap p {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 6px;
}

/* ---------- 响应式 ---------- */
@media (min-width: 992px) {
    .qr-wrap {
        display: block;
    }
}

@media (max-width: 420px) {
    .app-icon {
        width: 50px;
        height: 50px;
        border-radius: 12px;
    }

    .app-card {
        padding: 12px;
        gap: 10px;
    }

    .app-cta {
        padding: 6px 14px;
        font-size: 12px;
    }

    .app-name {
        font-size: 14px;
    }
}
