/* ============================================
   移动端应用内样式适配
   每个应用单独适配
   ============================================ */

@media (max-width: 768px) {

    /* ===== 1. 文件管理器 ===== */
    .files-app .file-list-item {
        padding: 12px 16px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
    }

    .files-app .file-list-item .file-icon {
        width: 32px !important;
        height: 32px !important;
        flex-shrink: 0 !important;
    }

    .files-app .file-list-item .file-name {
        font-size: 14px !important;
        flex: 1 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .files-app .file-list-item .file-size {
        font-size: 12px !important;
        color: rgba(255, 255, 255, 0.4) !important;
    }

    .files-app .file-toolbar {
        padding: 8px 12px !important;
        display: flex !important;
        gap: 8px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .files-app .file-toolbar button {
        padding: 8px 14px !important;
        font-size: 13px !important;
        min-height: 36px !important;
        white-space: nowrap !important;
    }

    .files-app .breadcrumb {
        padding: 8px 12px !important;
        font-size: 13px !important;
        overflow-x: auto !important;
        display: flex !important;
        gap: 4px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* ===== 2. 设置 ===== */
    .settings-app .setting-item {
        padding: 12px 16px !important;
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
    }

    .settings-app .setting-item .setting-icon {
        width: 28px !important;
        height: 28px !important;
        flex-shrink: 0 !important;
    }

    .settings-app .setting-item .setting-label {
        font-size: 14px !important;
        flex: 1 !important;
    }

    .settings-app .setting-item .setting-value {
        font-size: 13px !important;
        color: rgba(255, 255, 255, 0.4) !important;
    }

    .settings-app .setting-item .setting-arrow {
        color: rgba(255, 255, 255, 0.2) !important;
        font-size: 16px !important;
    }

    .settings-app .toggle-switch {
        width: 48px !important;
        height: 28px !important;
        min-width: 48px !important;
    }

    .settings-app .toggle-switch .toggle-thumb {
        width: 22px !important;
        height: 22px !important;
    }

    /* ===== 3. 计算器 ===== */
    .calculator-app .calc-display {
        padding: 16px !important;
        font-size: 32px !important;
        text-align: right !important;
    }

    .calculator-app .calc-buttons {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
        padding: 12px !important;
    }

    .calculator-app .calc-buttons button {
        padding: 16px !important;
        font-size: 20px !important;
        min-height: 52px !important;
        border-radius: 12px !important;
    }

    /* ===== 4. 浏览器 ===== */
    .browser-app .browser-toolbar {
        padding: 6px 8px !important;
        display: flex !important;
        gap: 4px !important;
        flex-wrap: nowrap !important;
    }

    .browser-app .browser-toolbar input {
        flex: 1 !important;
        padding: 8px 12px !important;
        font-size: 14px !important;
        min-height: 36px !important;
        border-radius: 8px !important;
    }

    .browser-app .browser-toolbar button {
        padding: 6px 12px !important;
        min-height: 36px !important;
        font-size: 16px !important;
    }

    .browser-app .browser-content iframe {
        height: calc(100% - 50px) !important;
    }

    /* ===== 5. 便签 ===== */
    .notes-app .notes-editor {
        padding: 12px !important;
    }

    .notes-app .notes-editor textarea {
        font-size: 16px !important;
        line-height: 1.6 !important;
        min-height: 200px !important;
        padding: 12px !important;
    }

    .notes-app .notes-toolbar {
        padding: 6px 8px !important;
        display: flex !important;
        gap: 4px !important;
        flex-wrap: wrap !important;
    }

    .notes-app .notes-toolbar button {
        padding: 6px 10px !important;
        font-size: 13px !important;
        min-height: 32px !important;
    }

    /* ===== 6. 天气 ===== */
    .weather-app .weather-main {
        padding: 16px !important;
        text-align: center !important;
    }

    .weather-app .weather-temp {
        font-size: 48px !important;
        font-weight: 200 !important;
    }

    .weather-app .weather-condition {
        font-size: 16px !important;
        color: rgba(255, 255, 255, 0.6) !important;
    }

    .weather-app .weather-forecast {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)) !important;
        gap: 8px !important;
        padding: 12px !important;
    }

    .weather-app .weather-forecast .day {
        text-align: center !important;
        padding: 8px !important;
        border-radius: 8px !important;
        background: rgba(255, 255, 255, 0.04) !important;
    }

    /* ===== 7. 时钟 ===== */
    .clock-app .clock-display {
        padding: 20px !important;
        text-align: center !important;
    }

    .clock-app .clock-time {
        font-size: 48px !important;
        font-weight: 200 !important;
        font-variant-numeric: tabular-nums !important;
    }

    .clock-app .clock-date {
        font-size: 16px !important;
        color: rgba(255, 255, 255, 0.5) !important;
    }

    .clock-app .clock-tabs {
        display: flex !important;
        gap: 4px !important;
        padding: 8px 12px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .clock-app .clock-tabs button {
        padding: 8px 16px !important;
        font-size: 13px !important;
        min-height: 36px !important;
        white-space: nowrap !important;
        border-radius: 8px !important;
        background: transparent !important;
        border: 1px solid rgba(255, 255, 255, 0.06) !important;
    }

    .clock-app .clock-tabs button.active {
        background: rgba(74, 158, 255, 0.2) !important;
        border-color: rgba(74, 158, 255, 0.3) !important;
    }

    /* ===== 8. 照片 ===== */
    .photos-app .photos-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 2px !important;
        padding: 2px !important;
    }

    .photos-app .photos-grid .photo-item {
        aspect-ratio: 1 !important;
        background: rgba(255, 255, 255, 0.04) !important;
        overflow: hidden !important;
    }

    .photos-app .photos-grid .photo-item img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    /* ===== 9. 媒体播放器 ===== */
    .media-app .media-player {
        padding: 16px !important;
    }

    .media-app .media-player .album-art {
        width: 160px !important;
        height: 160px !important;
        border-radius: 12px !important;
        margin: 0 auto 12px !important;
    }

    .media-app .media-player .song-title {
        font-size: 16px !important;
        font-weight: 500 !important;
        text-align: center !important;
    }

    .media-app .media-player .song-artist {
        font-size: 13px !important;
        color: rgba(255, 255, 255, 0.4) !important;
        text-align: center !important;
    }

    .media-app .media-player .controls {
        display: flex !important;
        justify-content: center !important;
        gap: 16px !important;
        margin-top: 12px !important;
    }

    .media-app .media-player .controls button {
        width: 48px !important;
        height: 48px !important;
        border-radius: 50% !important;
        font-size: 20px !important;
    }

    /* ===== 10. 终端 ===== */
    .terminal-app .terminal-output {
        padding: 12px !important;
        font-size: 13px !important;
        font-family: 'Courier New', monospace !important;
        min-height: 200px !important;
    }

    .terminal-app .terminal-input {
        padding: 8px 12px !important;
        display: flex !important;
        gap: 8px !important;
    }

    .terminal-app .terminal-input input {
        flex: 1 !important;
        padding: 8px 12px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
        background: rgba(255, 255, 255, 0.04) !important;
        border: 1px solid rgba(255, 255, 255, 0.06) !important;
        color: inherit !important;
        min-height: 36px !important;
    }

    /* ===== 11. 应用内通用按钮 ===== */
    .app-btn {
        padding: 6px 14px !important;
        border-radius: 6px !important;
        border: none !important;
        background: rgba(255, 255, 255, 0.06) !important;
        color: rgba(255, 255, 255, 0.8) !important;
        font-size: 13px !important;
        cursor: pointer !important;
        min-height: 36px !important;
    }

    .app-btn:active {
        transform: scale(0.95) !important;
        background: rgba(255, 255, 255, 0.1) !important;
    }

    .app-container-inner {
        padding: 16px !important;
        height: 100% !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .file-item {
        display: flex !important;
        justify-content: space-between !important;
        padding: 10px 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
    }

    .file-item .file-name {
        color: rgba(255, 255, 255, 0.8) !important;
        font-size: 14px !important;
    }

    .file-item .file-size {
        color: rgba(255, 255, 255, 0.3) !important;
        font-size: 12px !important;
    }

    /* ===== 12. 浅色主题适配 ===== */
    .theme-light .files-app .file-list-item {
        border-bottom-color: rgba(0, 0, 0, 0.04) !important;
    }

    .theme-light .files-app .file-list-item .file-size {
        color: rgba(0, 0, 0, 0.3) !important;
    }

    .theme-light .settings-app .setting-item {
        border-bottom-color: rgba(0, 0, 0, 0.03) !important;
    }

    .theme-light .settings-app .setting-item .setting-value {
        color: rgba(0, 0, 0, 0.4) !important;
    }

    .theme-light .settings-app .setting-item .setting-arrow {
        color: rgba(0, 0, 0, 0.2) !important;
    }

    .theme-light .weather-app .weather-condition {
        color: rgba(0, 0, 0, 0.5) !important;
    }

    .theme-light .clock-app .clock-date {
        color: rgba(0, 0, 0, 0.4) !important;
    }

    .theme-light .clock-app .clock-tabs button {
        border-color: rgba(0, 0, 0, 0.06) !important;
    }

    .theme-light .media-app .media-player .song-artist {
        color: rgba(0, 0, 0, 0.4) !important;
    }

    .theme-light .terminal-app .terminal-input input {
        background: rgba(0, 0, 0, 0.03) !important;
        border-color: rgba(0, 0, 0, 0.06) !important;
    }

    .theme-light .app-btn {
        background: rgba(0, 0, 0, 0.04) !important;
        color: rgba(0, 0, 0, 0.7) !important;
    }

    .theme-light .app-btn:active {
        background: rgba(0, 0, 0, 0.08) !important;
    }

    .theme-light .file-item {
        border-bottom-color: rgba(0, 0, 0, 0.04) !important;
    }

    .theme-light .file-item .file-name {
        color: rgba(0, 0, 0, 0.7) !important;
    }

    .theme-light .file-item .file-size {
        color: rgba(0, 0, 0, 0.3) !important;
    }

}