* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    color: #f5e7c1;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background: linear-gradient(135deg, #2c2010, #1a1408);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 白色主题 */
body.white-theme {
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    color: #333;
}

/* 视频背景容器 */
#videoBackgroundContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

#backgroundVideo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    filter: brightness(0.4);
    display: none;
}

/* 太阳系3D背景容器 */
#solarSystemContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: #000;
    display: block;  /* 确保默认显示 */
}

/* 导航页面容器 */
.nav-container {
    position: relative;
    z-index: 10;
    background: rgba(60, 40, 10, 0.3);
    min-height: 100vh;
    padding: 20px;
    transition: background 0.3s ease;
}

/* 白色主题下的导航容器 */
body.white-theme .nav-container {
    background: rgba(255, 255, 255, 0.3);
}

/* 左侧控制面板 - 默认隐藏 */
.controls {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 100;
    background: rgba(40, 30, 10, 0.8);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 300px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(210, 180, 140, 0.3);
    transform: translateX(-100%);
    opacity: 0;
    transition: all 0.3s ease;
}

body.white-theme .controls {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(200, 200, 200, 0.3);
}

.controls.active {
    transform: translateX(0);
    opacity: 1;
}

.control-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-section h4 {
    color: #ffd700;
    margin-bottom: 5px;
    text-align: center;
    font-size: 0.95rem;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(210, 180, 140, 0.3);
    transition: color 0.3s ease;
}

body.white-theme .control-section h4 {
    color: #333;
}

.controls button {
    padding: 10px 12px;
    cursor: pointer;
    background: rgba(184, 134, 11, 0.8);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: all 0.3s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.white-theme .controls button {
    background: rgba(245, 245, 245, 0.8);
    color: #333;
}

.controls button:hover {
    background: #ffd700;
    color: #5d4000;
    transform: translateX(5px);
}

body.white-theme .controls button:hover {
    background: #333;
    color: #fff;
}

/* 左侧控制面板显示/隐藏按钮 */
.controls-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99;
    background: rgba(184, 134, 11, 0.8);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.white-theme .controls-toggle {
    background: rgba(245, 245, 245, 0.8);
    color: #333;
}

.controls-toggle:hover {
    background: #ffd700;
    color: #5d4000;
    transform: scale(1.1);
}

body.white-theme .controls-toggle:hover {
    background: #333;
    color: #fff;
}

/* 太阳系信息显示 */
#planetInfo {
    position: fixed;
    top: 15px;
    left: 15px;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 100;
    max-width: 250px;
    display: none;
}

#solarSystemInfo {
    position: fixed;
    top: 15px;
    right: 15px;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 100;
    text-align: center;
    max-width: 250px;
}

/* 导航页面内容 */
.container {
    max-width: 65%;
    margin: 0 auto;
    position: relative;
}

/* 头部时间区域 */
.header {
    text-align: center;
    padding: 25px 0 30px;
    position: relative;
}

.time-display {
    font-size: 2.8rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 10px;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
    transition: color 0.3s ease;
}

body.white-theme .time-display {
    color: #333;
    text-shadow: 0 0 10px rgba(51, 51, 51, 0.5);
}

.date-display {
    font-size: 1.1rem;
    color: #d4c19c;
    margin-bottom: 25px;
    transition: color 0.3s ease;
}

body.white-theme .date-display {
    color: #666;
}

/* 搜索下拉区域 */
.search-top-section {
    background: rgba(80, 60, 30, 0.8);
    border-radius: 12px;
    padding: 15px 25px;
    margin: 0 auto 30px;
    max-width: 800px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    border-left: 4px solid #ffd700;
    transition: background 0.3s ease, border-color 0.3s ease;
}

body.white-theme .search-top-section {
    background: rgba(245, 245, 245, 0.8);
    border-left: 4px solid #333;
}

.search-title {
    color: #ffd700;
    font-size: 1.2rem;
    white-space: nowrap;
    transition: color 0.3s ease;
}

body.white-theme .search-title {
    color: #333;
}

.search-top-container {
    display: flex;
    flex: 1;
    min-width: 300px;
    max-width: 90%;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 30px 0 0 30px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1rem;
    outline: none;
    border: 1px solid rgba(255, 215, 0, 0.3);
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

body.white-theme .search-input {
    background: rgba(200, 200, 200, 0.3);
    color: #333;
    border: 1px solid rgba(51, 51, 51, 0.3);
}

.search-input::placeholder {
    color: #d4c19c;
    transition: color 0.3s ease;
}

body.white-theme .search-input::placeholder {
    color: #666;
}

.search-select {
    padding: 12px 15px;
    border: none;
    background: rgba(184, 134, 11, 0.9);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    border-radius: 0;
    min-width: 120px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body.white-theme .search-select {
    background: rgba(245, 245, 245, 0.9);
    color: #333;
    border: 1px solid rgba(51, 51, 51, 0.3);
}

.search-btn {
    background: #ffd700;
    color: #5d4000;
    border: none;
    padding: 0 25px;
    border-radius: 0 30px 30px 0;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s, color 0.3s;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

body.white-theme .search-btn {
    background: #333;
    color: #fff;
    border: 1px solid rgba(51, 51, 51, 0.3);
}

.search-btn:hover {
    background: #ffec8b;
    color: #5d4000;
}

body.white-theme .search-btn:hover {
    background: #555;
    color: #fff;
}

/* 卡片网格布局 - 更紧凑 */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.card {
    background: rgba(100, 80, 40, 0.5);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s ease;
    border: 1px solid rgba(210, 180, 140, 0.3);
    position: relative;
    overflow: hidden;
    height: 80px;
    /* 高度缩小一半 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    backdrop-filter: blur(10px);
}

body.white-theme .card {
    background: rgba(245, 245, 245, 0.5);
    border: 1px solid rgba(200, 200, 200, 0.3);
}

.card:hover {
    transform: translateY(-3px);
    background: rgba(184, 134, 11, 0.8);
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.3);
}

body.white-theme .card:hover {
    background: rgba(200, 200, 200, 0.8);
    border-color: rgba(51, 51, 51, 0.6);
}

.card-icon {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: #ffd700;
    transition: color 0.3s ease;
}

body.white-theme .card-icon {
    color: #333;
}

.card h3 {
    font-size: 0.95rem;
    margin-bottom: 5px;
    color: #f5e7c1;
    transition: color 0.3s ease;
}

body.white-theme .card h3 {
    color: #333;
}

.card p {
    color: #d4c19c;
    font-size: 0.75rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

body.white-theme .card p {
    color: #666;
}

/* 舔狗日记区域 */
.diary-section {
    background: rgba(80, 60, 30, 0.5);
    border-radius: 12px;
    padding: 20px;
    margin: 0 auto 30px;
    max-width: 800px;
    border-left: 4px solid #ffd700;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    transition: background 0.3s ease, border-color 0.3s ease;
}

body.white-theme .diary-section {
    background: rgba(245, 245, 245, 0.5);
    border-left: 4px solid #333;
}

.diary-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.diary-title h2 {
    color: #ffd700;
    font-size: 1.3rem;
    transition: color 0.3s ease;
}

body.white-theme .diary-title h2 {
    color: #333;
}

.copy-btn {
    background: rgba(255, 215, 0, 0.3);
    border: 1px solid #ffd700;
    color: #ffd700;
    padding: 6px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

body.white-theme .copy-btn {
    background: rgba(51, 51, 51, 0.3);
    border: 1px solid #333;
    color: #333;
}

.copy-btn:hover {
    background: rgba(255, 215, 0, 0.5);
    color: #5d4000;
    border-color: #ffec8b;
}

body.white-theme .copy-btn:hover {
    background: rgba(51, 51, 51, 0.5);
    color: #fff;
    border-color: #555;
}

.diary-content {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #f0e0c0;
    transition: color 0.3s ease;
}

body.white-theme .diary-content {
    color: #333;
}

/* 右侧弹窗按钮 - 悬停触发 */
.sidebar-toggle {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: #ffd700;
    color: #5d4000;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.white-theme .sidebar-toggle {
    background: #333;
    color: #fff;
}

.sidebar-toggle:hover {
    background: #ffec8b;
    color: #5d4000;
    transform: translateY(-50%) scale(1.1);
}

body.white-theme .sidebar-toggle:hover {
    background: #555;
    color: #fff;
}

/* 右侧悬停弹窗 */
.sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 260px;
    height: 100%;
    background: rgba(60, 40, 10, 0.95);
    backdrop-filter: blur(10px);
    z-index: 999;
    transition: right 0.4s ease;
    padding: 25px;
    overflow-y: auto;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
    border-left: 1px solid rgba(210, 180, 140, 0.4);
    pointer-events: none;
    opacity: 0;
}

body.white-theme .sidebar {
    background: rgba(255, 255, 255, 0.95);
}

.sidebar.active {
    right: 0;
    pointer-events: auto;
    opacity: 1;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(210, 180, 140, 0.3);
}

body.white-theme .sidebar-header {
    border-bottom: 1px solid rgba(200, 200, 200, 0.3);
}

.sidebar-title {
    color: #ffd700;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

body.white-theme .sidebar-title {
    color: #333;
}

.sidebar-close {
    background: none;
    border: none;
    color: #d4c19c;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

body.white-theme .sidebar-close {
    color: #666;
}

.sidebar-close:hover {
    color: #ffec8b;
}

body.white-theme .sidebar-close:hover {
    color: #555;
}

.sidebar-section {
    margin-bottom: 25px;
}

.sidebar-section h3 {
    color: #f5e7c1;
    margin-bottom: 15px;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

body.white-theme .sidebar-section h3 {
    color: #333;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    max-width: 100%;
    width: fit-content;
    margin: 0 auto; /* 居中对齐 */
}

.emoji-item {
    background: rgba(120, 90, 50, 0.6);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 1/1; /* 保持正方形比例 */
    display: flex;
    align-items: center;
    justify-content: center;
}

body.white-theme .emoji-item {
    background: rgba(240, 240, 240, 0.6);
}

.emoji-item:hover {
    background: rgba(255, 215, 0, 0.3);
    transform: scale(1.1);
}

body.white-theme .emoji-item:hover {
    background: rgba(200, 200, 200, 0.3);
}

.component-item {
    background: rgba(120, 90, 50, 0.6);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

body.white-theme .component-item {
    background: rgba(240, 240, 240, 0.6);
}

.component-item:hover {
    background: rgba(255, 215, 0, 0.3);
    transform: translateX(5px);
}

body.white-theme .component-item:hover {
    background: rgba(200, 200, 200, 0.3);
}

.component-item h4 {
    color: #f5e7c1;
    margin-bottom: 5px;
    font-size: 1rem;
    transition: color 0.3s ease;
}

body.white-theme .component-item h4 {
    color: #333;
}

.component-item p {
    color: #d4c19c;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

body.white-theme .component-item p {
    color: #666;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 25px 0;
    color: #c9b89c;
    font-size: 0.9rem;
    border-top: 1px solid rgba(210, 180, 140, 0.3);
    transition: color 0.3s ease, border-color 0.3s ease;
}

body.white-theme .footer {
    color: #666;
    border-top: 1px solid rgba(200, 200, 200, 0.3);
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin: 15px 0;
}

.footer-links a {
    color: #d4c19c;
    text-decoration: none;
    transition: color 0.3s;
}

body.white-theme .footer-links a {
    color: #666;
}

.footer-links a:hover {
    color: #ffd700;
}

body.white-theme .footer-links a:hover {
    color: #333;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 0 10px;
    }

    .card {
        height: 70px;
        padding: 8px 5px;
    }

    .card-icon {
        font-size: 1rem;
        margin-bottom: 4px;
    }

    .card h3 {
        font-size: 0.8rem;
        margin-bottom: 3px;
    }

    .card p {
        font-size: 0.65rem;
        line-height: 1.2;
    }

    .time-display {
        font-size: 2.2rem;
    }

    .search-top-section {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }

    .search-title {
        text-align: center;
        margin-bottom: 10px;
    }

    .search-top-container {
        display: flex;
        flex-direction: column;
        min-width: 100%;
    }

    .search-input {
        border-radius: 30px;
        margin-bottom: 10px;
        padding: 14px 20px;
    }

    .search-select, .search-btn {
        border-radius: 30px;
        margin-bottom: 10px;
        padding: 14px;
        min-width: auto;
    }

    .search-select {
        margin-bottom: 10px;
    }

    .search-btn {
        border-radius: 30px;
        padding: 14px;
    }

    .sidebar {
        width: 85%; /* 调整为屏幕的85% */
        right: -85%;
    }

    .sidebar.active {
        right: 0;
    }

    .sidebar-toggle {
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    .controls-toggle {
        left: 10px;
        bottom: 10px;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    .controls {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
        transform: translateY(100%);
        opacity: 0;
        transition: all 0.3s ease;
    }

    .controls.active {
        transform: translateY(0);
        opacity: 1;
    }

    #planetInfo,
    #solarSystemInfo {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        margin: 10px auto;
        max-width: 100%;
    }
}