* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 动漫背景 - 竖屏使用2.png */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('2.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

/* 横屏使用1.jpg */
@media screen and (orientation: landscape) {
    body::before {
        background-image: url('1.jpg');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }
}



/* 主要内容区域 */
.main-content {
    padding: 60px 16px 40px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* 移动端主内容区域优化 */
@media (max-width: 768px) {
    .main-content {
        padding: 80px 16px 40px;
    }
}


/* 主标题 */
.main-title {
    color: white;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    text-align: center;
}

/* 大屏幕标题优化 */
@media (min-width: 768px) {
    .main-title {
        font-size: 32px;
        margin-bottom: 32px;
    }
}

/* 搜索容器 */
.search-container {
    display: flex;
    margin-bottom: 24px;
    max-width: 600px;
    position: relative;
    width: 100%;
}

/* 大屏幕搜索布局优化 */
@media (min-width: 768px) {
    .search-container {
        justify-content: center;
        margin: 0 auto 24px;
    }
}

/* 移动端搜索容器优化 */
@media (max-width: 768px) {
    .search-container {
        margin: 0 auto 24px;
        padding: 0 16px;
    }
}

/* 玻璃态搜索框 */
.search-input {
    flex: 1;
    padding: 16px 20px;
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}


/* 移动端搜索框优化 */
@media (max-width: 768px) {
    .search-input {
        padding: 14px 16px;
        font-size: 14px;
        border-radius: 16px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .search-input {
        padding: 12px 14px;
        font-size: 13px;
    }
}

/* API卡片 */
.api-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* 大屏幕多列布局 */
@media (min-width: 768px) {
    .api-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .api-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .api-cards {
        grid-template-columns: repeat(4, 1fr);
    }
}

.api-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    height: 120px;
}


.api-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.15);
}


.card-left {
    flex: 1;
}


.api-info {
    width: 100%;
}

.api-info h3 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status {
    font-size: 12px;
    margin-bottom: 4px;
}

.status.normal {
    color: #2ed573;
}

.description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.call-count {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
}

.access-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    top: 16px;
    right: 16px;
}

.access-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}



/* 响应式设计 */
@media (max-width: 480px) {
    .main-content {
        padding: 20px 12px 20px;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .search-btn {
        width: 100%;
    }
    
    .api-card {
        padding: 12px;
        min-height: 100px;
        max-height: 120px;
        height: 120px;
    }
    
    
}

/* API详情弹窗 */
.api-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.api-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.modal-body {
    padding: 0 24px 24px;
}

.api-section {
    margin-bottom: 24px;
}

.section-title {
    color: #ff9500;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.section-content {
    color: white;
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
}

/* URL容器 */
.url-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.url-input {
    background: rgba(40, 40, 40, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    color: white;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    outline: none;
    transition: all 0.3s ease;
}

.url-input:focus {
    border-color: #ff9500;
    box-shadow: 0 0 0 2px rgba(255, 149, 0, 0.2);
}

.copy-btn {
    background: #007AFF;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #0056CC;
    transform: translateY(-1px);
}

.copy-btn:active {
    transform: translateY(0);
}

/* 参数表格 */
.params-table {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.params-table table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(40, 40, 40, 0.5);
}

.params-table th {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
    padding: 12px 8px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.params-table td {
    color: white;
    padding: 12px 8px;
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.params-table tr:last-child td {
    border-bottom: none;
}

.params-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* 代码块 */
.code-block {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.code-block pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    background: transparent;
}

.code-block code {
    color: #e6e6e6;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
}

/* 弹窗动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 移动端适配 */
@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header {
        padding: 16px 20px 12px;
    }
    
    .modal-body {
        padding: 0 20px 20px;
    }
    
    .modal-title {
        font-size: 18px;
    }
    
    .params-table th,
    .params-table td {
        padding: 8px 6px;
        font-size: 11px;
    }
    
    .url-input {
        font-size: 12px;
    }
    
    .copy-btn {
        font-size: 12px;
        padding: 10px 12px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 友链区域样式 */
.friends-section {
    margin-top: 40px;
    padding: 24px 0;
    width: 100%;
}

.friends-title {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.friends-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    width: 100%;
    margin: 0;
}

/* 手机端和小屏幕：2+1布局（上方两个，下方一个居中） */
@media (max-width: 768px) {
    .friends-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 16px;
        width: 100%;
        margin: 0;
        padding: 0 16px;
    }
    
    /* 上方两个卡片的容器 */
    .friends-row {
        display: flex;
        justify-content: space-between;
        width: 100%;
        gap: 16px;
        margin-bottom: 0;
    }
    
    /* 前两个卡片放在上方一行 */
    .friend-card:nth-child(1),
    .friend-card:nth-child(2) {
        flex: 1;
        aspect-ratio: 1;
        min-height: 200px;
    }
    
    /* 第三个卡片居中显示在下方 */
    .friend-card:nth-child(3) {
        width: 200px;
        height: 200px;
        margin: 0 auto;
    }
    
    /* 如果有更多卡片，继续居中显示 */
    .friend-card:nth-child(n+4) {
        width: 200px;
        height: 200px;
        margin: 0 auto;
    }
}

/* 更精确的手机端布局控制 */
@media (max-width: 480px) {
    .friends-container {
        gap: 12px;
        padding: 0 12px;
    }
    
    .friends-row {
        gap: 12px;
    }
    
    .friend-card:nth-child(1),
    .friend-card:nth-child(2) {
        aspect-ratio: 1;
        min-height: 160px;
    }
    
    .friend-card:nth-child(3),
    .friend-card:nth-child(n+4) {
        width: 160px;
        height: 160px;
    }
}

/* 大屏幕：隐藏friends-row，使用网格布局 */
@media (min-width: 769px) {
    .friends-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
        margin: 0;
        padding: 0;
    }
    
    .friends-row {
        display: none;
    }
    
    .friend-card:nth-child(1),
    .friend-card:nth-child(2),
    .friend-card:nth-child(3),
    .friend-card:nth-child(n+4) {
        width: auto;
        max-width: none;
        margin: 0;
        aspect-ratio: 1;
    }
}

/* 中等屏幕：3列布局 */
@media (min-width: 769px) and (max-width: 1024px) {
    .friends-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 大屏幕：4列布局 */
@media (min-width: 1025px) and (max-width: 1440px) {
    .friends-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
    }
}

/* 超大屏幕：5列布局 */
@media (min-width: 1441px) {
    .friends-container {
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
    }
}

.friend-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    width: 100%;
    aspect-ratio: 1;
    box-sizing: border-box;
}

.friend-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 16px;
    z-index: -1;
}

.friend-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.friend-icon {
    width: 25%;
    height: 25%;
    min-width: 50px;
    min-height: 50px;
    max-width: 80px;
    max-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    margin-bottom: 8px;
    margin-right: 0;
}

.friend-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.friend-icon:empty {
    background: rgba(255, 255, 255, 0.1);
}

.friend-icon:empty::after {
    content: '🔗';
    font-size: 24px;
    color: rgba(255, 255, 255, 0.6);
}

.friend-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0 8px;
}

.friend-name {
    font-size: clamp(14px, 4vw, 18px);
    font-weight: 600;
    color: white;
    margin: 0 0 6px 0;
    text-align: center;
    line-height: 1.3;
    word-break: break-word;
}

.friend-description {
    font-size: clamp(10px, 3vw, 14px);
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    line-height: 1.4;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.friend-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

/* 公告弹窗样式 */
.announcement-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.announcement-modal.show {
    opacity: 1;
    visibility: visible;
}

.announcement-content {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.announcement-modal.show .announcement-content {
    transform: scale(1) translateY(0);
}


.announcement-text {
    text-align: center;
    margin-top: 20px;
}

.announcement-text h2 {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    margin: 0 0 20px 0;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.announcement-text p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    margin: 8px 0;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 移动端公告弹窗优化 */
@media (max-width: 768px) {
    .announcement-content {
        width: 95%;
        padding: 25px;
    }
    
    .announcement-text h2 {
        font-size: 18px;
    }
    
    .announcement-text p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .announcement-content {
        width: 98%;
        padding: 20px;
    }
    
    .announcement-text h2 {
        font-size: 16px;
    }
    
    .announcement-text p {
        font-size: 13px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .friend-card {
        padding: 16px;
    }
    
    .friend-icon {
        width: 30%;
        height: 30%;
        min-width: 60px;
        min-height: 60px;
        max-width: 90px;
        max-height: 90px;
        margin-bottom: 12px;
    }
    
    .friend-name {
        font-size: clamp(16px, 4.5vw, 20px);
        margin-bottom: 8px;
    }
    
    .friend-description {
        font-size: clamp(12px, 3.5vw, 16px);
    }
}

/* 大屏幕优化 */
@media (min-width: 769px) {
    .friend-card {
        padding: 24px;
    }
    
    .friend-icon {
        width: 35%;
        height: 35%;
        min-width: 70px;
        min-height: 70px;
        max-width: 100px;
        max-height: 100px;
        margin-bottom: 16px;
    }
    
    .friend-name {
        font-size: clamp(18px, 5vw, 22px);
        margin-bottom: 10px;
    }
    
    .friend-description {
        font-size: clamp(14px, 4vw, 18px);
    }
}