/* ============================================================
 *  FAN-HUB 下载中心 - 样式
 *  浅紫 / 浅蓝 渐变科技风
 * ============================================================ */

:root {
    --bg1: #f4f2fc;
    --bg2: #eef4fd;
    --card: #ffffff;
    --purple: #a78bfa;
    --purple-dark: #7c6cf0;
    --blue: #7db8fa;
    --blue-dark: #5a9ff0;
    --pink: #f9b8d2;
    --text: #3a3750;
    --muted: #8a86a8;
    --line: #e6e2f7;
    --danger: #e05a7a;
    --ok: #3fa76e;
    --radius: 16px;
    --shadow: 0 6px 24px rgba(124, 108, 240, .12);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: linear-gradient(135deg, var(--bg1) 0%, var(--bg2) 100%);
    min-height: 100vh;
}

a { color: var(--purple-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶部栏 ---------- */
.topbar {
    background: linear-gradient(90deg, #b7a3fb, #a9c4fb);
    box-shadow: 0 2px 14px rgba(124, 108, 240, .25);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .5px;
    text-shadow: 0 1px 6px rgba(124, 108, 240, .35);
}
.topbar nav { display: flex; gap: 10px; }

/* ---------- 布局 ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }
.container.narrow { max-width: 760px; }
.page-title { font-size: 22px; margin: 6px 0 18px; color: var(--purple-dark); }
.page-title.small { font-size: 17px; margin-top: 26px; }

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 20px;
    border: 1px solid var(--line);
}
.card h3 { margin: 0 0 14px; color: var(--purple-dark); font-size: 16px; }
.card.empty { text-align: center; color: var(--muted); padding: 44px 22px; }
.card.empty p { margin: 8px 0; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none !important;
    transition: filter .15s, transform .05s;
    font-family: inherit;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn-accent {
    background: linear-gradient(90deg, var(--purple), var(--blue));
    color: #fff;
    box-shadow: 0 4px 14px rgba(124, 108, 240, .35);
}
.btn-outline {
    background: #fff;
    color: var(--purple-dark);
    border: 1.5px solid var(--purple);
}
.btn-ghost {
    background: #f1eefc;
    color: var(--purple-dark);
    border: 1px solid var(--line);
    padding: 6px 14px;
    font-size: 13px;
}
/* 顶部渐变栏里的按钮: 白色半透明底 + 白字 */
.topbar .btn-ghost {
    background: rgba(255, 255, 255, .35);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .55);
}
.btn-ghost.plain { background: #f1eefc; color: var(--purple-dark); border: 1px solid var(--line); padding: 6px 14px; font-size: 13px; }
.btn-danger-ghost { background: #fdeef3; color: var(--danger); border: 1px solid #f7c6d6; padding: 6px 14px; font-size: 13px; }
.btn.full { width: 100%; margin-top: 6px; }

/* ---------- 软件卡片网格 ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}
.product-card {
    display: block;
    overflow: hidden;
    padding: 0;
    text-decoration: none !important;
    transition: transform .15s, box-shadow .15s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(124, 108, 240, .22); }
.thumb { height: 170px; background: linear-gradient(135deg, #e8e0ff, #dcebff); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-placeholder { font-size: 52px; font-weight: 700; color: rgba(124, 108, 240, .5); }
.pcard-body { padding: 14px 16px 16px; }
.pcard-body h3 { margin: 0 0 6px; font-size: 16px; color: var(--text); }
.pcard-intro { margin: 0 0 10px; font-size: 13px; color: var(--muted); min-height: 38px; }
.pcard-meta { display: flex; align-items: center; justify-content: space-between; }
.ver-tag {
    background: linear-gradient(90deg, var(--purple), var(--blue));
    color: #fff;
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 12.5px;
    font-weight: 600;
}
.date { font-size: 12px; color: var(--muted); }

/* ---------- 详情页 ---------- */
.hero-img {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    background: linear-gradient(135deg, #e8e0ff, #dcebff);
}
.hero-img img { display: block; width: 100%; max-height: 420px; object-fit: cover; }

.download-box { padding: 24px; }
.intro-box {
    padding: 20px 24px;
    font-size: 14px;
    line-height: 1.75;
    color: var(--text);
    margin-bottom: 20px;
    white-space: normal;
    word-break: break-word;
}
.dl-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
}
.dl-row:last-child { border-bottom: none; }
.dl-main { background: #f6f3ff; border-radius: 12px; padding: 14px 16px; border: 1px solid #e6dcff; }
.dl-info { min-width: 0; }
.dl-name { font-size: 15px; font-weight: 600; display: block; }
.dl-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; display: block; }

/* ---------- 后台 ---------- */
.notice { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 14px; }
.notice.ok { background: #eaf9f1; color: var(--ok); border: 1px solid #bfe8d2; }
.notice.danger { background: #fdeef3; color: var(--danger); border: 1px solid #f7c6d6; }

.table-card { padding: 6px 8px; overflow-x: auto; }
.mg-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mg-table th {
    text-align: left;
    padding: 12px 10px;
    color: var(--muted);
    font-weight: 600;
    border-bottom: 2px solid var(--line);
    white-space: nowrap;
}
.mg-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.mg-table tr:last-child td { border-bottom: none; }
.cell-title { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.cell-thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.code-chip {
    background: #efeaff;
    color: var(--purple-dark);
    border: 1px solid #ddd2ff;
    border-radius: 8px;
    padding: 2px 10px;
    font-size: 13px;
    letter-spacing: 1px;
}
.code-chip.big { font-size: 16px; padding: 5px 14px; }
.cell-actions { white-space: nowrap; }
.cell-actions .btn { margin: 2px 0; }
.log-cell { max-width: 360px; white-space: pre-wrap; }

/* ---------- 表单 ---------- */
.form-card label { display: block; font-size: 14px; font-weight: 600; margin: 16px 0 6px; color: #4a4568; }
.form-card input[type=text], .form-card input[type=password], .form-card textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fbfaff;
    color: var(--text);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.form-card input[type=text]:focus, .form-card input[type=password]:focus, .form-card textarea:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, .18);
}
.form-card input[type=file] { display: block; margin-top: 6px; font-size: 13px; }
.form-card .btn-accent { margin-top: 18px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 0; }

.item-row { display: flex; gap: 8px; margin-bottom: 8px; }
.item-row input[type=text] { flex: 1; }
.row-del { flex-shrink: 0; }

.current-img img { max-width: 200px; max-height: 120px; border-radius: 10px; margin-bottom: 8px; border: 1px solid var(--line); }

/* ---------- 登录页 ---------- */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.auth-card { width: 360px; padding: 30px 28px; }
.auth-card h1 { margin: 0 0 4px; font-size: 20px; color: var(--purple-dark); }
.auth-card label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 14px; color: #4a4568; }
.auth-card input[type=password] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    background: #fbfaff;
}
.auth-card input[type=password]:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(167, 139, 250, .18); }

/* ---------- 其他 ---------- */
.tbl-list { text-align: left; margin: 10px 0; }
.tbl-list li { font-family: Consolas, monospace; padding: 3px 0; }
.danger { color: var(--danger); }
.ok { color: var(--ok); }

.footer {
    text-align: center;
    color: var(--muted);
    font-size: 12.5px;
    padding: 22px 0 34px;
}
