/* ============================================================
   custom.css - 可乐云门户模板扩展样式
   基础部分迁移自原站 protocol/index.html 内联样式，保持原视觉风格
   ============================================================ */

.gradient-bg {
    background: linear-gradient(120deg, #2563eb, #3b82f6, #60a5fa);
    background-size: 200% 200%;
    animation: gradientBG 15s ease infinite;
}
@keyframes gradientBG {
    0% {background-position: 0% 50%;}
    50% {background-position: 100% 50%;}
    100% {background-position: 0% 50%;}
}
.hover-scale {
    transition: transform 0.3s ease;
}
.hover-scale:hover {
    transform: scale(1.05);
}
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.nav-menu {
    display: flex;
    align-items: center;
}
.mobile-menu {
    display: none;
}
.cola-gradient {
    background: linear-gradient(90deg, #1d4ed8, #3b82f6);
}
.cola-text {
    background: linear-gradient(90deg, #1d4ed8, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    .mobile-menu {
        display: none;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        padding: 1rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        z-index: 40;
        animation: slideDown 0.3s ease-out;
    }
    @keyframes slideDown {
        from {
            transform: translateY(-10px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    .mobile-menu.active {
        display: block;
    }
}

/* ---------------- 文章 / 协议正文（沿用原站协议页样式） ---------------- */
.agreement-container {
    line-height: 1.8;
}
.agreement-section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}
.agreement-section:last-child {
    border-bottom: none;
}
.agreement-h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1d4ed8;
}
.agreement-h3 {
    font-size: 1.2rem;
    font-weight: 500;
    margin: 1.5rem 0 0.8rem 0;
    color: #374151;
}
.agreement-p {
    margin-bottom: 1rem;
    color: #4b5563;
}
.agreement-list {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}
.agreement-list li {
    margin-bottom: 0.5rem;
    color: #4b5563;
}
.agreement-highlight {
    background-color: #dbeafe;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    border-left: 4px solid #3b82f6;
}
.agreement-warning {
    background-color: #fef3c7;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    border-left: 4px solid #f59e0b;
    font-weight: 500;
    color: #92400e;
}
.agreement-danger {
    background-color: #fee2e2;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    border-left: 4px solid #ef4444;
    font-weight: 500;
    color: #991b1b;
}
.breadcrumb {
    margin-bottom: 1.5rem;
}
.breadcrumb-item {
    display: inline-block;
    color: #6b7280;
    font-size: 0.9rem;
}
.breadcrumb-item a {
    color: #3b82f6;
    text-decoration: none;
}
.breadcrumb-item a:hover {
    text-decoration: underline;
}
.breadcrumb-separator {
    margin: 0 0.5rem;
    color: #9ca3af;
}

/* ---------------- 文章详情正文排版（接口返回的 HTML 内容） ---------------- */
.article-content {
    line-height: 1.8;
    color: #374151;
    word-wrap: break-word;
}
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    color: #1f2937;
    font-weight: 600;
    margin: 1.5rem 0 0.8rem;
    line-height: 1.4;
}
.article-content h1 { font-size: 1.75rem; }
.article-content h2 { font-size: 1.5rem; color: #1d4ed8; }
.article-content h3 { font-size: 1.25rem; }
.article-content p { margin-bottom: 1rem; }
.article-content ul,
.article-content ol { margin: 0 0 1rem 1.5rem; }
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: 0.5rem; }
.article-content blockquote {
    border-left: 4px solid #3b82f6;
    background-color: #eff6ff;
    padding: 0.75rem 1rem;
    border-radius: 0 0.5rem 0.5rem 0;
    margin: 1rem 0;
    color: #4b5563;
}
.article-content pre {
    background-color: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
    font-size: 0.875rem;
}
.article-content code {
    background-color: #f1f5f9;
    color: #b91c1c;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}
.article-content pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
}
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}
.article-content th,
.article-content td {
    border: 1px solid #e5e7eb;
    padding: 0.5rem 0.75rem;
    text-align: left;
}
.article-content th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 0.5rem 0;
}

/* ---------------- 公告 / 弹窗（沿用原站视觉语言） ---------------- */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.modal-mask.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 40rem;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.25s ease;
}
.modal-mask.active .modal-card {
    transform: translateY(0) scale(1);
}
.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    line-height: 1.8;
    color: #374151;
}
.modal-body img { max-width: 100%; height: auto; border-radius: 0.5rem; }
.modal-body h1, .modal-body h2, .modal-body h3 { color: #1f2937; font-weight: 600; margin: 1rem 0 0.5rem; }
.modal-body p { margin-bottom: 0.75rem; }
.modal-body ul, .modal-body ol { margin: 0 0 0.75rem 1.5rem; }
.modal-body ul { list-style: disc; }
.modal-body ol { list-style: decimal; }
.modal-body pre {
    background-color: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
}
.modal-close-btn {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s;
    cursor: pointer;
}
.modal-close-btn:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

/* ---------------- 公告条（Hero 下方短提示） ---------------- */
.announce-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    border-radius: 9999px;
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
    backdrop-filter: blur(8px);
}

/* ---------------- 公告 / 文章卡片通用 ---------------- */
.kly-card {
    background: #fff;
    border: 1px solid #f3f4f6;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s, transform 0.3s;
}
.kly-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}
.kly-tab {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.925rem;
    font-weight: 500;
    color: #4b5563;
    background: #fff;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
}
.kly-tab:hover { border-color: #93c5fd; color: #1d4ed8; }
.kly-tab.active {
    background: linear-gradient(90deg, #1d4ed8, #3b82f6);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 15px -3px rgba(30, 64, 175, 0.3);
}
.kly-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #eff6ff;
    color: #1d4ed8;
}

/* ---------------- API 文档页 ---------------- */
.method-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #fff;
}
.method-get { background: #2563eb; }
.method-post { background: #059669; }
.method-put { background: #d97706; }
.method-delete { background: #dc2626; }
.api-path {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9rem;
    color: #1f2937;
    word-break: break-all;
}
.code-block {
    background-color: #1e293b;
    color: #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.825rem;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre;
}
.code-block .tok-key { color: #7dd3fc; }
.code-block .tok-str { color: #fbbf24; }

/* ---------------- 骨架屏 ---------------- */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-wave 1.4s ease infinite;
    border-radius: 0.5rem;
}
@keyframes skeleton-wave {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------------- 空状态 / 错误状态 ---------------- */
.state-box {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}
.state-box .state-icon {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 1rem;
    border-radius: 9999px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
}
.retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    background: #2563eb;
    color: #fff;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}
.retry-btn:hover { background: #1d4ed8; }
