/* ================= 夜间模式切换按钮 ================= */
.theme-btn{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #f1f3f9;
  color: #64748b;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.theme-btn:hover{ background: #e7eaf3; color: #4f46e5; }
.theme-ico{ display: block; }
.theme-btn .ico-moon{ display: none; }
html[data-theme="dark"] .theme-btn .ico-sun{ display: none; }
html[data-theme="dark"] .theme-btn .ico-moon{ display: block; }
.theme-btn::after{
  content: '切换到夜间模式';
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 1090;
  padding: 6px 10px;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 400;
  color: #475569;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(15,23,42,.12);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -4px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  pointer-events: none;
}
html[data-theme="dark"] .theme-btn::after{ content: '切换到日间模式'; }
.theme-btn:hover::after{ opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ================= 夜间主题 ================= */
html[data-theme="dark"]{
  color-scheme: dark;
  --bs-body-bg: #0d0f16;
  --bs-primary: #8b7cff;
  --bs-primary-rgb: 139,124,255;
  --card-shadow: 0 12px 28px rgba(0,0,0,.5);
}

html[data-theme="dark"] body{ background-color: #0d0f16; color: #e5e8f2; }

html[data-theme="dark"] .navbar{
  background-color: rgba(17,19,27,.92) !important;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
html[data-theme="dark"] .navbar-brand{ color: #a99bff !important; }
html[data-theme="dark"] .nav-link{ color: #9aa3b8 !important; }
html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] .nav-link.active{ color: #a99bff !important; }
html[data-theme="dark"] .navbar-toggler{ border-color: rgba(255,255,255,.16); }
html[data-theme="dark"] .navbar-toggler-icon{
  filter: invert(1) grayscale(1) brightness(1.6);
}

html[data-theme="dark"] .card{
  background: #161a24;
  color: #e5e8f2;
  box-shadow: var(--card-shadow);
}
html[data-theme="dark"] .card-header{
  background-color: transparent;
  border-bottom-color: rgba(255,255,255,.07);
}
html[data-theme="dark"] .card-title{ color: #f1f5f9; }
html[data-theme="dark"] .card-footer,
html[data-theme="dark"] .bg-white{
  background-color: #161a24 !important;
  color: #e5e8f2;
}
html[data-theme="dark"] .text-dark{ color: #e5e8f2 !important; }
html[data-theme="dark"] .text-muted{ color: #8b93a7 !important; }
html[data-theme="dark"] .bg-light{ background-color: #1b2030 !important; color: #e5e8f2; }

html[data-theme="dark"] .table{
  --bs-table-bg: transparent;
  color: #dfe3ee;
}
html[data-theme="dark"] .table thead th{
  background-color: #1b2030;
  color: #9aa3b8;
  border-bottom-color: rgba(255,255,255,.08);
}
html[data-theme="dark"] .table tbody td{
  color: #cfd6e6;
  border-bottom-color: rgba(255,255,255,.06);
}
html[data-theme="dark"] .table tbody td a{ color: #9dc0ff; }
html[data-theme="dark"] .table-hover tbody tr:hover{
  background-color: #1d2333;
  color: #e5e8f2;
}
html[data-theme="dark"] .badge.bg-light{
  background-color: #232a3c !important;
  border-color: rgba(255,255,255,.14) !important;
  color: #dfe3ee !important;
}
html[data-theme="dark"] .border,
html[data-theme="dark"] .border-top,
html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-start,
html[data-theme="dark"] .border-end{ border-color: rgba(255,255,255,.1) !important; }

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select{
  background-color: #1b2030;
  border-color: rgba(255,255,255,.12);
  color: #e5e8f2;
}
html[data-theme="dark"] .form-control::placeholder{ color: #6f7891; }
html[data-theme="dark"] .form-control:focus{
  background-color: #212838;
  border-color: #8b7cff;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(139,124,255,.16);
}
html[data-theme="dark"] .input-group-text{
  background-color: #1b2030;
  border-color: rgba(255,255,255,.12);
  color: #9aa3b8;
}

html[data-theme="dark"] .btn-primary{
  background-color: #6f5bff;
  border-color: #6f5bff;
  box-shadow: 0 6px 16px rgba(111,91,255,.28);
}
html[data-theme="dark"] .btn-primary:hover{
  background-color: #5b47e6;
  border-color: #5b47e6;
}
html[data-theme="dark"] .btn-light{
  background-color: #232a3c;
  border-color: rgba(255,255,255,.12);
  color: #dfe3ee;
}

html[data-theme="dark"] .dropdown-menu{
  background-color: #1b2030;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 14px 30px rgba(0,0,0,.55);
}
html[data-theme="dark"] .dropdown-item{ color: #cfd6e6; }
html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus{ background-color: #232a3c; color: #fff; }
html[data-theme="dark"] .dropdown-divider{ border-color: rgba(255,255,255,.1); }

html[data-theme="dark"] .nav-tabs{ border-bottom-color: rgba(255,255,255,.1); }
html[data-theme="dark"] .nav-tabs .nav-link{ color: #9aa3b8; }
html[data-theme="dark"] .nav-tabs .nav-link.active{
  background-color: transparent;
  border-color: rgba(255,255,255,.1) rgba(255,255,255,.1) transparent;
  color: #a99bff;
}

html[data-theme="dark"] .pagination .page-link{ background: transparent; color: #9aa3b8; }
html[data-theme="dark"] .pagination .page-link:hover{ background: #232a3c; color: #fff; }
html[data-theme="dark"] .pagination .page-item.active .page-link{
  background-color: #6f5bff;
  color: #fff;
}
html[data-theme="dark"] .pagination .page-item.disabled .page-link{
  background: transparent;
  color: #4d5568;
}

html[data-theme="dark"] .footer{
  background-color: #161a24 !important;
  border-top-color: rgba(255,255,255,.08) !important;
}

html[data-theme="dark"] .shadow-sm{ box-shadow: 0 8px 20px rgba(0,0,0,.45) !important; }
html[data-theme="dark"] .alert-info{
  background-color: #17243a;
  border-color: #1f3f68;
  color: #bcd9ff;
}
html[data-theme="dark"] input[type="file"]{ color: #cfd6e6; }

html[data-theme="dark"] .theme-btn{ background: #232a3c; color: #cfd6e6; }
html[data-theme="dark"] .theme-btn:hover{ background: #2d3549; color: #a99bff; }
html[data-theme="dark"] .theme-btn::after{
  background: #1b2030;
  border-color: rgba(255,255,255,.12);
  color: #cfd6e6;
  box-shadow: 0 12px 26px rgba(0,0,0,.6);
}

/* ================= 手机端导航图标区 ================= */
.nav-mobile-actions{ display:flex; align-items:center; gap:2px; }
.nav-mobile-ico{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  padding:0;
  border:0;
  border-radius:8px;
  background:transparent;
  color:#64748b;
  font-size:18px;
  line-height:1;
  text-decoration:none;
  cursor:pointer;
  transition:color .18s ease, background .18s ease;
}
.nav-mobile-ico:hover{ color:#4f46e5; }
.theme-mobile .ico-moon{ display:none; }
html[data-theme="dark"] .theme-mobile .ico-sun{ display:none; }
html[data-theme="dark"] .theme-mobile .ico-moon{ display:block; }
html[data-theme="dark"] .nav-mobile-ico{ color:#cfd6e6; }
html[data-theme="dark"] .nav-mobile-ico:hover{ color:#a99bff; }

@media (max-width: 991.98px){
  .navbar{ min-height:56px; }
  .navbar .navbar-brand{ font-size:1.05rem; }
  .navbar .navbar-toggler{ border:0; padding:.15rem .35rem; box-shadow:none !important; }
  .navbar .navbar-toggler:focus{ box-shadow:none !important; }
  .navbar .navbar-toggler-icon{ width:1.15em; height:1.15em; }

  /* 手机端：已登录时菜单里的账号项直接展开，跟弹出层一样平铺 */
  .navbar-nav .dropdown-menu.user-menu{
    display:block !important;
    position:static !important;
    float:none;
    width:100%;
    margin:0;
    padding:2px 0 6px;
    background:transparent !important;
    border:0 !important;
    box-shadow:none !important;
  }
  .navbar-nav .dropdown-menu.user-menu .dropdown-item{
    padding:.6rem .75rem;
    border-radius:8px;
  }
  html[data-theme="dark"] .navbar-nav .dropdown-menu.user-menu .dropdown-item{
    color:#cfd6e6;
  }
  html[data-theme="dark"] .navbar-nav .dropdown-menu.user-menu .dropdown-item:hover{
    background:#232a3c;
  }
  html[data-theme="dark"] .navbar-nav .dropdown-menu.user-menu .dropdown-divider{
    border-color: rgba(255,255,255,.1);
  }
}

/* 手机端卡片列表在夜间模式下的配色 */html[data-theme="dark"] .file-cards{ border-top-color: rgba(255,255,255,.07); }
html[data-theme="dark"] .fc-item{ border-bottom-color: rgba(255,255,255,.07); }
html[data-theme="dark"] .fc-name{ color: #f1f5f9; }
html[data-theme="dark"] .fc-meta{ color: #8b93a7; }
html[data-theme="dark"] .fc-btn{
  color:#a99bff;
  background: rgba(139,124,255,.14);
  border-color: rgba(139,124,255,.28);
}
html[data-theme="dark"] .fc-btn:hover{ background: rgba(139,124,255,.24); color:#c3b9ff; }
html[data-theme="dark"] .fc-empty{ color:#8b93a7; }

html[data-theme="dark"] .mp{
  background: transparent;
  color: #e5e8f2;
  box-shadow: none;
}
html[data-theme="dark"] .mp-cover{
  box-shadow: 0 0 0 5px #232a3c, 0 10px 22px rgba(0,0,0,.45);
}
html[data-theme="dark"] .mp-name{ color: #cfd6e6; }
html[data-theme="dark"] .mp-name .mp-item{ color: #cfd6e6; }
html[data-theme="dark"] .mp-bar{ background: #2a3145; }
html[data-theme="dark"] .mp-meta{ color: #9aa3b8; }
html[data-theme="dark"] .mp-tip{ color: #9aa3b8; }
html[data-theme="dark"] .mp-tip .mp-tip-on{ color: #a99bff; }

/* ================= 手机端：文件页标签页单行左右滑动（带可见滚动条） ================= */
@media (max-width: 767.98px){
  .nav-tabs{
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(111,91,255,.6) rgba(111,91,255,.12);
  }
  .nav-tabs .nav-item{
    flex: 0 0 auto;
    width: auto;
  }
  .nav-tabs .nav-link{
    flex: 0 0 auto;
    white-space: nowrap;
    padding: .5rem .9rem;
    font-size: 13.5px;
  }
  .nav-tabs .nav-link i{ margin-right: .35rem !important; }

  html[data-theme="dark"] .nav-tabs{
    scrollbar-color: rgba(169,155,255,.65) rgba(255,255,255,.1);
  }
}

/* ================= 手机端：外链输入框更矮、更宽，复制按钮更窄 ================= */
@media (max-width: 767.98px){
  .card-body{ padding: 1rem .85rem; }
  .tab-content.p-2{ padding: .25rem !important; }

  .input-group > .form-control.bg-light{
    padding: .4rem .6rem;
    font-size: 12.5px;
    height: auto;
  }
  .input-group > .copy-btn{
    padding: .4rem .55rem;
    font-size: 12px;
    line-height: 1.5;
    min-width: 0;
    flex: 0 0 auto;
  }
  .input-group > .copy-btn i{
    font-size: 11px;
    margin-right: .15rem !important;
  }
  .tab-content .form-label,
  .tab-content .col-form-label{ font-size: 12.5px; margin-bottom: .35rem; }
  .tab-content .mb-3{ margin-bottom: .75rem !important; }
}

/* ================= 手机端：文件详情表格横向滑动，不挤压换行 ================= */
@media (max-width: 767.98px){
  #info .table-responsive{
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(111,91,255,.6) rgba(111,91,255,.12);
  }
  #info table{ min-width: 560px; }
  #info table th,
  #info table td{
    white-space: nowrap;
    padding: .45rem .55rem;
    font-size: 12.5px;
    vertical-align: middle;
  }
  #info table th{ width: auto !important; min-width: 74px; }
  html[data-theme="dark"] #info .table-responsive{
    scrollbar-color: rgba(169,155,255,.65) rgba(255,255,255,.1);
  }
}

/* 文件详情：文件名称单元格允许换行 */
#info td.info-name{
  white-space: normal !important;
  word-break: break-all;
  line-height: 1.5;
}

/* ================= 文件外链/代码调用：标签与输入框紧凑（桌面） ================= */
@media (min-width: 768px){
  #link .row, #code .row{ --bs-gutter-x: 8px; }
  #link .row > .col-md-2,
  #code .row > .col-md-2{
    flex: 0 0 96px;
    max-width: 96px;
    padding-right: 0;
    padding-left: 0;
  }
  #link .row > .col-md-10,
  #code .row > .col-md-10{
    flex: 1 1 auto;
    max-width: none;
    padding-left: 0;
  }
  #link .input-group > .form-control,
  #code .input-group > .form-control{
    padding: .3rem .65rem;
    font-size: 13px;
    height: auto;
  }
  #link .input-group > .copy-btn,
  #code .input-group > .copy-btn{
    padding: .3rem .75rem;
    font-size: 12.5px;
    line-height: 1.5;
    min-width: 0;
    flex: 0 0 auto;
  }
  #link .copy-btn i,
  #code .copy-btn i{ font-size: 12px; }
}


/* ================= 上传页：拖拽上传区（#fileInput）夜间模式 ================= */
html[data-theme="dark"] #fileInput{
  background: #141a26 !important;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: .85rem;
}
html[data-theme="dark"] #fileInput:hover{
  background: rgba(139,92,246,.10) !important;
  border-color: rgba(139,92,246,.35);
}
html[data-theme="dark"] #fileInput .fa-cloud-arrow-up{
  color: #a99bff !important;
  opacity: .55;
}
html[data-theme="dark"] #fileInput #uploadTitle{
  color: #e7ebf5 !important;
}
html[data-theme="dark"] #fileInput .form-check-label{
  color: #9aa3b7;
}

/* ================= 文件列表 操作列：下载与文件名按钮贴合 ================= */
.card .table .btn-group.btn-group-sm{
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}
.card .table .btn-group.btn-group-sm > .btn{
  padding: .2rem .45rem;
  font-size: 12.5px;
  line-height: 1.7;
  border-radius: .35rem;
  box-shadow: none;
}
.card .table .btn-group.btn-group-sm > .btn + .btn{
  margin-left: 0;
  padding-left: .16rem;
}
.card .table .btn-group.btn-group-sm > .btn .fa-solid{
  font-size: 12px;
}

/* ================= 文件列表：序号列与操作列贴合 ================= */
@media (min-width: 768px){
  .file-table > thead > tr > th:first-child,
  .file-table > tbody > tr > td:first-child{
    width: 50px;
    min-width: 50px;
    padding-left: 1.35rem !important;
    padding-right: .15rem !important;
  }
  .file-table > thead > tr > th:nth-child(2),
  .file-table > tbody > tr > td:nth-child(2){
    padding-left: .2rem !important;
  }
}





/* ================= layer 弹层（复制成功等提示）夜间适配 ================= */
html[data-theme="dark"] .layui-layer{
  background-color: #1b2231 !important;
  box-shadow: 0 14px 40px rgba(0,0,0,.62) !important;
  border-radius: 10px;
}
html[data-theme="dark"] .layui-layer.layui-layer-msg{
  background-color: #1b2231 !important;
  border-color: rgba(255,255,255,.14) !important;
}
html[data-theme="dark"] .layui-layer .layui-layer-title{
  background-color: #232a3a !important;
  color: #e9edf7 !important;
  border-bottom-color: rgba(255,255,255,.08) !important;
}
html[data-theme="dark"] .layui-layer-dialog .layui-layer-content,
html[data-theme="dark"] .layui-layer-msg .layui-layer-content{
  color: #e9edf7 !important;
}
html[data-theme="dark"] .layui-layer-btn a{
  background-color: #242c3d !important;
  border-color: rgba(255,255,255,.16) !important;
  color: #dfe5f2 !important;
}
html[data-theme="dark"] .layui-layer-btn .layui-layer-btn0{
  background-color: #5b47e6 !important;
  border-color: #5b47e6 !important;
  color: #fff !important;
}
html[data-theme="dark"] .layui-layer-shade{ background-color: #000 !important; }
