.tool-content {
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    padding: 1.2em;
    border-radius: .6em;
    position: relative;
}

.tool-content .text-item {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tool-content .text-item > label {
    display: block;
}

.tool-content .operate-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

/*按钮样式*/
.btn {
    outline: none;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 12px;
    color: #333;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
    font-family: var(--font-simple);
}

.btn .ripple {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    z-index: 1;
    animation: ripple-effect 0.6s ease-out forwards;
}

.btn-blue {
    color: #fff;
    background-color: rgb(93 79 248 / 85%);
    border-color: rgb(93 79 248 / 85%);
}

.btn-blue svg {
    fill: #fff;
}

/* 关键动画：扩散 + 淡出 */
@keyframes ripple-effect {
    0% {
        width: 0;
        height: 0;
        opacity: 0.4;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* ==================== 进制选择框 ==================== */
.icon-unit-selector {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px 0;
    font-size: 14px;
}

.unit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 24px;
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    position: relative;
}

.unit-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* 外圈 - 圆形边框 */
.unit-item::before {
    content: '';
    position: relative;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 1.5px solid #adb5bd;
    border-radius: 50%;
    background-color: white;
    transition: all 0.2s ease;
    z-index: 1;
}

.unit-item.active::before {
    border-color: rgba(90, 77, 248, 0.9);
}

/* 内点 - 默认不显示，active 时出现 */
.unit-item::after {
    content: '';
    position: absolute;
    left: 4px;
    width: 10px;
    height: 10px;
    background-color: rgba(90, 77, 248, 0.9);
    border-radius: 50%;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.unit-item.active::after {
    opacity: 1;
}

.unit-label {
    color: #212529;
    line-height: 1.4;
    position: relative;
    z-index: 1;
}

.unit-item.active .unit-label {
    color: rgba(90, 77, 248, 0.9);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table tr:nth-child(odd) {
    background-color: var(--main-bg);
}

table tr:first-child {
    background-color: #f1f2f5 !important;
}

table tr:hover {
    background-color: rgba(90, 77, 248, 0.1);
}

table th, table td {
    border: 1px solid #ddd;
    padding: 10px 15px;
    text-align: left;
    font-size: 14px;
    word-break: break-all;
    overflow-wrap: break-word;
    white-space: normal;
}

.input-text {
    border: solid 1px #ddd;
    background-color: var(--main-bg);
    min-width: 150px;
    height: 40px;
    line-height: 40px;
    padding: 0 12px;
    border-radius: 7px;
    font-family: var(--font-simple);
    outline: none;
    font-size: 14px;
}

.input-text:focus {
    border-color: #5a4df8;
    background-color: #f8f7fd;
    box-shadow: inset 0 1px 4px rgba(90, 77, 248, 0.2), 0 0 0 2px rgba(90, 77, 248, 0.1);
}

.input-small {
    width: 240px;
    background-color: #fff;
}

/* ==================== 关键：松手后整体弹出动画 ==================== */

@keyframes popIn {
    0% {
        transform: scale(0);
    }
    60% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* 同时给外圈和内点添加动画 */
.unit-item.pop-animation::before,
.unit-item.pop-animation::after {
    animation: popIn 0.3s cubic-bezier(0.25, 0.1, 0.75, 1) forwards;
}

@media (max-width: 768px) {
    .tool-content {
        padding: .8em !important;
    }

    .operate-buttons .btn {
        line-height: 32px !important;
        height: 32px !important;
        padding: 0 8px !important;
    }

    .tool-content .mobile-item label span {
        height: 16px !important;
        padding: 0 4px !important;
        margin: 0 2px !important;
        font-size: 12px !important;
    }

    .table-container table th, .table-container table td {
        padding: 6px 8px !important;
    }

    .input-small {
        height: 36px;
        line-height: 36px;
        width: 180px;
    }
}

/* ==================== 狼吃羊棋 Wolf-Sheep Chess ==================== */
.wsc-app * {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

.wsc-app {
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
    color: #3b342a;
    max-width: 1080px;
    margin: 0 auto
}

.wsc-app .wsc-header {
    text-align: center;
    margin-bottom: 18px
}

.wsc-app .wsc-header h1 {
    font-size: 30px;
    letter-spacing: 6px;
    color: #6b3d24;
    text-shadow: 0 2px 0 #fff
}

.wsc-app .wsc-subtitle {
    margin-top: 6px;
    font-size: 13px;
    color: #9b8a70;
    letter-spacing: 2px
}

.wsc-app .wsc-main {
    display: grid;
    grid-template-columns:minmax(0, 1fr) 380px;
    gap: 1em;
    align-items: start
}

@media (max-width: 840px) {
    .wsc-app .wsc-main {
        grid-template-columns:1fr
    }
}

.wsc-app .wsc-board-wrap {
    background: #fffdf7;
    border: 1px solid #e5d7bd;
    border-radius: 8px;
    padding: 1em;
    box-shadow: 0 10px 30px rgba(90, 60, 25, .10)
}

.wsc-app .wsc-board {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    margin: 0 auto;
    background: linear-gradient(145deg, #f5e9ce, #e8d5ae);
    border: 2px solid #c8a873;
    border-radius: 8px;
    box-shadow: inset 0 0 34px rgba(120, 80, 30, .16), 0 4px 12px rgba(90, 60, 25, .12)
}

.wsc-app .wsc-grid {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none
}

.wsc-app .wsc-pieces {
    position: absolute;
    inset: 0
}

.wsc-app .wsc-piece {
    position: absolute;
    width: 13%;
    height: 13%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "STKaiti", "KaiTi", "楷体", "STSong", serif;
    font-size: clamp(19px, 3.8vw, 32px);
    font-weight: 700;
    letter-spacing: 0;
    cursor: pointer;
    user-select: none;
    transition: transform .14s, box-shadow .14s;
    background: repeating-radial-gradient(ellipse at 28% 22%, rgba(120, 72, 28, .10) 0 2px, rgba(255, 236, 196, .07) 2px 5px), radial-gradient(circle at 34% 28%, #f6ddb0 0%, #e6c185 46%, #c4924c 100%);
    box-shadow: inset 0 0 0 3px rgba(150, 94, 40, .32), inset 0 2px 6px rgba(255, 250, 228, .7), 0 3px 7px rgba(80, 50, 15, .3)
}

.wsc-app .wsc-piece::after {
    content: "";
    position: absolute;
    inset: 11%;
    border-radius: 50%;
    border: 1.5px solid rgba(146, 86, 36, .5);
    box-shadow: inset 0 0 0 1px rgba(255, 244, 214, .55);
    pointer-events: none
}

.wsc-app .wsc-piece.wsc-wolf {
    color: #ffd97a;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .55);
    background: repeating-radial-gradient(ellipse at 28% 22%, rgba(0, 0, 0, .16) 0 2px, rgba(255, 200, 150, .05) 2px 5px), radial-gradient(circle at 34% 28%, #7a4a2c 0%, #5a3018 46%, #351a0c 100%);
    box-shadow: inset 0 0 0 3px rgba(240, 200, 120, .55), inset 0 2px 6px rgba(255, 220, 160, .18), 0 3px 8px rgba(60, 20, 5, .45)
}

.wsc-app .wsc-piece.wsc-wolf::after {
    border-color: rgba(240, 200, 120, .5);
    box-shadow: inset 0 0 0 1px rgba(255, 230, 170, .28)
}

.wsc-app .wsc-piece.wsc-sheep {
    color: #265e46;
    text-shadow: 0 1px 0 rgba(255, 240, 208, .75)
}

.wsc-app .wsc-piece.wsc-selected {
    box-shadow: 0 0 0 4px #e8b648, 0 0 20px #e8b648;
    transform: translate(-50%, -50%) scale(1.09)
}

.wsc-app .wsc-piece.wsc-hinted {
    box-shadow: 0 0 0 4px #6aa9d8, 0 0 20px #6aa9d8
}

.wsc-app .wsc-marker {
    position: absolute;
    width: 18%;
    height: 18%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    cursor: pointer
}

.wsc-app .wsc-marker::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 42%;
    height: 42%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(62, 138, 101, .88);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .65);
    animation: wscPulse 1.3s infinite;
    pointer-events: none
}

.wsc-app .wsc-marker.wsc-capture::after {
    width: 70%;
    height: 70%;
    background: transparent;
    border: 3px solid #c8452c;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .5)
}

@keyframes wscPulse {
    50% {
        transform: translate(-50%, -50%) scale(1.15)
    }
}

.wsc-app .wsc-confetti {
    position: absolute;
    inset: 0;
    z-index: 20;
    width: 100%;
    height: 100%;
    pointer-events: none;
    border-radius: 12px
}

.wsc-app .wsc-wintip {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 21;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 12px 26px;
    min-width: 190px;
    border-radius: 14px;
    background: rgba(58, 36, 20, .82);
    border: 1px solid rgba(233, 201, 121, .85);
    box-shadow: 0 8px 26px rgba(60, 30, 10, .4);
    text-align: center;
    pointer-events: none;
    animation: wsc-tipIn .5s cubic-bezier(.2, 1.4, .4, 1) both
}

.wsc-app .wsc-wintip-ico {
    font-size: 26px;
    line-height: 1
}

.wsc-app .wsc-wintip-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 3px;
    color: #ffe7a3
}

.wsc-app .wsc-wintip-sub {
    font-size: 12px;
    color: #e8d5b0
}

@keyframes wsc-tipIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.9) }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1) }
}

.wsc-app .wsc-panel {
    display: flex;
    flex-direction: column;
    gap: 1em
}

.wsc-app .wsc-card {
    background: #fffdf7;
    border: 1px solid #e5d7bd;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 6px 18px rgba(90, 60, 25, .07)
}

.wsc-app .wsc-card h2 {
    font-size: 14px;
    color: #8a6c43;
    margin-bottom: 12px;
    letter-spacing: 2px;
    font-weight: 700
}

.wsc-app .wsc-turn-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px
}

.wsc-app .wsc-turn-badge {
    padding: 6px 14px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 15px;
    color: #fff;
    background: #7b3f22;
}

.wsc-app .wsc-turn-badge.wsc-sheep {
    background: #5b7d54
}

.wsc-app .wsc-turn-text {
    font-size: 13px;
    color: #8a7a60
}

.wsc-app .wsc-counts {
    display: flex;
    gap: 10px
}

.wsc-app .wsc-count {
    flex: 1;
    background: #f7f0e2;
    border-radius: 10px;
    padding: 9px;
    text-align: center
}

.wsc-app .wsc-count b {
    display: block;
    font-size: 22px;
    color: #5b4530
}

.wsc-app .wsc-count span {
    font-size: 12px;
    color: #9b8a70
}

.wsc-app .wsc-msg {
    margin-top: 12px;
    font-size: 13px;
    color: #7a5f3d;
    background: #faf3e4;
    border-left: 3px solid #d2a75a;
    padding: 8px 10px;
    border-radius: 0 8px 8px 0;
    min-height: 36px;
    line-height: 1.5
}

.wsc-app .wsc-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
    color: #6b5a42
}

.wsc-app select.wsc-select {
    font: inherit;
    font-size: 13px;
    padding: 6px 30px 6px 10px;
    border: 1px solid #dbc9a8;
    border-radius: 8px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' fill='none' stroke='%236b5a42' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    color: #4a3a26;
    max-width: 150px;
    cursor: pointer;
    outline: none;
}

.wsc-app .wsc-btns {
    display: grid;
    grid-template-columns:1fr 1fr;
    gap: 8px;
    margin-top: 6px
}

.wsc-app button.wsc-btn {
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 6px;
    border: 1px solid #d9c49f;
    border-radius: 7px;
    background: #fdf8ee;
    color: #6a4e30;
    cursor: pointer;
    transition: .15s
}

.wsc-app button.wsc-btn:hover {
    background: #f4e6cb;
    transform: translateY(-1px)
}

.wsc-app button.wsc-btn.wsc-primary {
    background: #8c5a35;
    color: #fff;
    border-color: #8c5a35
}

.wsc-app button.wsc-btn.wsc-primary:hover {
    background: #7a4a28
}

.wsc-app .wsc-log {
    max-height: 170px;
    overflow: auto;
    font-size: 12px;
    line-height: 1.8;
    color: #735f45
}

.wsc-app .wsc-log div {
    border-bottom: 1px dashed #e8dcc4;
    padding: 2px 0
}

.wsc-app .wsc-log .w {
    color: #9a4b2a
}

.wsc-app .wsc-log .s {
    color: #4c7043
}

.wsc-app .wsc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: #8a7a60;
    justify-content: center;
    margin-top: 10px
}

.wsc-app .wsc-legend i {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    vertical-align: -2px;
    margin-right: 4px
}

.wsc-app .wsc-legend .lw {
    background: radial-gradient(circle at 34% 28%, #7a4a2c, #351a0c);
    border: 2px solid #f0c878
}

.wsc-app .wsc-legend .ls {
    background: radial-gradient(circle at 34% 28%, #f6ddb0, #c4924c);
    border: 2px solid #b99a66
}

.wsc-app .wsc-legend .lm {
    background: #3e8a65;
    width: 10px;
    height: 10px
}

.wsc-app .wsc-legend .lc {
    background: transparent;
    border: 2px solid #c8452c;
    width: 12px;
    height: 12px
}

.wsc-app .wsc-modal {
    position: fixed;
    inset: 0;
    background: rgba(45, 32, 20, .5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 9999
}

.wsc-app .wsc-modal.wsc-show {
    display: flex
}

.wsc-app .wsc-modal-card {
    background: #fffdf7;
    border-radius: 16px;
    max-width: 580px;
    width: 100%;
    max-height: 84vh;
    overflow: auto;
    padding: 24px 26px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25)
}

.wsc-app .wsc-modal-card h2 {
    color: #6b3d24;
    margin-bottom: 14px;
    letter-spacing: 3px
}

.wsc-app .wsc-modal-card h3 {
    color: #8a6c43;
    font-size: 14px;
    margin: 16px 0 6px
}

.wsc-app .wsc-modal-card p, .wsc-app .wsc-modal-card li {
    font-size: 13px;
    line-height: 1.85;
    color: #6b5a42
}

.wsc-app .wsc-modal-card ol, .wsc-app .wsc-modal-card ul {
    padding-left: 20px
}

.wsc-app .wsc-close {
    float: right;
    background: none;
    border: none;
    font-size: 22px;
    color: #9b8a70;
    cursor: pointer;
    line-height: 1
}
