/**
 * 沙漏计时器样式 - 班级宠物系统整合版
 */

/* 模态框背景 - z-index提高到11000，确保高于其他所有元素 */
.sg-timer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 11000;
    display: none;
    pointer-events: none;
}

.sg-timer-modal.active {
    display: block;
    pointer-events: auto;
}

/* 计时器窗口 */
.sg-timer-window {
    position: fixed;
    width: 600px;
    height: 500px;
    background: linear-gradient(135deg, var(--sg-bg, #121212), #2c3e50);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 11001;
    left: calc(50% - 300px);
    top: calc(50% - 250px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
                opacity 0.3s ease,
                width 0.2s ease,
                height 0.2s ease,
                left 0.2s ease,
                top 0.2s ease;
    --sg-primary: #4a00e0;
    --sg-secondary: #8e2de2;
    --sg-bg: #121212;
    --sg-sand-color: #f1c40f;
    --sg-text-color: #f5f5f5;
    --sg-border-color: #333;
}

.sg-timer-window.minimized {
    height: 48px !important;
    width: 280px !important;
    left: calc(50% - 140px) !important;
    top: auto !important;
    bottom: 20px !important;
    right: auto !important;
    overflow: hidden;
    border-radius: 12px !important;
}

.sg-timer-window.minimized .sg-timer-content,
.sg-timer-window.minimized .sg-settings-fab,
.sg-timer-window.minimized .sg-resize-handle {
    display: none !important;
}

.sg-timer-window.minimized .sg-timer-header {
    border-bottom: none;
    padding: 8px 12px;
}

.sg-timer-window.maximized {
    width: 100vw !important;
    height: 100vh !important;
    left: 0 !important;
    top: 0 !important;
    bottom: auto !important;
    border-radius: 0;
    transition: all 0.3s ease;
}

/* 最大化模式下也要能点击控制按钮 */
.sg-timer-window.maximized .sg-timer-controls {
    z-index: 11002;
    pointer-events: auto;
}

.sg-timer-window.maximized .sg-timer-content {
    overflow: auto;
}

/* 最小化模式下的控制按钮也要能点击 */
.sg-timer-window.minimized .sg-timer-controls {
    pointer-events: auto;
}

/* 非最大化时，允许点击穿透到主页 */
.sg-timer-modal.active:not(.maximized-mode) {
    pointer-events: none;
}

.sg-timer-modal.active:not(.maximized-mode) .sg-timer-window {
    pointer-events: auto;
}

.sg-timer-window.dragging {
    opacity: 0.9;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

/* 标题栏 */
.sg-timer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
}

.sg-timer-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--sg-text-color);
    font-weight: 600;
    font-size: 16px;
}

.sg-timer-title i {
    color: var(--sg-secondary);
    font-size: 18px;
}

/* 最小化状态下标题栏倒计时样式 */
.sg-timer-title .timer-countdown {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 18px;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
    letter-spacing: 2px;
    animation: sgTimerPulse 1s ease-in-out infinite;
}

@keyframes sgTimerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* 最小化状态下调整标题栏样式 */
.sg-timer-window.minimized .sg-timer-title {
    font-size: 14px;
}

.sg-timer-window.minimized .sg-timer-title span:first-child {
    font-size: 14px;
}

.sg-timer-controls {
    display: flex;
    gap: 8px;
}

.sg-timer-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--sg-text-color);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 12px;
}

.sg-timer-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.sg-timer-btn.sg-close-btn:hover {
    background: #e74c3c;
}

/* 控制按钮图标 - 使用CSS绘制，确保在所有设备上正常显示 */
.sg-icon-minimize,
.sg-icon-maximize,
.sg-icon-close {
    display: inline-block;
    width: 10px;
    height: 10px;
    position: relative;
}

/* 最小化图标 - 一条横线 */
.sg-icon-minimize::before {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    border-radius: 1px;
}

/* 最大化图标 - 方框 */
.sg-icon-maximize::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 0;
    width: 100%;
    height: 8px;
    border: 1.5px solid currentColor;
    border-radius: 1px;
    box-sizing: border-box;
}

/* 关闭图标 - X */
.sg-icon-close::before,
.sg-icon-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 1.5px;
    background-color: currentColor;
    border-radius: 1px;
}

.sg-icon-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.sg-icon-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* 内容区域 */
.sg-timer-content {
    flex: 1;
    overflow: auto;
    position: relative;
    padding: 20px;
}

.sg-timer-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

/* 沙漏容器 */
.sg-sandglass-wrapper {
    position: relative;
    width: clamp(180px, 30%, 240px);
    height: clamp(240px, 45%, 320px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.sg-sandglass {
    position: relative;
    width: clamp(140px, 80%, 200px);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sg-glass-top, .sg-glass-bottom {
    position: relative;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.sg-glass-top {
    height: 45%;
    border-radius: 100px 100px 10px 10px;
    box-shadow: inset 0 -10px 20px rgba(0, 0, 0, 0.3);
}

.sg-glass-bottom {
    height: 45%;
    border-radius: 10px 10px 100px 100px;
    box-shadow: inset 0 10px 20px rgba(0, 0, 0, 0.3);
}

.sg-neck {
    position: relative;
    width: 40px;
    height: 10%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
    border-bottom: none;
    margin: 0 auto;
    z-index: 2;
    overflow: hidden;
}

.sg-sand-top {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--sg-sand-color);
    border-radius: 100px 100px 10px 10px;
    transition: height 0.5s linear;
}

.sg-sand-bottom {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--sg-sand-color);
    border-radius: 10px 10px 100px 100px;
    transition: height 0.5s linear;
}

.sg-flowing-sand {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 30px;
    background: var(--sg-sand-color);
    border-radius: 50% 50% 0 0;
    z-index: 3;
    animation: sgSandFlow 1s infinite linear;
    display: none;
}

@keyframes sgSandFlow {
    0% { height: 5px; }
    50% { height: 20px; }
    100% { height: 5px; }
}

.sg-sand-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}

.sg-sand-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--sg-sand-color);
    border-radius: 50%;
    top: 0;
    animation: sgSandFall linear forwards;
}

@keyframes sgSandFall {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(100px);
        opacity: 0;
    }
}

/* 计时器显示 */
.sg-timer-display {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: bold;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 30px;
    border-radius: 15px;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    font-family: 'Courier New', monospace;
    color: var(--sg-text-color);
}

/* 按钮组 */
.sg-timer-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: nowrap;
    width: 100%;
}

.sg-btn {
    background: linear-gradient(135deg, var(--sg-primary), var(--sg-secondary));
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    min-width: 70px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.sg-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(142, 45, 226, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.sg-btn:active {
    transform: translateY(0) scale(0.98);
}

.sg-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.sg-btn i {
    font-size: 11px;
}

/* 设置悬浮按钮 */
.sg-settings-fab {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sg-primary), var(--sg-secondary));
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
}

.sg-settings-fab:hover {
    transform: rotate(25deg) scale(1.08);
    box-shadow: 0 4px 14px rgba(142, 45, 226, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* 设置面板 */
.sg-settings-panel {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.sg-settings-panel.show {
    opacity: 1;
    visibility: visible;
}

.sg-settings-content {
    background: var(--sg-bg);
    border-radius: 16px;
    padding: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 85%;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--sg-border-color);
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.3s;
}

.sg-settings-panel.show .sg-settings-content {
    transform: translateY(0) scale(1);
}

.sg-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--sg-border-color);
}

.sg-settings-header h3 {
    font-size: 1.4rem;
    background: linear-gradient(to right, var(--sg-secondary), var(--sg-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.sg-settings-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 20px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.sg-settings-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* 设置网格 */
.sg-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.sg-setting-group {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 16px;
}

.sg-setting-group h4 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--sg-text-color);
}

.sg-setting-group h4 i {
    color: var(--sg-secondary);
}

/* 时间输入 */
.sg-time-inputs {
    display: flex;
    gap: 10px;
}

.sg-time-input {
    flex: 1;
}

.sg-time-input label {
    display: block;
    margin-bottom: 5px;
    color: #bbb;
    font-size: 12px;
}

.sg-time-input input {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--sg-border-color);
    border-radius: 8px;
    color: white;
    font-size: 16px;
    text-align: center;
}

.sg-time-input input:focus {
    outline: none;
    border-color: var(--sg-secondary);
}

.sg-reminder-time {
    margin-top: 12px;
}

/* 开关样式 */
.sg-toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0;
}

.sg-toggle-container label:first-child {
    color: var(--sg-text-color);
}

.sg-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.sg-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.sg-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    transition: .4s;
    border-radius: 24px;
}

.sg-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.sg-toggle input:checked + .sg-slider {
    background: linear-gradient(to right, var(--sg-primary), var(--sg-secondary));
}

.sg-toggle input:checked + .sg-slider:before {
    transform: translateX(26px);
}

/* 样式网格 */
.sg-style-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.sg-style-item {
    height: 45px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.sg-style-item:hover {
    transform: scale(1.05);
}

.sg-style-item.active {
    border-color: var(--sg-secondary);
    box-shadow: 0 0 10px rgba(142, 45, 226, 0.5);
}

/* 主题样式 */
.sg-theme-1 { background: linear-gradient(135deg, #4a00e0, #8e2de2); }
.sg-theme-2 { background: linear-gradient(135deg, #ff416c, #ff4b2b); }
.sg-theme-3 { background: linear-gradient(135deg, #11998e, #38ef7d); }
.sg-theme-4 { background: linear-gradient(135deg, #654ea3, #eaafc8); }
.sg-theme-5 { background: linear-gradient(135deg, #00c9ff, #92fe9d); }
.sg-theme-6 { background: linear-gradient(135deg, #ff5e62, #ff9966); }
.sg-theme-7 { background: linear-gradient(135deg, #5433ff, #20bdff); }
.sg-theme-8 { background: linear-gradient(135deg, #834d9b, #d04ed6); }
.sg-theme-9 { background: linear-gradient(135deg, #2b5876, #4e4376); }
.sg-theme-10 { background: linear-gradient(135deg, #ff6e7f, #bfe9ff); }

/* 沙漏样式 */
.sg-sand-style-1 { background-color: #f1c40f; }
.sg-sand-style-2 { background-color: #e74c3c; }
.sg-sand-style-3 { background-color: #2ecc71; }
.sg-sand-style-4 { background-color: #3498db; }
.sg-sand-style-5 { background-color: #9b59b6; }
.sg-sand-style-6 { background: linear-gradient(to bottom, #f1c40f, #e67e22); }
.sg-sand-style-7 { background: linear-gradient(to bottom, #e74c3c, #c0392b); }
.sg-sand-style-8 { background: linear-gradient(to bottom, #2ecc71, #27ae60); }
.sg-sand-style-9 { background: linear-gradient(to bottom, #3498db, #2980b9); }
.sg-sand-style-10 { background: linear-gradient(to bottom, #9b59b6, #8e44ad); }

/* 调整大小手柄 */
.sg-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.3) 50%);
    border-bottom-right-radius: 16px;
    z-index: 20;
    touch-action: none;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

.sg-timer-window.maximized .sg-resize-handle {
    display: none;
}

/* 滚动条美化 */
.sg-settings-content::-webkit-scrollbar {
    width: 6px;
}

.sg-settings-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.sg-settings-content::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--sg-primary), var(--sg-secondary));
    border-radius: 3px;
}

/* 窗口缩小时的按钮样式 - 小尺寸窗口 */
.sg-timer-window[data-small="true"] .sg-timer-buttons,
.sg-timer-window[style*="width: 3"][style*="px"] .sg-timer-buttons,
.sg-timer-window[style*="width: 4"][style*="px"] .sg-timer-buttons {
    gap: 6px;
}

.sg-timer-window[data-small="true"] .sg-btn,
.sg-timer-window[style*="width: 3"][style*="px"] .sg-btn,
.sg-timer-window[style*="width: 4"][style*="px"] .sg-btn {
    padding: 6px 10px;
    font-size: 11px;
    min-width: 55px;
    border-radius: 16px;
    gap: 3px;
}

.sg-timer-window[data-small="true"] .sg-settings-fab,
.sg-timer-window[style*="width: 3"][style*="px"] .sg-settings-fab,
.sg-timer-window[style*="width: 4"][style*="px"] .sg-settings-fab {
    width: 32px;
    height: 32px;
    font-size: 13px;
    bottom: 12px;
    right: 12px;
}

/* 响应式设计 - 平板和移动端 */
@media (max-width: 768px), (max-height: 600px) {
    .sg-timer-window {
        width: min(300px, 92vw) !important;
        height: min(400px, 62vh) !important;
        left: calc(50% - min(150px, 46vw)) !important;
        top: calc(50% - min(200px, 31vh)) !important;
        bottom: auto !important;
        border-radius: 12px;
    }
    
    .sg-timer-window.maximized {
        width: 100vw !important;
        height: 100vh !important;
        left: 0 !important;
        top: 0 !important;
        border-radius: 0;
    }
    
    /* 确保移动端控制按钮可点击 */
    .sg-timer-window .sg-timer-controls {
        pointer-events: auto;
        position: relative;
        z-index: 11002;
    }
    
    .sg-timer-window .sg-timer-btn {
        pointer-events: auto;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* 移动端标题栏 - 确保可拖拽 */
    .sg-timer-window .sg-timer-header {
        pointer-events: auto;
        touch-action: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    .sg-timer-content {
        padding: 8px;
        overflow-x: hidden;
    }
    
    .sg-timer-container {
        gap: 8px;
        justify-content: flex-start;
        padding-top: 5px;
    }
    
    /* 移动端最大化模式下内容垂直居中 */
    .sg-timer-window.maximized .sg-timer-container {
        justify-content: center;
        padding-top: 0;
        gap: 32px;
    }
    
    /* 移动端最大化模式下增大沙漏尺寸 */
    .sg-timer-window.maximized .sg-sandglass-wrapper {
        width: 180px;
        height: 240px;
    }
    
    .sg-timer-window.maximized .sg-sandglass {
        width: 140px;
    }
    
    /* 移动端最大化模式下增大数字计时显示 */
    .sg-timer-window.maximized .sg-timer-display {
        font-size: 2.2rem;
        padding: 12px 24px;
    }
    
    /* 移动端最大化模式下增大按钮 */
    .sg-timer-window.maximized .sg-timer-buttons {
        gap: 16px;
    }
    
    .sg-timer-window.maximized .sg-btn {
        padding: 12px 24px;
        font-size: 14px;
        min-width: 80px;
    }
    
    .sg-sandglass-wrapper {
        width: 130px;
        height: 170px;
        flex-shrink: 0;
    }
    
    .sg-sandglass {
        width: 100px;
    }
    
    .sg-timer-display {
        font-size: 1.6rem;
        padding: 8px 16px;
        letter-spacing: 2px;
        flex-shrink: 0;
    }
    
    .sg-timer-buttons {
        gap: 8px;
        flex-wrap: nowrap;
        flex-shrink: 0;
    }
    
    .sg-btn {
        padding: 8px 14px;
        font-size: 12px;
        min-width: 65px;
        flex-shrink: 0;
        border-radius: 18px;
    }
    
    .sg-settings-fab {
        width: 32px;
        height: 32px;
        font-size: 14px;
        bottom: 8px;
        right: 8px;
        pointer-events: auto;
        touch-action: manipulation;
    }
    
    /* 移动端调整大小手柄 */
    .sg-resize-handle {
        width: 30px;
        height: 30px;
        pointer-events: auto;
        touch-action: none;
    }
    
    .sg-settings-content {
        width: 95%;
        max-height: 80%;
        padding: 12px;
    }
    
    .sg-settings-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .sg-style-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }
    
    .sg-style-item {
        height: 36px;
    }
    
    .sg-time-inputs {
        flex-wrap: nowrap;
    }
    
    .sg-time-input {
        min-width: 60px;
        flex: 1;
    }
    
    .sg-time-input label {
        font-size: 10px;
    }
    
    .sg-time-input input {
        padding: 6px 4px;
        font-size: 14px;
    }
    
    .sg-setting-group {
        padding: 10px;
    }
    
    .sg-setting-group h4 {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 400px) {
    .sg-timer-window {
        width: 94vw !important;
        height: 380px !important;
        left: 3vw !important;
        top: calc(50% - 190px) !important;
    }
    
    .sg-sandglass-wrapper {
        width: 120px;
        height: 155px;
    }
    
    .sg-sandglass {
        width: 90px;
    }
    
    .sg-timer-display {
        font-size: 1.4rem;
        padding: 6px 12px;
    }
    
    .sg-btn {
        padding: 7px 12px;
        font-size: 11px;
        min-width: 58px;
    }
}

/* 防止内容溢出 */
.sg-timer-content {
    scrollbar-width: thin;
    scrollbar-color: var(--sg-primary) rgba(255, 255, 255, 0.05);
}

/* 动画优化 */
@media (prefers-reduced-motion: reduce) {
    .sg-timer-window,
    .sg-btn,
    .sg-timer-btn,
    .sg-settings-fab,
    .sg-settings-content,
    .sg-style-item {
        transition: none;
    }
    
    .sg-flowing-sand {
        animation: none;
    }
}
