/* ==========================================
   开始界面样式
   ========================================== */

/* 开始界面主容器 */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 51, 0.95);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

.start-content {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2001;
    pointer-events: auto;
}

/* Logo 样式 */
.logo-container {
    margin-bottom: 0;
    text-align: center;
    order: 1;
}

.logo {
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

/* 设置区域 */
.settings {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 2002;
    pointer-events: auto;
    order: 3;
}

.toggle-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
    padding: 10px 0;
    position: relative;
    z-index: 2003;
    pointer-events: auto;
}

.setting-item {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

.setting-item select {
    padding: 8px 15px;
    border-radius: 15px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 16px;
    cursor: pointer;
    margin-left: 10px;
}

.setting-item select:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* 开始按钮 */
.start-button {
    background: #e0af00;
    color: #e9e9e9;
    border: none;
    padding: 15px 40px;
    font-size: 24px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 150px;
}

.start-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* 切换按钮通用样式 */
.toggle-btn {
    width: 180px;
    height: 45px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    box-sizing: border-box;
    transform-origin: center;
    border: 1px solid transparent;
}

.toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

/* 各个按钮的特定样式 */
.toggle-btn.pinyin {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.toggle-btn.sound {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
}

.toggle-btn.stars {
    background: linear-gradient(135deg, #1A237E, #3949AB);
}

/* 按钮激活状态的高级效果 */
.toggle-btn.active {
    background: linear-gradient(135deg, #26c000, #a5ff9c);
    box-shadow:
        inset 0 0 8px rgba(255, 255, 255, 0.314);
    transform: scale(1.05);
    color: #fff;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

/* 为每种类型的按钮提供不同的激活颜色 */
.toggle-btn.pinyin.active {
    background: linear-gradient(135deg, #2196F3, #64b5f6);
}

.toggle-btn.sound.active {
    background: linear-gradient(135deg, #9C27B0, #ce93d8);
}

.toggle-btn.stars.active {
    background: linear-gradient(135deg, #1A237E, #5c6bc0);
}

/* 右上角按钮样式 */
.corner-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 150px;
    height: 40px;
    font-size: 14px;
    z-index: 2002;
    box-sizing: border-box;
    transform-origin: center;
    border: 1px solid transparent;
}

.corner-btn .tooltip {
    visibility: hidden;
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
}

.corner-btn:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.corner-btn .tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 5px 5px 5px;
    border-style: solid;
    border-color: transparent transparent rgba(0, 0, 0, 0.8) transparent;
}

/* 确保激活状态按钮固定位置 */
.corner-btn.active {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    margin: 0 !important;
}

/* 教程按钮样式 */
.tutorial-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: white;
    font-size: 24px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: absolute;
    left: -20px;
    top: -15px;
}

.tutorial-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

/* 时间模式按钮样式 */
.toggle-btn.time {
    background-color: #14a41e;
}

.toggle-btn.time.active {
    background-color: #33cc33;
    color: white;
    box-shadow: 0 0 15px rgba(51, 204, 51, 0.6);
}

/* Start Button Wrapper */
.start-btn-wrapper {
    position: relative;
    width: 150px;
    /* Match start button width */
    height: 60px;
    /* Match start button height */
    margin: 0 auto;
    transition: width 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.start-btn-wrapper.expanded {
    width: 320px;
    /* 150px * 2 + 20px gap */
}

/* Learning Mode Button (Hidden by default on Desktop) */
.learning-mode-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #4CAF50, #8BC34A);
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0;
    transform: translateX(0);
    transition: all 0.3s ease;
    z-index: 1;
    pointer-events: none;
    /* Disable clicks when hidden */
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    white-space: nowrap;
    /* Prevent text wrapping during animation */
    overflow: hidden;
    /* Ensure text doesn't spill out */
}

.learning-mode-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

/* Start Button Adjustments */
.start-button {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
    z-index: 2;
}

/* Expanded State */
.start-btn-wrapper.expanded .learning-mode-btn {
    opacity: 1;
    width: 150px;
    pointer-events: auto;
    transform: translateX(0);
}

.start-btn-wrapper.expanded .start-button {
    width: 150px;
    /* Remove translateX, rely on right: 0 and wrapper expansion */
    transform: none;
    background: #e0af00;
    /* Keep original color */
}