* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    overflow: hidden;
    user-select: none;
}

.desktop {
    background-image: url('https://rinr2.jiuyou.eu.org/rin/rinimages/fda0361be74cbeeb7b1b8ab98163b0827fefdfa7.png');
    background-size: cover;
    background-position: center;
    height: 100vh;
    width: 100vw;
    position: relative;
    overflow: hidden;
}

/* 桌面图标样式 */
.desktop-icons {
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-width: 180px;
    margin-left: 10px;
}

.icon {
    width: 80px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.icon i {
    font-size: 32px;
    margin-bottom: 8px;
    color: #fff;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

.icon span {
    color: #fff;
    text-align: center;
    font-size: 12px;
    max-width: 100%;
    word-break: break-word;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

.icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.icon:active {
    background-color: rgba(255, 255, 255, 0.2);
}

.icon .tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    top: 110%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    white-space: nowrap;
    z-index: 10;
}

.icon:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

/* 任务栏样式 */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background-color: rgba(25, 25, 35, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    z-index: 1000;
}

.start-button {
    width: 48px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.start-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.start-button i {
    color: white;
    font-size: 20px;
}

.search-box {
    height: 32px;
    margin-left: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    width: 240px;
}

.search-box i {
    color: white;
    margin-right: 8px;
}

.search-box input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
    width: 100%;
    font-size: 14px;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.taskbar-icons {
    display: flex;
    align-items: center;
    height: 100%;
    margin-left: 10px;
}

.taskbar-icons i {
    width: 40px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.taskbar-icons i:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.system-tray {
    margin-left: auto;
    display: flex;
    align-items: center;
    height: 100%;
}

.system-tray i {
    width: 24px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 14px;
}

.time-date {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 12px;
    width: 80px;
    height: 100%;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.time-date:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 开始菜单样式 */
.start-menu {
    position: fixed;
    bottom: 40px;
    left: 0;
    width: 350px;
    background-color: rgba(25, 25, 35, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
    color: white;
    padding: 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 999;
    display: none;
}

.start-menu.active {
    transform: translateY(0);
    display: block;
}

.start-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.start-header i {
    font-size: 32px;
    margin-right: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.start-header span {
    font-size: 16px;
    font-weight: 500;
}

.app-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 80px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.app-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.app-item i {
    font-size: 24px;
    margin-bottom: 8px;
}

.app-item span {
    font-size: 12px;
}

/* 设置面板样式 */
.settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(25, 25, 35, 0.95);
    backdrop-filter: blur(20px);
    color: white;
    z-index: 2000;
    display: none;
    flex-direction: column;
}

.settings-panel.active {
    display: flex;
}

.settings-header {
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: rgba(20, 20, 30, 0.9);
}

.settings-header i {
    font-size: 18px;
    cursor: pointer;
    padding: 10px;
    margin: -10px;
}

.settings-header span {
    margin-left: 20px;
    font-size: 18px;
    font-weight: 500;
    flex: 1;
}

.settings-header #closeSettings {
    margin-left: auto;
}

.settings-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #0078d7;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-item span {
    font-size: 14px;
}

#changeBackgroundBtn {
    background-color: #0078d7;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

#changeBackgroundBtn:hover {
    background-color: #0063b1;
}

.color-options {
    display: flex;
    gap: 10px;
}

.color-option {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
    border: 2px solid transparent;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active {
    border-color: white;
}

/* 开关按钮样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: .4s;
    border-radius: 24px;
}

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

input:checked + .slider {
    background-color: #0078d7;
}

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

.about-info {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 4px;
}

.about-info p {
    margin-bottom: 8px;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .settings-panel {
        overflow-y: auto;
    }
    
    .settings-content {
        padding: 15px;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .color-options {
        margin-top: 10px;
    }

    /* 桌面图标优化 */
    .desktop-icons {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        padding: 10px;
    }
    
    .icon {
        width: 70px;
        height: 90px;
    }
    
    .icon i {
        font-size: 28px;
    }
    
    .icon span {
        font-size: 11px;
    }
    
    /* 触摸优化 - 显示tooltip */
    .icon .tooltip {
        position: fixed;
        bottom: 50px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1100;
    }
    
    .icon:active .tooltip {
        opacity: 1;
        visibility: visible;
    }
    
    /* 任务栏优化 */
    .taskbar {
        height: 50px;
    }
    
    .start-button {
        width: 50px;
    }
    
    .search-box {
        display: none; /* 在移动端隐藏搜索框 */
    }
    
    .taskbar-icons i {
        width: 50px;
        font-size: 18px;
    }
    
    .system-tray i {
        width: 30px;
    }
    
    .time-date {
        width: 70px;
    }
    
    /* 开始菜单优化 */
    .start-menu {
        width: 100%;
        bottom: 50px;
        border-radius: 8px 8px 0 0;
    }
    
    .app-list {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .app-item {
        height: 70px;
    }

    /* 设置面板优化 */
    .settings-section h3 {
        font-size: 16px;
    }
    
    .setting-item span {
        font-size: 14px;
    }
    
    .about-info p {
        font-size: 13px;
    }
}

/* 更小的移动设备优化 */
@media (max-width: 480px) {
    .desktop-icons {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 8px;
    }
    
    .icon {
        width: 60px;
        height: 80px;
    }
    
    .icon i {
        font-size: 24px;
    }
    
    .icon span {
        font-size: 10px;
    }
    
    .start-menu {
        padding: 10px;
    }
    
    .app-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .app-item {
        height: 60px;
    }
    
    .app-item i {
        font-size: 20px;
    }
    
    /* 简化系统托盘 */
    .system-tray i:not(:last-child) {
        display: none;
    }
    
    /* 右键菜单优化 */
    .context-menu {
        width: 80%;
        left: 10% !important;
        right: 10%;
    }
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .desktop-icons {
        grid-template-columns: repeat(6, 1fr);
        padding: 5px;
        gap: 5px;
    }
    
    .icon {
        width: 60px;
        height: 70px;
    }
    
    .icon i {
        font-size: 22px;
        margin-bottom: 4px;
    }
    
    .taskbar {
        height: 40px;
    }
    
    .start-menu {
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }
    
    .settings-panel {
        overflow-y: auto;
    }
    
    .app-list {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* 触摸设备优化 */
@media (pointer: coarse) {
    /* 增大点击区域 */
    .icon, .app-item, .start-button, .taskbar-icons i, .time-date {
        min-height: 44px; /* 苹果推荐的最小触摸区域高度 */
        touch-action: pan-x pan-y; /* 允许滚动但阻止缩放 */
    }
    
    /* 替换悬停效果为点击效果 */
    .icon:hover {
        background-color: transparent;
    }
    
    .icon:active {
        background-color: rgba(255, 255, 255, 0.2);
    }
    
    .app-item:active, .start-button:active, .taskbar-icons i:active {
        background-color: rgba(255, 255, 255, 0.2);
    }
    
    /* 消除悬停显示的工具提示，改为长按显示 */
    .icon:hover .tooltip {
        opacity: 0;
        visibility: hidden;
    }
    
    .icon:active .tooltip {
        opacity: 1;
        visibility: visible;
    }
    
    /* 防止图标意外移动 */
    .icon {
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* 防止文本选择 */
    .icon span {
        user-select: none;
        -webkit-user-select: none;
    }
}

/* 暗黑模式支持 */
@media (prefers-color-scheme: dark) {
    /* 已经是深色主题，无需额外调整 */
}

/* 减少动画（如果用户开启了减少动画选项） */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* 移动设备指引蒙层 */
.mobile-guide {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.mobile-guide.active {
    display: flex;
}

.guide-content {
    background-color: rgba(40, 40, 50, 0.95);
    border-radius: 10px;
    padding: 20px;
    color: white;
    max-width: 90%;
    width: 320px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
}

.guide-content h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--theme-color, #0078d7);
    text-align: center;
}

.guide-content ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.guide-content li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.guide-content li i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    color: var(--theme-color, #0078d7);
}

#closeGuide {
    background-color: var(--theme-color, #0078d7);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 15px;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.2s;
}

#closeGuide:hover {
    background-color: rgba(0, 120, 215, 0.8);
}

/* 关闭移动设备优化时的样式 */
body.disable-mobile-optimize .desktop-icons {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
    gap: 20px !important;
    padding: 20px !important;
}

body.disable-mobile-optimize .icon {
    width: 80px !important;
    height: 100px !important;
}

body.disable-mobile-optimize .icon i {
    font-size: 32px !important;
}

body.disable-mobile-optimize .icon span {
    font-size: 12px !important;
}

body.disable-mobile-optimize .taskbar {
    height: 40px !important;
}

body.disable-mobile-optimize .start-button {
    width: 48px !important;
}

body.disable-mobile-optimize .search-box {
    display: flex !important;
}

/* 日历和世界时钟面板 */
.calendar-panel {
    position: fixed;
    bottom: 40px;
    right: 0;
    width: 350px;
    background-color: rgba(25, 25, 35, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
    color: white;
    padding: 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 999;
    display: none;
}

.calendar-panel.active {
    transform: translateY(0);
    display: block;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 500;
}

.panel-controls {
    display: flex;
    align-items: center;
}

.panel-controls i {
    cursor: pointer;
    padding: 5px 10px;
    transition: background-color 0.2s;
    border-radius: 4px;
}

.panel-controls i:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.calendar-container {
    margin-bottom: 20px;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    text-align: center;
    padding: 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

.calendar-day:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.calendar-day.today {
    background-color: var(--theme-color, #19191f);
}

.calendar-day.other-month {
    color: rgba(255, 255, 255, 0.4);
}

.world-clock {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

.world-clock h4 {
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.clock-list {
    display: grid;
    gap: 10px;
}

.clock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.location {
    font-size: 14px;
}

.time {
    font-size: 14px;
}

/* 命令提示符终端窗口 */
.cmd-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 400px;
    background-color: #0c0c0c;
    color: #cccccc;
    border-radius: 4px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    z-index: 2000;
    resize: both;
    overflow: hidden;
    font-family: 'Consolas', 'Courier New', monospace;
}

.cmd-window.active {
    display: flex;
}

.cmd-window.maximized {
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transform: none;
    border-radius: 0;
}

.window-header {
    height: 32px;
    background-color: #323232;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    cursor: move;
}

.window-title {
    display: flex;
    align-items: center;
    color: #fff;
    font-size: 14px;
}

.window-title i {
    margin-right: 8px;
    font-size: 14px;
}

.window-controls {
    display: flex;
}

.window-controls i {
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 10px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 12px;
}

.window-controls i:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.window-controls i.fa-times:hover {
    background-color: #e81123;
}

.cmd-content {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.4;
}

.cmd-output {
    white-space: pre-wrap;
    margin-bottom: 10px;
}

.cmd-input-line {
    display: flex;
    align-items: baseline;
}

.cmd-prompt {
    color: #cccccc;
    margin-right: 4px;
}

#cmdInput {
    background: transparent;
    border: none;
    color: #cccccc;
    outline: none;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    flex: 1;
    caret-color: #cccccc;
}

/* 移动设备适配 */
@media (max-width: 768px) {
    .cmd-window {
        width: 90%;
        height: 70%;
    }
} 