/* 全局样式 */
body {
    background-color: #f7f8fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Segoe UI, Arial, Roboto, 'PingFang SC', 'miui', 'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

#app {
    min-height: 100vh;
    padding-bottom: 50px;
    /* 底部导航栏高度 */
    background-color: #f7f8fa;
}

/* PC 端适配：居中显示，模拟手机 */
@media (min-width: 768px) {
    body {
        background-color: #eef0f4;
        display: flex;
        justify-content: center;
    }

    #app {
        width: 100%;
        max-width: 600px;
        min-height: 100vh;
        background-color: #f7f8fa;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
        position: relative;
    }

    /* 底部导航栏在 PC 端也要限制宽度 */
    .van-tabbar {
        max-width: 600px;
        left: 50% !important;
        transform: translateX(-50%);
    }
}

/* 工具类 */
.mt-2 {
    margin-top: 8px;
}

.mb-2 {
    margin-bottom: 8px;
}

.pt-2 {
    padding-top: 8px;
}

.pb-2 {
    padding-bottom: 8px;
}

/* 页面标题栏 */
.page-header {
    background-color: #fff;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

/* 卡片样式加强 */
.van-cell-group--inset {
    margin: 12px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    border: 1px solid #ebedf0;
    /* 增加圆角线条 */
}

/* 宫格快捷入口 */
.grid-nav {
    margin: 12px;
    background: transparent;
    border: none;
}

.grid-nav .van-grid-item__content {
    border-radius: 12px;
    border: 1px solid #ebedf0;
    /* 增加圆角线条 */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

/* 配置卡片通用样式 */
.config-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin: 12px;
    border: 1px solid #ebedf0;
    /* 增加圆角线条 */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.tool-tabs .van-tabs__wrap {
    height: 72px;
    overflow: visible;
}

.tool-tabs .van-tabs__nav {
    padding-top: 6px;
    padding-bottom: 8px;
}

.tool-tabs .van-tabs__line {
    bottom: 6px;
}

.tool-tabs .van-tab {
    height: 72px;
    min-height: 72px;
    line-height: 1;
    padding: 0 2px 8px;
}

.tool-tab-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-height: 54px;
    line-height: 1.1;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.tool-tab-icon-wrap {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    overflow: hidden;
}

.tool-tab-icon {
    display: block;
    max-width: 22px;
    max-height: 22px;
    width: auto;
    height: auto;
    object-fit: contain;
    flex: none;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
    transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.tool-tab-label {
    display: block;
    font-size: 11px;
    color: #646566;
    white-space: nowrap;
    line-height: 1.15;
    transition: color 0.2s ease, font-weight 0.2s ease;
}

.tool-tabs .van-tab:not(.van-tab--active) .tool-tab-title {
    opacity: 0.92;
}

.tool-tabs .van-tab--active .tool-tab-title {
    transform: translateY(-1px);
}

.tool-tabs .van-tab--active .tool-tab-icon {
    transform: scale(1.08);
    filter: drop-shadow(0 3px 8px rgba(255, 151, 106, 0.28));
}

.tool-tabs .van-tab--active .tool-tab-label {
    color: #ff976a;
    font-weight: 600;
}

.tool-content-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 12px;
    color: #666;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 4px;
}

.tool-content-title--center {
    justify-content: center;
}

.tool-content-title--large {
    font-size: 16px;
    color: #323233;
    font-weight: 700;
    margin-bottom: 0;
}

.tool-content-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
    flex: none;
}

.tool-content-icon--large {
    width: 22px;
    height: 22px;
}

.club-overview-card {
    padding: 10px;
}

.club-overview-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.club-overview-logo {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.club-overview-meta {
    margin-left: 8px;
    flex: 1;
    min-width: 0;
}

.club-overview-name {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin-bottom: 1px;
    line-height: 1.2;
}

.club-overview-subtitle {
    font-size: 11px;
    color: #999;
    line-height: 1.25;
}

.club-overview-refresh {
    margin-left: 6px;
}

.club-overview-grid {
    margin-bottom: 10px;
}

.club-overview-grid .van-grid-item__content {
    background: #f7f8fa;
    border-radius: 8px;
    min-height: 60px;
    padding: 8px 6px;
}

.club-overview-stat {
    text-align: center;
}

.club-overview-stat-label {
    font-size: 11px;
    color: #999;
    margin-bottom: 2px;
    line-height: 1.2;
}

.club-overview-stat-value {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}

.club-overview-stat-value--mono {
    font-family: monospace;
}

.club-overview-stat-value--danger {
    color: #ee0a24;
}

.club-overview-signin {
    margin-bottom: 10px;
    border-radius: 8px;
    height: 34px;
    font-size: 12px;
}

.club-overview-announcement {
    background: #fffbe8;
    padding: 8px 10px;
    border-radius: 8px;
    color: #ed6a0c;
    font-size: 11px;
    line-height: 1.4;
    margin-bottom: 10px;
}

.club-overview-announcement-title {
    font-weight: 700;
    margin-bottom: 2px;
}

.club-overview-leader {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: #f7f8fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.club-overview-leader-label {
    font-size: 12px;
    color: #666;
    margin-right: 6px;
}

.club-overview-leader-name {
    font-size: 12px;
    font-weight: 700;
    margin-left: 6px;
}

.club-overview-bag {
    background: #f7f8fa;
    border-radius: 8px;
    padding: 8px 10px;
}

.club-overview-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.club-overview-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #333;
}

.club-overview-section-meta {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
}

.club-overview-bag-empty {
    font-size: 11px;
    color: #999;
    text-align: center;
    padding: 8px 0;
}

.club-overview-bag-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.club-overview-bag-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 8px 9px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #edf0f3;
}

.club-overview-bag-icon-wrap {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    overflow: hidden;
    flex: 0 0 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e5e7eb;
}

.club-overview-bag-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.club-overview-bag-icon-fallback {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    line-height: 1;
}

.club-overview-bag-info {
    min-width: 0;
    flex: 1;
}

.club-overview-bag-name {
    font-size: 12px;
    color: #333;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.club-overview-bag-quantity {
    margin-top: 2px;
    font-size: 11px;
    font-weight: 700;
    color: #1989fa;
    line-height: 1.2;
}

.pk-toolbar {
    flex-wrap: nowrap;
}

.pk-teams {
    overflow: hidden;
}

.pk-teams__layout {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    min-width: 0;
}

.pk-team-panel,
.pk-team-title {
    min-width: 0;
}

.pk-team-panel {
    flex: 1 1 0;
}

.pk-team-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

.pk-team-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex: none;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.pk-team-name,
.pk-team-power,
.pk-legacy__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pk-team-name {
    font-size: 12px;
}

.pk-team-power {
    font-size: 10px;
    color: #718096;
    flex: none;
}

.pk-legacy {
    margin-top: 3px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

.pk-legacy__icon {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex: none;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #fff;
}

@keyframes pk-legacy-rainbow {
    0% {
        color: #ff6b6b;
    }

    16% {
        color: #f59e0b;
    }

    33% {
        color: #facc15;
    }

    50% {
        color: #4ade80;
    }

    66% {
        color: #60a5fa;
    }

    83% {
        color: #c084fc;
    }

    100% {
        color: #ff6b6b;
    }
}

.pk-legacy__text--rainbow {
    animation: pk-legacy-rainbow 4s linear infinite;
    font-weight: 800;
}

.pk-heroes-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, auto);
    row-gap: 4px;
    column-gap: 4px;
    align-items: center;
    justify-items: center;
    width: 100%;
    margin: 0 auto;
    min-width: 0;
    overflow: hidden;
}

.pk-hero-slot {
    text-align: center;
    position: relative;
    min-height: 110px;
    width: 100%;
    max-width: 88px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px 1px;
    box-sizing: border-box;
}

.pk-hero-empty {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.pk-hero-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1px;
    min-height: 12px;
    width: 100%;
    max-width: 74px;
}

.pk-hero-pearl,
.pk-hero-fish,
.pk-hero-meta {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pk-hero-pearl {
    font-size: 9px;
    line-height: 1;
    font-weight: 700;
}

.pk-hero-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin-top: 1px;
    max-width: 100%;
    flex-wrap: wrap;
}

.pk-hero-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1px solid #999;
    flex: none;
    box-sizing: border-box;
}

.pk-hero-image-wrap {
    position: relative;
    margin: 1px 0;
}

.pk-hero-image {
    display: block;
    width: 42px;
    height: 42px;
    border-radius: 4px;
}

.pk-hero-fish {
    max-width: 74px;
    font-size: 9px;
    line-height: 1.1;
}

.pk-hero-meta {
    max-width: 82px;
    margin-top: 1px;
    font-size: 9px;
    color: #333;
    line-height: 1.15;
    transform: scale(0.9);
    transform-origin: center top;
}

.pk-vs-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex: 0 0 24px;
    align-self: stretch;
}

.pk-vs-divider {
    width: 1px;
    height: 80%;
}

.pk-vs-badge {
    width: 20px;
    height: 20px;
    font-size: 10px;
}

.pk-team-stats {
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
}

.pk-results {
    word-break: break-word;
    overflow-wrap: anywhere;
}

@media (min-width: 768px) {
    .tool-tabs .van-tabs__wrap {
        height: 76px;
    }

    .tool-tabs .van-tab {
        height: 76px;
        min-height: 76px;
    }

    .tool-tab-icon-wrap {
        width: 30px;
        height: 30px;
    }

    .tool-tab-icon {
        max-width: 24px;
        max-height: 24px;
    }

    .tool-tab-label {
        font-size: 12px;
    }

    .tool-content-title {
        font-size: 13px;
    }

    .club-overview-grid .van-grid-item__content {
        min-height: 58px;
        padding: 7px 6px;
    }

    .club-overview-bag-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .pk-card {
        margin: 10px !important;
        padding: 12px !important;
    }

    .pk-header {
        margin-bottom: 12px !important;
    }

    .pk-status {
        margin-left: 8px;
    }

    .pk-toolbar {
        flex-wrap: wrap !important;
        gap: 8px 6px !important;
        padding: 10px 8px !important;
    }

    .pk-toolbar > div {
        display: none !important;
    }

    .pk-toolbar > #match-opponent-id {
        flex: 1 1 calc(100% - 32px) !important;
        min-width: 0;
    }

    .pk-toolbar > input[type="number"] {
        width: 64px !important;
    }

    .pk-toolbar > #match-start-btn {
        margin-left: auto;
        padding: 0 16px !important;
    }

    .pk-teams {
        padding: 12px 10px !important;
    }

    .pk-teams__layout {
        gap: 8px !important;
    }

    .pk-team-title {
        margin-bottom: 8px !important;
    }

    .pk-team-summary {
        gap: 3px;
    }

    .pk-team-avatar {
        width: 20px;
        height: 20px;
    }

    .pk-team-name {
        max-width: 68px;
        font-size: 11px;
    }

    .pk-team-power {
        max-width: 46px;
        font-size: 9px;
    }

    .pk-legacy {
        gap: 3px;
    }

    .pk-legacy__text {
        max-width: 82px;
    }

    .pk-vs-wrap {
        flex-basis: 18px;
    }

    .pk-vs-badge {
        width: 18px;
        height: 18px;
        font-size: 9px;
    }

    .pk-hero-slot {
        min-height: 96px;
        max-width: 74px;
        padding: 1px 0;
    }

    .pk-hero-top,
    .pk-hero-fish {
        max-width: 62px;
    }

    .pk-hero-image {
        width: 38px;
        height: 38px;
    }

    .pk-hero-meta {
        max-width: 68px;
        font-size: 8px;
    }

    .pk-team-stats {
        width: 100%;
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    .pk-results {
        max-height: 220px !important;
        padding: 10px !important;
        font-size: 12px !important;
    }
}

@media (max-width: 380px) {
    .pk-teams__layout {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .pk-vs-wrap {
        display: none !important;
    }

    .pk-team-panel {
        width: 100%;
    }

    .pk-heroes-grid {
        max-width: 220px;
    }
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.task-title {
    font-size: 16px;
    font-weight: 600;
    color: #323233;
}

.task-desc {
    font-size: 12px;
    color: #969799;
    margin-top: 4px;
}

/* 日志区域 */
.log-container {
    background: #1e1e1e;
    color: #a9b7c6;
    padding: 10px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
    height: calc(100vh - 120px);
    overflow-y: auto;
    margin: 12px;
    border-radius: 12px;
    border: 1px solid #ebedf0;
    /* 也加上线条 */
}

.log-info {
    color: #a9b7c6;
}

.log-error {
    color: #ff6b68;
    font-weight: bold;
}

.log-warn {
    color: #cc9900;
}

.log-success {
    color: #6a8759;
}
