/* ========== 基础样式 ========== */
body,
html {
    height: 100%;
    margin: 0;
    background-color: rgb(30, 30, 30);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 15px;
}

/* ========== 布局样式 ========== */
.center-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    transition: all 0.5s ease-out;
    position: relative;
}

.content-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80%;
    max-width: 600px;
    transition: all 0.5s ease-out;
}

/* ========== 图片容器样式 ========== */
.center-image-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    animation: container-pulse 1s ease-in-out infinite alternate;
}

.center-image {
    width: 100px;
    height: auto;
    position: absolute;
    top: 0;
    left: 0;
    /* cursor: pointer; */
    transition: filter 1.0s ease-in-out;
}

.center-image:hover {
    filter: invert(1) hue-rotate(180deg);
    animation: none;
}

@keyframes container-pulse {
    0% {
        filter: drop-shadow(0 0 2px rgba(60, 169, 242, 0.8));
    }

    100% {
        filter: drop-shadow(0 0 10px rgba(60, 169, 242, 1));
    }
}

/* ========== 用户信息区域 ========== */
.user-info-container {
    display: flex;
    width: 100%;
    padding: 20px;
    background-color: rgba(40, 40, 40, 0.8);
    border-radius: 8px;
    margin-bottom: 20px;
    align-items: center;
    border: 1px solid rgba(60, 169, 242, 0.3);
    transition: border 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-right: 20px;
    border: 2px solid rgb(0, 122, 204);
    box-shadow: 0 0 10px rgba(60, 169, 242, 0.5);
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
    /* 防止flex项目溢出容器 */
}

/* 信息行样式 */
.info-row {
    margin-bottom: 10px;
    display: flex;
}

.info-key {
    min-width: 80px;
    font-weight: bold;
    color: #aaa;
    flex-shrink: 0;
}

.info-value {
    flex: 1;
    word-break: break-all;
    /* 允许在任意字符处换行 */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Token信息样式 */
.token-info {
    color: rgba(60, 169, 242, 1);
}

/* 配额信息样式 */
.quota-info {
    color: rgba(60, 169, 242, 1);
    font-weight: normal;
}

/* 配额使用率样式 */
.quota-low {
    color: rgb(100, 255, 0); /* 绿色 - 低于50% */
    font-weight: normal;
}

.quota-medium {
    color: rgb(255, 255, 0); /* 黄色 - 50-80% */
    font-weight: normal;
}

.quota-high {
    color: rgb(255, 45, 81); /* 红色 - 80-99% */
    font-weight: normal;
}

.quota-full {
    color: #888; /* 灰色 - 100%，与最后刷新时间相同 */
    font-weight: normal;
}

/* 最后刷新时间样式 */
.last-refresh {
    color: #888;
}

/* 授权状态样式 */
.auth-valid {
    color: rgb(100, 255, 0);
}

.auth-invalid {
    color: rgb(255, 45, 81);
}

/* 有效边框样式 */
.border-valid {
    border: 1px solid rgba(100, 255, 0, 0.5) !important;
    box-shadow: 0 0 10px rgba(100, 255, 0, 0.3) !important;
}

/* 无效边框样式 */
.border-invalid {
    border: 1px solid rgba(255, 45, 81, 0.5) !important;
    box-shadow: 0 0 10px rgba(255, 45, 81, 0.3) !important;
}

/* ========== 生效提示 ========== */
.apply-tips {
    bottom: 10px;
    right: 10px;
    background-color: rgba(255, 45, 81, 0.3);
    color: rgb(255, 45, 81);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8em;
}

/* ========== 按钮样式 ========== */
.auth-button {
    background-color: rgb(0, 122, 204);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
    margin-top: 20px;
    box-shadow: 0 0 10px rgba(0, 122, 204, 0.3);
}

.auth-button:hover {
    background-color: rgb(0, 102, 184);
}

.auth-button:disabled {
    background-color: #555;
    cursor: not-allowed;
}

/* ========== 授权信息区域 ========== */
.auth-info-container {
    width: 100%;
    padding: 20px;
    background-color: rgba(40, 40, 40, 0.8);
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid rgba(60, 169, 242, 0.3);
    display: none;
    box-sizing: border-box;
}

.auth-code-container {
    position: relative;
    cursor: pointer;
    padding: 10px;
    background-color: rgba(60, 169, 242, 0.05);
    border-radius: 5px;
    transition: all 0.3s;
    margin: 15px 0;
}

.auth-code-container:hover {
    background-color: rgba(60, 169, 242, 0.1);
}

.auth-code-container:active {
    background-color: rgba(60, 169, 242, 0.15);
}

.auth-code {
    font-size: 2em;
    color: rgba(60, 169, 242, 1);
    text-align: center;
    letter-spacing: 5px;
    font-weight: bold;
}

.copy-tooltip {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.auth-code-container:hover .copy-tooltip {
    opacity: 1;
}

.copy-success {
    opacity: 1 !important;
    background-color: rgba(100, 255, 0, 0.7) !important;
}

/* ========== 复制成功提示 ========== */

.auth-link {
    display: block;
    color: rgba(60, 169, 242, 1);
    text-align: center;
    margin: 15px 0;
    text-decoration: none;
    padding: 10px;
    background-color: rgba(0, 122, 204, 0.2);
    border-radius: 4px;
    transition: background-color 0.3s;
}

.auth-link:hover {
    background-color: rgba(0, 122, 204, 0.3);
}

.auth-expires {
    color: #aaa;
    text-align: center;
    margin-top: 15px;
    font-size: 0.9em;
}

/* ========== 加载动画样式 ========== */
.loading {
    position: relative;
    width: 6rem;
    height: 6rem;
    transform-style: preserve-3d;
    perspective: 40rem;
    margin: 20px auto;
}

.loading .line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border-bottom: 0.15rem solid rgb(40, 162, 255, 1);
    animation: var(--ani) 1.15s linear infinite;
    animation-delay: var(--d);
}

@keyframes rotate1 {
    0% {
        transform: rotateX(35deg) rotateY(-45deg) rotate(0);
    }

    to {
        transform: rotateX(35deg) rotateY(-45deg) rotate(1turn);
    }
}

@keyframes rotate2 {
    0% {
        transform: rotateX(50deg) rotateY(10deg) rotate(0);
    }

    to {
        transform: rotateX(50deg) rotateY(10deg) rotate(1turn);
    }
}

@keyframes rotate3 {
    0% {
        transform: rotateX(35deg) rotateY(55deg) rotate(0);
    }

    to {
        transform: rotateX(35deg) rotateY(55deg) rotate(1turn);
    }
}

/* ========== 调试模式指示器 ========== */
.debug-mode {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background-color: rgba(255, 45, 81, 0.3);
    color: rgb(255, 45, 81);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8em;
}

/* ========== 自定义滚动条样式 ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(40, 162, 255, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(40, 162, 255, 0.7);
}

/* ========== 响应式布局调整 ========== */
@media screen and (max-width: 600px) {
    .content-wrap {
        width: 90%;
    }

    .user-info-container {
        flex-direction: column;
        padding: 15px;
    }

    .user-avatar {
        margin-right: 0;
        margin-bottom: 20px;
    }

    .user-details {
        width: 100%;
    }

    .info-row {
        flex-direction: column;
        margin-bottom: 15px;
    }

    .info-key {
        margin-bottom: 5px;
    }
}