:root {
    --primary: #4F46E5;
    --primary-light: #818CF8;
    --secondary: #7C3AED;
    --accent: #06B6D4;
    --accent-warm: #F59E0B;
    --bg-start: #EEF2FF;
    --bg-end: #F5F3FF;
    --card-bg: #FFFFFF;
    --section-bg: rgba(238, 242, 255, 0.85);
    --section-border: rgba(129, 140, 248, 0.25);
    --text-dark: #1E293B;
    --text-body: #475569;
    --text-muted: #94A3B8;
    --gradient-primary: linear-gradient(135deg, #4F46E5, #7C3AED);
    --gradient-nav: linear-gradient(to right, #4F46E5, #6D28D9, #2563EB);
    --gradient-section: linear-gradient(135deg, #4F46E5, #6D28D9);
    --shadow-sm: 0 1px 3px rgba(79, 70, 229, 0.08);
    --shadow-md: 0 4px 16px rgba(79, 70, 229, 0.1);
    --shadow-lg: 0 8px 30px rgba(79, 70, 229, 0.15);
    --radius: 14px;
    --radius-sm: 10px;
}

body {
    max-width: 660px;
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0 auto;
    padding: 0;
    background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
    background-attachment: fixed;
    color: var(--text-body);
    line-height: 1.6;
}

header {
    width: 100%;
    max-width: 660px;
    display: flex;
    background: var(--gradient-nav);
    color: #ffffff;
    height: 6vh;
    z-index: 10;
    box-shadow: 0 2px 20px rgba(79, 70, 229, 0.3);
}

#nav-open {
    display: block;
    position: relative;
    height: 3vh;
}

#nav-close {
    display: none;
    position: relative;
    height: 4vh;
}

.tudcb-nav-logo img {
    height: 4vh;
    display: block;
}

.tudcb-navbar {
    display: flex;
    color: #fff;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0px 20px;
    position: relative;
}

.tudcb-menu {
    display: flex;
    width: 55%;
    flex-direction: column;
    gap: 0;
    background: linear-gradient(180deg, #4338CA 0%, #6D28D9 100%);
    position: absolute;
    align-items: start;
    height: auto;
    min-height: 100vh;
    top: 6vh;
    right: 0px;
    padding: 20px 1rem;
    z-index: 10;
    margin: 0;
    list-style-type: none;
    display: none;
    box-shadow: -4px 0 25px rgba(79, 70, 229, 0.4);
    border-radius: 0 0 0 var(--radius);
}

.tudcb-menu li {
    position: relative;
    width: 100%;
}

.tudcb-menu li a {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    display: block;
}

.tudcb-menu li a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

.tudcb-menu.open {
    display: flex;
    flex-direction: column;
}

.tudcb-menu.open #nav-open {
    display: none;
}

.tudcb-menu.open #nav-close {
    display: block;
}

#tudcb-menu {
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateX(10px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* ================================== */
/* Game Card */
/* ================================== */
.tudcb-game-item {
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    background-color: var(--card-bg);
    border: 1px solid rgba(129, 140, 248, 0.15);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tudcb-game-item a {
    text-decoration: none;
}

.tudcb-game-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

/* ================================== */
/* Game Cover */
/* ================================== */
.tudcb-game-cover-recommend {
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
    position: relative;
    transform: none;
    margin: 0;
    border: none;
    box-shadow: none;
}

.tudcb-game-cover-recommend img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.4s ease-out;
}

/* 大游戏块图片高度 */
.tudcb-game-big-2 .tudcb-game-cover-recommend img,
.tudcb-game-big .tudcb-game-cover-recommend img {
    height: 340px;
}

/* 移动端优化 - 仅调整图片高度，保持原有布局 */
@media (max-width: 768px) {
    .tudcb-game-big-2 .tudcb-game-cover-recommend img,
    .tudcb-game-big .tudcb-game-cover-recommend img {
        height: 200px;
    }
    
    .tudcb-game-cover-recommend img {
        height: 140px;
    }
}

@media (max-width: 480px) {
    .tudcb-game-cover-recommend img {
        height: 120px;
    }
    
    .tudcb-game-big-2 .tudcb-game-cover-recommend img,
    .tudcb-game-big .tudcb-game-cover-recommend img {
        height: 160px;
    }
}

.tudcb-game-item:hover .tudcb-game-cover-recommend img {
    transform: scale(1.06);
}

/* ================================== */
/* Game Info */
/* ================================== */
.tudcb-game-info {
    display: flex;
    justify-content: center;
    align-items: start;
    flex-direction: column;
    padding: 10px 12px;
}

.tudcb-game-info p {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5em;
    max-height: 7.5em;
    font-size: 0.92rem;
    color: var(--text-body);
    font-weight: 500;
}

.tudcb-game-info p:first-child {
    color: var(--text-dark);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 0;
    transition: color 0.3s ease;
}

.tudcb-game-item:hover .tudcb-game-info p:first-child {
    color: var(--primary);
}

.tudcb-game-info p:last-child {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.tudcb-game-cover img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
    display: block;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
}

.common-game-right {
    display: flex;
    width: 20%;
    height: 30px;
    background: var(--gradient-primary);
    border-radius: 20px;
    right: 0px;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.2);
    transition: all 0.3s ease;
}

/* ================================== */
/* Section Container */
/* ================================== */
.tudcb-recomed-div {
    margin: 18px 12px;
    border-radius: var(--radius);
    padding: 16px;
    background-color: var(--section-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--section-border);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.tudcb-recomed-div:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.tudcb-detail-recomed-div {
    margin: 10px 20px;
    border-radius: var(--radius-sm);
    padding: 10px 0px;
}

/* ================================== */
/* Section Title */
/* ================================== */
.tudcb-common-recommend-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--gradient-section);
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 12px rgba(79, 70, 229, 0.2);
}

.tudcb-common-recommend-title p {
    color: #fff;
    font-size: 1rem;
    margin: 8px 0px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.tudcb-common-recommend-title img {
    width: 22px;
    height: 22px;
    opacity: 0.9;
}

.tudcb-common-recommend-content {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.tudcb-common-recommend-content-2 {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.tudcb-game-big-2 {
    grid-column: span 2;
    grid-row: span 2;
}

.game-big-3 {
    grid-column: span 3;
    grid-row: span 3;
}

/* ================================== */
/* Footer */
/* ================================== */
footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: var(--gradient-nav);
    text-align: center;
    box-shadow: 0 -2px 20px rgba(79, 70, 229, 0.15);
}

.tudcb-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.tudcb-footer-links a {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.tudcb-footer-links a:hover {
    background: rgba(255, 255, 255, 0.15);
    text-decoration: none;
}

footer .tudcb-copyright {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.85);
    margin: 10px 0px;
}

/* ================================== */
/* Floating Buttons */
/* ================================== */
#back-top,
#back-home {
    width: 22px;
    height: 22px;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.2s;
}

#back-top:hover,
#back-home:hover {
    opacity: 1;
}

#flow {
    position: fixed;
    bottom: 10rem;
    right: 0.6rem;
    display: none;
    flex-direction: column;
    align-items: center;
    background: var(--gradient-nav);
    padding: 0.5rem;
    gap: 10PX;
    border-radius: 10rem;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
    transition: box-shadow 0.3s;
}

#flow:hover {
    box-shadow: 0 6px 24px rgba(79, 70, 229, 0.4);
}

/* ================================== */
/* Game Detail */
/* ================================== */
.tudcb-game-detail-title {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0px 1rem;
    border-radius: var(--radius);
}

.game-detail-iframe {
    width: 100%;
}

.tudcb-game-detail-img {
    width: 80%;
}

.tudcb-game-detail-img img {
    width: 100%;
    border-radius: var(--radius);
    object-fit: cover;
    aspect-ratio: 1 / 0.8;
    display: block;
    box-shadow: var(--shadow-md);
}

.tudcb-detail-info {
    position: relative;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    margin: 0px 20px;
    order: 1;
}

.tudcb-detail-info h2 {
    color: var(--text-dark);
    font-size: 1rem;
    margin: 10px;
    font-weight: 400;
}

.tudcb-detail-info p {
    color: var(--text-body);
    font-size: 0.95rem;
    margin: 10px 0px;
    line-height: 1.6;
}

.tudcb-detail-info a {
    text-decoration: none;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    order: -1;
}

.tudcb-game-instructions {
    display: flex;
    flex-wrap: wrap;
    margin: 10px 20px;
    background: var(--gradient-section);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.tudcb-game-instructions p {
    color: #fff;
    line-height: 1.5rem;
    font-size: 1rem;
}

.tudcb-game-gameplay-button {
    display: flex;
    border-radius: var(--radius);
    margin: 10px;
    width: 50%;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: -140px;
    right: -10px;
}

.tudcb-game-gameplay-button img {
    width: 120px;
    height: 120px;
}

.tudcb-game-gameplay-button p {
    color: #fff;
    margin: 0px;
}

/* ================================== */
/* Game iframe */
/* ================================== */
.tudcb-game-iframe {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: 100vh;
    position: relative;
}

#iframe-menu-btn {
    margin-top: 20px;
    margin-left: 60px;
    position: absolute;
    height: 40px;
}

#iframe-back-btn {
    margin-top: 20px;
    margin-left: 20px;
    position: absolute;
    height: 50px;
}

/* ================================== */
/* News / Article Detail */
/* ================================== */
.tudcb-news-detail {
    color: var(--text-dark);
    text-align: start;
    padding: 1.2rem;
    margin-top: 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    margin-left: 10px;
    margin-right: 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(129, 140, 248, 0.1);
}

.tudcb-news-detail h3 {
    color: var(--primary);
    font-size: 1.4rem;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--section-border);
}

.tudcb-news-detail h4 {
    color: var(--secondary);
    font-size: 1.1rem;
    margin: 20px 0 10px;
}

.tudcb-news-detail p {
    color: var(--text-body);
    line-height: 1.7;
    margin: 10px 0;
}

.tudcb-news-detail img {
    width: 100%;
    object-fit: contain;
}

/* ================================== */
/* Error Page */
/* ================================== */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.error-page h1 {
    font-size: 2em;
    color: var(--text-dark);
}

.error-page p {
    font-size: 1.4em;
    color: var(--text-body);
    padding: 1rem;
}

.error-page img {
    width: 100%;
    padding: 2rem 1rem;
}

/* ================================== */
/* Game Mark / Badge */
/* ================================== */
.tudcb-game-mark {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: start;
    height: 4vh;
    position: absolute;
    border-radius: 0px 0px var(--radius-sm) var(--radius-sm);
    top: -10px;
    left: -10px;
}

.tudcb-game-mark img {
    width: 50px;
    height: 25px;
}

.tudcb-game-new {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: start;
    height: 4vh;
    position: absolute;
    border-radius: 0px 0px var(--radius-sm) var(--radius-sm);
    top: 0px;
    left: -10px;
}

.tudcb-game-new img {
    width: 50px;
    height: 50px;
}

.tudcb-game-mark p {
    color: #fff;
    font-size: 1rem;
    margin: 0px 10px;
}

#tudcb-game-body {
    margin-top: 30px;
}

/* ================================== */
/* Iframe Menu */
/* ================================== */
.iframe-menu {
    display: flex;
    width: 60%;
    flex-direction: column;
    gap: 35px;
    background: linear-gradient(180deg, #EEF2FF, #FFFFFF);
    position: absolute;
    align-items: start;
    height: 100vh;
    top: 0vh;
    right: 0px;
    z-index: 8;
    margin: 0;
    list-style-type: none;
    display: none;
    padding: 10px 10px;
    border-left: 3px solid var(--primary);
}

.iframe-menu.open {
    display: flex;
    flex-direction: column;
}

.iframe-menu li a {
    font-size: 1rem;
    color: var(--text-dark);
    text-decoration: none;
}

.iframe-list-item a {
    display: flex;
    flex-direction: row;
    margin: 0px;
    justify-content: space-between;
    align-items: center;
}

.iframe-list-item a img {
    margin: 0px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    aspect-ratio: 1 / 1;
    display: block;
}

.iframe-list-item a p {
    margin: 0px 20px;
    position: relative;
}

.iframe-list-item-close a {
    display: flex;
    flex-direction: row;
    margin: 0px;
    justify-content: end;
    align-items: center;
}

.iframe-list-item-close img {
    margin: 0px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    aspect-ratio: 1 / 1;
    display: block;
}

#iframe-close-btn {
    right: 0px;
    top: 0px;
}
