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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
    padding: 20px;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px 0;
}

header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

header p {
    color: #86868b;
    font-size: 14px;
}

/* ---------- 新增：分类筛选栏 ---------- */
.category-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 24px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    scrollbar-width: none; /* Firefox */
}
.category-bar::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.category-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    background: #fff;
    color: #1d1d1f;
    border: 1px solid #d2d2d7;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
    user-select: none;
}

.category-btn:hover {
    background: #f5f5f7;
    border-color: #86868b;
}

.category-btn.active {
    background: #1d1d1f;
    color: #fff;
    border-color: #1d1d1f;
}
/* --------------------------------- */

#app {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 18px 18px 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.card h3 {
    font-size: 17px;
    font-weight: 600;
}

.card .version {
    font-size: 11px;
    color: #86868b;
    background: #f0f0f2;
    padding: 2px 8px;
    border-radius: 8px;
    flex-shrink: 0;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
}

.card .desc {
    font-size: 12.5px;
    color: #86868b;
    margin-bottom: 12px;
}

.tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #d0d0d5 transparent;
    -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { height: 5px; }
.tabs::-webkit-scrollbar-track { background: transparent; }
.tabs::-webkit-scrollbar-thumb { background: #d0d0d5; border-radius: 3px; }

.tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    background: #f0f0f2;
    color: #1d1d1f;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
    user-select: none;
    font-family: inherit;
}
.tab:hover { background: #e5e5ea; }
.tab.active {
    background: #0071e3;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 113, 227, 0.3);
}
.tab .count {
    font-size: 10px;
    opacity: 0.75;
    background: rgba(0, 0, 0, 0.08);
    padding: 0 5px;
    border-radius: 7px;
    line-height: 15px;
    min-width: 15px;
    text-align: center;
}
.tab.active .count {
    background: rgba(255, 255, 255, 0.28);
    opacity: 1;
}
.tab-badge {
    font-size: 9px;
    padding: 1px 5px;
    background: #ff9500;
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    line-height: 13px;
}
.tab.active .tab-badge { background: #fff; color: #0071e3; }

.assets-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 230px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #d0d0d5 transparent;
}
.assets-panel::-webkit-scrollbar { width: 6px; }
.assets-panel::-webkit-scrollbar-track { background: transparent; }
.assets-panel::-webkit-scrollbar-thumb { background: #d0d0d5; border-radius: 3px; }

.btn {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
    word-break: break-all;
    line-height: 1.45;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
}
.btn-primary { background: #0071e3; color: #fff; }
.btn-primary:hover { background: #0077ed; }
.btn-mirror { background: #f0f0f2; color: #1d1d1f; }
.btn-mirror:hover { background: #e5e5ea; }
.btn .size { opacity: 0.7; font-size: 11px; margin-left: 4px; font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
.btn-primary .size { opacity: 0.85; }

.loading { text-align: center; color: #86868b; padding: 24px 0; font-size: 13px; }
.error { color: #ff3b30; font-size: 13px; text-align: center; padding: 14px 0; }

footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #86868b;
    font-size: 12px;
}

@media (max-width: 480px) {
    #app { grid-template-columns: 1fr; }
    .assets-panel { max-height: 200px; }
}

/* ========== 公告板 ========== */
.board {
    max-width: 1400px;
    margin: 40px auto 0;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.board h2 { font-size: 20px; margin-bottom: 6px; }
.board-desc { font-size: 13px; color: #86868b; margin-bottom: 16px; }
.board-input-row { display: flex; gap: 8px; margin-bottom: 16px; }
#boardInput {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d0d0d5;
    border-radius: 8px;
    font-size: 13px;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    outline: none;
    transition: border-color 0.15s;
}
#boardInput:focus { border-color: #0071e3; }
.board-btn-clear {
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    background: #f0f0f2;
    color: #1d1d1f;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}
.board-btn-clear:hover { background: #e5e5ea; }
.board-results { display: flex; flex-direction: column; gap: 8px; }
.mirror-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
}
.mirror-row .mirror-name { font-size: 12px; font-weight: 600; color: #0071e3; min-width: 110px; flex-shrink: 0; }
.mirror-row .mirror-url {
    flex: 1;
    font-size: 12px;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    color: #1d1d1f;
    word-break: break-all;
    line-height: 1.4;
    background: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #e8e8ed;
    user-select: all;
    cursor: text;
}
.mirror-row .mirror-copy {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    background: #0071e3;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
    font-family: inherit;
}
.mirror-row .mirror-copy:hover { background: #0077ed; }
.mirror-row .mirror-copy.copied { background: #34c759; }
.board-empty { text-align: center; color: #86868b; font-size: 13px; padding: 20px; }
.board-tip { font-size: 12px; color: #86868b; margin-top: 12px; line-height: 1.6; }
.board-tip code { background: #f0f0f2; padding: 1px 6px; border-radius: 4px; font-size: 11px; font-family: ui-monospace, Consolas, monospace; }