* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    margin: 20px 15%;
    background: #f0f4f8;
    color: #333;
}

h2 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
    margin-bottom: 16px;
    text-align: center;
    position: relative;
}
.ver { font-size: 15px; color: #888; font-weight: normal; margin-left: 8px; }
.sub-motto { position: absolute; right: 0; bottom: 6px; font-size: 13px; color: #bbb; font-weight: normal; font-style: italic; }
h3 { color: #2c3e50; margin-bottom: 12px; }
#pg3 h3 { font-size: 16px; }
#pg3 { font-size: 13px; }
#pg9.active { display: flex; flex-direction: column; height: calc(100vh - 120px); }
#pg9.active .pn { overflow: hidden; }

.review-row { display: flex; gap: 16px; }

.manual-layout { display: flex; gap: 0; }
.manual-layout .manual-item { padding: 6px 8px; cursor: pointer; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.manual-layout .manual-item:hover { background: #fef0d9; }
.manual-layout .manual-item.active { background: #fef0d9; font-weight: bold; color: #2c3e50; }

/* ===== Manual Article Typography ===== */
.manual-article {
    max-width: 720px;
    margin: 0 auto;
    font-family: "Noto Serif SC", "STSong", "SimSun", "Songti SC", serif;
    font-size: 16px;
    line-height: 2.0;
    color: #333;
}

.manual-article-title {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 22px;
    font-weight: bold;
    color: #1a1a1a;
    margin: 0 0 32px;
    padding-bottom: 12px;
    border-bottom: 2px solid #2c3e50;
}

.manual-h3 {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 17px;
    font-weight: bold;
    color: #2c3e50;
    margin: 40px 0 12px;
    padding: 0;
}

.manual-p {
    margin: 0 0 20px;
    text-align: justify;
    text-justify: inter-ideograph;
}

.manual-keyrule {
    margin: 0 0 20px;
    padding: 12px 16px;
    background: #fafafa;
    border-left: 3px solid #2c3e50;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 15px;
    color: #444;
}

.manual-quote {
    margin: 24px 0;
    padding: 16px 24px;
    background: #f8f8f8;
    border-left: 3px solid #ccc;
    color: #666;
    font-size: 15px;
    line-height: 2.0;
}

.manual-dialogue {
    margin: 8px 0;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 15px;
    color: #555;
    padding: 6px 16px;
    background: #fafafa;
    border-radius: 4px;
}

.manual-table-wrap {
    margin: 24px 0;
    overflow-x: auto;
}

.manual-table {
    width: 100%;
    border-collapse: collapse;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 13px;
}

.manual-table th {
    background: #2c3e50;
    color: #fff;
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    border: none;
}

.manual-table td {
    padding: 8px 14px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.manual-table tr:last-child td {
    border-bottom: none;
}

.mth-tbl { width: 100%; border-collapse: collapse; }
.mth-tbl th { background: #2c3e50; color: white; padding: 6px 8px; font-size: 12px; }
.mth-tbl td { padding: 5px 8px; border-bottom: 1px solid #eee; font-size: 13px; }
.subtitle { font-size: 14px; color: #888; font-weight: normal; }

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.tab {
    padding: 10px 18px;
    background: #ddd;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    user-select: none;
}
.tab:hover { background: #bdc3c7; }
.tab.active { background: #3498db; color: white; }

.pg { display: none; }
.pg.active { display: block; }

.pn {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.rw {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.rw label {
    font-weight: bold;
    color: #555;
}
.inp, select {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}
.quick-bar {
    background: #f0f8ff;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 10px;
}
.quick-bar input { flex: 1; }
input[type="text"] { width: 220px; }
input[type="number"] { width: 80px; }
.w80 { width: 80px !important; }

.tr {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    border-left: 3px solid var(--rank-color, #3498db);
}
.tr label { width: 55px; }
.tb { width: 260px !important; }
.nb { width: 80px !important; }

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 24px;
    border-radius: 3px;
    color: white;
    font-size: 11px;
    font-weight: bold;
    flex-shrink: 0;
}
.r1 { background: #e74c3c; }
.r2 { background: #e67e22; }
.r3 { background: #f1c40f; color: #333; }
.r4 { background: #3498db; }
.r5 { background: #95a5a6; }

.rb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: white;
    font-size: 10px;
    font-weight: bold;
    flex-shrink: 0;
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    font-weight: bold;
    transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }
.b1 { background: #27ae60; color: white; }
.b2 { background: #e74c3c; color: white; }
.b3 { background: #3498db; color: white; }
.bd { font-size: 18px; font-weight: bold; color: #e74c3c; }

.msg { padding: 10px; border-radius: 4px; margin-top: 10px; display: none; }
.msg.ok { background: #d4edda; color: #155724; display: block; }
.msg.err { background: #f8d7da; color: #721c24; display: block; }
.msg.info { background: #d1ecf1; color: #0c5460; display: block; }

.tbl-wrap { overflow-x: auto; margin-top: 12px; }
.tbl-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.tbl-wrap th {
    background: #3498db;
    color: white;
    padding: 8px 10px;
    text-align: left;
    white-space: nowrap;
}
.tbl-wrap td {
    padding: 6px 10px;
    border-bottom: 1px solid #eee;
}
.tbl-wrap tr:hover td { background: #f0f7ff; }

.result-info { font-size: 13px; color: #666; margin-top: 8px; }

.hint { font-size: 12px; color: #999; margin: 6px 0 12px; }

.hidden { display: none !important; }

.badge-beta {
    font-size: 11px;
    background: #e67e22;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    vertical-align: middle;
}

.home-row { display: flex; gap: 24px; margin-top: 12px; }
.home-left { flex: 1; min-width: 300px; }
.home-right { flex: 1; min-width: 300px; margin-left: 5%; }
.home-h3 { margin: 0 0 4px 0; color: #2c3e50; font-size: 16px; }

.topic-card {
    background: #fff;
    border-left: 4px solid #3498db;
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: 0 6px 6px 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.topic-card .tc-name { font-size: 16px; font-weight: bold; color: #2c3e50; }
.topic-card .tc-info { font-size: 13px; color: #666; margin-top: 4px; }
.tc-tbl { width: 100%; border-collapse: collapse; }
.tc-tbl td { font-size: 13px; color: #666; padding: 2px 4px; white-space: nowrap; }
.tc-tbl td:first-child { padding-left: 0; }
.tc-tbl td:last-child { padding-right: 0; text-align: right; }
.tc-v { color: #e74c3c; font-weight: bold; }
.tc-s { color: #e67e22; }
.tc-m { color: #3498db; }

@media (max-width: 768px) {
    body { margin: 10px 4%; }
    .rw { flex-direction: column; align-items: flex-start; }
    .tr { flex-wrap: wrap; }
    .home-row { flex-direction: column; }
}
