html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    transition: background 0.8s ease;
}

/* 主题背景 */
body.theme-default { background-color: #f5f5dc; transition: background 0.8s ease; }
body.theme-hearth { background: linear-gradient(135deg, #42a5f5, #e3f2fd); }
body.theme-tavern { background: linear-gradient(135deg, #5d4037, #a1887f); }

/* 头部 */
.header {
    padding: 20px;
    text-align: center;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    position: relative;
    transition: all 0.8s ease;
}
body.theme-default .header { background: linear-gradient(to bottom, #8b0000, #666); }
body.theme-hearth .header { background: linear-gradient(to bottom, #42a5f5, #90caf9); color: #000; text-shadow: none; }
body.theme-tavern .header { background: linear-gradient(to bottom, #5d4037, #a1887f); color: #fff; text-shadow: 1px 1px 2px rgba(0,0,0,0.3); }

/* 主题切换按钮 */
.theme-buttons {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 5px;
}
.theme-btn {
    padding: 6px 12px;
    font-size: 0.9em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    color: white;
    transition: all 0.6s ease;
}
.btn-default { background-color: #8b0000; }
.btn-hearth { background-color: #42a5f5; }
.btn-tavern { background-color: #5d4037; }
.theme-btn:not(.active) { animation: floatBtn 3s ease-in-out infinite; }
@keyframes floatBtn { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* 主体布局 */
main { flex: 1; display: flex; justify-content: center; align-items: center; padding: 20px 0; }

/* 二维码和按钮盒子 */
.qrcode-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-height: calc(100vh - 160px);
    transition: all 0.8s ease;
    animation: floatBox 4s ease-in-out infinite;
}
@keyframes floatBox { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.qrcode-img {
    max-width: 350px;
    max-height: 50vh;
    width: auto;
    height: auto;
    border: 3px solid currentColor;
    border-radius: 8px;
    margin-bottom: 20px;
    transition: border-color 0.8s ease;
}
body.theme-default .qrcode-img { border-color: #8b0000; }
body.theme-hearth .qrcode-img { border-color: #42a5f5; }
body.theme-tavern .qrcode-img { border-color: #5d4037; }

.join-btn {
    display: inline-block;
    padding: 12px 25px;
    font-weight: bold;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.6s ease;
}
body.theme-default .join-btn { background: linear-gradient(45deg, #ff3333, #8b0000); color: #fff; }
body.theme-hearth .join-btn { background: linear-gradient(45deg, #42a5f5, #90caf9); color: #000; }
body.theme-tavern .join-btn { background: linear-gradient(45deg, #5d4037, #a1887f); color: #fff; }

/* 按钮涟漪 */
.theme-btn, .join-btn { position: relative; overflow: hidden; }
.theme-btn::after, .join-btn::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.6s ease, opacity 0.8s ease;
}
.theme-btn:active::after, .join-btn:active::after { transform: scale(4); opacity: 0.3; left: 50%; top: 50%; transform-origin: center; }

/* 底部 */
.footer {
    background-color: #1a1a1a;
    color: #fff;
    text-align: center;
    padding: 15px;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 100;
}

/* 响应式 */
@media (max-width: 480px) {
    .qrcode-img { max-width: 90%; max-height: 40vh; }
    .join-btn { width: 90%; text-align: center; }
    .theme-buttons { top: 10px; right: 10px; gap: 3px; }
}
