.ailm {
    --ailm-ink: #171a20;
    --ailm-sub: #6b7280;
    --ailm-line: #eceef3;
    --ailm-bg: #ffffff;
    --ailm-soft: #f6f7f9;
    --ailm-pink: #ff4d7d;
    --ailm-violet: #7c5cff;
    --ailm-radius: 16px;
    color: var(--ailm-ink);
    font-size: 15px;
    line-height: 1.6;
    max-width: 1080px;
    margin: 0 auto;
    padding: 4px 0 40px;
}

.ailm *,
.ailm *::before,
.ailm *::after {
    box-sizing: border-box;
}

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

.ailm h2,
.ailm h3,
.ailm h4 {
    margin: 0 0 8px;
    line-height: 1.35;
    color: var(--ailm-ink);
    font-weight: 700;
}

.ailm-h2 {
    font-size: 22px;
}

.ailm-h3 {
    font-size: 17px;
}

.ailm-muted {
    color: var(--ailm-sub);
    font-size: 13px;
    margin: 6px 0;
}

.ailm-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

/* 顶部导航 */
.ailm-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: var(--ailm-bg);
    border: 1px solid var(--ailm-line);
    border-radius: var(--ailm-radius);
    margin-bottom: 16px;
}

.ailm-nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.ailm-nav a {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 10px;
    font-size: 14px;
    color: #374151;
    transition: background .18s, color .18s;
}

.ailm-nav a:hover {
    background: var(--ailm-soft);
}

.ailm-nav a.is-on {
    background: linear-gradient(135deg, var(--ailm-pink), var(--ailm-violet));
    color: #fff;
    font-weight: 600;
}

.ailm-credit {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.ailm-credit-label {
    color: var(--ailm-sub);
    font-size: 13px;
}

.ailm-credit strong {
    font-size: 19px;
    color: var(--ailm-pink);
}

/* 面板 */
.ailm-panel {
    background: var(--ailm-bg);
    border: 1px solid var(--ailm-line);
    border-radius: var(--ailm-radius);
    padding: 18px;
    margin-bottom: 16px;
}

.ailm-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.ailm-center {
    text-align: center;
}

/* 合规提示 */
.ailm-notice {
    background: linear-gradient(180deg, #fff7f9, #ffffff);
    border: 1px solid #ffd9e4;
    border-radius: var(--ailm-radius);
    padding: 16px 18px;
    margin-bottom: 16px;
}

.ailm-notice-title {
    font-weight: 700;
    color: #c2185b;
    margin-bottom: 6px;
    font-size: 15px;
}

.ailm-notice p {
    margin: 0 0 8px;
    font-size: 13px;
    color: #4b5563;
}

.ailm-notice ul {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: #4b5563;
}

.ailm-notice li {
    margin: 3px 0;
}

/* 卡片网格 */
.ailm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.ailm-grid-sm {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 12px;
}

.ailm-card {
    background: var(--ailm-bg);
    border: 1px solid var(--ailm-line);
    border-radius: var(--ailm-radius);
    overflow: hidden;
    display: block;
    transition: transform .18s ease, box-shadow .18s ease;
}

.ailm-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(23, 26, 32, .08);
}

.ailm-cover {
    width: 100%;
    aspect-ratio: 16 / 11;
    overflow: hidden;
    background: var(--ailm-soft);
}

.ailm-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ailm-series-body {
    padding: 12px 14px 14px;
}

.ailm-series-body h3 {
    font-size: 16px;
    margin-bottom: 2px;
}

.ailm-sub {
    color: var(--ailm-sub);
    font-size: 12.5px;
    margin: 0 0 8px;
    min-height: 18px;
}

.ailm-series-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.ailm-price {
    font-weight: 700;
    color: var(--ailm-pink);
    font-size: 18px;
}

.ailm-price i {
    font-style: normal;
    font-size: 12px;
    color: var(--ailm-sub);
    font-weight: 400;
}

.ailm-series-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.ailm-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef0ff;
    color: #4b3bd6;
    font-size: 12px;
}

.ailm-tag-ok {
    background: #e7f8ef;
    color: #15803d;
}

.ailm-tag-warn {
    background: #fff4e5;
    color: #b45309;
}

.ailm-tag-muted {
    background: var(--ailm-soft);
    color: var(--ailm-sub);
}

/* 详情 */
.ailm-back {
    display: inline-block;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--ailm-sub);
}

.ailm-detail-head {
    display: flex;
    gap: 18px;
    background: var(--ailm-bg);
    border: 1px solid var(--ailm-line);
    border-radius: var(--ailm-radius);
    padding: 16px;
    margin-bottom: 16px;
}

.ailm-cover-lg {
    width: 240px;
    flex: 0 0 240px;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    background: var(--ailm-soft);
}

.ailm-cover-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ailm-detail-info {
    flex: 1 1 auto;
    min-width: 0;
}

.ailm-kv {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13.5px;
    padding: 5px 0;
    border-bottom: 1px dashed var(--ailm-line);
}

.ailm-kv span {
    color: var(--ailm-sub);
}

.ailm-buy {
    margin-top: 14px;
}

/* 按钮 */
.ailm-btn {
    display: inline-block;
    border: 0;
    cursor: pointer;
    padding: 11px 22px;
    border-radius: 999px;
    background: var(--ailm-ink);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    transition: opacity .18s, transform .18s;
}

.ailm-btn:hover {
    opacity: .92;
}

.ailm-btn-buy {
    background: linear-gradient(135deg, var(--ailm-pink), var(--ailm-violet));
    box-shadow: 0 8px 18px rgba(255, 77, 125, .28);
    width: 100%;
    padding: 14px 22px;
    font-size: 16px;
}

.ailm-btn-sm {
    padding: 7px 14px;
    font-size: 13px;
}

.ailm-btn-block {
    width: 100%;
}

.ailm-btn-disabled,
.ailm-btn[disabled] {
    background: #d7dae0;
    color: #fff;
    cursor: not-allowed;
    box-shadow: none;
}

.ailm-link {
    background: none;
    border: 0;
    color: var(--ailm-pink);
    cursor: pointer;
    padding: 0;
    font-size: 13px;
}

.ailm-tip {
    font-size: 12.5px;
    color: var(--ailm-sub);
    margin: 10px 0 0;
}

.ailm-tip-warn {
    font-size: 12.5px;
    color: #b45309;
    background: #fff7e8;
    border-radius: 10px;
    padding: 8px 10px;
    margin: 10px 0 0;
}

/* 表格 */
.ailm-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ailm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.ailm-table th,
.ailm-table td {
    text-align: left;
    padding: 10px 10px;
    border-bottom: 1px solid var(--ailm-line);
    vertical-align: middle;
    white-space: nowrap;
}

.ailm-table th {
    color: var(--ailm-sub);
    font-weight: 600;
    font-size: 12.5px;
    background: var(--ailm-soft);
}

.ailm-cell-style {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ailm-rarity {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: var(--ailm-soft);
    color: #4b5563;
}

.ailm-rarity.r2 {
    background: #eaf2ff;
    color: #1d4ed8;
}

.ailm-rarity.r3 {
    background: #f0e9ff;
    color: #6d28d9;
}

.ailm-rarity.r4 {
    background: #fff1d6;
    color: #b45309;
}

/* 缩略图 */
.ailm-thumb {
    overflow: hidden;
    background: var(--ailm-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ailm-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ailm-thumb-ph span {
    font-weight: 700;
    color: #9aa1ad;
    letter-spacing: 1px;
}

.ailm-thumb-sm {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    flex: 0 0 38px;
    font-size: 12px;
}

/* 仓库 / 寄售 列表 */
.ailm-item {
    display: block;
}

.ailm-item-img {
    width: 100%;
    aspect-ratio: 1 / 1;
}

.ailm-item-body {
    padding: 10px 12px 12px;
}

.ailm-item-body h4 {
    font-size: 14px;
    margin: 0 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ailm-item-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.ailm-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: var(--ailm-soft);
    color: #4b5563;
}

.ailm-badge-ok {
    background: #e7f8ef;
    color: #15803d;
}

.ailm-badge-warn {
    background: #fff4e5;
    color: #b45309;
}

.ailm-badge-done {
    background: #eaf2ff;
    color: #1d4ed8;
}

.ailm-badge-info {
    background: #f0e9ff;
    color: #6d28d9;
}

.ailm-badge-muted {
    background: var(--ailm-soft);
    color: var(--ailm-sub);
}

/* 概率公示 */
.ailm-rule {
    margin: 8px 0 0;
    padding-left: 18px;
    font-size: 13px;
    color: #4b5563;
}

.ailm-prob-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.ailm-prob-block {
    border-top: 1px dashed var(--ailm-line);
    padding-top: 12px;
    margin-top: 12px;
}

.ailm-prob-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--ailm-sub);
    margin-bottom: 10px;
    align-items: center;
}

/* 弹层 */
.ailm-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(15, 18, 24, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.ailm-modal[hidden] {
    display: none;
}

.ailm-modal-box {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: 88vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}

.ailm-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: none;
    font-size: 24px;
    line-height: 1;
    color: #9aa1ad;
    cursor: pointer;
}

.ailm-form {
    display: grid;
    gap: 10px;
    margin: 12px 0;
}

.ailm-form label {
    display: grid;
    gap: 4px;
    font-size: 13px;
    color: var(--ailm-sub);
}

.ailm-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ailm-line);
    border-radius: 10px;
    font-size: 14px;
    color: var(--ailm-ink);
    background: #fff;
}

.ailm-form input:focus {
    outline: none;
    border-color: var(--ailm-violet);
}

.ailm-check-list {
    display: grid;
    gap: 6px;
    max-height: 160px;
    overflow-y: auto;
    background: var(--ailm-soft);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 6px;
}

.ailm-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
}

.ailm-result {
    text-align: center;
}

.ailm-result-thumb {
    width: 180px;
    height: 180px;
    margin: 8px auto 12px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--ailm-soft);
    font-size: 34px;
}

.ailm-result h3 {
    font-size: 20px;
    margin-bottom: 4px;
}

.ailm-result .ailm-rarity {
    margin-bottom: 10px;
}

.ailm-result-meta {
    display: flex;
    justify-content: center;
    gap: 18px;
    font-size: 12.5px;
    color: var(--ailm-sub);
    margin: 10px 0 16px;
    flex-wrap: wrap;
}

.ailm-result-actions {
    display: grid;
    gap: 8px;
}

.ailm-spin {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, .5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ailm-spin .7s linear infinite;
    vertical-align: -2px;
    margin-right: 6px;
}

@keyframes ailm-spin {
    to {
        transform: rotate(360deg);
    }
}

.ailm-disclaimer {
    font-size: 12.5px;
    color: var(--ailm-sub);
    padding: 0 4px;
}

.ailm-loading {
    opacity: .65;
    pointer-events: none;
}

@media (max-width: 720px) {
    .ailm {
        font-size: 14px;
        padding: 0 2px 28px;
    }

    .ailm-topbar {
        padding: 8px 10px;
        border-radius: 14px;
    }

    .ailm-nav a {
        padding: 6px 9px;
        font-size: 13px;
    }

    .ailm-detail-head {
        flex-direction: column;
        padding: 14px;
    }

    .ailm-cover-lg {
        width: 100%;
        flex: none;
        aspect-ratio: 16 / 10;
    }

    .ailm-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .ailm-grid-sm {
        grid-template-columns: repeat(2, 1fr);
    }

    .ailm-panel {
        padding: 14px;
        border-radius: 14px;
    }

    .ailm-h2 {
        font-size: 19px;
    }

    .ailm-price {
        font-size: 16px;
    }

    .ailm-series-body {
        padding: 10px 11px 12px;
    }

    .ailm-series-body h3 {
        font-size: 14.5px;
    }

    .ailm-table th,
    .ailm-table td {
        padding: 8px 8px;
        font-size: 12.5px;
    }
}
