/* ==========================================================================
   布局重排（Apple 风）
   与 glass.css 同文件加载，放在其后面追加亦可
   ========================================================================== */

/* 容器 */
.wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px 80px;
}

/* 顶栏改为悬浮胶囊 */
.topbar {
    position: sticky;
    top: 14px;
    margin: 14px auto 0;
    max-width: 1160px;
    width: calc(100% - 28px);
    border-radius: 999px;
    border: 1px solid var(--g-hair);
    box-shadow: var(--g-shadow);
    background: rgba(12, 14, 20, .55);
}
.topbar-inner {
    max-width: none;
    padding: 10px 10px 10px 16px;
    gap: 10px;
}
.brand-logo {
    width: 40px; height: 40px;
    border-radius: 13px;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .1);
    border: 1px solid var(--g-hair);
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.brand-sub  { font-size: 11.5px; color: var(--g-ink-3); margin-top: 1px; }
.icon-btn {
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 13px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--g-hair);
    color: var(--g-ink);
    display: inline-flex; align-items: center; gap: 7px;
    transition: background .25s var(--g-ease), transform .2s var(--g-ease);
}
.icon-btn:hover { background: rgba(255, 255, 255, .13); transform: translateY(-1px); }

/* Hero：全部居中 */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: clamp(40px, 8vw, 92px) 0 0;
    gap: 0;
}
.hero-title {
    font-size: clamp(34px, 6.2vw, 62px);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -.035em;
    margin: 0;
    background: linear-gradient(180deg, #ffffff 0%, #c8d4ff 60%, #9d8bff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-desc {
    margin: 16px 0 0;
    font-size: clamp(14px, 1.6vw, 17px);
    line-height: 1.6;
    color: var(--g-ink-2);
    max-width: 560px;
}

/* 搜索：大号玻璃胶囊 */
.search-box {
    position: relative;
    width: min(620px, 100%);
    margin: 32px auto 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    height: 56px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid var(--g-hair-strong);
    -webkit-backdrop-filter: var(--g-blur);
    backdrop-filter: var(--g-blur);
    box-shadow: var(--g-shadow);
    transition: box-shadow .3s var(--g-ease), transform .3s var(--g-ease), background .3s var(--g-ease);
}
.search-box:focus-within {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, .1);
    box-shadow: 0 0 0 4px rgba(91, 140, 255, .16), var(--g-shadow-lg);
}
.search-box .fa-search { color: var(--g-ink-3); font-size: 15px; }
.search-input {
    flex: 1;
    height: 100%;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--g-ink);
    font-size: 15.5px;
    padding: 0;
}
.search-input::placeholder { color: var(--g-ink-3); }

/* 分类：分段控件 */
.chips {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 22px auto 0;
    padding: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--g-hair);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    max-width: 100%;
}
.chip {
    border: none !important;
    background: transparent !important;
    color: var(--g-ink-2);
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 550;
    display: inline-flex; align-items: center; gap: 7px;
    cursor: pointer;
    transition: background .25s var(--g-ease), color .25s var(--g-ease), transform .2s var(--g-ease);
}
.chip .n {
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    color: var(--g-ink-2);
}
.chip:hover { background: rgba(255, 255, 255, .08) !important; color: var(--g-ink); }
.chip.active {
    background: rgba(255, 255, 255, .16) !important;
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 18px -8px rgba(0, 0, 0, .8);
}
.chip.active .n { background: rgba(255, 255, 255, .22); color: #fff; }

/* 统计条 */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    width: min(720px, 100%);
    margin: 34px auto 0;
}
.hero-stats .stat-pill {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    padding: 14px 12px;
    border-radius: 18px;
    font-size: 12.5px;
    color: var(--g-ink-3);
}
.hero-stats .stat-pill strong {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--g-ink);
}
.stat-dot { width: 7px; height: 7px; border-radius: 50%; background: #5b8cff; box-shadow: 0 0 12px #5b8cff; }
.stat-dot.green { background: #34d399; box-shadow: 0 0 12px #34d399; }
.stat-dot.amber { background: #fbbf24; box-shadow: 0 0 12px #fbbf24; }

/* 添加源按钮：两张并排大卡 */
.add-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: min(720px, 100%);
    margin: 14px auto 0;
}
.add-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 18px;
    text-align: left;
    text-decoration: none;
}
.add-btn img {
    width: 36px; height: 36px;
    border-radius: 10px;
    object-fit: cover;
    background: rgba(255, 255, 255, .08);
}
.add-btn .t { font-size: 14px; font-weight: 600; color: var(--g-ink); }
.add-btn .s { font-size: 11.5px; color: var(--g-ink-3); margin-top: 2px; }

/* 公告 */
.notice {
    width: min(720px, 100%);
    margin: 16px auto 0;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    text-align: left;
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(91, 140, 255, .1);
    border: 1px solid rgba(91, 140, 255, .28);
    color: #cfdcff;
    font-size: 13px;
    line-height: 1.6;
}

/* 应用网格 */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
    width: 100%;
    margin: 40px auto 0;
}
@media (min-width: 1024px) {
    .app-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

.app-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 14px 16px;
    border-radius: 22px;
    text-align: center;
    cursor: pointer;
}
.app-icon {
    width: 62px; height: 62px;
    border-radius: 17px;
    overflow: hidden;
    background: rgba(255, 255, 255, .08);
    border: 1px solid var(--g-hair);
    box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .9);
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--g-ink);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-meta { font-size: 11.5px; color: var(--g-ink-3); }

/* 页脚 */
.page-footer {
    margin-top: 64px;
    padding-top: 26px;
    border-top: 1px solid var(--g-hair);
    text-align: center;
    font-size: 12.5px;
    color: var(--g-ink-3);
    line-height: 2;
}
.page-footer a { color: var(--g-ink-2); text-decoration: none; }
.page-footer a:hover { color: #fff; }

/* 移动端收紧 */
@media (max-width: 640px) {
    .wrap { padding: 0 14px 64px; }
    .topbar { top: 8px; margin-top: 8px; border-radius: 22px; }
    .hero { padding-top: 34px; }
    .search-box { height: 50px; margin-top: 24px; }
    .chips { border-radius: 20px; }
    .hero-stats { gap: 8px; }
    .hero-stats .stat-pill { flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; }
    .add-row { grid-template-columns: 1fr; }
}

/* 修正：home.css 把放大镜绝对定位、给输入框留了左内边距，这里重置 */
.search-box .fa-search {
    position: static !important;
    left: auto !important;
    top: auto !important;
    margin: 0 10px 0 2px;
    font-size: 15px;
    color: var(--g-ink-3);
    flex: 0 0 auto;
}
.search-box .search-input {
    padding: 0 !important;
    text-indent: 0 !important;
    min-width: 0;
}


/* ================= 今日更新 ================= */
.today-sec {
    width: 100%;
    margin: 46px auto 0;
    text-align: left;
}
.today-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding: 0 4px;
}
.today-title {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 19px;
    font-weight: 650;
    letter-spacing: -.02em;
    color: var(--g-ink);
}
.today-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, .16), 0 0 14px rgba(52, 211, 153, .9);
    animation: today-pulse 2.2s var(--g-ease) infinite;
}
@keyframes today-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .55; transform: scale(.86); }
}
.today-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--g-ink-3);
    background: rgba(255, 255, 255, .07);
    border: 1px solid var(--g-hair);
    border-radius: 999px;
    padding: 2px 10px;
}
.today-more {
    border: 1px solid var(--g-hair);
    background: rgba(255, 255, 255, .05);
    color: var(--g-ink-2);
    border-radius: 999px;
    padding: 7px 15px;
    font-size: 12.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background .25s var(--g-ease), color .25s var(--g-ease), transform .2s var(--g-ease);
}
.today-more:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.today-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 4px 12px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.today-strip::-webkit-scrollbar { height: 6px; }
.today-strip .app-card {
    flex: 0 0 168px;
    scroll-snap-align: start;
    padding: 16px 12px 14px;
}
.today-strip .app-icon { width: 52px; height: 52px; border-radius: 15px; }
.today-strip .app-name { font-size: 12.5px; }

@media (max-width: 640px) {
    .today-sec { margin-top: 34px; }
    .today-strip .app-card { flex: 0 0 138px; padding: 13px 10px 12px; }
    .today-strip .app-icon { width: 46px; height: 46px; border-radius: 13px; }
    .today-title { font-size: 16.5px; }
}

/* 修正：flex 列里 max-width 560 / 620 会把移动端撑宽 */
.hero-title { max-width: 100%; }
.hero-desc  { max-width: min(560px, 100%); }
.hero-stats, .add-row, .notice { max-width: 100%; }
.hero { width: 100%; }

/* 今日更新条两端渐隐 */
.today-strip {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 26px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 26px), transparent 100%);
}

@media (max-width: 640px) {
    .hero-title { font-size: clamp(30px, 8.4vw, 40px); line-height: 1.12; }
    .hero-desc  { font-size: 13.5px; }
    .chips { border-radius: 18px; padding: 5px; gap: 4px; }
    .chip  { padding: 8px 12px; font-size: 12.5px; }
}

/* ================= 顶栏快捷入口 ================= */
.top-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}
.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 550;
    color: var(--g-ink-2);
    text-decoration: none;
    border: 1px solid transparent;
    transition: background .25s var(--g-ease), color .25s var(--g-ease),
                border-color .25s var(--g-ease), transform .2s var(--g-ease);
}
.nav-item i { font-size: 13px; opacity: .85; }
.nav-item:hover {
    background: rgba(255, 255, 255, .1);
    border-color: var(--g-hair);
    color: #fff;
    transform: translateY(-1px);
}
.nav-item.is-primary {
    color: #fff;
    background: linear-gradient(135deg, rgba(91, 140, 255, .9), rgba(160, 107, 255, .9));
    border-color: transparent;
    box-shadow: 0 8px 22px -12px rgba(91, 140, 255, .95);
}
.nav-item.is-primary:hover {
    background: linear-gradient(135deg, #6b97ff, #b07bff);
}
@media (max-width: 720px) {
    .nav-item span { display: none; }
    .nav-item { padding: 9px 12px; }
    .nav-item i { font-size: 14px; }
}

/* 顶栏：移动端用短标签而不是纯图标 */
.nav-item .short { display: none; }
@media (max-width: 720px) {
    .nav-item span { display: inline; }
    .nav-item .full  { display: none; }
    .nav-item .short { display: inline; }
    .nav-item { padding: 8px 12px; gap: 0; font-size: 12.5px; }
    .nav-item i { display: none; }
    .brand-sub { display: none; }
    .brand-name { font-size: 14px; }
}

/* 顶栏入口标签：桌面只显示全称，移动端只显示简称（硬覆盖，避免重复/空白） */
.nav-item .short { display: none !important; }
.nav-item .full  { display: inline !important; }
@media (max-width: 720px) {
    .nav-item .full  { display: none !important; }
    .nav-item .short { display: inline !important; }
    .nav-item i      { display: none !important; }
    .nav-item { padding: 9px 13px !important; }
}
