/* 中医方剂大全 —— 前台样式（宣纸 / 宋体 / 朱红，与说文解字、中草药库一致） */
.fj-wrap {
    font-family: "Songti SC", "STSong", "SimSun", serif;
    color: var(--brown, #5a4430);
    max-width: 1120px;
    margin: 0 auto;
    padding: 6px 0 30px;
}
.fj-wrap .page-title {
    text-align: center;
    margin: 0 0 8px;
    color: var(--dark-red, #8c2323);
    font-size: 28px;
    letter-spacing: 5px;
    font-weight: 400;
}
.fj-hero { padding: 4px 0 18px; }
.fj-wrap .page-sub {
    text-align: center;
    color: #9a8b78;
    font-size: 13px;
    letter-spacing: 1px;
    margin: 0;
    line-height: 1.9;
}
.fj-wrap .page-sub b { color: var(--dark-red, #8c2323); font-weight: 400; }

/* ---------------- 搜索 ---------------- */
.fj-search {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px;
    margin: 6px 0 16px;
    background: rgba(255, 253, 245, .9);
    border: 1px solid var(--border-line, #d9cbb8);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(90, 68, 48, .04);
}
.fj-search-box { position: relative; flex: 1 1 320px; min-width: 0; display: flex; align-items: center; }
.fj-search-ico { position: absolute; left: 14px; font-size: 14px; opacity: .45; }
.fj-search input[type=text] {
    width: 100%;
    padding: 13px 38px 13px 38px;
    border: 1px solid var(--border-line, #d9cbb8);
    border-radius: 8px;
    background: #fff;
    color: var(--brown, #5a4430);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.fj-search input[type=text]::placeholder { color: #b8ab99; font-size: 13px; }
.fj-search input[type=text]:focus {
    border-color: var(--light-gold, #c8a878);
    box-shadow: 0 0 0 3px rgba(200, 168, 120, .18);
}
.fj-search-clear {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    width: 20px; height: 20px; line-height: 18px; text-align: center;
    border-radius: 50%; background: #efe7da; color: #8b7355;
    text-decoration: none; font-size: 14px;
}
.fj-search-clear:hover { background: var(--dark-red, #8c2323); color: #fff; }
.fj-search-btn {
    padding: 13px 30px;
    background: var(--dark-red, #8c2323);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    letter-spacing: 3px;
    cursor: pointer;
    font-family: inherit;
    transition: background .2s, transform .2s;
}
.fj-search-btn:hover { background: #6d1a1a; transform: translateY(-1px); }
.fj-random-btn {
    padding: 12px 18px;
    background: #fffdf8;
    border: 1px solid var(--border-line, #d9cbb8);
    border-radius: 8px;
    color: var(--brown, #5a4430);
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
    transition: all .2s;
}
.fj-random-btn:hover { border-color: var(--light-gold, #c8a878); color: var(--dark-red, #8c2323); background: #fff; }

/* ---------------- 统计 ---------------- */
.fj-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 0 0 16px;
}
.fj-stat {
    padding: 14px 8px 12px;
    text-align: center;
    background: linear-gradient(180deg, #fffdf7, #f8f2e6);
    border: 1px solid #ece0cc;
    border-radius: 10px;
}
.fj-stat b {
    display: block;
    font-size: 22px;
    font-weight: 400;
    color: var(--dark-red, #8c2323);
    letter-spacing: 1px;
    font-family: "Songti SC", "STSong", serif;
}
.fj-stat span { font-size: 11px; color: #9a8b78; letter-spacing: 1px; }

/* ---------------- 拼音索引 ---------------- */
.fj-letter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px;
    padding: 10px;
    margin: 0 0 10px;
    background: rgba(255, 253, 245, .92);
    border: 1px solid var(--border-line, #d9cbb8);
    border-radius: 10px;
}
.fj-letter a, .fj-letter .fj-lf-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 27px;
    height: 27px;
    padding: 0 4px;
    border: 1px solid var(--border-line, #d9cbb8);
    border-radius: 5px;
    background: #fff;
    color: var(--brown, #5a4430);
    font-size: 13px;
    line-height: 1;
    text-decoration: none;
    font-family: "Times New Roman", serif;
    transition: all .18s;
}
.fj-letter a:hover { border-color: var(--light-gold, #c8a878); color: var(--dark-red, #8c2323); background: #fffcf5; }
.fj-letter a.active {
    background: var(--dark-red, #8c2323);
    border-color: var(--dark-red, #8c2323);
    color: #fff;
    box-shadow: 0 2px 8px rgba(140, 35, 35, .25);
}
.fj-letter a.lf-all, .fj-letter .fj-lf-all {
    min-width: 44px;
    letter-spacing: 2px;
    font-family: inherit;
    font-size: 12px;
}
.fj-letter a i {
    font-style: normal;
    font-size: 9px;
    opacity: .45;
    margin-left: 2px;
    transform: translateY(1px);
}
.fj-letter a.active i { opacity: .7; }
.fj-letter .fj-lf-empty { color: #cfc3b1; background: #faf7f0; border-style: dashed; }

/* ---------------- 功效分类 ---------------- */
.fj-cats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.fj-cats-lab {
    font-size: 11px;
    color: #a8977f;
    letter-spacing: 3px;
    padding-right: 4px;
    border-right: 1px solid #e6dbc9;
    margin-right: 2px;
}
.fj-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 5px 11px;
    border: 1px solid #e6dbc9;
    border-radius: 20px;
    background: #fffdf8;
    color: #6b5b48;
    font-size: 13px;
    text-decoration: none;
    transition: all .2s;
}
.fj-chip i { font-style: normal; font-size: 10px; color: #b9a88f; }
.fj-chip:hover { border-color: var(--light-gold, #c8a878); color: var(--dark-red, #8c2323); }
.fj-chip.is-cur {
    background: rgba(140, 35, 35, .06);
    border-color: var(--dark-red, #8c2323);
    color: var(--dark-red, #8c2323);
    font-weight: 700;
}
.fj-chip.is-cur i { color: #b06a6a; }

/* ---------------- 结果头 ---------------- */
.fj-res-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin: 14px 0 12px;
    padding-bottom: 9px;
    border-bottom: 1px dashed var(--border-line, #d9cbb8);
    font-size: 13px;
    color: #8b7355;
    letter-spacing: .5px;
}
.fj-res-head b { color: var(--dark-red, #8c2323); font-weight: 400; font-size: 15px; }
.fj-res-head .fj-kw { color: var(--dark-red, #8c2323); }
.fj-res-page { font-size: 12px; color: #a8977f; }

/* ---------------- 方剂卡片 ---------------- */
.fj-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.fj-card {
    position: relative;
    background: #fffdf8;
    border: 1px solid #e6dbc9;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow .25s, transform .25s, border-color .25s;
}
.fj-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--light-gold, #c8a878), rgba(200, 168, 120, .25));
    opacity: 0;
    transition: opacity .25s;
}
.fj-card:hover {
    border-color: #ddc9a8;
    box-shadow: 0 8px 24px rgba(90, 68, 48, .1);
    transform: translateY(-2px);
}
.fj-card:hover::before { opacity: 1; }
.fj-card-link { display: block; padding: 15px 18px 13px; text-decoration: none; color: inherit; }
.fj-card-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.fj-name {
    margin: 0;
    font-size: 19px;
    font-weight: 400;
    color: var(--dark-red, #8c2323);
    letter-spacing: 1.5px;
    line-height: 1.4;
}
.fj-cat {
    display: inline-block;
    padding: 1px 8px;
    border: 1px solid #e8d9bf;
    border-radius: 10px;
    background: #fdf7ea;
    color: #a98b52;
    font-size: 11px;
    letter-spacing: .5px;
    white-space: nowrap;
    text-decoration: none;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}
.fj-book {
    margin-top: 5px;
    font-size: 12px;
    color: #a8977f;
    letter-spacing: .5px;
}
.fj-line {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.75;
    color: #6b5b48;
}
.fj-lab {
    flex: 0 0 auto;
    font-size: 11px;
    color: #b09a7c;
    letter-spacing: 2px;
    padding-top: 2px;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}
.fj-txt {
    flex: 1;
    min-width: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}
.fj-line-herb .fj-txt { color: #8b7355; font-size: 12.5px; -webkit-line-clamp: 1; }
.fj-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px dashed #eee2d0;
    font-size: 11px;
    color: #b3a48e;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}
.fj-more { color: #b08a5a; letter-spacing: 1px; }
.fj-card:hover .fj-more { color: var(--dark-red, #8c2323); }
.fj-more i { font-style: normal; transition: transform .2s; display: inline-block; }
.fj-card:hover .fj-more i { transform: translateX(3px); }
mark.fj-hit { background: #fff1c9; color: #8c2323; padding: 0 1px; border-radius: 2px; }

/* ---------------- 分页 ---------------- */
.fj-pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 24px 0 6px; }
.fj-pg {
    min-width: 34px;
    height: 32px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e6dbc9;
    border-radius: 6px;
    background: #fffdf8;
    color: #6b5b48;
    font-size: 13px;
    text-decoration: none;
    transition: all .2s;
}
.fj-pg:hover { border-color: var(--light-gold, #c8a878); color: var(--dark-red, #8c2323); }
.fj-pg.is-cur { background: var(--dark-red, #8c2323); border-color: var(--dark-red, #8c2323); color: #fff; }
.fj-pg.is-off { color: #cbbda9; background: #faf7f0; }
.fj-pg-dot { color: #b3a48e; padding: 0 2px; }

/* ---------------- 空态 ---------------- */
.fj-miss {
    padding: 46px 20px;
    text-align: center;
    color: #9a8b78;
    font-size: 14px;
    line-height: 2;
    background: #fffdf8;
    border: 1px dashed #e0d3bd;
    border-radius: 10px;
}
.fj-miss a { color: var(--dark-red, #8c2323); }

/* ---------------- 通用块 ---------------- */
.fj-block {
    margin-top: 22px;
    padding: 16px 18px;
    background: #fffdf8;
    border: 1px solid #e6dbc9;
    border-radius: 10px;
}
.fj-block-title {
    margin: 0 0 12px;
    padding-bottom: 9px;
    border-bottom: 1px dashed #e6dbc9;
    font-size: 14px;
    font-weight: 400;
    color: var(--dark-red, #8c2323);
    letter-spacing: 3px;
}
.fj-block-title span { float: right; font-size: 11px; color: #b3a48e; letter-spacing: 1px; }
.fj-herbs { display: flex; flex-wrap: wrap; gap: 7px; }
.fj-herb {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 11px;
    border: 1px solid #e6dbc9;
    border-radius: 16px;
    background: #fff;
    color: #6b5b48;
    font-size: 13px;
    text-decoration: none;
    transition: all .2s;
}
.fj-herb:hover { border-color: var(--light-gold, #c8a878); color: var(--dark-red, #8c2323); background: #fffcf5; }
.fj-herb i { font-style: normal; font-size: 10px; color: #bcab92; }
.fj-about { margin-top: 26px; padding: 18px 20px; background: rgba(200, 168, 120, .07); border-radius: 10px; }
.fj-about h4 { font-size: 14px; color: var(--dark-red, #8c2323); letter-spacing: 2px; margin: 0 0 10px; font-weight: 400; }
.fj-about p { font-size: 13px; line-height: 2; color: #7a6851; margin: 0 0 8px; }
.fj-about .fj-warn { color: #a06a3a; font-size: 12.5px; }

/* ---------------- 详情 ---------------- */
.fj-crumb {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    color: #a8977f;
    margin-bottom: 16px;
    letter-spacing: .5px;
}
.fj-crumb a { color: #8b7355; text-decoration: none; }
.fj-crumb a:hover { color: var(--dark-red, #8c2323); }
.fj-crumb-letter { color: #bcab92; }
.fj-detail-head {
    padding: 0 0 16px;
    margin-bottom: 18px;
    border-bottom: 2px solid var(--border-line, #d9cbb8);
    text-align: center;
}
.fj-detail-name {
    margin: 0 0 10px;
    font-size: 30px;
    font-weight: 400;
    color: var(--dark-red, #8c2323);
    letter-spacing: 6px;
}
.fj-detail-tags { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.fj-detail-count { font-size: 12px; color: #b3a48e; }

.fj-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.fj-tab {
    display: inline-block;
    padding: 7px 16px;
    border: 1px solid #e6dbc9;
    border-radius: 18px;
    background: #fffdf8;
    color: #7a6851;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
}
.fj-tab:hover { border-color: var(--light-gold, #c8a878); }
.fj-tab.active {
    background: rgba(140, 35, 35, .06);
    border-color: var(--dark-red, #8c2323);
    color: var(--dark-red, #8c2323);
}
/* 多出处版本下拉（>6 个版本时启用） */
.fj-versel {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 9px 14px;
    background: rgba(255, 253, 248, .82);
    border: 1px solid #e9dfcd;
    border-radius: 8px;
}
.fj-versel label { font-size: 13px; color: #7a6851; letter-spacing: 1px; white-space: nowrap; }
.fj-versel select {
    flex: 1 1 300px;
    min-width: 0;
    max-width: 620px;
    padding: 7px 10px;
    border: 1px solid #e0d3bd;
    border-radius: 6px;
    background: #fffdf8;
    color: #4a3f30;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}
.fj-versel select:focus { outline: none; border-color: var(--dark-red, #8c2323); }
.fj-versel-tip { font-size: 12px; color: #a8977f; }

.fj-ver { display: none; }.fj-ver.active { display: block; }
.fj-ver-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.fj-ver-book { font-size: 17px; color: #7a5a34; letter-spacing: 1px; }
.fj-ver-src { font-size: 12px; color: #b3a48e; }
.fj-fields {
    margin: 0;
    padding: 6px 20px;
    background: #fffdf8;
    border: 1px solid #e6dbc9;
    border-radius: 10px;
}
.fj-field { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px dashed #eee2d0; }
.fj-field:last-child { border-bottom: none; }
.fj-field dt {
    flex: 0 0 72px;
    font-size: 13px;
    color: #a8894f;
    letter-spacing: 3px;
    padding-top: 2px;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}
.fj-field dd {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 15px;
    line-height: 2;
    color: #4a3a28;
    word-break: break-word;
}
.fj-field-main dd { color: #3f2f1e; }
.fj-field-main dt { color: var(--dark-red, #8c2323); }
.fj-ver-foot {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.fj-copy {
    padding: 8px 18px;
    border: 1px solid var(--border-line, #d9cbb8);
    border-radius: 6px;
    background: #fff;
    color: var(--dark-red, #8c2323);
    font-size: 12.5px;
    letter-spacing: 1px;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
}
.fj-copy:hover { background: var(--dark-red, #8c2323); color: #fff; border-color: var(--dark-red, #8c2323); }
.fj-note { font-size: 11.5px; color: #b3a48e; }
.fj-rel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fj-rel-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 9px 12px;
    background: #fff;
    border: 1px solid #eee2d0;
    border-radius: 7px;
    text-decoration: none;
    transition: all .2s;
}
.fj-rel-item:hover { border-color: var(--light-gold, #c8a878); background: #fffcf5; }
.fj-rel-item b { font-weight: 400; color: var(--dark-red, #8c2323); font-size: 14px; white-space: nowrap; }
.fj-rel-item span { font-size: 11.5px; color: #a8977f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 悬浮入口 ---------------- */
#fjFloatBtn {
    position: fixed;
    right: 22px;
    bottom: 196px;
    z-index: 2147481899;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 15px;
    border-radius: 30px;
    background: linear-gradient(135deg, #a6855a, #8c6f4a);
    color: #fff;
    text-decoration: none;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 13px;
    line-height: 1;
    box-shadow: 0 8px 24px rgba(90, 68, 48, .28);
    transition: transform .2s, box-shadow .2s;
}
#fjFloatBtn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(90, 68, 48, .34); }
#fjFloatBtn .fj-float-ico {
    width: 20px; height: 20px; line-height: 20px; text-align: center;
    border: 1px solid rgba(255, 255, 255, .55); border-radius: 4px; font-size: 12px;
}
#fjFloatBtn .fj-float-txt { white-space: nowrap; letter-spacing: 1px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
    .fj-grid { grid-template-columns: 1fr; }
    .fj-stats { grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .fj-stat b { font-size: 18px; }
    .fj-stat span { font-size: 10px; }
}
@media (max-width: 640px) {
    .fj-wrap .page-title { font-size: 22px; letter-spacing: 3px; }
    .fj-wrap .page-sub { font-size: 12px; line-height: 1.9; padding: 0 6px; }
    .fj-search { padding: 10px; gap: 8px; border-radius: 10px; }
    .fj-search-box { flex: 1 1 100%; }
    .fj-search input[type=text] { padding: 11px 34px; font-size: 14px; }
    .fj-search-btn { flex: 1; padding: 11px 0; letter-spacing: 2px; }
    .fj-random-btn { padding: 10px 14px; font-size: 13px; }
    .fj-stat { padding: 10px 4px; }
    .fj-stat b { font-size: 16px; }
    .fj-letter { padding: 8px; gap: 4px; }
    .fj-letter a, .fj-letter .fj-lf-empty { min-width: 26px; height: 26px; font-size: 12px; }
    .fj-letter a i { display: none; }
    .fj-cats { gap: 5px; }
    .fj-chip { padding: 4px 9px; font-size: 12px; }
    .fj-card-link { padding: 13px 14px 11px; }
    .fj-name { font-size: 17px; }
    .fj-detail-name { font-size: 23px; letter-spacing: 3px; }
    .fj-detail-head { text-align: left; }
    .fj-detail-tags { justify-content: flex-start; }
    .fj-field { flex-direction: column; gap: 4px; padding: 11px 0; }
    .fj-field dt { flex: none; font-size: 12px; letter-spacing: 2px; }
    .fj-field dd { font-size: 14px; line-height: 1.95; }
    .fj-fields { padding: 4px 14px; }
    .fj-rel { grid-template-columns: 1fr; }
    .fj-block { padding: 13px 14px; }
    .fj-about { padding: 14px 16px; }
    #fjFloatBtn { display: none; }
}
