* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 16px;
}

header {
  text-align: center;
  margin-bottom: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}
header h1 { font-size: 28px; color: #1a73e8; }

.header-right {
  position: absolute;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 主内容区：左右布局 */
.main-content {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.left-panel {
  flex: 1;
  min-width: 0;
}

.right-panel {
  width: 480px;
  flex-shrink: 0;
}

@media (max-width: 1000px) {
  .main-content {
    flex-direction: column;
  }
  .right-panel {
    width: 100%;
  }
}

/* 各区块 */
section { background: #fff; border-radius: 12px; padding: 24px; margin-bottom: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
h2 { font-size: 18px; margin-bottom: 16px; color: #444; }

/* 表单 */
input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 10px;
  transition: border-color .2s;
  outline: none;
}
input:focus { border-color: #1a73e8; }

form { display: grid; grid-template-columns: 1fr 2fr auto; gap: 10px; align-items: end; }
@media (max-width: 640px) { form { grid-template-columns: 1fr; } }

button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: background .2s;
}
button[type="submit"], .btn-save { background: #1a73e8; color: #fff; }
button[type="submit"]:hover, .btn-save:hover { background: #1557b0; }
.btn-login { background: #34a853; color: #fff; font-size: 13px; padding: 6px 14px; }
.btn-login:hover { background: #2d8e47; }
.btn-cancel { background: #f1f3f4; color: #555; }
.btn-cancel:hover { background: #e2e5e7; }
.btn-edit { background: #f9ab00; color: #fff; font-size: 13px; padding: 6px 12px; }
.btn-edit:hover { background: #e08f00; }
.btn-del { background: #ea4335; color: #fff; font-size: 13px; padding: 6px 12px; }
.btn-del:hover { background: #c62828; }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid #eee; }
th { color: #888; font-size: 13px; font-weight: 500; }
tr:hover td { background: #f9fafe; }
td a { color: #1a73e8; text-decoration: none; }
td a:hover { text-decoration: underline; }
td:last-child, td.action-cell { white-space: nowrap; }

/* 角标 */
#countBadge {
  display: inline-block;
  background: #e8f0fe;
  color: #1a73e8;
  font-size: 13px;
  padding: 2px 10px;
  border-radius: 12px;
}

/* 消息提示 */
.msg { font-size: 14px; margin-top: 8px; min-height: 20px; }
.msg.ok { color: #188038; }
.msg.err { color: #ea4335; }

/* 弹窗 */
.modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.modal-content h3 { margin-bottom: 20px; color: #333; }
.modal-btns { display: flex; gap: 10px; margin-top: 16px; }

/* ========== 文件下载区域样式 ========== */
.file-section {
  position: sticky;
  top: 20px;
}

/* 路径输入框 */
.path-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
}
.path-label { color: #666; font-size: 13px; white-space: nowrap; }
.path-input {
  flex: 1;
  border: 1px solid #ddd !important;
  border-radius: 4px;
  padding: 6px 10px !important;
  font-size: 13px;
  font-family: monospace;
  margin-bottom: 0 !important;
  width: auto !important;
}
.path-input:focus { border-color: #1a73e8 !important; }
.btn-go {
  padding: 6px 14px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-go:hover { background: #1557b0; }

.file-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-action {
  padding: 8px 14px;
  background: #e8f0fe;
  color: #1a73e8;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}
.btn-action:hover {
  background: #d2e3fc;
}

.file-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

.file-list .loading {
  padding: 30px;
  text-align: center;
  color: #888;
}

.file-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background .15s;
  gap: 8px;
}
.file-item:last-child { border-bottom: none; }
.file-item:hover { background: #f5f5f5; }
.file-item.is-dir { background: #fafbfc; }
.file-item.is-dir:hover { background: #f0f0f0; }

.file-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.file-info {
  flex: 1 1 0;
  overflow: hidden;
  min-width: 0;
}

.file-name {
  font-size: 14px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.file-meta {
  font-size: 11px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 右侧元信息（大小、时间） */
.file-meta-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-size: 12px;
  color: #888;
}
.meta-size {
  font-family: monospace;
  white-space: nowrap;
}
.meta-time {
  color: #aaa;
  white-space: nowrap;
}

.file-download {
  padding: 6px 12px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
}
.file-item:hover .file-download { opacity: 1; }
.file-download:hover { background: #1557b0; }

.empty-dir {
  padding: 30px;
  text-align: center;
  color: #888;
  font-size: 14px;
}

/* 添加路径区域 */
.add-path-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #e0e0e0;
}
.add-path-section h3 {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}
.add-path-form {
  display: flex;
  gap: 8px;
}
.add-path-form input {
  flex: 1;
  margin-bottom: 0;
  font-size: 13px;
  padding: 8px 12px;
}
