/* public_ui.css - modern responsive skin for the public site pages.
   Load after css/dyxsoft.css. Pages that adopt it add class="pub" on <body>
   and wrap content in .pub-header / .pub-container. Purple / gold / black. */

:root {
    --ink: #140C1F;
    --ink-2: #241539;
    --purple: #4A3082;
    --purple-2: #673C81;
    --gold: #C9A227;
    --gold-l: #E3C24E;
    --gold-text: #8A6A1F;
    --bg: #F4F2F7;
    --panel: #FFFFFF;
    --line: #E6E1EE;
    --text: #2F2A3A;
    --muted: #8B7FA6;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.pub {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.7 "Microsoft YaHei", "Segoe UI", SimSun, sans-serif;
}

body.pub a { color: var(--purple-2); text-decoration: none; }
body.pub a:hover { color: var(--gold-text); text-decoration: none; }
body.pub img { max-width: 100%; }
body.pub table { max-width: 100%; }

/* ---------- header ---------- */

.pub-header {
    background: linear-gradient(90deg, #120C1A 0%, #241539 55%, #2B1650 100%);
    border-bottom: 2px solid var(--gold);
    color: #fff;
}

.pub-header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.pub-brand { display: flex; align-items: center; gap: 12px; }
.pub-brand img { height: 46px; width: auto; display: block; }
.pub-brand .slogan { font-size: 11px; color: #C9B8E0; letter-spacing: 2px; }

.pub-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-left: auto;
}

.pub-nav a {
    color: #CFC3E6;
    font-size: 13px;
    padding: 7px 11px;
    border-radius: 6px;
    white-space: nowrap;
}

.pub-nav a:hover { color: #F2D98A; background: rgba(212,175,55,.10); }
.pub-nav a.on { color: #F2D98A; background: rgba(212,175,55,.14); font-weight: 600; }

/* ---------- layout ---------- */

.pub-container {
    max-width: 1180px;
    margin: 18px auto 28px;
    padding: 0 18px;
}

.pub-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 288px;
    gap: 18px;
    align-items: start;
}

.pub-layout.no-aside { grid-template-columns: minmax(0, 1fr); }

.pub-aside { display: flex; flex-direction: column; gap: 16px; }

/* ---------- panels ---------- */

.pub-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(20, 12, 31, .05);
    overflow: hidden;
    margin-bottom: 16px;
}

.pub-panel-hd {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 12px 18px;
    background: #FBFAFD;
    border-bottom: 1px solid var(--line);
    color: var(--purple);
    font-size: 15px;
    font-weight: 600;
}

.pub-panel-hd::before {
    content: "";
    width: 3px;
    height: 15px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--gold-l), var(--gold));
    margin-right: 2px;
    flex: none;
}

.pub-panel-hd .more { font-size: 12px; font-weight: 400; color: var(--muted); }
.pub-panel-hd .more,
.pub-panel-hd .meta,
.pub-panel-hd .right { margin-left: auto; }

.pub-panel-bd { padding: 18px; }
.pub-panel-bd.tight { padding: 12px; }
.pub-panel-bd.flush { padding: 0; }

/* ---------- auth box (aside) ---------- */

.pub-auth .pub-panel-bd { padding: 16px 18px; }
.pub-auth .field { margin-bottom: 12px; }
.pub-auth label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.pub-auth .row { display: flex; gap: 8px; }
.pub-auth .row > * { flex: 1; }
.pub-auth .links { display: flex; justify-content: space-between; font-size: 12px; margin-top: 10px; }
.pub-auth .who { font-size: 13px; color: var(--text); line-height: 1.9; }
.pub-auth .who b { color: var(--purple); }

/* ---------- forms ---------- */

.pub-field { margin-bottom: 16px; }
.pub-field > label,
.pub-label {
    display: block;
    font-size: 13px;
    color: #5B4A78;
    font-weight: 600;
    margin-bottom: 6px;
}

.pub-input,
.pub-select,
.pub-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #D8D0E4;
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font: 14px/1.5 "Microsoft YaHei", "Segoe UI", SimSun, sans-serif;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.pub-input:focus,
.pub-select:focus,
.pub-textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, .16);
}

.pub-textarea { min-height: 140px; resize: vertical; }

.pub-help { font-size: 12px; color: var(--muted); margin-top: 5px; }
.pub-error { color: #C0392B; font-size: 13px; }
.pub-ok { color: #1E8449; font-size: 13px; }

.pub-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- buttons ---------- */

.pub-btn {
    display: inline-block;
    padding: 9px 20px;
    border: 1px solid var(--gold);
    border-radius: 6px;
    background: linear-gradient(180deg, #D9B94A, #C9A227);
    color: #241040 !important;
    font: 600 14px/1.4 "Microsoft YaHei", "Segoe UI", SimSun, sans-serif;
    cursor: pointer;
    text-align: center;
    transition: filter .15s, transform .1s;
}

.pub-btn:hover { filter: brightness(.94); color: #140C1F !important; }
.pub-btn:active { transform: translateY(1px); }

.pub-btn-outline {
    background: #fff;
    border-color: #D8D0E4;
    color: var(--purple) !important;
    font-weight: 500;
}

.pub-btn-outline:hover { border-color: var(--gold); background: #FBF8F0; }
.pub-btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 5px; }
.pub-btn-block { width: 100%; }

/* ---------- tables ---------- */

.pub-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.pub-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pub-table th {
    background: #2B1650;
    color: #F2D98A;
    font-weight: 600;
    text-align: left;
    padding: 10px 12px;
    white-space: nowrap;
}
.pub-table td { padding: 10px 12px; border-bottom: 1px solid #F0ECF7; }
.pub-table tr:hover td { background: #FAF8F4; }

/* ---------- software grid ---------- */

.pub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 16px;
}

.pub-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    transition: box-shadow .15s, transform .15s;
}

.pub-card:hover { box-shadow: 0 8px 22px rgba(74, 48, 130, .10); transform: translateY(-2px); }

.pub-card .thumb {
    display: block;
    width: 100%;
    height: 120px;
    border-radius: 7px;
    background: #F6F3FA center/cover no-repeat;
    margin-bottom: 9px;
    overflow: hidden;
}

.pub-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pub-card .title {
    display: block;
    font-size: 13px;
    color: var(--text);
    font-weight: 600;
    line-height: 1.45;
    min-height: 38px;
    overflow: hidden;
}

.pub-card .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.pub-card .price { color: var(--gold-text); font-weight: 600; }

.pub-badge {
    display: inline-block;
    padding: 0 7px;
    border-radius: 9px;
    background: #F1EAF8;
    color: var(--purple);
    font-size: 11px;
    line-height: 18px;
    vertical-align: 1px;
}

.pub-badge.hot { background: #FDECEC; color: #C0392B; }

/* ---------- list rows (news / ranking) ---------- */

.pub-list { list-style: none; margin: 0; padding: 0; }
.pub-list li {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px dashed #EEE9F4;
    font-size: 13px;
}
.pub-list li:last-child { border-bottom: 0; }
.pub-list .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-list .n { color: var(--muted); font-size: 12px; }
.pub-list .idx {
    width: 18px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    flex: none;
}
.pub-list .idx.top { color: #C0392B; font-weight: 700; }

/* ---------- pagination (legacy DBSql.GetPage markup) ---------- */

.p_bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    padding: 14px 0 2px;
}

.p_bar a {
    display: inline-block;
    min-width: 24px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fff;
    color: var(--purple-2) !important;
    font-size: 12px;
    text-align: center;
    line-height: 1.6;
}

.p_bar a:hover { background: #FBF8F0; border-color: var(--gold); }
.p_bar .p_curpage {
    background: linear-gradient(180deg, #D9B94A, #C9A227);
    border-color: var(--gold);
    color: #241040 !important;
    font-weight: 600;
}
.p_bar .p_total,
.p_bar .p_pages {
    border: none;
    background: transparent;
    color: var(--muted) !important;
}
.p_input {
    width: 46px;
    height: 28px;
    padding: 2px 6px;
    border: 1px dashed #D8D0E4;
    border-radius: 5px;
    background: #FBFAFD;
    color: var(--purple-2);
    font-size: 12px;
    text-align: center;
}
.p_input:focus { border-style: solid; border-color: var(--gold); background: #fff; outline: none; }

/* ---------- empty state ---------- */

.pub-empty {
    padding: 46px 20px;
    text-align: center;
    color: var(--muted);
}
.pub-empty .icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #F3EEFA;
    border: 1px solid var(--line);
}
.pub-empty .ttl { font-size: 15px; color: #5B4A78; font-weight: 600; margin-bottom: 6px; }

/* ---------- footer ---------- */

.pub-footer {
    background: #120C1A;
    border-top: 2px solid var(--gold);
    color: #A99BC4;
    font-size: 12px;
    text-align: center;
    padding: 18px 14px;
    line-height: 1.9;
}
.pub-footer a { color: #C9B8E0 !important; }
.pub-footer a:hover { color: var(--gold-l) !important; }

/* ---------- utility ---------- */

.pub-muted { color: var(--muted); }
.pub-center { text-align: center; }
.pub-right { text-align: right; }
.pub-mt { margin-top: 16px; }
.pub-mb { margin-bottom: 16px; }
.pub-nowrap { white-space: nowrap; }

/* ---------- responsive ---------- */

@media (max-width: 980px) {
    .pub-layout { grid-template-columns: minmax(0, 1fr); }
    .pub-aside { order: 2; }
}

@media (max-width: 720px) {
    body.pub { font-size: 15px; }

    .pub-header-inner { padding: 10px 12px; gap: 10px; }

    .pub-brand img { height: 38px; }

    .pub-nav {
        width: 100%;
        margin-left: 0;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .pub-nav::-webkit-scrollbar { display: none; }
    .pub-nav a { padding: 6px 10px; font-size: 14px; }

    .pub-container { padding: 0 12px; margin-top: 12px; }

    .pub-panel-bd { padding: 14px; }

    .pub-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
    .pub-card .thumb { height: 100px; }

    .pub-table th, .pub-table td { padding: 8px; }

    .pub-btn { padding: 9px 16px; }
}

/* ---------- vip badge (shared) ---------- */
.vip-badge { display: inline-flex; align-items: center; gap: 4px; min-width: 46px; height: 18px; padding: 0 6px; border-radius: 4px; background: linear-gradient(135deg, rgba(217,184,74,.26), rgba(142,91,184,.18)); border: 1px solid rgba(217,184,74,.46); color: #8A6A1F; font-size: 9px; font-weight: 800; letter-spacing: .5px; white-space: nowrap; flex: 0 0 auto; }
.vip-badge svg { display: block; width: 10px; height: 10px; flex: 0 0 auto; }
.vip-badge.vip-0 { color: #7d7090; background: rgba(74,48,130,.06); border-color: rgba(74,48,130,.18); }
.vip-badge.vip-4, .vip-badge.vip-5, .vip-badge.vip-6 { color: #8A6A1F; border-color: rgba(201,162,39,.72); box-shadow: 0 0 10px rgba(201,162,39,.16); }
