/* ========================================
   文件图标样式 - 全局公共样式
   所有页面通用，只需引入一次
   优化配色版 - 高辨识度无重复
   ======================================== */

/* 图标容器基础样式 */
.file-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-tertiary, #f3f4f6);
    border-radius: 8px;
    flex-shrink: 0;
}

.file-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* 平铺视图大图标 */
.file-list.grid-view .file-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
}

.file-list.grid-view .file-icon svg {
    width: 32px;
    height: 32px;
}

/* ========================================
   核心文件类型（高频，高辨识度）
   ======================================== */

/* 文件夹 - 经典金黄 */
.file-icon.folder {
    background-color: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

/* 默认文件（未知类型） - 中性灰 */
.file-icon.default {
    background-color: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
}

/* ========================================
   媒体文件
   ======================================== */

/* 图片 - 天蓝色 */
.file-icon.image {
    background-color: rgba(14, 165, 233, 0.12);
    color: #0ea5e9;
}

/* 视频 - 玫红色（区别于红色PDF） */
.file-icon.video {
    background-color: rgba(236, 72, 153, 0.12);
    color: #ec4899;
}

/* 音频 - 紫罗兰 */
.file-icon.audio {
    background-color: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
}

/* ========================================
   压缩包 - 棕褐色（明显区别于黄色文件夹）
   ======================================== */
.file-icon.archive {
    background-color: rgba(180, 83, 9, 0.12);
    color: #b45309;
}

/* ========================================
   文档类（保持Office官方色）
   ======================================== */

/* PDF - Adobe红 */
.file-icon.pdf {
    background-color: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

/* Word - 微软蓝 */
.file-icon.word {
    background-color: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

/* Excel - 微软绿 */
.file-icon.excel {
    background-color: rgba(22, 163, 74, 0.1);
    color: #16a34a;
}

/* PPT - 微软橙红 */
.file-icon.ppt {
    background-color: rgba(220, 88, 42, 0.1);
    color: #dc582a;
}

/* 纯文本 - 石墨灰 */
.file-icon.text {
    background-color: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* Markdown - 深蓝灰 */
.file-icon.markdown {
    background-color: rgba(51, 65, 85, 0.12);
    color: #334155;
}

/* ========================================
   前端开发（官方品牌色）
   ======================================== */

/* HTML - HTML5橙红 */
.file-icon.html {
    background-color: rgba(227, 76, 38, 0.1);
    color: #e34c26;
}

/* CSS - CSS3蓝 */
.file-icon.css {
    background-color: rgba(38, 77, 228, 0.1);
    color: #264de4;
}

/* JavaScript - JS黄 */
.file-icon.js {
    background-color: rgba(247, 223, 30, 0.18);
    color: #b8860b;
}

/* Vue - Vue绿 */
.file-icon.vue {
    background-color: rgba(66, 184, 131, 0.12);
    color: #42b883;
}

/* ========================================
   后端语言
   ======================================== */

/* PHP - PHP紫蓝 */
.file-icon.php {
    background-color: rgba(119, 123, 180, 0.12);
    color: #777bb4;
}

/* Python - Python蓝 */
.file-icon.python {
    background-color: rgba(55, 118, 171, 0.12);
    color: #3776ab;
}

/* Java - Java橙 */
.file-icon.java {
    background-color: rgba(248, 152, 32, 0.12);
    color: #f89820;
}

/* C/C++ - 深蓝 */
.file-icon.cpp {
    background-color: rgba(0, 89, 156, 0.12);
    color: #00599c;
}

/* C# - 紫色 */
.file-icon.csharp {
    background-color: rgba(81, 43, 212, 0.1);
    color: #512bd4;
}

/* Go - 青蓝色 */
.file-icon.go {
    background-color: rgba(0, 173, 216, 0.12);
    color: #00add8;
}

/* Rust - 铁锈橙棕 */
.file-icon.rust {
    background-color: rgba(183, 65, 14, 0.1);
    color: #b7410e;
}

/* Ruby - 宝石红 */
.file-icon.ruby {
    background-color: rgba(204, 52, 45, 0.1);
    color: #cc342d;
}

/* Swift - Swift橙 */
.file-icon.swift {
    background-color: rgba(240, 81, 56, 0.1);
    color: #f05138;
}

/* Kotlin - Kotlin紫 */
.file-icon.kotlin {
    background-color: rgba(127, 82, 255, 0.1);
    color: #7f52ff;
}

/* ========================================
   数据格式
   ======================================== */

/* JSON - 墨绿色（区别于Excel绿） */
.file-icon.json {
    background-color: rgba(5, 150, 105, 0.1);
    color: #059669;
}

/* XML - 橙色 */
.file-icon.xml {
    background-color: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

/* YAML - 玫瑰红 */
.file-icon.yaml {
    background-color: rgba(225, 29, 72, 0.1);
    color: #e11d48;
}

/* SQL - 海军蓝 */
.file-icon.sql {
    background-color: rgba(30, 58, 138, 0.12);
    color: #1e3a8a;
}

/* ========================================
   脚本文件
   ======================================== */

/* Shell - 炭黑 */
.file-icon.shell {
    background-color: rgba(31, 41, 55, 0.15);
    color: #1f2937;
}

/* Batch/PowerShell - Windows蓝 */
.file-icon.batch {
    background-color: rgba(0, 120, 215, 0.1);
    color: #0078d7;
}

/* 通用代码 - 青色 */
.file-icon.code {
    background-color: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
}

/* ========================================
   可执行/应用程序
   ======================================== */

/* EXE - 钢灰色 */
.file-icon.exe {
    background-color: rgba(71, 85, 105, 0.12);
    color: #475569;
}

/* APK - Android绿 */
.file-icon.apk {
    background-color: rgba(61, 220, 132, 0.12);
    color: #3ddc84;
}

/* IPA - Apple蓝 */
.file-icon.ipa {
    background-color: rgba(0, 122, 255, 0.1);
    color: #007aff;
}

/* Linux - Ubuntu橙 */
.file-icon.linux {
    background-color: rgba(221, 72, 20, 0.1);
    color: #dd4814;
}

/* ========================================
   设计文件（官方品牌色）
   ======================================== */

/* PSD - Photoshop蓝 */
.file-icon.psd {
    background-color: rgba(49, 168, 255, 0.12);
    color: #31a8ff;
}

/* AI - Illustrator橙 */
.file-icon.ai {
    background-color: rgba(255, 154, 0, 0.12);
    color: #ff9a00;
}

/* Figma - Figma紫 */
.file-icon.figma {
    background-color: rgba(162, 89, 255, 0.1);
    color: #a259ff;
}

/* Sketch - Sketch黄 */
.file-icon.sketch {
    background-color: rgba(253, 173, 0, 0.12);
    color: #fdad00;
}

/* XD - XD品红 */
.file-icon.xd {
    background-color: rgba(255, 97, 246, 0.1);
    color: #ff61f6;
}

/* CorelDRAW - CDR绿 */
.file-icon.cdr {
    background-color: rgba(0, 160, 64, 0.1);
    color: #00a040;
}

/* 矢量图 */
.file-icon.vector {
    background-color: rgba(217, 119, 6, 0.12);
    color: #d97706;
}

/* CAD - 深红色 */
.file-icon.cad {
    background-color: rgba(196, 30, 58, 0.1);
    color: #c41e3a;
}

/* 3D模型 - 珊瑚粉 */
.file-icon.model3d {
    background-color: rgba(244, 63, 94, 0.12);
    color: #f43f5e;
}

/* ========================================
   特殊文件类型
   ======================================== */

/* 字体 - 靛蓝 */
.file-icon.font {
    background-color: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

/* 电子书 - 琥珀色 */
.file-icon.ebook {
    background-color: rgba(217, 119, 6, 0.12);
    color: #d97706;
}

/* 数据库 - 深紫 */
.file-icon.database {
    background-color: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
}

/* ISO镜像 - 银灰 */
.file-icon.iso {
    background-color: rgba(148, 163, 184, 0.12);
    color: #64748b;
}

/* 虚拟机 - VMware蓝 */
.file-icon.vm {
    background-color: rgba(0, 136, 206, 0.1);
    color: #0088ce;
}

/* 配置文件 - 石板灰 */
.file-icon.config {
    background-color: rgba(100, 116, 139, 0.1);
    color: #64748b;
}

/* 环境变量 - 暗金 */
.file-icon.env {
    background-color: rgba(161, 98, 7, 0.12);
    color: #a16207;
}

/* 日志 - 浅灰 */
.file-icon.log {
    background-color: rgba(203, 213, 225, 0.15);
    color: #94a3b8;
}

/* 种子 - 青绿（区别于绿色） */
.file-icon.torrent {
    background-color: rgba(20, 184, 166, 0.12);
    color: #14b8a6;
}

/* 快捷方式 - 蓝色 */
.file-icon.link {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* 证书 - 金色 */
.file-icon.cert {
    background-color: rgba(202, 138, 4, 0.12);
    color: #ca8a04;
}

/* 密钥 - 暗橙 */
.file-icon.key {
    background-color: rgba(194, 65, 12, 0.12);
    color: #c2410c;
}

/* 备份 - 暗灰 */
.file-icon.backup {
    background-color: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* 临时文件 - 最浅灰 */
.file-icon.temp {
    background-color: rgba(209, 213, 219, 0.1);
    color: #d1d5db;
}

/* Git - Git橙红 */
.file-icon.git {
    background-color: rgba(240, 80, 51, 0.1);
    color: #f05033;
}

/* Docker - Docker蓝 */
.file-icon.docker {
    background-color: rgba(36, 150, 237, 0.1);
    color: #2496ed;
}

/* ========================================
   暗色主题适配
   使用 data-theme="dark" 选择器
   ======================================== */

/* 核心类型 */
[data-theme="dark"] .file-icon.folder { background-color: rgba(251, 191, 36, 0.2); }
[data-theme="dark"] .file-icon.default { background-color: rgba(156, 163, 175, 0.15); }

/* 媒体文件 */
[data-theme="dark"] .file-icon.image { background-color: rgba(14, 165, 233, 0.18); }
[data-theme="dark"] .file-icon.video { background-color: rgba(236, 72, 153, 0.18); }
[data-theme="dark"] .file-icon.audio { background-color: rgba(139, 92, 246, 0.18); }

/* 压缩包 */
[data-theme="dark"] .file-icon.archive { background-color: rgba(180, 83, 9, 0.18); }

/* Office文档 */
[data-theme="dark"] .file-icon.pdf { background-color: rgba(220, 38, 38, 0.18); }
[data-theme="dark"] .file-icon.word { background-color: rgba(37, 99, 235, 0.18); }
[data-theme="dark"] .file-icon.excel { background-color: rgba(22, 163, 74, 0.18); }
[data-theme="dark"] .file-icon.ppt { background-color: rgba(220, 88, 42, 0.18); }
[data-theme="dark"] .file-icon.text { background-color: rgba(107, 114, 128, 0.18); }
[data-theme="dark"] .file-icon.markdown { background-color: rgba(71, 85, 105, 0.2); color: #94a3b8; }

/* 前端 */
[data-theme="dark"] .file-icon.html { background-color: rgba(227, 76, 38, 0.18); }
[data-theme="dark"] .file-icon.css { background-color: rgba(38, 77, 228, 0.18); }
[data-theme="dark"] .file-icon.js { background-color: rgba(247, 223, 30, 0.15); color: #fbbf24; }
[data-theme="dark"] .file-icon.vue { background-color: rgba(66, 184, 131, 0.18); }

/* 后端语言 */
[data-theme="dark"] .file-icon.php { background-color: rgba(119, 123, 180, 0.18); }
[data-theme="dark"] .file-icon.python { background-color: rgba(55, 118, 171, 0.18); }
[data-theme="dark"] .file-icon.java { background-color: rgba(248, 152, 32, 0.18); }
[data-theme="dark"] .file-icon.cpp { background-color: rgba(0, 89, 156, 0.18); }
[data-theme="dark"] .file-icon.csharp { background-color: rgba(81, 43, 212, 0.18); }
[data-theme="dark"] .file-icon.go { background-color: rgba(0, 173, 216, 0.18); }
[data-theme="dark"] .file-icon.rust { background-color: rgba(183, 65, 14, 0.18); }
[data-theme="dark"] .file-icon.ruby { background-color: rgba(204, 52, 45, 0.18); }
[data-theme="dark"] .file-icon.swift { background-color: rgba(240, 81, 56, 0.18); }
[data-theme="dark"] .file-icon.kotlin { background-color: rgba(127, 82, 255, 0.18); }

/* 数据格式 */
[data-theme="dark"] .file-icon.json { background-color: rgba(5, 150, 105, 0.18); }
[data-theme="dark"] .file-icon.xml { background-color: rgba(249, 115, 22, 0.18); }
[data-theme="dark"] .file-icon.yaml { background-color: rgba(225, 29, 72, 0.18); }
[data-theme="dark"] .file-icon.sql { background-color: rgba(30, 58, 138, 0.2); }

/* 脚本 */
[data-theme="dark"] .file-icon.shell { background-color: rgba(107, 114, 128, 0.2); color: #9ca3af; }
[data-theme="dark"] .file-icon.batch { background-color: rgba(0, 120, 215, 0.18); }
[data-theme="dark"] .file-icon.code { background-color: rgba(6, 182, 212, 0.18); }

/* 可执行文件 */
[data-theme="dark"] .file-icon.exe { background-color: rgba(71, 85, 105, 0.2); }
[data-theme="dark"] .file-icon.apk { background-color: rgba(61, 220, 132, 0.18); }
[data-theme="dark"] .file-icon.ipa { background-color: rgba(0, 122, 255, 0.18); }
[data-theme="dark"] .file-icon.linux { background-color: rgba(221, 72, 20, 0.18); }

/* 设计文件 */
[data-theme="dark"] .file-icon.psd { background-color: rgba(49, 168, 255, 0.18); }
[data-theme="dark"] .file-icon.ai { background-color: rgba(255, 154, 0, 0.18); }
[data-theme="dark"] .file-icon.figma { background-color: rgba(162, 89, 255, 0.18); }
[data-theme="dark"] .file-icon.sketch { background-color: rgba(253, 173, 0, 0.18); }
[data-theme="dark"] .file-icon.xd { background-color: rgba(255, 97, 246, 0.18); }
[data-theme="dark"] .file-icon.cdr { background-color: rgba(0, 160, 64, 0.18); }
[data-theme="dark"] .file-icon.vector { background-color: rgba(217, 119, 6, 0.18); }
[data-theme="dark"] .file-icon.cad { background-color: rgba(196, 30, 58, 0.18); }
[data-theme="dark"] .file-icon.model3d { background-color: rgba(244, 63, 94, 0.18); }

/* 特殊文件 */
[data-theme="dark"] .file-icon.font { background-color: rgba(99, 102, 241, 0.18); }
[data-theme="dark"] .file-icon.ebook { background-color: rgba(217, 119, 6, 0.18); }
[data-theme="dark"] .file-icon.database { background-color: rgba(124, 58, 237, 0.18); }
[data-theme="dark"] .file-icon.iso { background-color: rgba(148, 163, 184, 0.18); }
[data-theme="dark"] .file-icon.vm { background-color: rgba(0, 136, 206, 0.18); }
[data-theme="dark"] .file-icon.config { background-color: rgba(100, 116, 139, 0.18); }
[data-theme="dark"] .file-icon.env { background-color: rgba(161, 98, 7, 0.18); }
[data-theme="dark"] .file-icon.log { background-color: rgba(148, 163, 184, 0.15); }
[data-theme="dark"] .file-icon.torrent { background-color: rgba(20, 184, 166, 0.18); }
[data-theme="dark"] .file-icon.link { background-color: rgba(59, 130, 246, 0.18); }
[data-theme="dark"] .file-icon.cert { background-color: rgba(202, 138, 4, 0.18); }
[data-theme="dark"] .file-icon.key { background-color: rgba(194, 65, 12, 0.18); }
[data-theme="dark"] .file-icon.backup { background-color: rgba(107, 114, 128, 0.18); }
[data-theme="dark"] .file-icon.temp { background-color: rgba(156, 163, 175, 0.12); }
[data-theme="dark"] .file-icon.git { background-color: rgba(240, 80, 51, 0.18); }
[data-theme="dark"] .file-icon.docker { background-color: rgba(36, 150, 237, 0.18); }
