/* ============ 极软商城 · 共享样式 ============ */
:root {
    --primary: #3b5bfd;
    --primary-2: #6e8bff;
    --primary-dark: #2a44d6;
    --grad-primary: linear-gradient(120deg, #3b5bfd 0%, #6e8bff 100%);
    --grad-gold: linear-gradient(120deg, #f7b733 0%, #fc4a1a 100%);
    --accent: #ff7a45;
    --success: #00b894;
    --danger: #e33;
    --bg: #f4f6fb;
    --card: #ffffff;
    --border: #e7eaf3;
    --text: #1c2333;
    --text-2: #535a6e;
    --text-3: #9aa1b5;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(35, 55, 150, .08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* 顶栏 */
.top-bar { background: #171d33; color: #c8cee6; font-size: 12px; padding: 8px 0; }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.top-bar a { color: #c8cee6; margin-left: 14px; transition: color .2s; }
.top-bar a:hover { color: #fff; }
.top-bar i { margin-right: 4px; }

/* 导航 */
.header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header .container { display: flex; align-items: center; gap: 26px; height: 66px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 900; flex-shrink: 0; }
.logo em { font-style: normal; color: var(--primary); }
.logo-icon {
    width: 38px; height: 38px; border-radius: 11px; background: var(--grad-primary);
    display: grid; place-items: center; color: #fff; font-size: 17px;
    box-shadow: 0 6px 16px rgba(59,91,253,.35);
}
.nav-menu { display: flex; align-items: center; gap: 2px; flex: 1; white-space: nowrap; }
.nav-menu a {
    display: inline-flex; align-items: center;
    padding: 8px 12px; border-radius: 9px; color: var(--text-2);
    font-weight: 500; font-size: 14px; transition: all .2s; position: relative;
}
.nav-menu a i { margin-right: 4px; font-size: 13px; }
.nav-menu a:hover { color: var(--primary); background: rgba(59,91,253,.07); }
.nav-menu a.active { color: var(--primary); font-weight: 600; }
.nav-menu a.active::after {
    content: ''; position: absolute; left: 50%; transform: translateX(-50%);
    bottom: 2px; width: 20px; height: 3px; border-radius: 3px; background: var(--grad-primary);
}
.header-search {
    flex: 1 1 200px; max-width: 320px; min-width: 0; display: flex; align-items: center;
    background: var(--bg); border: 1px solid var(--border); border-radius: 40px;
    padding: 4px 6px 4px 16px; transition: all .25s;
}
.header-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(59,91,253,.12); background: #fff; }
.header-search i { color: var(--text-3); font-size: 13px; flex: none; }
.header-search input { flex: 1; min-width: 0; border: none; background: transparent; padding: 8px 8px; font-size: 13px; color: var(--text); outline: none; font-family: inherit; }
.header-search input::placeholder { color: var(--text-3); }
.header-search button {
    border: none; background: var(--grad-primary); color: #fff; padding: 8px 16px;
    border-radius: 30px; cursor: pointer; font-size: 13px; font-weight: 600;
    white-space: nowrap; flex: none; transition: opacity .2s; font-family: inherit;
}
.header-search button:hover { opacity: .9; }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }
.avatar-btn {
    width: 36px; height: 36px; border-radius: 50%; background: var(--grad-primary);
    color: #fff; display: grid; place-items: center; font-weight: 700;
}

/* 按钮 */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid var(--border); background: #fff; color: var(--text);
    padding: 10px 22px; border-radius: 12px; font-weight: 700; cursor: pointer;
    font-size: 13px; font-family: inherit; transition: all .2s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--grad-primary); color: #fff; border: none; box-shadow: 0 8px 20px rgba(59,91,253,.3); }
.btn-primary:hover { color: #fff; opacity: .9; transform: translateY(-1px); }
.btn-gold { background: var(--grad-gold); color: #fff; border: none; box-shadow: 0 8px 20px rgba(252,74,26,.3); }
.btn-gold:hover { color: #fff; opacity: .9; }
.btn-outline { background: transparent; }
.btn-sm { padding: 7px 16px; font-size: 12px; border-radius: 10px; }
.btn-lg { padding: 13px 32px; font-size: 15px; border-radius: 14px; }

/* 通用卡片 */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }

/* 区块标题 */
.sec-head { display: flex; align-items: center; justify-content: space-between; margin: 34px 0 18px; }
.sec-head h2 { font-size: 22px; font-weight: 900; display: flex; align-items: center; gap: 10px; }
.sec-head h2 i { color: var(--primary); }
.sec-head .more { font-size: 13px; color: var(--text-3); font-weight: 600; }
.sec-head .more:hover { color: var(--primary); }

/* 标签 */
.tag {
    display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px;
    border-radius: 6px; background: #eef1ff; color: var(--primary);
}
.tag.hot { background: #fff2ec; color: #e8552e; }
.tag.free { background: #e6f9f1; color: #009f6e; }
.tag.new { background: #fff7e6; color: #c77b00; }

/* 软件卡片 */
.sw-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.sw-card {
    background: #fff; border: 1px solid var(--border); border-radius: 16px;
    padding: 20px; transition: all .25s; position: relative; display: block;
}
.sw-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(35,55,150,.12); border-color: var(--primary-2); }
.sw-card .sc-top { display: flex; gap: 13px; align-items: center; }
.sw-card .sc-icon {
    width: 56px; height: 56px; border-radius: 15px; flex-shrink: 0;
    display: grid; place-items: center; color: #fff; font-size: 23px; font-weight: 800;
}
.sw-card .sc-name { font-size: 15px; font-weight: 800; }
.sw-card .sc-ver { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.sw-card .sc-desc {
    font-size: 12px; color: var(--text-3); line-height: 1.7; margin: 12px 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px;
}
.sw-card .sc-foot { display: flex; align-items: center; justify-content: space-between; }
.sw-card .sc-rating { font-size: 12px; color: var(--text-3); }
.sw-card .sc-rating i { color: #f7b733; margin-right: 3px; }
.sw-card .sc-price { font-size: 17px; font-weight: 900; color: var(--danger); }
.sw-card .sc-price.free-p { color: var(--success); font-size: 14px; }
.sw-card .sc-price small { font-size: 11px; color: var(--text-3); font-weight: 500; }
.sw-card .sc-tags { position: absolute; top: 14px; right: 14px; display: flex; gap: 5px; }

/* 面包屑 */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); padding: 22px 0 0; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb i { font-size: 10px; color: var(--text-3); }
.breadcrumb .cur { color: var(--text); font-weight: 600; }

/* 筛选胶囊 */
.f-pill {
    border: 1px solid var(--border); background: #fff; color: var(--text-2);
    font-size: 12px; font-weight: 600; padding: 5px 15px; border-radius: 20px;
    cursor: pointer; transition: all .2s; font-family: inherit;
}
.f-pill:hover { border-color: var(--primary); color: var(--primary); }
.f-pill.active { background: var(--grad-primary); color: #fff; border-color: transparent; }

/* 页脚 */
.footer { background: #171d33; color: #8d94b0; margin-top: 44px; padding: 44px 0 0; font-size: 13px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 34px; padding-bottom: 30px; }
.footer .logo { color: #fff; }
.footer p { margin-top: 14px; line-height: 1.9; font-size: 12px; }
.footer h5 { color: #fff; font-size: 14px; margin-bottom: 14px; }
.footer-links li { margin-bottom: 9px; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid #262d4a; padding: 16px 0; display: flex;
    justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 12px;
}
.footer-bottom a { margin-left: 16px; }
.footer-bottom a:hover { color: #fff; }

/* 移动端菜单 */
.hamburger { display: none; border: none; background: none; font-size: 19px; cursor: pointer; color: var(--text); }
.mobile-menu {
    display: none; background: #fff; border-bottom: 1px solid var(--border); padding: 14px 20px; flex-direction: column; gap: 4px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a { padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.mobile-menu a:hover, .mobile-menu a.active { background: #eef1ff; color: var(--primary); }
.m-search { display: flex; gap: 8px; align-items: center; background: var(--bg); border-radius: 20px; padding: 9px 15px; margin-bottom: 8px; }
.m-search input { border: none; background: none; outline: none; flex: 1; font-family: inherit; font-size: 13px; }
.m-actions { display: flex; gap: 10px; margin-top: 10px; }

/* 响应式 */
@media (max-width: 1024px) {
    .nav-menu, .header-search { display: none; }
    .hamburger { display: block; }
    .sw-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .sw-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .footer-grid { grid-template-columns: 1fr; }
    .header-actions .btn { display: none; }
}

/* ============ 左侧广告位（HTML 标记：.lad-rail，数据由数据库写入） ============ */
.lad-rail {
    position: fixed; left: 14px; top: 50%; transform: translateY(-50%);
    width: 279px; z-index: 880; max-height: 94vh; overflow-y: auto;
    scrollbar-width: none; -ms-overflow-style: none;
}
.lad-rail::-webkit-scrollbar { display: none; }
.lad-box {
    background: #fff; border: 1px solid #e8ebf5; border-radius: 16px;
    padding: 12px 10px; box-shadow: 0 8px 24px rgba(23,29,51,.08);
}
.lad-title { font-size: 11px; color: #8b93b0; text-align: center; margin: 2px 0 10px; letter-spacing: 4px; font-weight: 600; }
.lad-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* 图片广告位：可整块替换为 <a class="lad-img"><img src="..."></a> */
.lad-img {
    position: relative; display: block; width: 100%; height: 62px; border-radius: 11px;
    overflow: hidden; cursor: pointer; text-decoration: none;
    transition: transform .2s, box-shadow .2s;
}
.lad-img:hover { transform: scale(1.07); box-shadow: 0 8px 18px rgba(23,29,51,.25); z-index: 2; }
.lad-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lad-img span {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
    justify-content: center; color: #fff; font-size: 12px; font-weight: 700; gap: 3px;
    padding: 0 2px; text-align: center;
}
.lad-img span i { font-size: 16px; opacity: .9; }
.lad-img em {
    position: absolute; top: 0; right: 0; background: rgba(0,0,0,.32); color: #fff;
    font-size: 9px; padding: 1px 5px; border-radius: 0 0 0 8px; font-style: normal; font-weight: 400;
}
.lad-text { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 6px; }
.lad-text a {
    font-size: 12px; color: #4a5578; text-decoration: none; text-align: center; padding: 6px 0;
    border-radius: 8px; transition: all .15s; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; cursor: pointer;
}
.lad-text a:hover { color: var(--primary); background: #eef1fd; transform: translateY(-1px); }
.lad-div { height: 1px; background: linear-gradient(90deg, transparent, #e2e7f5, transparent); margin: 12px 0 10px; }
@media (max-width: 1620px) { .lad-rail { display: none; } }
