* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    height: 100vh;
    background: linear-gradient(135deg, #b7ccdd 0%, #526d98 100%);
    position: relative;
}

/* 桌面背景 */
.desktop {
    width: 100%;
    height: calc(100vh - 48px);
    position: relative;
    padding: 20px;
    margin-top: 48px;
}

/* 桌面圖示容器 */
.desktop-icons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: absolute;
    top: 20px;
    left: 20px;
}

/* 桌面圖示 */
.desktop-icon {
    width: 80px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background 0.2s;
    padding: 8px;
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.desktop-icon-image {
    width: 48px;
    height: 48px;
    background: #e7e5e3;
    margin: 0 auto 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.desktop-icon-label {
    color: white;
    font-size: 12px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* 工作列 */
.taskbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: rgba(82, 109, 152, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    padding: 0 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

/* 開始按鈕 */
.start-button {
    width: 48px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 20px;
}

.start-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.start-button.active {
    background: rgba(255, 255, 255, 0.15);
}

/* Windows Logo */
.windows-logo {
    width: 20px;
    height: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2px;
}

.logo-square {
    background: #e7e5e3;
    border-radius: 1px;
}

/* 開始選單 */
.start-menu {
    position: fixed;
    top: 58px;
    left: 8px;
    width: 600px;
    height: 650px;
    background: rgba(231, 229, 227, 0.95);
    backdrop-filter: blur(40px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
}

.start-menu.show {
    display: flex;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 搜尋框 */
.search-box {
    margin: 20px 20px 10px 20px;
    padding: 10px 15px;
    background: white;
    border: 2px solid #b7ccdd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.search-box:focus {
    border-color: #526d98;
}

/* 釘選區域 */
.pinned-section {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.section-title {
    font-size: 13px;
    color: #526d98;
    margin-bottom: 15px;
    font-weight: 600;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
}

.app-item:hover {
    background: rgba(183, 204, 221, 0.3);
}

.app-icon {
    width: 48px;
    height: 48px;
    background: #526d98;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 8px;
    color: white;
}

.app-name {
    font-size: 11px;
    text-align: center;
    color: #333;
}

/* 底部用戶區 */
.user-section {
    padding: 15px 20px;
    border-top: 1px solid rgba(82, 109, 152, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: #526d98;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.user-name {
    font-size: 13px;
    color: #333;
}

.power-button {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 18px;
}

.power-button:hover {
    background: rgba(82, 109, 152, 0.2);
}

/* 工作列其他圖示 */
.taskbar-icons {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.taskbar-icon {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 16px;
    text-decoration: none;
    color: inherit;
}

.taskbar-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 系統托盤 */
.system-tray {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 12px;
}

.tray-icon {
    font-size: 14px;
    color: #526d98;
    cursor: pointer;
}

.clock {
    font-size: 12px;
    color: #333;
    text-align: right;
    line-height: 1.3;
}

.clock-time {
    font-weight: 600;
}

/* 滾動條樣式 */
.pinned-section::-webkit-scrollbar {
    width: 8px;
}

.pinned-section::-webkit-scrollbar-track {
    background: transparent;
}

.pinned-section::-webkit-scrollbar-thumb {
    background: rgba(82, 109, 152, 0.3);
    border-radius: 4px;
}

.pinned-section::-webkit-scrollbar-thumb:hover {
    background: rgba(82, 109, 152, 0.5);
}

/* 視窗樣式 */
.window {
    position: absolute;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.window-header {
    background: linear-gradient(to bottom, #526d98, #455a7d);
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.window-title {
    font-size: 13px;
    font-weight: 500;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.window-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.window-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.close-btn:hover {
    background: #e81123;
}

.window-content {
    flex: 1;
    padding: 30px 40px;
    overflow: hidden;
    background: #f5f5f5;
}

/* 工具表單樣式 */
.tool-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 450px;
    margin: 0 auto;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row label {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #b7ccdd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: #526d98;
}

.separator {
    font-size: 16px;
    color: #666;
    font-weight: bold;
}

/* 錯誤訊息樣式 */
.error-message {
    min-height: 20px;
    font-size: 12px;
    color: #e81123;
    margin-top: 5px;
    padding-left: 2px;
}

/* 日期時間顯示樣式 */
.datetime-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    gap: 10px;
    background: linear-gradient(135deg, #e7e5e3 0%, #f5f5f5 100%);
    border-radius: 8px;
    padding: 15px;
}

.time-display {
    font-size: 32px;
    font-weight: 600;
    color: #526d98;
    font-family: 'Consolas', 'Monaco', 'Menlo', monospace;
    letter-spacing: 2px;
}

.date-display {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    margin-bottom: 5px;
}

.weekday-display {
    font-size: 14px;
    color: #666;
    margin-top: -4px;
}

/* 日曆表格樣式 */
.calendar-container {
    width: 100%;
    margin-top: 5px;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.calendar-table th {
    background: #526d98;
    color: white;
    padding: 6px 4px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.calendar-table td {
    padding: 6px 4px;
    text-align: center;
    font-size: 12px;
    border: 1px solid #e0e0e0;
    color: #333;
}

.calendar-table td.empty {
    background: #f9f9f9;
    border-color: #f0f0f0;
}

.calendar-table td.day {
    background: white;
    cursor: default;
    transition: background 0.2s;
}

.calendar-table td.day:hover {
    background: #f0f0f0;
}

.calendar-table td.today {
    background: #526d98 !important;
    color: white !important;
    font-weight: bold;
    box-shadow: inset 0 0 0 2px #455a7d;
}

/* 時鐘視窗特殊樣式 */
.clock-window .window-content {
    padding: 15px;
    background: transparent;
}

/* 伺服器監控樣式 */
.server-monitor {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

.monitor-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 10px;
    background: linear-gradient(135deg, #526d98 0%, #455a7d 100%);
    border-radius: 8px;
}

.overview-stat {
    text-align: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.overview-stat.online {
    background: rgba(76, 175, 80, 0.2);
}

.overview-stat.hashrate {
    background: rgba(33, 150, 243, 0.2);
}

.stat-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 16px;
    font-weight: bold;
    color: white;
}

.server-list {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
}

.server-item {
    background: white;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    border-left: 3px solid #e0e0e0;
    transition: all 0.2s;
}

.server-item.online {
    border-left-color: #4caf50;
}

.server-item.offline {
    border-left-color: #f44336;
    opacity: 0.6;
}

.server-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.server-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f44336;
}

.server-item.online .server-status {
    background: #4caf50;
}

.server-name {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    flex: 1;
}

.server-hashrate {
    font-size: 12px;
    font-weight: 600;
    color: #526d98;
    font-family: 'Consolas', monospace;
}

.server-specs {
    font-size: 11px;
    color: #666;
    margin-bottom: 6px;
}

.spec {
    font-family: 'Consolas', monospace;
}

.spec-divider {
    margin: 0 6px;
    color: #ccc;
}

.server-progress {
    margin-top: 6px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #526d98 0%, #4caf50 100%);
    transition: width 0.3s ease;
}

.server-item.offline .progress-fill {
    background: #ccc;
}

/* 監控視窗特殊樣式 */
.monitor-window .window-content {
    padding: 12px;
    background: #f5f5f5;
}

/* 捲軸樣式 */
.server-list::-webkit-scrollbar {
    width: 6px;
}

.server-list::-webkit-scrollbar-track {
    background: transparent;
}

.server-list::-webkit-scrollbar-thumb {
    background: rgba(82, 109, 152, 0.3);
    border-radius: 3px;
}

.server-list::-webkit-scrollbar-thumb:hover {
    background: rgba(82, 109, 152, 0.5);
}

/* 國道監視器樣式 */
.cctv-monitor {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cctv-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    padding: 10px;
    background: #e7e5e3;
    border-radius: 6px;
    margin-bottom: 10px;
    text-align: center;
}

.cctv-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    min-height: 250px;
}

.loading-text {
    position: absolute;
    font-size: 14px;
    color: #666;
}

.cctv-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cctv-refresh {
    margin-top: 10px;
    text-align: center;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.refresh-btn {
    padding: 8px 16px;
    background: #526d98;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.refresh-btn:hover {
    background: #455a7d;
}

.map-btn {
    padding: 8px 16px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-block;
}

.map-btn:hover {
    background: #45a049;
}

/* 檔案總管樣式 */
.file-manager {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
}

.file-toolbar {
    display: flex;
    align-items: center;
    padding: 0;
    background: #f8f8f8;
    border-bottom: 1px solid #d0d0d0;
    min-height: 80px;
}

.toolbar-box-btn {
    width: 80px;
    height: 100%;
    padding: 0;
    margin: 0;
    background: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
}

.toolbar-box-btn::after {
    content: '';
    position: absolute;
    right: 0;
    top: 12px;
    bottom: 12px;
    width: 1px;
    background: #d0d0d0;
}

.toolbar-box-btn:hover {
    background: #f0f0f0;
}

.toolbar-box-btn:hover::after {
    background: #526d98;
}

.toolbar-box-btn:active {
    background: #e8e8e8;
}

.toolbar-box-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.toolbar-box-btn:disabled:hover {
    background: white;
}

.toolbar-box-btn:disabled::after {
    background: #d0d0d0;
}

.btn-icon {
    font-size: 28px;
    line-height: 1;
}

.toolbar-box-btn:nth-child(1) .btn-icon,
.toolbar-box-btn:nth-child(2) .btn-icon {
    color: #526d98;
}

.btn-text {
    font-size: 11px;
    color: #333;
    white-space: nowrap;
}

.file-limit-info {
    font-size: 11px;
    color: #666;
    margin-left: auto;
}

.toolbar-btn:hover {
    background: #455a7d;
}

.file-limit-info {
    font-size: 11px;
    color: #666;
    margin-left: auto;
}

.file-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.file-sidebar {
    width: 150px;
    background: #f8f8f8;
    border-right: 1px solid #d0d0d0;
    padding: 0;
}

.sidebar-item {
    padding: 8px 15px 8px 0;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-item.active {
    background: #e7f3ff;
    border-left: 3px solid #526d98;
    padding-left: 0;
}

.sidebar-item.nested {
    padding-left: 15px;
}

.sidebar-item.nested.active {
    padding-left: 12px;
}

.sidebar-icon {
    font-size: 14px;
}

.sidebar-text {
    font-size: 12px;
}

.file-list-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.file-list-header {
    display: flex;
    padding: 8px 0;
    background: #f0f0f0;
    border-bottom: 1px solid #d0d0d0;
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.header-col {
    padding: 0 8px;
}

.col-name {
    flex: 1;
    min-width: 200px;
}

.col-size {
    width: 100px;
}

.col-date {
    width: 150px;
}

.col-download {
    width: 60px;
    text-align: center;
}

.file-list-content {
    flex: 1;
    overflow-y: auto;
    background: white;
}

.file-item {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
}

.file-item:hover {
    background: #f5f5f5;
}

.file-col {
    padding: 0 8px;
    font-size: 12px;
    display: flex;
    align-items: center;
}

.file-col.col-name {
    flex: 1;
    min-width: 200px;
    gap: 8px;
}

.file-icon {
    font-size: 16px;
}

.file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-col.col-size {
    width: 100px;
    color: #666;
}

.file-col.col-date {
    width: 150px;
    color: #666;
}

.file-col.col-download {
    width: 60px;
    text-align: center;
    justify-content: center;
}

.download-btn {
    font-size: 18px;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.download-btn:hover {
    background: rgba(82, 109, 152, 0.1);
}

.file-statusbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: #f0f0f0;
    border-top: 1px solid #d0d0d0;
    font-size: 11px;
    color: #666;
}

.status-left {
    flex: 0 0 auto;
}

.status-right {
    flex: 0 0 auto;
    color: #888;
}

.loading-message,
.empty-message,
.error-message {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.error-message {
    color: #e81123;
}

/* 檔案列表捲軸 */
.file-list-content::-webkit-scrollbar {
    width: 8px;
}

.file-list-content::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.file-list-content::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 4px;
}

.file-list-content::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* 磁碟機卡片樣式 */
.drive-container {
    padding: 20px;
    display: flex;
    justify-content: flex-start;
}

.drive-card {
    width: 200px;
    padding: 20px;
    background: white;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.drive-card:hover {
    background: #f5f5f5;
    border-color: #526d98;
    box-shadow: 0 2px 8px rgba(82, 109, 152, 0.2);
}

.drive-icon {
    font-size: 48px;
}

.drive-info {
    flex: 1;
}

.drive-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.drive-label {
    font-size: 11px;
    color: #666;
}

/* 檔案總管視窗特殊樣式 - 移除 padding */
.file-manager-window .window-content {
    padding: 0;
    overflow: hidden;
}

/* Base64 編解碼工具樣式 */
.base64-tool {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
}

.base64-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.base64-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.base64-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.copy-btn {
    padding: 4px 10px;
    background: #f0f0f0;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #e0e0e0;
    border-color: #526d98;
    color: #526d98;
}

.base64-textarea {
    width: 100%;
    height: 100%;
    padding: 12px;
    border: 2px solid #b7ccdd;
    border-radius: 6px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 13px;
    resize: none;
    transition: border-color 0.2s;
}

.base64-textarea:focus {
    outline: none;
    border-color: #526d98;
}

.base64-textarea::placeholder {
    color: #999;
}

.base64-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.base64-btn {
    padding: 10px 30px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.encode-btn {
    background: #526d98;
    color: white;
}

.encode-btn:hover {
    background: #455a7d;
}

.decode-btn {
    background: #4a90e2;
    color: white;
}

.decode-btn:hover {
    background: #357abd;
}

.clear-btn {
    background: #e0e0e0;
    color: #666;
}

.clear-btn:hover {
    background: #d0d0d0;
    color: #333;
}

.base64-info {
    font-size: 11px;
    color: #888;
    text-align: center;
    padding: 5px;
}

/* 檔名亂碼還原工具 */
.decoder-tool {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.decoder-tool .base64-section {
    flex: unset;
}

.decoder-intro {
    background: #1e1e2e;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.8;
    color: #ccc;
    text-align: left;
    margin-bottom: 8px;
}

.decoder-intro-title {
    color: #7eb8f7;
    font-weight: bold;
    margin-bottom: 4px;
}

.decoder-intro code {
    color: #f9a8d4;
}