* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Comic Neue', 'Comic Sans MS', cursive;
    background: #fff9c4;
    background-image: 
        radial-gradient(circle, #000 1px, transparent 1px);
    background-size: 20px 20px;
    min-height: 100vh;
}

/* 顶部标题 */
.header {
    text-align: center;
    padding: 25px 20px;
    position: relative;
}
.header h1 {
    font-family: 'Bangers', cursive;
    font-size: 42px;
    color: #fff;
    text-shadow: 
        3px 3px 0 #000,
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000;
    letter-spacing: 3px;
    display: inline-block;
    background: #ff1744;
    padding: 10px 30px;
    border: 4px solid #000;
    border-radius: 8px;
    transform: rotate(-2deg);
    box-shadow: 6px 6px 0 #000;
}

/* 顶部标签栏 - 仅移动端显示 */
.tab-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffeb3b;
    border-bottom: 4px solid #000;
    z-index: 100;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    gap: 10px;
}
.tab-btn {
    display: inline-block;
    padding: 12px 20px;
    background: #fff;
    color: #000;
    border: 3px solid #000;
    border-radius: 0;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 4px 4px 0 #000;
    transform: rotate(-1deg);
}
.tab-btn:nth-child(even) {
    transform: rotate(1deg);
}
.tab-btn:hover {
    transform: translate(-2px, -2px) rotate(-1deg);
    box-shadow: 6px 6px 0 #000;
}
.tab-btn.active {
    background: #ff1744;
    color: #fff;
    transform: translate(2px, 2px) rotate(0deg) !important;
    box-shadow: 2px 2px 0 #000;
}

/* 移动端全屏iframe容器 */
.mobile-view {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
}
.mobile-frame {
    width: 100%;
    height: 100%;
    display: none;
    position: relative;
    border: 4px solid #000;
}
.mobile-frame.active {
    display: block;
}
.mobile-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 桌面端网格布局 */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
    gap: 25px;
    padding: 0 25px 25px;
    max-width: 1800px;
    margin: 0 auto;
}
.site-card {
    background: #fff;
    border: 4px solid #000;
    overflow: visible;
    display: flex;
    flex-direction: column;
    height: 420px;
    box-shadow: 8px 8px 0 #000;
    position: relative;
    transform: rotate(-0.5deg);
    transition: all 0.15s ease;
}
.site-card:nth-child(even) {
    transform: rotate(0.5deg);
}
.site-card:hover {
    transform: translate(-4px, -4px) rotate(0deg);
    box-shadow: 12px 12px 0 #000;
}

/* 漫画格子编号 */
.site-card::before {
    content: attr(data-num);
    position: absolute;
    top: -15px;
    left: -15px;
    width: 40px;
    height: 40px;
    background: #ffeb3b;
    border: 3px solid #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Bangers', cursive;
    font-size: 20px;
    z-index: 10;
}

.site-header {
    background: linear-gradient(90deg, #00bcd4, #4dd0e1);
    color: #000;
    padding: 12px 18px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 4px solid #000;
    position: relative;
}

.site-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 0.5px;
}
.status-dot {
    width: 12px;
    height: 12px;
    background: #4caf50;
    border: 2px solid #000;
    border-radius: 50%;
}
.status-dot.loading {
    background: #ffeb3b;
    animation: blink 0.5s infinite;
}
.status-dot.error {
    background: #ff1744;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.header-btns {
    display: flex;
    gap: 8px;
}
.header-btn {
    color: #000;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    background: #ffeb3b;
    border: 2px solid #000;
    cursor: pointer;
    transition: all 0.1s;
    font-family: Arial, sans-serif;
    box-shadow: 3px 3px 0 #000;
}
.header-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 #000;
}
.header-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 #000;
}

.frame-wrapper {
    flex: 1;
    position: relative;
    background: #fff;
    overflow: hidden;
}
.frame-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 加载状态 - 漫画风格 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            #f5f5f5 10px,
            #f5f5f5 20px
        );
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 10;
}
.loading-overlay.hidden {
    display: none;
}
.loading-text {
    font-family: 'Bangers', cursive;
    font-size: 28px;
    color: #000;
    text-shadow: 2px 2px 0 #ffeb3b;
    animation: shake 0.3s infinite;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px) rotate(-2deg); }
    75% { transform: translateX(3px) rotate(2deg); }
}
.loading-dots {
    display: flex;
    gap: 8px;
}
.loading-dots span {
    width: 16px;
    height: 16px;
    background: #ff1744;
    border: 2px solid #000;
    animation: bounce 0.6s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* 错误状态 - 漫画风格 */
.error-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    text-align: center;
    z-index: 10;
}
.error-overlay.show {
    display: flex;
}
.error-bubble {
    background: #fff;
    border: 4px solid #000;
    border-radius: 20px;
    padding: 25px 35px;
    position: relative;
    box-shadow: 5px 5px 0 #000;
}
.error-bubble::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    border: 15px solid transparent;
    border-top-color: #000;
}
.error-bubble::before {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    border: 12px solid transparent;
    border-top-color: #fff;
    z-index: 1;
}
.error-title {
    font-family: 'Bangers', cursive;
    font-size: 24px;
    color: #ff1744;
    text-shadow: 2px 2px 0 #000;
}
.error-desc {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    margin-top: 10px;
}
.error-btn {
    margin-top: 10px;
    padding: 12px 30px;
    background: #ff1744;
    color: #fff;
    border: 3px solid #000;
    font-family: 'Bangers', cursive;
    font-size: 18px;
    letter-spacing: 1px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 4px 4px 0 #000;
    transition: all 0.1s;
}
.error-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000;
}

/* 全屏模式 */
.fullscreen-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    padding: 20px;
}
.fullscreen-modal.show {
    display: flex;
    flex-direction: column;
}
.fullscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
}
.fullscreen-title {
    font-family: 'Bangers', cursive;
    font-size: 28px;
    color: #ffeb3b;
    text-shadow: 3px 3px 0 #000;
    letter-spacing: 2px;
}
.fullscreen-close {
    width: 50px;
    height: 50px;
    background: #ff1744;
    border: 3px solid #000;
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 4px 4px 0 #000;
    transition: all 0.1s;
}
.fullscreen-close:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000;
}
.fullscreen-content {
    flex: 1;
    background: #fff;
    border: 4px solid #000;
    overflow: hidden;
    position: relative;
    box-shadow: 8px 8px 0 #000;
}
.fullscreen-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .header {
        display: none;
    }
    .tab-bar {
        display: flex;
    }
    .mobile-view {
        display: block;
    }
    .container {
        display: none;
    }
    .fullscreen-modal {
        padding: 10px;
    }
}

/* 平板适配 */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        grid-template-columns: repeat(2, 1fr);
    }
    .site-card {
        height: 380px;
    }
}

/* 隐藏滚动条 */
.tab-bar::-webkit-scrollbar {
    display: none;
}
.tab-bar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
