/* ========== 多主题定义（保持你原来的） ========== */
:root {
  --bg: linear-gradient(120deg,#faf5f0,#ffffff);
  --card-bg: rgba(255,255,255,0.65);
  --text: #2c2929;
  --header-bg: rgba(254,216,195,0.8);
  --hover-bg: rgba(255,255,255,0.5);
  --accent: #f3a683;
}
[data-theme="dark"] {
    --bg: radial-gradient(circle at top left, #1c1f26, #101213);
    --card-bg: rgba(255,255,255,0.08);
    --text: #e5e5e5;
    --header-bg: rgba(40,40,40,0.6);
    --hover-bg: rgba(255,255,255,0.12);
    --accent: #00eeff; /* 霓虹蓝 */
}
[data-theme="aurora"] {
    --bg: linear-gradient(135deg, #ff9966, #ff5e62);
    --card-bg: rgba(255,255,255,0.75);
    --text: #2b2b2b;
    --header-bg: #ff5e62;
    --hover-bg: rgba(255,255,255,0.4);
    --accent: #ff9966;
}
[data-theme="evergreen"] {
    --bg: #e9f5ec;
    --card-bg: #ffffff;
    --text: #2f4930;
    --header-bg: #3fa46a;
    --hover-bg: #d4eadd;
    --accent: #3fa46a;
}



/* ========== 通用样式 ========== */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* 顶栏 */
#header {
    height: 60px;
    background: var(--header-bg);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 20px;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
/* Logo 区域样式 */
#logo {
  font-size: 24px;    /* 文字大小，你可以换成 28px、30px 等 */
  font-weight: bold;  /* 可选，让字体更醒目 */
  letter-spacing: 0.5px; /* 可选，稍微增加字距更舒展 */
}
#logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

#theme-select {
  height: 36px;           /* 搜索框整体高度 */
  padding: 0px 0px;      /* 内边距与搜索框一致 */
  border: 1px solid #ccc; /* 添加细边框使风格统一 */
  border-radius: 6px;
  font-size: 15px;
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
}

/* 工具栏 */
#header-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

#search-box,
#upload-btn,
#mkdir-btn {
    background: var(--card-bg);
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text);
}

#search-box {
  width: 260px;      /* 控制整体宽度，可改大或改小 */
  height: 24px;      /* 控制高度 */
  font-size: 15px;   /* 输入文字大小 */
  padding: 6px 12px; /* 内边距，让文字不贴边 */
  border-radius: 6px;
  border: 1px solid #ccc;
  cursor: text;   /* ✅ 鼠标移入时变为竖线形输入光标 */
}

#upload-btn:hover,
#mkdir-btn:hover {
    background: var(--hover-bg);
}

/* 空间条 */
#used-space-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px; /* ✅ 自动生成文字与进度条之间的间距 */
}

#used-bar {
    width: 160px;
    height: 8px;
    background: #d0d5e0;
    border-radius: 3px;
    overflow: hidden;
}

#used-bar-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width .3s;
}

/* 面包屑 */
#breadcrumb {
    padding: 15px 25px;
    font-size: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
}

#back-btn {
    padding: 4px 10px;
    border: none;
    background: var(--hover-bg);
    border-radius: 5px;
    cursor: pointer;
}

/* 文件列表 */
#file-list {
    list-style: none;
    padding: 15px 25px;
    margin: 0;
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

#file-list li {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}

#file-list li:hover {
    transform: scale(1.04);
    box-shadow: 0 3px 9px rgba(0,0,0,0.15);
}

/* 图标 */
.icon {
    width: 50px;
    height: 50px;
    margin-bottom: 8px;
}
/* 文件名样式优化：自动省略过长文字 */
#file-list .name {
    display: block;
    width: 100%;
    font-size: 15px;
    text-align: center;
    white-space: nowrap;        /* 不换行 */
    overflow: hidden;           /* 超出隐藏 */
    text-overflow: ellipsis;    /* 显示省略号 */
    margin-top: 6px;
}
/* ========= 拖拽提示（已修复样式） ========= */
#drag-hint {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 42px;
    font-weight: bold;
    color: rgba(0,0,0,0.15);
    pointer-events: none;
}

#drag-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    border: 5px dashed var(--accent);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 45px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
    z-index: 999;
}

#drag-overlay.show {
    opacity: 1;
    pointer-events: all;
}

/* ========= 上传进度条 ========= */
#upload-progress {
    position: fixed;
    width: 300px;
    left: 50%;
    top: 120px;
    transform: translateX(-50%);
    background: var(--card-bg);
    box-shadow: 0 3px 9px rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    z-index: 999;
}

#upload-progress-bar {
    height: 12px;
    background: var(--accent);
    width: 0%;
    border-radius: 6px;
    transition: width .2s;
}

#upload-progress-text {
    margin-top: 10px;
    font-size: 18px;
    color: var(--text);
}

.hidden {
    display: none;
}

/* ========= Windows11 风格右键菜单 ========= */
#context-menu {
    position: fixed;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0px 8px 28px rgba(0, 0, 0, 0.25);
    padding: 6px 0;
    width: 180px;
    z-index: 9999;
    border: 1px solid rgba(255,255,255,0.4);
    animation: fadeIn .12s ease-out;
}
[data-theme="dark"] #context-menu {
    background: rgba(40, 40, 40, 0.85);
    border: 1px solid rgba(255,255,255,0.15);
}

/* 菜单项 */
#context-menu .menu-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 18px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    margin: 2px 6px;
    transition: background 0.15s;
}

/* Hover 效果 —— Windows 11 的浅蓝色 / 深色模式灰色 */
#context-menu .menu-item:hover {
    background: rgba(0, 120, 215, 0.15);
}
[data-theme="dark"] #context-menu .menu-item:hover {
    background: rgba(255,255,255,0.1);
}

/* 淡入动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

/* ----- 弹窗背景遮罩 ----- */
#dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(3px);
    z-index: 9998;
}

/* ----- 弹窗盒子 ----- */
#dialog-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    background: var(--card-bg);
    color: var(--text);
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.25);
    z-index: 9999;
    animation: dialogFade .2s ease;
}

@keyframes dialogFade {
    from {opacity: 0; transform: translate(-50%, -46%);}
    to   {opacity: 1; transform: translate(-50%, -50%);}
}

/* 标题 */
#dialog-title {
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: bold;
}

/* 输入框 */
#dialog-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: 18px;
}

/* 按钮区域 */
#dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 按钮样式 */
#dialog-buttons button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    transition: opacity .15s;
}

#dialog-buttons button:hover {
    opacity: .8;
}

#dialog-cancel {
    background: var(--hover-bg);
    color: var(--text);
}

.hidden { display: none; }

/* ========== 底部半透明工具栏 ========== */
#footer-tools {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    /* 背景采用顶部 header 的基础色，结合半透明与模糊 */
    background: var(--header-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background-color: rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.15);
    z-index: 990;
    border-top: 1px solid rgba(255,255,255,0.25);
}

/* 深色主题下的底栏颜色微调 */
[data-theme="dark"] #footer-tools {
    background-color: rgba(35, 35, 35, 0.6);
    border-top: 1px solid rgba(255,255,255,0.12);
}

/* 底栏左侧按钮风格 */
#footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
/* 上传 / 新建文件夹按钮，与文件卡片交互一致 */
#footer-left button {
    background: var(--card-bg);
    border: none;
    padding: 8px 18px;
    border-radius: 14px;                /* 与文件卡片圆角一致 */
    cursor: pointer;
    font-size: 18px;
    color: var(--text);
    transition: transform 0.15s, box-shadow 0.15s;
}

/* hover 时放大 + 阴影，与 #file-list li 的效果相同 */
#footer-left button:hover {
      transform: translateY(-2px);
  /* background: rgba(255, 255, 255, 0.45); */
    background: var(--hover-bg);
}

/* 空间条与原样保持一致，只是在底部容器里右对齐 */
#footer-tools #used-space-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    color: var(--text);
}
/* 底部栏储存空间文字大小调整 */
#footer-tools #used-space {
  font-size: 18px;  /* ✅ 比原来略大一点 */
  font-weight: 500; /* 可选，让文字稍微更醒目 */
}

/* 为避免内容被底部栏遮挡 */
body {
    padding-bottom: 70px; /* 底部留白 */
}

/* ========== 响应式调整 ========== */

/* 手机端小屏 */
/* 手机端小屏 */
@media (max-width:600px){
  #header { flex-direction:column; align-items:stretch; height:auto; padding:8px 14px; gap:6px;}
  #logo-area { justify-content:flex-start; }
  #search-box { width:100%; }
  #theme-select { display:none; }
  #breadcrumb { flex-direction:column; align-items:flex-start; gap:6px; padding:10px 14px; font-size:14px; }
  #file-list { padding:10px; gap:10px; grid-template-columns:repeat(auto-fill,minmax(100px,1fr)); }
  .icon { width:40px; height:40px; }

  /* ===== 底部工具栏一行布局（按钮 + 空间信息） ===== */
  #footer-tools {
    display:flex;
    flex-direction:row;        /* 一行排列 */
    justify-content:space-between; /* 左右两端分布 */
    align-items:center;        /* 垂直居中对齐 */
    padding:10px 14px;
    gap:10px;
    height:auto;
  }

  /* 左侧按钮组：上传和新建靠左排列 */
  #footer-left {
    display:flex;
    flex-direction:row;
    align-items:center;
    gap:8px;
  }

  #footer-left button {
    font-size:16px;
    padding:6px 14px;
    border-radius:10px;
  }
  /* ✅ 手机端隐藏“新建文件夹”文字，只显示图标 */
  #upload-btn .text,
  #mkdir-btn .text {
    display: none;
  }

  /* 可选：让图标略大一点更显眼 */
  #upload-btn .icon,
  #mkdir-btn .icon {
    font-size: 22px;
  }
  /* 右侧空间信息紧靠按钮区域的右侧 */
  #used-space-box {
    display:flex;
    flex-direction:column;
    align-items:flex-end;      /* 靠右对齐 */
    justify-content:center;
    width:auto;
  }

  #used-space {
    font-size:15px;
    text-align:right;
    width: 100%;              /* 占满容器宽度 */
  }

   /* ✅ 跟随文字说明等宽 */
  #used-bar {
    width: 100%;
    height:8px;
    border-radius:3px;
    background:#d0d5e0;
    overflow:hidden;
    margin-top:3px;
  }

  #used-bar-fill {
    height:100%;
    background:var(--accent);
    width:0%;
    transition:width .3s;
  }
}

/* 平板中等宽度 */
@media (min-width:601px) and (max-width:1024px){
  #header { padding:10px 20px; }
  #search-box { width:200px; }
  #file-list { grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:18px; padding:15px 20px; }
  .icon { width:45px; height:45px; }
}
@media (min-width:1440px){
  #file-list { grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); }
}