/* ============================================================
   style.css —— 简洁实用样式（无框架依赖，纯手写）
   配色：浅色、干净、阅读友好
   ============================================================ */

:root {
    --c-primary: #2563eb;
    --c-primary-dark: #1d4ed8;
    --c-bg: #f8fafc;
    --c-card: #ffffff;
    --c-border: #e2e8f0;
    --c-text: #1e293b;
    --c-text-muted: #64748b;
    --c-tag-bg: #e0e7ff;
    --c-tag-text: #3730a3;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--c-bg);
    color: var(--c-text);
    line-height: 1.6;
    font-size: 15px;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ===== 头部 ===== */
.site-header {
    background: var(--c-card);
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 20px;
    max-width: 1140px;
    margin: 0 auto;
}
.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--c-text);
}
.logo:hover { text-decoration: none; }
.search-box {
    flex: 1;
    display: flex;
    max-width: 480px;
}
.search-box input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 14px;
    outline: none;
}
.search-box input:focus { border-color: var(--c-primary); }
.search-box button {
    padding: 8px 16px;
    background: var(--c-primary);
    color: #fff;
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
    font-size: 14px;
}
.user-nav { display: flex; gap: 12px; align-items: center; }
.user-nav .user-name { color: var(--c-text-muted); font-size: 14px; }

.nav-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    padding: 10px 20px;
    max-width: 1140px;
    margin: 0 auto;
    font-size: 13px;
}
.nav-categories a { color: var(--c-text-muted); }
.nav-categories a:hover { color: var(--c-primary); }
.nav-categories a.active { color: var(--c-primary); font-weight: 600; }

/* ===== 主内容 ===== */
main.container { padding-top: 24px; padding-bottom: 48px; }

.hero {
    text-align: center;
    padding: 40px 20px 32px;
}
.hero h1 { font-size: 28px; margin-bottom: 8px; }
.hero p { color: var(--c-text-muted); }

.section { margin-bottom: 36px; }
.section-title {
    font-size: 18px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--c-border);
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
}
@media (max-width: 768px) { .two-col { grid-template-columns: 1fr; } }

/* ===== 卡片网格 ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}
.card {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    color: var(--c-text);
    transition: box-shadow 0.15s, transform 0.15s;
}
.card:hover {
    text-decoration: none;
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.card-logo {
    width: 48px; height: 48px;
    border-radius: var(--radius);
    object-fit: contain;
    flex-shrink: 0;
    background: #f1f5f9;
}
.card-logo.placeholder {
    display: flex; align-items: center; justify-content: center;
    color: var(--c-text-muted); font-weight: 700; font-size: 20px;
}
.card-title { font-size: 15px; margin-bottom: 4px; }
.card-desc {
    font-size: 13px; color: var(--c-text-muted);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-meta { margin-top: 6px; font-size: 12px; color: var(--c-text-muted); }

/* ===== 标签 ===== */
.tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--c-tag-bg);
    color: var(--c-tag-text);
    border-radius: 4px;
    font-size: 12px;
    margin-right: 6px;
}
.tag.latest { background: #dcfce7; color: #166534; }
.dl-count { color: var(--c-text-muted); }

/* ===== 详情页 ===== */
.breadcrumb {
    font-size: 13px;
    color: var(--c-text-muted);
    margin-bottom: 16px;
}
.software-detail { background: var(--c-card); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 24px; }
.detail-title-row { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
.detail-logo { width: 64px; height: 64px; border-radius: var(--radius); object-fit: contain; }
.software-detail h1 { font-size: 24px; }
.software-detail h1 .ver { font-size: 15px; color: var(--c-text-muted); font-weight: normal; margin-left: 8px; }
.detail-cat { font-size: 13px; margin-top: 4px; }

.detail-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--c-border); }
.detail-section h2 { font-size: 17px; margin-bottom: 10px; }
.summary { white-space: pre-wrap; }

/* 下载区 */
.download-group { margin-bottom: 14px; }
.os-title { font-size: 14px; color: var(--c-text-muted); margin-bottom: 6px; }
.download-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-download {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    background: var(--c-primary);
    color: #fff;
    border-radius: var(--radius);
    min-width: 180px;
}
.btn-download:hover { background: var(--c-primary-dark); text-decoration: none; color: #fff; }
.dl-name { font-size: 14px; font-weight: 500; word-break: break-all; }
.dl-info { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.quota-tip { margin-top: 12px; color: var(--c-text-muted); }

.changelog {
    background: var(--c-bg);
    padding: 12px;
    border-radius: var(--radius);
    white-space: pre-wrap;
    font-size: 13px;
    max-height: 320px;
    overflow-y: auto;
}

.history-list { list-style: none; }
.history-list li { padding: 6px 0; border-bottom: 1px solid var(--c-border); font-size: 14px; }
.ver-tag { font-family: monospace; margin-right: 10px; }

/* ===== 软件信息表（详情页） ===== */
.meta-table { background: var(--c-bg); }
.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.info-table th, .info-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--c-border);
    vertical-align: top;
}
.info-table th {
    width: 110px;
    color: var(--c-text-muted);
    font-weight: 500;
    text-align: right;
}
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom: none; }

.badge-blue { background: #dbeafe; color: #1e40af; padding: 2px 8px; border-radius: 4px; font-size: 12px; }

/* ===== 截图（详情页） ===== */
.screenshots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 8px;
}
.screenshots a {
    display: block;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
}
.screenshots img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.2s;
}
.screenshots a:hover img { transform: scale(1.02); }

/* ===== 表单 / 按钮 ===== */
.btn {
    display: inline-block;
    padding: 8px 16px;
    background: var(--c-card);
    color: var(--c-text);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    cursor: pointer;
}
.btn:hover { text-decoration: none; border-color: var(--c-primary); }
.btn-primary { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.btn-primary:hover { background: var(--c-primary-dark); color: #fff; border-color: var(--c-primary-dark); }

.auth-box {
    max-width: 380px;
    margin: 40px auto;
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 28px;
}
.auth-box h1 { font-size: 20px; margin-bottom: 16px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form label { display: flex; flex-direction: column; font-size: 13px; color: var(--c-text-muted); }
.auth-form input {
    margin-top: 4px;
    padding: 9px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    font-size: 14px;
}
.auth-form input:focus { border-color: var(--c-primary); outline: none; }
.auth-box .small { margin-top: 14px; text-align: center; }

.form-msg { padding: 8px 12px; border-radius: var(--radius); font-size: 13px; margin-bottom: 12px; }
.form-msg.error { background: #fef2f2; color: #b91c1c; }
.form-msg.info { background: #eff6ff; color: #1d4ed8; }

.empty-box {
    text-align: center;
    padding: 60px 20px;
    color: var(--c-text-muted);
}
.empty-box h1 { color: var(--c-text); margin-bottom: 8px; }
.empty { color: var(--c-text-muted); padding: 24px; text-align: center; }
.page-title { font-size: 22px; margin-bottom: 18px; }

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 28px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    padding: 6px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--c-card);
    font-size: 14px;
}
.pagination a:hover { text-decoration: none; border-color: var(--c-primary); }
.pagination .current { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.pagination .disabled { color: var(--c-text-muted); opacity: 0.5; }

/* ===== 底部 ===== */
.site-footer {
    background: var(--c-card);
    border-top: 1px solid var(--c-border);
    padding: 24px 0;
    text-align: center;
    color: var(--c-text-muted);
    font-size: 13px;
}
.site-footer .small { font-size: 12px; margin-top: 6px; opacity: 0.8; }

.small { font-size: 13px; color: var(--c-text-muted); }
