/* 现代化风格CSS - API聚合站点 */
:root {
    --primary-color: #4a6cf7;
    --primary-hover: #3c58d6;
    --secondary-color: #6c7a89;
    --text-color: #4a5568;
    --light-text: #718096;
    --dark-text: #2d3748;
    --background: #f8f9fa;
    --card-bg: #ffffff;
    --success: #38b2ac;
    --warning: #ed8936;
    --danger: #e53e3e;
    --info: #3182ce;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-md: 0 8px 16px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
    --radius: 10px;
    --radius-sm: 6px;
    --font-main: 'PingFang SC', 'Microsoft Yahei', 'Hiragino Sans GB', 'Heiti SC', 'WenQuanYi Micro Hei', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* 基本样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

html {
    font-size: 16px;
}

body {
    background-color: var(--background);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 1rem;
    overflow-x: hidden;
    width: 100%;
    -webkit-tap-highlight-color: transparent; /* 移动端点击高亮消除 */
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: #cfd8dc;
}

::-webkit-scrollbar-thumb:hover {
    background: #b0bec5;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

/* 导航栏 */
.header {
    position: sticky;
    top: 0;
    background-color: var(--card-bg);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    padding: 0 2rem;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    width: 100%;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease;
}

.header-brand:hover .header-logo {
    transform: rotate(5deg) scale(1.05);
}

.header-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-text);
    position: relative;
    transition: color 0.3s ease;
}

.header-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.header-brand:hover .header-title::after {
    width: 100%;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn {
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.7s ease;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(74, 108, 247, 0.25);
    transform: translateY(-2px);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 横幅区域 */
.banner {
    height: 200px;
    background-color: #5322da; /* 紫色 */
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white; /* 文字颜色改回白色，因为背景是深色 */
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.banner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath d='M25 40h70M25 60h70M25 80h70M40 25v70M60 25v70M80 25v70' stroke='%23ffffff' stroke-width='1.5' stroke-opacity='0.12' fill='none' stroke-linecap='round'/%3E%3Ccircle cx='40' cy='40' r='3' fill='%23ffffff' fill-opacity='0.2'/%3E%3Ccircle cx='60' cy='60' r='3' fill='%23ffffff' fill-opacity='0.2'/%3E%3Ccircle cx='80' cy='80' r='3' fill='%23ffffff' fill-opacity='0.2'/%3E%3Ccircle cx='40' cy='80' r='3' fill='%23ffffff' fill-opacity='0.15'/%3E%3Ccircle cx='80' cy='40' r='3' fill='%23ffffff' fill-opacity='0.15'/%3E%3C/svg%3E");
    z-index: 1;
    animation: floatingAPIs 60s linear infinite alternate;
}

@keyframes floatingAPIs {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 100% 100%;
    }
}

.banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: 1;
    pointer-events: none;
}

.banner-content {
    position: relative;
    z-index: 2;
    padding: 0 1rem;
}

.banner-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.banner-subtitle {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

.banner-stats {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 0.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 主要内容 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.api-card {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-top: 4px solid var(--primary-color);
    position: relative;
}

.api-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.api-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    background: linear-gradient(to right, var(--primary-color), var(--primary-hover));
    transition: height 0.3s ease;
    z-index: 0;
    opacity: 0.05;
}

.api-card:hover::before {
    height: 100%;
}

.api-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.25rem 0.75rem;
    position: relative;
    z-index: 1;
}

.api-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-text);
    margin: 0;
    line-height: 1.3;
}

.api-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background-color: rgba(56, 178, 172, 0.1);
    color: var(--success);
}

.status-maintenance {
    background-color: rgba(237, 137, 54, 0.1);
    color: var(--warning);
}

.status-paid {
    background-color: rgba(49, 130, 206, 0.1);
    color: var(--info);
}

.status-private {
    background-color: rgba(229, 62, 62, 0.1);
    color: var(--danger);
}

.api-card-body {
    padding: 0.75rem 1.25rem 1rem;
    flex-grow: 1;
    position: relative;
    z-index: 1;
}

.api-description {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
}

.api-card-footer {
    padding: 0.75rem 1.25rem 1.25rem;
    display: flex;
    justify-content: flex-end;
    position: relative;
    z-index: 1;
}

.api-link {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background-color: rgba(74, 108, 247, 0.1);
    color: var(--primary-color);
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.api-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
    z-index: -1;
}

.api-link:hover {
    color: white;
    background-color: transparent;
    box-shadow: 0 4px 10px rgba(74, 108, 247, 0.2);
    transform: translateY(-2px);
}

.api-link:hover::before {
    width: 100%;
}

/* 底部区域 */
.footer {
    background-color: var(--card-bg);
    padding: 2rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover), #8C54FF, #c75af3);
    background-size: 300% 100%;
    animation: gradientMove 5s ease infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    color: var(--light-text);
    line-height: 1.6;
    padding: 0 1rem;
}

/* 搜索框样式 */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-overlay.show {
    opacity: 1;
    visibility: visible;
}

.search-container {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    transform: translateY(30px);
    transition: transform 0.3s ease;
    text-align: center;
}

.search-overlay.show .search-container {
    transform: translateY(0);
}

.search-title {
    margin-bottom: 1.5rem;
    color: var(--dark-text);
    font-size: 1.75rem;
}

.search-form {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: rgba(0, 0, 0, 0.02);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
}

.search-btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

/* 详情页样式 */
.api-detail {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.detail-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 1.5rem;
}

.detail-title {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--dark-text);
}

.detail-meta {
    margin-bottom: 1.5rem;
}

.meta-item {
    display: flex;
    margin-bottom: 0.5rem;
    align-items: flex-start;
}

.meta-label {
    width: 100px;
    font-weight: 500;
    color: var(--light-text);
}

.meta-value {
    color: var(--dark-text);
    flex: 1;
    word-break: break-word;
}

.detail-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--dark-text);
    font-weight: 600;
}

/* 代码响应式样式 */
.response-code {
    background-color: #f5f7fa;
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    overflow-x: auto;
    color: #2d3748;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.param-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.param-table th,
.param-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.param-table th {
    font-weight: 500;
    background-color: rgba(0, 0, 0, 0.02);
    color: var(--dark-text);
}

.param-required {
    color: var(--danger);
    font-weight: 500;
}

/* 悬浮操作按钮 */
.floating-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 90;
}

.floating-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary-color);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.floating-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(74, 108, 247, 0.3);
}

/* 管理员面板响应式样式 */
.admin-container {
    flex-direction: row;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.admin-content {
    overflow-x: hidden;
}

/* 改进的响应式适配 */
@media (max-width: 1024px) {
    html {
        font-size: 15px;
    }
    
    .container {
        padding: 1.5rem 1rem;
    }
    
    .api-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
    }
    
    .api-detail {
        padding: 1.5rem;
    }
}

@media (max-width: 900px) {
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: static;
        padding: 1rem 0;
    }
    
    .admin-sidebar-header {
        padding: 0 1rem 1rem;
    }
    
    .admin-menu-item {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .header {
        padding: 0 1rem;
        height: 60px;
    }
    
    .header-logo {
        width: 32px;
        height: 32px;
    }
    
    .header-title {
        font-size: 1.25rem;
    }
    
    .header-right {
        gap: 0.5rem;
    }
    
    .btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
    
    .banner {
        height: 180px;
    }
    
    .banner-title {
        font-size: 2rem;
    }
    
    .banner-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .detail-title {
        font-size: 1.5rem;
    }
    
    .meta-item {
        flex-direction: column;
        margin-bottom: 1rem;
    }
    
    .meta-label {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .search-container {
        padding: 1.5rem;
    }
    
    .search-title {
        font-size: 1.5rem;
    }
    
    .search-form {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-input, .search-btn {
        width: 100%;
    }
    
    .api-detail {
        padding: 1.25rem;
    }
    
    .floating-actions {
        bottom: 1.5rem;
        right: 1.5rem;
        gap: 0.75rem;
    }
    
    .floating-btn {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
    
    .container {
        padding: 1rem 0.75rem;
    }
    
    .api-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .banner {
        height: 160px;
    }
    
    .banner-title {
        font-size: 1.75rem;
    }
    
    .api-title {
        font-size: 1.1rem;
        max-width: 70%;
    }
    
    .api-status {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }
    
    .api-card-header {
        padding: 1rem 1rem 0.5rem;
    }
    
    .api-card-body {
        padding: 0.5rem 1rem;
    }
    
    .api-card-footer {
        padding: 0.5rem 1rem 1rem;
    }
    
    .api-link {
        padding: 0.4rem 1rem;
    }
    
    .detail-section {
        margin-bottom: 1.5rem;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .detail-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .response-code {
        padding: 1rem;
        font-size: 0.8rem;
    }
    
    .param-table th,
    .param-table td {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .floating-btn {
        width: 40px;
        height: 40px;
    }
    
    .search-title {
        font-size: 1.35rem;
        margin-bottom: 1rem;
    }
}

/* 触屏设备的交互优化 */
@media (hover: none) {
    .api-card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .api-link:hover {
        transform: none;
    }
    
    .floating-btn:hover {
        transform: none;
    }
    
    /* 增加触摸区域大小，提高可点击性 */
    .btn, .api-link, .floating-btn {
        padding: 0.6rem 1.25rem; 
    }
    
    .floating-btn {
        width: 50px;
        height: 50px;
    }
    
    /* 添加点击状态反馈 */
    .btn:active, .api-link:active, .floating-btn:active {
        transform: scale(0.97);
        opacity: 0.9;
    }
} 