/* 薄荷资源库 · CSDN 风下载站
   - 居中站点介绍与公告
   - 横向卡片：封面 + 标题/简介/标签 + 价格 + 下载量
   - 详情抽屉：价格区 + 评分 + 下载
*/

:root {
    --bg:        #f4f5f7;
    --card:      #ffffff;
    --text:      #1d1d1f;
    --text-2:    #595959;
    --text-3:    #8c8c8c;
    --border:    #e8e8ed;
    --line:      #f0f0f3;
    --blue:      #0071e3;
    --blue-h:    #0077ed;
    --red:       #f5222d;
    --orange:    #fa8c16;
    --gold:      #faad14;
    --green:     #52c41a;
    --vip-grad:  linear-gradient(135deg, #ffd166 0%, #fa8c16 60%, #f5222d 100%);
    --shadow:    0 1px 4px rgba(0,0,0,.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,.08);
    --radius:    10px;
    --safe-top:    env(safe-area-inset-top, 0);
    --safe-bottom: env(safe-area-inset-bottom, 0);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
    margin: 0; padding: 0;
    background: var(--bg); color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    font-size: 14px; line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--blue); }
button { font-family: inherit; cursor: pointer; }

.app-container {
    width: 100%; max-width: 1280px;
    margin: 0 auto; padding: 0 20px;
}

/* ========== Nav ========== */
.nav-bar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
}
.nav-content { display: flex; align-items: center; gap: 16px; height: 56px; }
.nav-logo { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; font-size: 16px; }
.brand-icon {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, #34c759, #00c7be);
    color: #fff; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-link {
    padding: 6px 14px; border-radius: 8px;
    color: var(--text-2); font-size: 14px;
    transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: var(--line); }
.nav-link--active { color: var(--text); font-weight: 500; }
.nav-source {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--blue); color: #fff;
    padding: 8px 14px; border-radius: 8px;
    font-weight: 500; font-size: 13px;
    border: 0; cursor: pointer;
    transition: background .15s;
}
.nav-source:hover { background: var(--blue-h); color: #fff; }

.nav-user-area { margin-left: 4px; }
.nav-user-btn {
    background: transparent; border: 0;
    width: 36px; height: 36px; border-radius: 50%;
    color: var(--text); cursor: pointer;
}
.nav-user-btn:hover { background: var(--line); }

/* ========== Hero ========== */
.main-content { padding-bottom: 60px; }
.store-intro { padding: 18px 0 0; }
.hero-grid { max-width: 820px; margin: 0 auto; }
.hero-left { min-width: 0; padding: 22px 28px; text-align: center; background: var(--card); border: 1px solid var(--border); border-radius: 14px; }
.intro-heading { display: flex; align-items: center; justify-content: center; gap: 10px; }
.hero-brand-mark { width: 36px; height: 36px; flex-shrink: 0; object-fit: contain; border-radius: 9px; }
#catalog-title { max-width: 100%; font-size: 23px; font-weight: 700; margin: 0; letter-spacing: -.02em; }
.catalog-summary { font-size: 13px; color: var(--text-2); margin: 8px 0 0; line-height: 1.7; }
.site-announcement { max-width: 640px; margin: 16px auto 0; padding-top: 12px; border-top: 1px solid var(--border); text-align: left; }
.site-announcement[hidden] { display: none; }
.announcement-label { color: var(--text-2); font-size: 12px; font-weight: 500; }
.announcement-label i { margin-right: 4px; }
.intro-notice { margin: 12px 0 0; color: var(--text-2); font-size: 12px; line-height: 1.7; }
.hero-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 0; font-size: 12px; color: var(--text-2); }
.hero-stats strong { color: var(--text); font-size: 15px; margin-right: 4px; }
.catalog-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.catalog-source, .catalog-purchase { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 500; border: 0; cursor: pointer; text-decoration: none; }
.catalog-source { background: var(--blue); color: #fff; }
.catalog-source:hover { background: var(--blue-h); color: #fff; }
.catalog-purchase { background: #f2f3f5; color: var(--text); }
.catalog-purchase:hover { background: #e8ebef; }

/* ========== Toolbar ========== */
.catalog-section { padding: 24px 0 40px; }
.catalog-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.section-title {
    font-size: 24px; font-weight: 700; margin: 0; letter-spacing: -.01em;
}
.nav-search-container { flex: 0 1 360px; min-width: 200px; }
#searchForm {
    position: relative; height: 38px;
    background: #fff; border: 1px solid var(--border);
    border-radius: 8px;
    display: flex; align-items: center; padding: 0 4px 0 12px;
    transition: border-color .15s;
}
#searchForm:focus-within { border-color: var(--blue); }
.search-icon { color: var(--text-3); margin-right: 6px; }
.search-input {
    border: 0; background: transparent; outline: none;
    flex: 1; height: 100%;
    font-size: 14px; color: var(--text);
}
.search-btn {
    border: 0; background: var(--blue); color: #fff;
    width: 30px; height: 30px; border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: background .15s;
}
.search-btn:hover { background: var(--blue-h); }

.category-section { margin-bottom: 16px; }
.category-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.category-scroll::-webkit-scrollbar { display: none; }
.category-tabs { display: flex; gap: 8px; padding-bottom: 4px; }
.category-tab {
    flex-shrink: 0;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-2);
    padding: 8px 16px; border-radius: 8px;
    font-size: 13px; font-weight: 500;
    transition: all .15s;
    display: inline-flex; align-items: center; gap: 6px;
}
.category-tab:hover { color: var(--text); border-color: var(--text-3); }
.category-tab.active {
    background: var(--blue); color: #fff;
    border-color: var(--blue);
}

/* ========== Apps list (双列应用卡片) ========== */
.apps-list {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
}
.apps-list > .no-results { grid-column: 1 / -1; }
.app-row {
    background: var(--card); border-radius: 10px;
    padding: 16px;
    display: grid; grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px; align-items: start; min-width: 0;
    box-shadow: var(--shadow);
    transition: box-shadow .2s, transform .2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.app-row:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.app-row__cover {
    width: 64px; height: 64px;
    border-radius: 8px;
    background: linear-gradient(135deg, #0071e3, #00c7be);
    object-fit: contain; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 28px;
}
.app-row__main {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; justify-content: space-between;
    gap: 6px;
}
.app-row__title {
    font-size: 15px; font-weight: 600;
    color: var(--text);
    overflow: hidden; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.app-row__title .vip-tag {
    font-size: 11px;
    background: var(--vip-grad); color: #fff;
    padding: 1px 6px; border-radius: 4px;
    font-weight: 500; line-height: 1.6;
}
.app-row__title .vip-only-tag {
    background: var(--red); font-size: 11px; color: #fff;
    padding: 1px 6px; border-radius: 4px;
}
.app-row__desc {
    font-size: 13px; color: var(--text-2);
    overflow-wrap: anywhere;
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    min-height: 38px;
}
.app-row__tags {
    display: flex; gap: 6px; flex-wrap: wrap;
    font-size: 12px;
}
.app-row__tags span {
    background: var(--line); color: var(--text-2);
    padding: 2px 8px; border-radius: 4px; max-width: 100%; overflow-wrap: anywhere;
}
.app-row__meta {
    display: flex; gap: 4px 12px; flex-wrap: wrap; overflow-wrap: anywhere;
    color: var(--text-3); font-size: 12px;
}
.app-row__meta i { margin-right: 2px; color: var(--text-3); }
.app-row__right {
    grid-column: 1 / -1; align-self: end;
    display: flex; gap: 12px; justify-content: space-between; align-items: center;
    padding-top: 12px; border-top: 1px solid var(--line);
}
.app-row__price .now {
    font-size: 22px; font-weight: 700;
    color: var(--red);
    line-height: 1.2;
}
.app-row__price .now::before { content: "¥"; font-size: 14px; margin-right: 1px; opacity: .8; font-weight: 400; }
.app-row__price .original {
    font-size: 11px; color: var(--text-3); text-decoration: line-through; opacity: .8;
}
.app-row__price .original::before { content: "原价 ¥"; }
.app-row__price .vip-price {
    font-size: 12px; color: var(--orange); margin-top: 2px;
}
.app-row__price .vip-price b { font-weight: 700; }
.app-row__price .free { font-size: 18px; font-weight: 700; color: var(--green); }
.app-row__btn {
    border: 0; background: var(--blue); color: #fff;
    padding: 7px 14px; border-radius: 999px;
    font-size: 12px; font-weight: 500;
    transition: background .15s;
    display: inline-flex; align-items: center; gap: 4px;
    flex-shrink: 0; min-height: 40px; white-space: nowrap;
}
.app-row__btn:hover { background: var(--blue-h); }
.app-row__btn.locked { background: var(--orange); }
.app-row__btn.locked:hover { background: #d96b00; }
.app-row__dl { font-size: 11px; color: var(--text-3); }
.app-row__dl strong { font-size: 14px; color: var(--text-2); }

.rating-stars { font-size: 12px; color: var(--gold); }
.rating-stars .num { color: var(--text); font-weight: 600; margin-left: 4px; }

/* Empty / loading */
.no-results { text-align: center; padding: 80px 20px; color: var(--text-3); }
.no-results-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; color: var(--text-2); }
.loading-indicator { display: none; text-align: center; padding: 20px; color: var(--text-3); font-size: 13px; }
.load-more-button {
    display: block; margin: 24px auto;
    padding: 10px 22px;
    border: 1px solid var(--border); border-radius: 999px;
    background: var(--card); color: var(--text);
    cursor: pointer;
    transition: background .15s;
}
.load-more-button:hover { background: var(--line); }
.load-more-button[hidden] { display: none; }

/* ========== Footer ========== */
.footer { background: #1f1f23; color: #aeb0ba; padding: 32px 0 24px; margin-top: 24px; }
.footer-top { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 26px; }
.footer-brand { min-width: 0; }
.footer-brand h2 { margin: 0 0 8px; color: #fff; font-size: 20px; overflow-wrap: anywhere; }
.footer-brand p { margin: 0; font-size: 13px; line-height: 1.8; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.footer-links a { padding: 10px 13px; border-radius: 8px; font-size: 13px; color: #e2e3e9; }
.footer-links a:hover { color: #fff; background: #303138; }
.footer a:focus-visible { outline: 2px solid #9ecbff; outline-offset: 3px; }
.footer-bottom { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; padding-top: 20px; border-top: 1px solid #36373f; font-size: 12px; }
.footer-bottom p { margin: 0; line-height: 1.8; overflow-wrap: anywhere; }
.footer-bottom a { margin-left: auto; color: #cbd8ea; white-space: nowrap; }
.footer-bottom a:hover { color: #fff; }

/* ========== Sheet Modal ========== */
.intro-notice a { color: var(--blue); margin-left: 6px; text-decoration: underline; text-underline-offset: 3px; }
.disclaimer-section { scroll-margin-top: 76px; display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 24px; padding: 24px 0; border-top: 1px solid #36373f; }
.disclaimer-section h2 { margin: 2px 0 0; font-size: 15px; color: #e2e3e9; }
.disclaimer-section p { margin: 0 0 8px; color: #b9bbc5; font-size: 13px; line-height: 1.9; overflow-wrap: anywhere; }
.disclaimer-section p:last-child { margin-bottom: 0; }
.sheet-modal { position: fixed; inset: 0; display: none; z-index: 200; }
.sheet-modal[aria-hidden="false"] { display: block; }
.sheet-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.4); opacity: 0; transition: opacity .25s; }
.sheet-modal[aria-hidden="false"] .sheet-modal-overlay { opacity: 1; }
.sheet-modal-container {
    position: absolute; left: 0; right: 0; bottom: 0;
    background: #fff; border-radius: 22px 22px 0 0;
    max-height: 88vh; overflow-y: auto;
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(.16,1,.3,1);
    padding-bottom: calc(28px + var(--safe-bottom));
}
.sheet-modal[aria-hidden="false"] .sheet-modal-container { transform: translateY(0); }
.sheet-modal-handle-wrapper { display: flex; justify-content: center; padding: 10px 0 4px; cursor: grab; }
.sheet-modal-handle { width: 36px; height: 5px; border-radius: 3px; background: rgba(0,0,0,.18); }
.sheet-modal-content { padding: 0 22px 22px; position: relative; }
.sheet-close {
    position: absolute; top: 14px; right: 18px;
    border: 0; background: rgba(0,0,0,.06);
    width: 30px; height: 30px; border-radius: 50%;
    cursor: pointer; color: var(--text);
    z-index: 5;
}

.sheet-app-header-large {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; padding: 16px 0 8px;
}
.sheet-app-icon-large {
    width: 80px; height: 80px; border-radius: 18px;
    background: linear-gradient(135deg, #0071e3, #00c7be);
    object-fit: cover;
    margin-bottom: 12px;
    box-shadow: 0 8px 20px rgba(0,113,227,.25);
}
#sheet-app-name { margin: 0 0 8px; font-size: 20px; }
.sheet-tags {
    display: flex; gap: 6px; flex-wrap: wrap; justify-content: center;
}
.sheet-tags span {
    background: var(--line); color: var(--text-2);
    padding: 3px 10px; border-radius: 4px;
    font-size: 12px;
}

.sheet-price {
    background: linear-gradient(135deg, #fff7e6, #ffe4b5);
    border-radius: 12px; padding: 16px;
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 14px;
}
.sheet-price .price-info .now { font-size: 22px; font-weight: 700; color: #287047; }
.sheet-price .price-info .original { font-size: 13px; color: var(--text-2); margin-top: 6px; }
.sheet-price .vip-tag-big {
    background: var(--vip-grad); color: #fff;
    padding: 4px 10px; border-radius: 6px; font-weight: 700; font-size: 12px;
}
.sheet-price .vip-price-num { font-size: 14px; color: var(--orange); margin-top: 4px; }

.sheet-stats {
    display: flex; gap: 20px; flex-wrap: wrap;
    padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    margin: 14px 0; color: var(--text-2); font-size: 13px;
}
.sheet-stats > div { display: flex; align-items: center; gap: 6px; }
.sheet-stats i { color: var(--text-3); }

.sheet-app-description {
    margin-top: 8px;
    color: var(--text-2); font-size: 14px; line-height: 1.7;
    white-space: pre-wrap; word-break: break-word;
}
.sheet-app-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

/* Form */
.form-input {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
}
.form-input:focus { border-color: var(--blue); }
.btn {
    border: 0; border-radius: 8px;
    padding: 12px 18px; font-size: 15px; font-weight: 500;
    cursor: pointer;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-h); }
.btn-gray    { background: var(--line); color: var(--text); }
.btn-success { background: var(--green); color: #fff; }
.btn-warning { background: var(--orange); color: #fff; }
.sheet-actions { display: flex; gap: 8px; margin: 14px 0; }
.sheet-actions .btn { flex: 1; }
.sheet-msg { min-height: 18px; font-size: 13px; color: var(--text-3); margin: 8px 0 0; }
.sheet-msg.error { color: var(--red); }
.sheet-msg.success { color: var(--green); }
.vip-line { margin: 0 0 8px; font-size: 13px; color: var(--text-2); }

/* Toast */
.toast {
    position: fixed; left: 50%; top: 80px;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(0,0,0,.85); color: #fff;
    padding: 10px 18px; border-radius: 999px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    z-index: 1000;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 6px; }

/* Mobile */
@media (max-width: 767px) {
    .apps-list { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 640px) {
    .nav-content { padding: 0 12px; gap: 8px; }
    .nav-logo { flex: 1; min-width: 0; }
    .nav-logo span { display: block; }
    .brand-icon { flex-shrink: 0; }
    .nav-link { display: none; }
    .nav-links, .nav-user-area { flex-shrink: 0; }
    .nav-source { white-space: nowrap; padding: 8px 10px; }
    .store-intro { padding-top: 10px; }
    .hero-left { padding: 18px 16px; }
    .catalog-summary { font-size: 12px; }
    #catalog-title { font-size: 21px; }

    .app-row { gap: 12px; }

    .footer-top { flex-direction: column; align-items: stretch; gap: 16px; padding-bottom: 20px; }
    .footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .footer-links a { background: #2b2c33; text-align: center; }
    .disclaimer-section { grid-template-columns: 1fr; gap: 12px; padding: 20px 0; }
    .footer-bottom { gap: 8px 16px; }
    .footer-bottom .copyright { width: 100%; }
}

.source-tools-title { margin: 22px 0 12px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 17px; }
.source-tools { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; max-width: 540px; margin: 18px auto 24px; }
.source-tool { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 6px; border-radius: 12px; color: var(--text); text-decoration: none; text-align: center; font-size: 14px; }
.source-tool:hover { background: #f1f6fc; }
.source-tool img { display: block; width: 56px; height: 56px; object-fit: contain; border-radius: 14px; }
.source-app-context { padding: 10px 12px; background: #f4f7fb; border-radius: 8px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.source-address { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.source-address summary { cursor: pointer; color: var(--blue); font-size: 14px; padding-bottom: 12px; }
.source-member-actions[hidden], .source-member-actions .btn[hidden], .source-app-context[hidden] { display: none; }
.detail-download { width: 100%; min-height: 46px; }
.nav-logo { min-width: 0; }
.nav-logo>span { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#catalog-title { overflow-wrap: anywhere; }
@media(max-width:640px) { .source-tools { gap: 10px; } .nav-logo>span { max-width: 125px; } }

.site-message { margin: 8px 0 0; color: var(--text-2); font-size: 13px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
