/* ========== Dock 导航栏 ========== */
.dock-nav {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    max-width: 800px;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid rgba(84, 84, 88, 0.35);
    border-radius: 20px;
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform, opacity;
}

body.sheet-open .dock-nav {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 20px);
}

/* ========== Dock 项 ========== */
.dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: rgba(235, 235, 245, 0.6);
    font-size: 12px;
    transition: all 0.25s ease;
    padding: 6px 12px;
    position: relative;
    cursor: pointer;
    will-change: transform, opacity;
    transform: translateZ(0);
}

.dock-item:hover {
    color: rgba(235, 235, 245, 0.8);
    transform: scale(1.05);
}

.dock-item:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.dock-item.active {
    color: #2979ff;
    font-weight: bold;
}

.dock-icon {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dock-icon svg {
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.footer {
    margin-bottom: 70px;
}

/* ========== CSS 变量 ========== */
:root {
    --linear-blue: #b8b8b834;
    --linear-blue-dark: #07070775;
    --linear-green: #30D158;
    --linear-red: #FF375F;
    --linear-red-dark: #E5354E;
    --linear-gray: #8E8E93;
    --linear-gray2: #636366;
    --linear-gray3: #48484A;
    --linear-gray4: #3A3A3C;
    --linear-gray5: #1f1fbb;
    --linear-gray6: #1C1C1E;
    --text-primary: #ffffffc5;
    --text-secondary: rgba(235, 235, 245, 0.9);
    --text-tertiary: rgba(235, 235, 245, 0.6);
    --text-quaternary: rgba(255, 255, 255, 0.534);
    --bg-primary: #00000093;
    --bg-secondary: #0000004d;
    --bg-tertiary: #0000006e;
    --separator: rgba(84, 84, 88, 0.6);
    --separator-opaque: #38383A;
    --radius-small: 4px;
    --radius-medium: 8px;
    --radius-large: 12px;
    --radius-xl: 16px;
    --spacing-2: 2px;
    --spacing-4: 4px;
    --spacing-8: 8px;
    --spacing-12: 12px;
    --spacing-16: 16px;
    --spacing-20: 20px;
    --spacing-24: 24px;
    --spacing-32: 32px;
    --spacing-40: 40px;
    --spacing-48: 48px;
    --spacing-64: 64px;
    --shadow-small: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.3);
    --timing-function: cubic-bezier(0.2, 0, 0, 1);
    --bg-blur-amount: 0px;
    --bg-brightness: 1;
    --bg-overlay-opacity: 0.8;
    --bg-blur-saturation: 10%;
}

/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: env(safe-area-inset-bottom);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://pp.panpan.plus/index.html') center/cover no-repeat;
    filter: blur(var(--bg-blur-amount)) brightness(var(--bg-brightness));
    z-index: -2;
}

/* ========== 容器 ========== */
.nav-bar.content-container {
    background-color: rgba(0, 0, 0, var(--bg-overlay-opacity));
    backdrop-filter: saturate(var(--bg-blur-saturation)) blur(20px);
    border-radius: var(--radius-large);
    border: 1px solid var(--separator);
    margin-bottom: var(--spacing-16);
}

.nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--separator);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-small);
}

.nav-logo {
    font-size: 21px;
    font-weight: 700;
    color: var(--linear-blue);
    text-decoration: none;
    letter-spacing: -0.5px;
    margin-right: var(--spacing-16);
}

.nav-search-container {
    flex: 1;
    max-width: 680px;
    position: relative;
}

.search-input {
    width: 100%;
    height: 40px;
    padding: 0 var(--spacing-40) 0 var(--spacing-40);
    border-radius: var(--radius-medium);
    border: none;
    background-color: #0505052a;
    font-size: 16px;
    color: var(--text-primary);
    transition: all 0.2s var(--timing-function);
}

.search-input:focus {
    outline: none;
    background-color: var(--bg-tertiary);
    box-shadow: 0 0 0 2px var(--linear-blue);
}

.search-icon {
    position: absolute;
    left: var(--spacing-12);
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--linear-gray);
}

/* ========== 主容器 ========== */
.app-container {
    max-width: 1070px;
    margin: 0 auto;
    padding: var(--spacing-16);
}

.main-content {
    padding: var(--spacing-24) 0 var(--spacing-64);
}

/* ========== 今日推荐 ========== */
.today-section {
    margin-bottom: var(--spacing-48);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    position: relative;
    padding-bottom: var(--spacing-16);
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-top: var(--spacing-4);
}

.section-header-content {
    text-align: right;
    max-width: 60%;
    margin: auto;
}

.app-count {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-top: var(--spacing-8);
}

/* ========== 通知区域 ========== */
.notice-section {
    margin-bottom: var(--spacing-32);
}

.notice-card {
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-large);
    padding: var(--spacing-16);
    margin-bottom: var(--spacing-16);
    border: 1px solid var(--separator);
}

.notice-card.primary {
    background-color: rgba(94, 92, 230, 0.1);
    border-color: rgba(94, 92, 230, 0.2);
}

.notice-card.warning {
    background-color: rgba(255, 55, 95, 0.1);
    border-color: rgba(255, 55, 95, 0.2);
}

.notice-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--linear-blue);
    margin-bottom: var(--spacing-8);
}

.notice-card.warning .notice-title {
    color: var(--linear-red);
}

.notice-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ========== 分类区域 ========== */
.category-section {
    margin-bottom: var(--spacing-24);
    position: relative;
}

.category-scroll {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: var(--spacing-4) 16px;
    margin: 0 -16px;
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

.category-tabs {
    display: inline-flex;
    gap: var(--spacing-8);
}

.category-tab {
    padding: var(--spacing-8) var(--spacing-16);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    background: none;
    border: none;
    border-radius: var(--radius-medium);
    cursor: pointer;
    transition: all 0.2s var(--timing-function);
    background-color: var(--bg-tertiary);
}

.category-tab.active {
    background-color: var(--linear-blue);
    color: white;
}

/* ========== 应用网格 ========== */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-16);
}

.app-card {
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-large);
    overflow: hidden;
    transition: all 0.3s var(--timing-function);
    box-shadow: var(--shadow-small);
    border: 1px solid var(--separator);
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
    border-color: var(--linear-blue);
}

.app-header {
    display: flex;
    align-items: center;
    padding: var(--spacing-16);
    border-bottom: 1px solid var(--separator);
}

.app-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-medium);
    object-fit: cover;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin-right: var(--spacing-16);
}

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

.app-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: var(--spacing-4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.app-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-4);
    font-size: 13px;
    color: var(--text-tertiary);
}

.app-meta2 {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: var(--spacing-4);
    font-size: 13px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.get-button {
    min-width: 70px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--linear-blue);
    color: white;
    border: none;
    border-radius: var(--radius-medium);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--timing-function);
    margin-left: var(--spacing-16);
}

.get-button:hover {
    background-color: var(--linear-blue-dark);
}

.app-body {
    padding: var(--spacing-16);
}

.app-description {
    font-size: 14px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    white-space: normal;
    word-break: break-word;
}

/* ========== 加载/无结果 ========== */
.loading-indicator {
    text-align: center;
    padding: var(--spacing-32) 0;
    color: var(--text-tertiary);
    font-size: 16px;
    display: none;
}

.no-results {
    text-align: center;
    padding: var(--spacing-48) var(--spacing-24);
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-large);
    border: 1px solid var(--separator);
}

.no-results-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--spacing-8);
    color: var(--text-primary);
}

.no-results-text {
    font-size: 16px;
    color: var(--text-tertiary);
}

.grid-full-width {
    grid-column: 1 / -1;
    width: 100%;
}

.no-more-apps {
    margin: var(--spacing-32) 0;
    text-align: center;
}

.no-more-apps .no-results {
    background-color: transparent;
    border: none;
    padding: var(--spacing-16);
}

.no-more-apps .no-results-text {
    color: var(--text-tertiary);
    font-size: 14px;
    position: relative;
    display: inline-block;
    padding: 0 var(--spacing-16);
}

.no-more-apps .no-results-text::before,
.no-more-apps .no-results-text::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 50px;
    height: 1px;
    background-color: var(--separator);
    border-radius: 3px;
}

.no-more-apps .no-results-text::before { left: -40px; }
.no-more-apps .no-results-text::after { right: -40px; }

/* ========== 页脚 ========== */
.footer {
    padding: var(--spacing-32) 0;
    border-top: 1px solid var(--separator);
    text-align: center;
    color: var(--text-tertiary);
    font-size: 12px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-16);
    margin-bottom: var(--spacing-16);
}

.footer-link {
    color: var(--linear-blue);
    text-decoration: none;
}

.footer-link:hover { text-decoration: underline; }

.copyright {
    color: var(--text-quaternary);
}

/* ========== 统计卡片 ========== */
.stats-container {
    margin-top: -30px;
    margin-bottom: 20px;
    border-radius: var(--radius-large);
    border: 1px solid var(--separator);
}

.stats-card {
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 16px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    position: relative;
}

.stat-item:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 1px;
    background: #eaeaea;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #2e8dfa;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

/* ========== 快捷操作 ========== */
.quick-actions {
    background-color: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 12px;
    margin: var(--spacing-8) 0;
    box-shadow: var(--shadow-small);
    border: 1px solid var(--separator);
}

.quick-actions .row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.quick-actions .col-6 {
    flex: 0 0 calc(50% - 0.375rem);
    max-width: calc(50% - 0.375rem);
}

@media (min-width: 768px) {
    .quick-actions .col-6 {
        flex: 0 0 calc(33.333% - 0.5rem);
        max-width: calc(33.333% - 0.5rem);
    }
}

@media (min-width: 1200px) {
    .quick-actions .col-6 {
        flex: 0 0 calc(25% - 0.6rem);
        max-width: calc(25% - 0.6rem);
    }
}

.quick-actions .btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1rem;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    height: 100%;
}

.quick-actions .btn-action:hover {
    background-color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.quick-actions .btn-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.quick-actions .btn-action span {
    font-size: 14px;
    white-space: nowrap;
}

/* ========== 分隔线 ========== */
.hr_gradient2 {
    width: 100%;
    margin: 0 auto;
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, transparent, var(--separator) 50%, transparent);
    opacity: 0.8;
    margin-top: 10px;
    margin-bottom: 10px;
}

/* ========== 底部弹出层 (Sheet Modal) ========== */
.sheet-modal {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    visibility: hidden;
    pointer-events: none;
}

.sheet-modal.active {
    visibility: visible;
    pointer-events: auto;
}

.sheet-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s var(--timing-function);
}

.sheet-modal.active .sheet-modal-overlay { opacity: 1; }

.sheet-modal-container {
    position: relative;
    background-color: var(--bg-tertiary);
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s var(--timing-function);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--separator);
}

.sheet-modal.active .sheet-modal-container { transform: translateY(0); }

.sheet-modal-handle-wrapper {
    padding: var(--spacing-8) 0;
    display: flex;
    justify-content: center;
    background-color: var(--bg-tertiary);
}

.sheet-modal-handle {
    width: 36px;
    height: 5px;
    border-radius: 2.5px;
    background-color: var(--separator);
}

.sheet-modal-content {
    padding: 0 var(--spacing-20) var(--spacing-32) var(--spacing-20);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sheet-app-header {
    display: flex;
    align-items: center;
    padding: var(--spacing-16) 0;
    border-bottom: 1px solid var(--separator);
}

.sheet-app-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-medium);
    object-fit: cover;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin-right: var(--spacing-16);
}

.sheet-app-title-area {
    flex: 1;
    min-width: 0;
}

.sheet-app-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: var(--spacing-4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.sheet-app-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-4);
    font-size: 14px;
    color: var(--text-tertiary);
}

.sheet-app-meta2 {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: var(--spacing-4);
    font-size: 14px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sheet-app-body { padding: var(--spacing-16) 0; }

.sheet-app-description {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: normal;
    word-break: break-word;
}

.sheet-download-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    height: 40px;
    background-color: var(--linear-blue);
    color: white;
    border: none;
    border-radius: var(--radius-medium);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s var(--timing-function);
    text-decoration: none;
    margin-left: var(--spacing-16);
}

.sheet-download-button:hover { background-color: var(--linear-blue-dark); }

.sheet-cancel-button {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-medium);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s var(--timing-function);
    margin-top: var(--spacing-16);
}

.sheet-cancel-button:hover { background-color: var(--bg-tertiary); }

body.sheet-open { overflow: hidden; }

/* ========== 背景 iframe ========== */
.background-iframe {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    border: none;
    filter: blur(var(--bg-blur-amount)) brightness(var(--bg-brightness));
    -webkit-filter: blur(var(--bg-blur-amount)) brightness(var(--bg-brightness));
}

/* ========== Dock 波纹效果 ========== */
.dock-ripple {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to { transform: scale(2); opacity: 0; }
}

.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

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

/* ========== 响应式 ========== */
@media (max-width: 834px) {
    .nav-logo {
        text-align: center;
        margin-right: 0;
        margin-bottom: var(--spacing-12);
    }
    .section-title { font-size: 24px; }
    .section-header-content {
        max-width: 100%;
        text-align: center;
    }
    .stats-grid { flex-wrap: wrap; }
    .stat-card {
        flex: 0 0 calc(50% - var(--spacing-8));
        margin-bottom: var(--spacing-16);
    }
    .actions-grid { grid-template-columns: repeat(3, 1fr) !important; }
    .quick-actions { padding: var(--spacing-16); }
}

@media (max-width: 428px) {
    .app-container { padding: 0 var(--spacing-12); }
    .section-title { font-size: 22px; }
    .section-subtitle { font-size: 15px; }
    .app-header { padding: var(--spacing-12); }
    .app-icon { width: 56px; height: 56px; }
    .app-body { padding: var(--spacing-12); }
    .get-button { min-width: 64px; height: 32px; font-size: 14px; }
    .stat-card {
        flex: 0 0 calc(50% - var(--spacing-4));
        margin-bottom: var(--spacing-12);
        min-width: 0;
        padding: var(--spacing-8);
    }
    .stat-value { font-size: 18px; }
    .stat-label { font-size: 10px; }
    .actions-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: var(--spacing-8) !important;
    }
    .action-icon-wrapper { width: 40px !important; height: 40px !important; }
    .action-label { font-size: 11px !important; }
    .quick-actions-title { font-size: 15px; }
}

@media (max-width: 360px) {
    .stats-grid { gap: var(--spacing-4); }
    .stat-card { padding: var(--spacing-6) var(--spacing-4); }
    .actions-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: var(--spacing-4) !important;
    }
    .action-icon-wrapper { width: 36px !important; height: 36px !important; }
    .action-label { font-size: 10px !important; }
}
