/* 题引力题库站 —— 版式参考易考吧题库站，独立实现 */
:root {
    --primary: #2578f3;
    --primary-dark: #1a63d8;
    --primary-light: #eaf2ff;
    --danger: #e8384f;
    --orange: #ff6b00;
    --bg: #f1f3f7;
    --card: #fff;
    --text: #333;
    --text-2: #666;
    --muted: #a2a4a8;
    --line: #eceff5;
    --radius: 6px;
    --shadow: 0 2px 12px rgba(30, 45, 74, .08);
    --wrap: 1200px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.6 "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
ul { list-style: none; margin: 0; padding: 0; }
img { border: 0; display: block; }
input, select, button { font-family: inherit; font-size: 14px; }

.wrap { width: var(--wrap); margin: 0 auto; }
.clear { clear: both; }
.muted { color: var(--muted); }
.tc { text-align: center; }
.price { color: var(--danger); font-weight: 700; }
.price::before { content: "￥"; font-size: 12px; }
.nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line2 {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------------- 顶部 ---------------- */
.topnav { background: #fff; box-shadow: 0 1px 6px rgba(47, 47, 47, .12); }
.topnav .con { width: var(--wrap); margin: 0 auto; display: flex; justify-content: space-between; }
.topnav ul { display: flex; align-items: center; height: 46px; gap: 22px; font-size: 13px; color: var(--text-2); }
.topnav li { position: relative; }
.topnav li .navlist { display: none; }

header .mainso {
    width: var(--wrap); margin: 0 auto; padding: 18px 0;
    display: flex; align-items: center; gap: 30px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo .mark {
    width: 42px; height: 42px; border-radius: 10px; background: var(--primary);
    color: #fff; font-size: 20px; font-weight: 700; display: flex;
    align-items: center; justify-content: center; letter-spacing: -1px;
}
.logo .txt b { font-size: 22px; letter-spacing: 2px; display: block; line-height: 1.1; }
.logo .txt span { font-size: 12px; color: var(--muted); }

.search-t { flex: 1; display: flex; align-items: center; gap: 16px; }
.search-t form { flex: 1; display: flex; height: 40px; }
.search-t input[type=text] {
    flex: 1; height: 40px; border: 2px solid var(--primary); border-right: 0;
    border-radius: 4px 0 0 4px; padding: 0 12px; outline: none;
}
.search-t button {
    width: 92px; border: 0; background: var(--primary); color: #fff; cursor: pointer;
    border-radius: 0 4px 4px 0; font-size: 15px;
}
.search-t button:hover { background: var(--primary-dark); }
.shop_cart {
    height: 40px; padding: 0 18px; border: 1px solid var(--line); background: #fff;
    border-radius: 4px; display: flex; align-items: center; gap: 6px; color: var(--primary);
}

.mainnav { background: var(--primary); }
.mainnav .wrap { display: flex; }
.mainnav a {
    display: block; padding: 0 30px; height: 42px; line-height: 42px; color: #fff; font-size: 15px;
}
.mainnav a:hover, .mainnav a.on { background: var(--primary-dark); color: #fff; }

/* ---------------- 首屏分类 ---------------- */
.hbanner { width: var(--wrap); margin: 18px auto 0; display: flex; gap: 14px; }
.hbanner_left { width: 210px; flex: 0 0 210px; background: #fff; border-radius: var(--radius); overflow: hidden; }
.hbanner_left_header { background: var(--primary); color: #fff; padding: 12px 16px; font-size: 16px; font-weight: 700; }
.left_list li a {
    display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 42px;
    border-bottom: 1px solid var(--line); font-size: 14px;
}
.left_list li:last-child a { border-bottom: 0; }
.left_list li a:hover, .left_list li a.active { background: var(--primary-light); color: var(--primary); }
.left_list .ico {
    width: 20px; height: 20px; border-radius: 4px; background: var(--primary-light);
    color: var(--primary); font-size: 12px; display: flex; align-items: center; justify-content: center;
}
.left_list .n { margin-left: auto; font-size: 12px; color: var(--muted); }

.hbanner_right { flex: 1; background: #fff; border-radius: var(--radius); padding: 16px 18px; }
.right_list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 26px; }
.right_list_item { display: flex; gap: 12px; padding: 8px 0; }
.letter_num { width: 54px; flex: 0 0 54px; }
.letter_title {
    display: block; background: var(--primary-light); color: var(--primary);
    text-align: center; border-radius: 4px; font-weight: 700; padding: 3px 0; font-size: 13px;
}
.letlter_list_ul { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.letlter_list_li a { font-size: 13px; color: var(--text-2); }
.letlter_list_li a:hover { color: var(--primary); }

.hbanner_right_bottom { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 10px; display: flex; gap: 20px; }
.think_you_need { flex: 1; }
.think_you_need h4 { margin: 0 0 8px; font-size: 15px; }
.right_bottom_content { display: flex; gap: 12px; }
.hbanner_pordect_footer img { width: 76px; height: 76px; object-fit: cover; border-radius: 4px; }
.hbanner_prodect_title p { margin: 0 0 6px; font-size: 13px; }
.hbanner_prodect_footer_box p { margin: 0; font-size: 12px; color: var(--muted); }
.QR_code { width: 130px; flex: 0 0 130px; text-align: center; font-size: 12px; color: var(--muted); }
.QR_code .qr {
    width: 96px; height: 96px; margin: 0 auto 6px; border: 1px solid var(--line); border-radius: 6px;
    display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted);
    background: #fafbfd;
}

/* ---------------- 通用区块 ---------------- */
.mslist { width: var(--wrap); margin: 18px auto 0; }
.block { background: #fff; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.block_title {
    display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; margin-bottom: 14px;
}
.block_title .bar { width: 4px; height: 18px; background: var(--primary); border-radius: 2px; }
.block_title .more { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--muted); }

.grid5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.grid6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.card {
    background: #fff; border-radius: var(--radius); border: 1px solid var(--line);
    overflow: hidden; transition: .18s; display: block;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #d9e6fb; }
.card .pic { width: 100%; aspect-ratio: 1/1; background: #f7f9fc; object-fit: cover; }
.card .body { padding: 10px 12px 12px; }
.card .t { font-size: 13px; height: 40px; margin: 0 0 6px; line-height: 1.45; }
.card .meta { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.card .btn-buy {
    background: var(--primary); color: #fff; border-radius: 4px; padding: 4px 12px; font-size: 13px;
}
.card .btn-buy:hover { background: var(--primary-dark); color: #fff; }

/* ---------------- 列表页筛选 ---------------- */
.filter { background: #fff; border-radius: var(--radius); padding: 12px 18px; margin-bottom: 14px; }
.filter .row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.filter .row:last-child { border-bottom: 0; }
.filter .lb { width: 62px; flex: 0 0 62px; color: var(--muted); font-size: 13px; padding-top: 3px; }
.filter .opts { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.filter .opts a {
    padding: 3px 12px; border-radius: 14px; font-size: 13px; color: var(--text-2); white-space: nowrap;
}
.filter .opts a:hover { color: var(--primary); }
.filter .opts a.on { background: var(--primary); color: #fff; }
.sortbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 13px; }
.sortbar a { padding: 4px 14px; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.sortbar a.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.count { margin-left: auto; color: var(--muted); }

.pager { display: flex; gap: 6px; justify-content: center; padding: 24px 0; }
.pager a, .pager span {
    min-width: 34px; height: 34px; line-height: 34px; text-align: center; background: #fff;
    border: 1px solid var(--line); border-radius: 4px; font-size: 13px; color: var(--text-2);
}
.pager a:hover { border-color: var(--primary); color: var(--primary); }
.pager .on { background: var(--primary); color: #fff; border-color: var(--primary); }

.empty { padding: 60px 0; text-align: center; color: var(--muted); }

/* ---------------- 详情 ---------------- */
.detail { display: flex; gap: 18px; }
.detail .left { flex: 1; background: #fff; border-radius: var(--radius); padding: 20px; }
.detail .right { width: 300px; flex: 0 0 300px; }
.dhead { display: flex; gap: 20px; }
.dhead .pic { width: 190px; height: 190px; object-fit: cover; border-radius: 8px; background: #f7f9fc; }
.dhead .info { flex: 1; }
.dhead h1 { font-size: 20px; margin: 0 0 12px; line-height: 1.4; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tag { background: var(--primary-light); color: var(--primary); padding: 2px 10px; border-radius: 3px; font-size: 12px; }
.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 20px; font-size: 13px; color: var(--text-2); margin-bottom: 14px; }
.kv b { color: var(--text); font-weight: 400; }
.buybox { background: #fffaf5; border: 1px solid #ffe0bd; border-radius: 8px; padding: 16px; }
.buybox .p { font-size: 30px; color: var(--danger); font-weight: 700; }
.btn {
    display: block; text-align: center; border-radius: 6px; padding: 12px; font-size: 16px;
    border: 0; cursor: pointer; margin-top: 12px;
}
.btn-primary { background: var(--danger); color: #fff; }
.btn-primary:hover { background: #cf2b40; color: #fff; }
.btn-ghost { background: var(--primary-light); color: var(--primary); }
.btn-ghost:hover { background: #dbe9ff; }

.side-box { background: #fff; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.side-box h4 { margin: 0 0 10px; font-size: 15px; }
.side-list li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.side-list li:last-child { border-bottom: 0; }

.doc { font-size: 14px; line-height: 1.9; color: var(--text-2); }
.doc h3 { color: var(--text); font-size: 15px; margin: 16px 0 6px; }

/* ---------------- 底部四栏 ---------------- */
.footcols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.footcols h3 { font-size: 15px; margin: 0 0 10px; }
.footcols li { font-size: 13px; color: var(--text-2); padding: 4px 0; }

footer { background: #2b3445; color: #aab4c6; margin-top: 26px; padding: 26px 0 18px; font-size: 13px; }
footer .wrap { text-align: center; line-height: 2; }
footer a { color: #cfd8e6; }

/* ---------------- 后台 ---------------- */
.admin-wrap { width: 1100px; margin: 20px auto; }
.admin-bar { background: #fff; border-radius: var(--radius); padding: 12px 18px; margin-bottom: 14px; display: flex; align-items: center; gap: 14px; }
.admin-bar h2 { margin: 0; font-size: 18px; }
.btn-sm { background: var(--primary); color: #fff; border: 0; border-radius: 4px; padding: 7px 16px; cursor: pointer; }
.btn-sm:hover { background: var(--primary-dark); color: #fff; }
.btn-sm.gray { background: #8a93a3; }
table.tbl { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
table.tbl th, table.tbl td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
table.tbl th { background: #fafbfd; color: var(--text-2); font-weight: 400; white-space: nowrap; }
table.tbl td select, table.tbl td input[type=number] { padding: 3px 6px; border: 1px solid var(--line); border-radius: 3px; }
.alert { background: var(--primary-light); color: var(--primary); padding: 10px 16px; border-radius: 4px; margin-bottom: 12px; font-size: 13px; }
.login-box { width: 360px; margin: 90px auto; background: #fff; border-radius: 8px; padding: 30px; box-shadow: var(--shadow); }
.login-box h2 { margin: 0 0 18px; text-align: center; }
.login-box input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 4px; padding: 0 12px; margin-bottom: 12px; outline: none; }
.login-box .err { color: var(--danger); font-size: 13px; margin-bottom: 10px; text-align: center; }

@media (max-width: 1240px) {
    .wrap, .hbanner, .mslist, .mainnav .wrap, .topnav .con, header .mainso { width: 96%; }
    .grid5 { grid-template-columns: repeat(4, 1fr); }
    .grid6 { grid-template-columns: repeat(4, 1fr); }
    .admin-wrap { width: 96%; }
}
