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

html, body {
    background: #ececec;
    color: #333;
    font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    -webkit-text-size-adjust: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

.kj-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
    padding: 0 10px;
    background: #4d4d4d;
    color: #fff;
}

.kj-topbar .back {
    min-width: 86px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

.kj-topbar .year-select {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    font-size: 16px;
    cursor: pointer;
}

.kj-topbar .year-select::after {
    content: "";
    display: inline-block;
    margin-left: 6px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #fff;
}

.kj-topbar .year-select select {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    cursor: pointer;
}

.kj-topbar .placeholder {
    min-width: 86px;
}

.kj-type-tabs {
    display: flex;
    gap: 6px;
    padding: 8px 8px 6px;
    background: #f5f5f5;
}

.kj-type-tabs a {
    flex: 1;
    height: 38px;
    line-height: 38px;
    text-align: center;
    font-size: 15px;
    color: #7d5531;
    background: linear-gradient(180deg, #efe7dd 0%, #d3b594 100%);
    border-radius: 999px;
    font-weight: 700;
}

.kj-type-tabs a.active {
    color: #e01919;
    background: #fff;
    box-shadow: inset 0 0 0 1px #eadfce;
}

.kj-tabs {
    display: flex;
    background: #d8d8d8;
    border-bottom: 1px solid #c5c5c5;
}

.kj-tabs a {
    flex: 1;
    height: 38px;
    line-height: 38px;
    text-align: center;
    font-size: 14px;
    color: #333;
    border-right: 1px solid #c8c8c8;
}

.kj-tabs a:last-child {
    border-right: 0;
}

.kj-tabs a.active {
    color: #fff;
    background: #ff9900;
}

.kj-filters {
    padding: 10px 8px 8px;
    background: #e6e6e6;
    background-image: repeating-linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.03) 0,
        rgba(0, 0, 0, 0.03) 2px,
        transparent 2px,
        transparent 6px
    );
    border-bottom: 1px solid #d0d0d0;
}

.kj-filters .row {
    margin-bottom: 8px;
}

.kj-filters .row-title {
    margin-bottom: 4px;
    font-size: 14px;
    color: #333;
}

.kj-filters label {
    display: inline-flex;
    align-items: center;
    margin: 2px 8px 2px 0;
    font-size: 13px;
    white-space: nowrap;
}

.kj-filters input {
    margin-right: 4px;
}

.kj-filters .attr-link {
    display: inline-block;
    margin-top: 2px;
    color: #ff9900;
    font-size: 14px;
}

.kj-list {
    padding-bottom: 24px;
}

.kj-item {
    border-bottom: 1px solid #ddd;
    background: #fff;
}

.kj-item:nth-child(even) {
    background: #fafafa;
}

.kj-item-head {
    padding: 8px 10px;
    background: #efefef;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    color: #333;
}

.kj-balls-wrap {
    background: #f3f3f3;
}

.kj-balls {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 10px 6px 8px;
    overflow-x: auto;
    min-height: 78px;
}

.kj-tile {
    flex: 0 0 auto;
    width: 40px;
    text-align: center;
}

.kj-tile-ball {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 37px;
    margin: 0 auto 3px;
    padding-right: 4px;
    box-sizing: border-box;
    color: #222;
    font-size: 20px;
    font-weight: 700;
    line-height: 37px;
    background: 0 0 no-repeat;
    background-size: 100% 100%;
}

.kj-tile-ball i {
    display: block;
    font-style: normal;
    margin-left: 2px;
    margin-top: -1px;
    color: #222;
    text-shadow: none;
}

.kj-tile-ball.red {
    background-image: url(/assets/images/kj-ball-red.png);
}

.kj-tile-ball.blue {
    background-image: url(/assets/images/kj-ball-blue.png);
}

.kj-tile-ball.green {
    background-image: url(/assets/images/kj-ball-green.png);
}

.kj-tile-sub {
    display: block;
    font-size: 13px;
    line-height: 1.2;
    color: #666;
}

.kj-tile-sub > span {
    display: block;
}

.kj-tile-sub .wx-jin { color: #d4a017; }
.kj-tile-sub .wx-mu { color: #1f9a1f; }
.kj-tile-sub .wx-shui { color: #1a6fd4; }
.kj-tile-sub .wx-huo { color: #d81e1e; }
.kj-tile-sub .wx-tu { color: #8b6914; }

.kj-plus {
    width: 18px;
    padding-bottom: 20px;
    font-size: 24px;
    font-weight: 700;
    color: #333;
    line-height: 1;
    text-align: center;
}

.kj-empty {
    padding: 40px 16px;
    text-align: center;
    color: #888;
}

.kj-loading {
    padding: 24px;
    text-align: center;
    color: #888;
}

.kj-attr-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.45);
}

.kj-attr-modal.show {
    display: block;
}

.kj-attr-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 92%;
    max-width: 420px;
    max-height: 80vh;
    overflow: auto;
    background: #fff;
    border-radius: 6px;
    padding: 14px;
}

.kj-attr-panel h3 {
    margin-bottom: 10px;
    font-size: 16px;
    text-align: center;
}

.kj-attr-panel table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.kj-attr-panel th,
.kj-attr-panel td {
    border: 1px solid #ddd;
    padding: 4px;
    text-align: center;
}

.kj-attr-close {
    display: block;
    width: 100%;
    margin-top: 12px;
    height: 36px;
    border: 0;
    border-radius: 4px;
    background: #ff9900;
    color: #fff;
    font-size: 15px;
}

@media screen and (max-width: 380px) {
    .kj-tile {
        width: 38px;
    }

    .kj-tile-ball {
        width: 38px;
        height: 35px;
        font-size: 18px;
    }

    .kj-tabs a {
        font-size: 12px;
    }
}
