/* 浅色主题变量 */
:root[data-theme="light"] {
    --primary-color: #0066cc;
    --background-color: #f5f5f7;
    --card-background: #ffffff;
    --text-color: #1d1d1f;
    --secondary-text: #86868b;
    --card-shadow: rgba(0, 0, 0, 0.05);
    --border-color: #d2d2d7;
}

/* 深色主题变量 */
:root[data-theme="dark"] {
    --primary-color: #cbe5ff;
    --background-color: #1c1c1e;
    --card-background: #2c2c2e;
    --text-color: #ffffff;
    --secondary-text: #98989d;
    --card-shadow: rgba(0, 0, 0, 0.2);
    --border-color: #3a3a3c;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background-color: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid var(--border-color);
}

:root[data-theme="dark"] .header {
    background-color: rgba(28, 28, 30, 0.72);
}

.header-layout {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.brand {
    order: 1;
}

.header-controls {
    order: 2;
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-bar {
    order: 3;
    width: 100%;
    position: relative;
    margin: 0;
}

/* 桌面端布局 */
@media (min-width: 768px) {
    .header-layout {
        flex-wrap: nowrap;
        gap: 24px;
    }

    .search-bar {
        order: 2;
        width: auto;
        flex-grow: 1;
        max-width: 600px;
    }

    .header-controls {
        order: 3;
    }
}

.brand h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-color) 0%, var(--secondary-text) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header.header-hidden {
    transform: translateY(-100%);
}

.search-bar input {
    width: 100%;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: rgba(118, 118, 128, 0.12);
    color: var(--text-color);
    font-size: 15px;
    transition: all 0.2s ease;
}

.search-bar input:focus {
    background: var(--card-background);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.15);
    outline: none;
}

.search-bar input::placeholder {
    color: var(--secondary-text);
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 0 0 2rem 0;
}

.app-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: .5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 2px 10px var(--card-shadow);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: auto;
    transform-origin: center;
    z-index: 1;
    border: 2px solid transparent;
    /* 添加透明边框作为占位 */
}

/* 修改悬停效果 — 由底部 gradient border + glow 接管 */
.app-card:hover:not(.expanded) {
    /* 悬停效果由底部增强样式处理 */
}

.app-details a {
    color: var(--primary-color);
}

/* 第一行布局 */
.app-card-main {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    flex-shrink: 0;
}

.app-info {
    flex-grow: 1;
    min-width: 0;
    /* 防止文本溢出 */
}

.app-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-description {
    color: var(--secondary-text);
    font-size: 0.9rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 下载图标调整 */
.download-icon-wrapper {
    position: absolute;
    top: 11px;
    right: 11px;
}

.app-card.expanded .download-icon-wrapper {
    display: none;
}

.download-icon {
    position: static;
    width: 24px;
    height: 24px;
    transition: transform 0.2s;
}

/* 标签样式调整 */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.tag {
    background: transparent;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--secondary-text);
    /* 加深边框颜色 */
    opacity: 0.8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: normal;
    /* 确保文字上下居中 */
}

/* 平台图标样式 */
.platform-info {
    position: absolute;
    bottom: 2.5rem;
    right: 0.8rem;
    display: flex;
    flex-direction: row;
    /* 改为单行 */
    align-items: center;
    /* 垂直居中对齐 */
    gap: 0.4rem;
    pointer-events: none;
    z-index: 2;
}

.platform-icons {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.platform-icon {
    width: 15px;
    height: 15px;
    color: var(--secondary-text);
    opacity: 0.8;
}

.platform-text {
    font-size: 11px;
    color: var(--secondary-text);
    opacity: 0.8;
    font-weight: 500;
}

.app-card.expanded .platform-info {
    display: none;
}

/* 无结果样式 */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--secondary-text);
    font-size: 1.1rem;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    background: var(--card-background);
    margin: 5% auto;
    padding: 2rem;
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    position: relative;
    color: var(--text-color);
}

.close-button {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

/* 编辑器链接与主题切换按钮样式 */
.editor-link,
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-background);
    border: none;
    box-shadow: 0 2px 10px var(--card-shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    text-decoration: none;
    color: var(--text-color);
}

.editor-link:hover,
.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    color: var(--text-color);
}

/* 标题样式 - 已在上方重新定义 */

/* 详情内容样式 */
.app-desc-content {
    font-size: 1rem;
    line-height: 1.6;
}

.app-desc-content p {
    margin: 1rem 0;
}

.app-desc-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.app-desc-content li {
    margin: 0.5rem 0;
}

.desc-img {
    width: 100%;
    border-radius: 12px;
    margin: 1.5rem 0;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.desc-img.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* 全局滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-text);
    border-radius: 4px;
    opacity: 0.5;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Firefox 滚动条样式 */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-text) transparent;
}

/* 深色主题滚动条调整 */
:root[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

:root[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* 头部控制按钮容器 - 已在上方重新定义 */

/* 设置按钮样式 */
.settings-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-background);
    border: none;
    box-shadow: 0 2px 10px var(--card-shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.settings-button:hover {
    transform: scale(1.1);
}

.editor-link svg,
.settings-button svg {
    width: 24px;
    height: 24px;
    color: var(--text-color);
}

/* 设置弹窗样式 */
.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.settings-content {
    background: var(--card-background);
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 20px var(--card-shadow);
}

.settings-content h2 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.settings-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.settings-form input {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--background-color);
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

.settings-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.settings-buttons button {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.save-button {
    background: var(--primary-color);
    color: var(--card-background);
}

.cancel-button {
    background: var(--background-color);
    color: var(--text-color);
}

.settings-buttons button:hover {
    transform: scale(1.05);
}

.expanded img {
    max-width: -webkit-fill-available;
}

/* ═══════════════════════════════════════
   Hero Bar
   ═══════════════════════════════════════ */
.hero {
    padding: 1.25rem 0 0;
    margin-bottom: 1rem;
}

.hero-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--card-background);
    color: var(--text-color);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.hero-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.hero-btn svg { flex-shrink: 0; }

.hero-btn-primary {
    background: #24292e;
    color: #fff;
    border-color: #24292e;
}

.hero-btn-primary:hover {
    background: #1a1e22;
    color: #fff;
    border-color: #1a1e22;
}

:root[data-theme="dark"] .hero-btn-primary {
    background: #f0f6fc;
    color: #24292e;
    border-color: #f0f6fc;
}

:root[data-theme="dark"] .hero-btn-primary:hover {
    background: #d8dee4;
    color: #24292e;
    border-color: #d8dee4;
}

.chevron-icon {
    transition: transform 0.2s ease;
}

.contact-dropdown.open .chevron-icon {
    transform: rotate(180deg);
}

.hero-app-count {
    font-size: 0.8rem;
    color: var(--secondary-text);
    opacity: 0.6;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════
   Contact Dropdown
   ═══════════════════════════════════════ */
.contact-dropdown {
    position: relative;
}

.contact-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 180px;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    z-index: 200;
    padding: 4px;
    animation: menuFadeIn 0.15s ease;
}

:root[data-theme="dark"] .contact-menu {
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.contact-dropdown.open .contact-menu {
    display: block;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.88rem;
    transition: background 0.15s ease;
}

.contact-item:hover {
    background: rgba(99, 102, 241, 0.08);
}

.contact-item svg {
    color: var(--secondary-text);
    flex-shrink: 0;
}

/* ═══════════════════════════════════════
   Tag Filter Dropdown
   ═══════════════════════════════════════ */
.tag-filter-dropdown {
    position: relative;
}

.tag-filter-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 200px;
    max-height: 60vh;
    overflow-y: auto;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    z-index: 200;
    padding: 6px;
    animation: menuFadeIn 0.15s ease;
}

:root[data-theme="dark"] .tag-filter-menu {
    box-shadow: none;
}

.tag-filter-dropdown.open .tag-filter-menu {
    display: block;
}

.tag-filter-dropdown.open .chevron-icon {
    transform: rotate(180deg);
}

.sidebar-title {
    display: none;
}

.sidebar-toggle {
    display: none;
}

.sidebar-header {
    display: none;
}

.tag-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 7px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-color);
    transition: background 0.12s ease;
    user-select: none;
}

.tag-option:hover {
    background: rgba(99, 102, 241, 0.06);
}

.tag-option-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tag-count {
    font-size: 0.75rem;
    color: var(--secondary-text);
    opacity: 0.5;
    text-align: right;
    flex-shrink: 0;
}

.tag-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 4px;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tag-option input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #6366f1, #0ea5e9);
    border-color: transparent;
}

.tag-option input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ═══════════════════════════════════════
   Wide Screen: Tag Filter as Left Sidebar宽度超过2400px时，标签筛选器作为左侧固定栏显示
   ═══════════════════════════════════════ */
@media (min-width: 2400px) {
    .tag-filter-dropdown {
        position: fixed;
        top: 72px;
        left: 16px;
        /* width: 160px; */
        z-index: 50;
        background: var(--card-background);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 1rem 0.5rem;
        box-shadow: 0 2px 10px var(--card-shadow);
        transition: transform 0.25s ease, opacity 0.25s ease;
    }

    .tag-filter-dropdown.collapsed {
        transform: translateX(-190px);
        opacity: 0;
    }

    .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 8px;
        margin-bottom: 0.5rem;
    }

    .sidebar-title {
        display: flex;
        align-items: baseline;
        gap: 0.3rem;
        font-size: 0.85rem;
        font-weight: 700;
        color: var(--text-color);
    }

    .sidebar-title .title-count {
        font-weight: 400;
        font-size: 0.75rem;
        color: var(--secondary-text);
    }

    .sidebar-clear {
        font-size: 0.72rem;
        color: var(--secondary-text);
        background: none;
        border: none;
        cursor: pointer;
        padding: 2px 6px;
        border-radius: 4px;
        transition: all 0.15s ease;
    }

    .sidebar-clear:hover {
        color: #ef4444;
        background: rgba(239, 68, 68, 0.08);
    }

    .sidebar-toggle {
        position: fixed;
        top: 76px;
        left: 220px;
        z-index: 51;
        width: 22px;
        height: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--card-background);
        border: 1px solid var(--border-color);
        border-radius: 50%;
        cursor: pointer;
        color: var(--secondary-text);
        font-size: 11px;
        box-shadow: 0 1px 4px var(--card-shadow);
        transition: left 0.25s ease, color 0.15s ease;
    }

    .sidebar-toggle:hover {
        color: var(--text-color);
    }

    .tag-filter-dropdown.collapsed ~ .sidebar-toggle {
        left: 8px;
    }

    .tag-filter-dropdown #tagFilterBtn {
        display: none !important;
    }

    .tag-filter-menu {
        display: block !important;
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: transparent;
        max-height: calc(100vh - 140px);
        overflow-y: auto;
        padding: 0;
        animation: none;
    }

    body {
        padding-left: 192px;
        transition: padding-left 0.25s ease;
    }

    body.sidebar-collapsed {
        padding-left: 32px;
    }

    /* 宽屏 detail mode: hero-bar 需要可见（fixed 侧边栏在里面） */
    main.container.detail-mode .hero-bar {
        display: flex;
    }
}

/* ═══════════════════════════════════════
   Card base transition (no entrance animation)
   ═══════════════════════════════════════ */
.app-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

/* ═══════════════════════════════════════
   Enhanced Card Hover Glow
   ═══════════════════════════════════════ */
.app-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(14, 165, 233, 0.3));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    filter: blur(12px);
}

.app-card:hover:not(.expanded)::after {
    opacity: 1;
}

.app-card.expanded::after {
    display: none;
}

/* ═══════════════════════════════════════
   Enhanced Card Border on Hover
   ═══════════════════════════════════════ */
.app-card:hover:not(.expanded) {
    transform: translateY(-2px);
    border-color: transparent;
    background: linear-gradient(var(--card-background), var(--card-background)) padding-box,
                linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(14, 165, 233, 0.4)) border-box;
    border: 2px solid transparent;
}

/* ═══════════════════════════════════════
   Master-Detail Layout
   ═══════════════════════════════════════ */
main.container.detail-mode {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.25rem;
    align-items: start;
}

/* 详情模式：hero 不占空间（但保留 fixed 侧边栏可见） */
main.container.detail-mode .hero {
    padding: 0;
    margin: 0;
    height: 0;
    overflow: visible;
}

main.container.detail-mode .hero-bar {
    display: none;
}

main.container.detail-mode .hero-actions > a,
main.container.detail-mode .hero-actions > .contact-dropdown,
main.container.detail-mode .hero-app-count {
    display: none;
}

/* 宽屏侧边栏 fixed 不受 detail-mode 影响，窄屏详情下隐藏筛选按钮 */
@media (max-width: 1399px) {
    main.container.detail-mode .tag-filter-dropdown {
        display: none;
    }
}

main.container.detail-mode .apps-grid {
    grid-column: 1;
    grid-template-columns: 1fr;
    gap: 6px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-right: 6px;
    position: sticky;
    top: 80px;
}

main.container.detail-mode .detail-panel {
    grid-column: 2;
}

/* Sidebar card compact style */
main.container.detail-mode .app-card {
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    gap: 0;
    opacity: 1;
    animation: none;
}

main.container.detail-mode .app-card::after {
    display: none;
}

main.container.detail-mode .app-card-main {
    gap: 0.6rem;
}

main.container.detail-mode .app-icon {
    width: 32px;
    height: 32px;
    border-radius: 7px;
}

main.container.detail-mode .app-name {
    font-size: 0.85rem;
}

main.container.detail-mode .app-description {
    font-size: 0.75rem;
    -webkit-line-clamp: 1;
    line-clamp: 1;
}

main.container.detail-mode .tags,
main.container.detail-mode .platform-info,
main.container.detail-mode .download-icon-wrapper {
    display: none;
}

main.container.detail-mode .app-card:hover:not(.expanded) {
    transform: none;
    background: var(--card-background);
    border-color: var(--border-color);
}

main.container.detail-mode .app-card.sidebar-active {
    border-color: var(--primary-color);
    background: linear-gradient(var(--card-background), var(--card-background)) padding-box,
                linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(14, 165, 233, 0.3)) border-box;
    border: 2px solid transparent;
}

/* Detail Panel */
.detail-panel {
    background: var(--card-background);
    border-radius: 14px;
    padding: 2rem;
    box-shadow: 0 2px 16px var(--card-shadow);
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    animation: detailSlideIn 0.3s ease;
}

@keyframes detailSlideIn {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: translateX(0); }
}

.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--secondary-text);
    transition: all 0.2s ease;
    margin-bottom: 1.5rem;
}

.detail-back:hover {
    border-color: var(--text-color);
    color: var(--text-color);
}

.detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

main.container.detail-mode .detail-header-left .app-icon {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    flex-shrink: 0;
}

main.container.detail-mode .detail-header-left .app-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0;
    white-space: normal;
}

.detail-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #0ea5e9;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s ease;
    flex-shrink: 0;
    padding: 0;
}

.share-btn:hover {
    background: rgba(14, 165, 233, 0.1);
}

.share-btn.copied {
    color: #22c55e;
}

main.container.detail-mode .detail-header-left .app-description {
    color: var(--secondary-text);
    font-size: 0.9rem;
    line-height: 1.4;
    -webkit-line-clamp: unset;
    line-clamp: unset;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-tag {
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    color: var(--secondary-text);
    background: rgba(118, 118, 128, 0.08);
    border: 1px solid var(--border-color);
}

.detail-content {
    line-height: 1.7;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

.detail-content img {
    max-width: 100%;
    border-radius: 12px;
    margin: 1rem 0;
}

.detail-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid rgba(99, 102, 241, 0.3);
    transition: border-color 0.2s ease;
}

.detail-content a:hover {
    border-bottom-color: var(--primary-color);
}

/* Code blocks */
.detail-content pre {
    background: rgba(128, 128, 128, 0.08);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.detail-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    color: inherit;
}

.detail-content code {
    background: rgba(128, 128, 128, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

/* Nested lists */
.detail-content ul {
    padding-left: 1.2rem;
    margin: 0.5rem 0;
}

.detail-content ul ul {
    margin: 0.2rem 0;
}

.detail-content li {
    margin: 0.3rem 0;
    line-height: 1.6;
}

.detail-download {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--primary-color);
    color: var(--card-background);
    padding: 8px 18px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    white-space: nowrap;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.detail-download:hover {
    transform: scale(1.03);
}

.detail-download svg {
    width: 16px;
    height: 16px;
}

.detail-platforms {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    color: var(--secondary-text);
    font-size: 0.82rem;
}

.detail-platforms .platform-icon {
    width: 16px;
    height: 16px;
}

/* Mobile detail: full-screen overlay */
@media (max-width: 768px) {
    main.container.detail-mode {
        display: block;
    }

    main.container.detail-mode .apps-grid {
        display: none;
    }

    .detail-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 100vh;
        border-radius: 0;
        z-index: 500;
        padding: 1.25rem;
    }
}