/* 文件库页面（独立于课表样式，复用主题变量） */

.files-frame { max-width: 900px; margin: 0 auto; padding: 24px 16px 60px; }
.files-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.files-brand { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.files-brand h1 { margin: 0; font-size: 22px; letter-spacing: 0.02em; color: var(--text-strong, #1b2430); }
.files-sub { font-size: 12px; color: var(--ink-soft, #6b7280); }
.files-back { font-size: 13px; color: var(--ink-soft, #4a90d9); text-decoration: none; }
.files-back:hover { text-decoration: underline; }

.files-upload-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; border: 0;
  background: #2f6f4f; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: filter 150ms;
}
.files-upload-btn:hover { filter: brightness(1.1); }
.files-upload-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.files-dropzone {
  border: 2px dashed #c3cbd6; border-radius: 12px; padding: 34px 20px; text-align: center;
  color: var(--ink-soft, #6b7280); font-size: 14px; background: var(--surface, #fff);
  transition: border-color 150ms, background 150ms; cursor: pointer; margin-bottom: 16px;
}
.files-dropzone.dragover { border-color: #2f6f4f; background: rgba(47, 111, 79, 0.06); }
.files-dropzone-sub { margin: 6px 0 0; font-size: 12px; opacity: 0.75; }

.files-status { min-height: 20px; margin-bottom: 12px; font-size: 13px; }
.files-status .up-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--ink-soft, #6b7280); }
.files-status .up-item .up-bar { flex: 1; height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.files-status .up-item .up-fill { height: 100%; background: #2f6f4f; border-radius: 3px; transition: width 150ms; }
.files-status .up-error { color: #c0392b; }

.files-list-wrap { }
.files-list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.files-list-head h2 { margin: 0; font-size: 15px; }
.files-count { color: var(--ink-faint, #9ca3af); font-size: 12px; font-weight: 400; }
.files-refresh { border: 1px solid #c3cbd6; background: transparent; border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--ink-soft, #6b7280); }
.files-refresh:hover { background: rgba(0,0,0,0.04); }

.files-list { display: grid; gap: 8px; }
.files-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--line, #e5e7eb); border-radius: 10px; background: var(--surface, #fff);
}
.files-icon {
  display: grid; width: 36px; height: 36px; place-items: center; border-radius: 8px; flex-shrink: 0;
  background: #eef2f7; color: #4a6b8a; font-size: 10px; font-weight: 750; letter-spacing: 0.02em;
}
.files-meta { flex: 1; min-width: 0; }
.files-name { font-size: 13px; font-weight: 600; color: var(--text-strong, #1b2430); word-break: break-all; }
.files-detail { font-size: 11px; color: var(--ink-faint, #9ca3af); margin-top: 2px; }
.files-ops { display: flex; gap: 6px; flex-shrink: 0; }
.files-op {
  border: 1px solid #c3cbd6; background: transparent; border-radius: 6px; padding: 4px 10px;
  font-size: 12px; cursor: pointer; color: var(--ink-soft, #6b7280); text-decoration: none;
}
.files-op:hover { background: rgba(0,0,0,0.05); }
.files-op.danger:hover { border-color: #c0392b; color: #c0392b; background: rgba(192,57,43,0.06); }
.files-op.primary { background: #2f6f4f; border-color: #2f6f4f; color: #fff; }
.files-op.primary:hover { filter: brightness(1.08); background: #2f6f4f; }

.files-empty { padding: 40px 0; text-align: center; color: var(--ink-faint, #9ca3af); font-size: 13px; }
.files-offline { padding: 14px; border: 1px solid #e5b800; background: rgba(229,184,0,0.08); border-radius: 8px; color: #8a6d00; font-size: 12px; margin-bottom: 12px; line-height: 1.6; }

/* 深色主题 */
[data-calendar-theme="dark"] .files-item { border-color: #2e3546; background: #232833; }
[data-calendar-theme="dark"] .files-dropzone { border-color: #3a4256; background: #1b1d27; }
[data-calendar-theme="dark"] .files-op { border-color: #3a4256; color: #aab2c5; }
[data-calendar-theme="dark"] .files-refresh { border-color: #3a4256; color: #aab2c5; }

@media (max-width: 560px) {
  .files-item { flex-wrap: wrap; }
  .files-ops { width: 100%; justify-content: flex-end; }
}
