:root {
  --bg: #f7f8fa; --card: #fff; --border: #e8eaed;
  --text: #1a1a1a; --text2: #6b7280; --text3: #9ca3af;
  --primary: #1a1a1a; --primary-hover: #333;
  --red: #dc2626; --blue: #2563eb; --green: #16a34a;
}
* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
}
.hidden { display:none !important; }
.page { min-height: 100vh; }

/* 登录 */
#loginPage, #sharePage {
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(180deg, #f7f8fa, #eef0f4);
}
.auth-card, .share-card, .modal-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 32px; width: 100%; max-width: 360px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.04);
}
.auth-card { text-align: center; }
.auth-card h1 { font-size: 24px; margin-bottom: 4px; }
.auth-sub { color: var(--text3); font-size: 13px; margin-bottom: 24px; }

input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; outline: none; margin-bottom: 10px;
}
input:focus { border-color: var(--primary); }

.btn-primary {
  display: inline-block; padding: 9px 18px; background: var(--primary);
  color: #fff; border: none; border-radius: 8px; font-size: 13px;
  cursor: pointer;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost {
  padding: 9px 16px; background: none; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--text2);
}
.btn-sm { padding: 6px 12px; font-size: 12px; margin-left: 8px; }
.error-text { color: var(--red); font-size: 13px; margin-top: 8px; min-height: 18px; }
.about-box { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text2); }
.about-tip { font-size: 12px; color: var(--text3); margin-top: 6px; line-height: 1.6; }

/* 导航 */
.navbar {
  background: rgba(255,255,255,0.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 880px; margin: 0 auto; padding: 0 24px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { font-weight: 600; font-size: 16px; }
.nav-actions { display: flex; gap: 4px; }
.nav-btn {
  background: none; border: none; color: var(--text2);
  font-size: 13px; cursor: pointer; padding: 6px 10px; border-radius: 6px;
}
.nav-btn:hover { background: #f3f4f6; }

/* 主内容 */
.container { max-width: 880px; margin: 0 auto; padding: 28px 24px 60px; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.page-head h2 { font-size: 20px; }
.page-sub { color: var(--text3); font-size: 13px; margin-top: 2px; }

.dropzone {
  border: 1.5px dashed var(--border); border-radius: 12px;
  padding: 20px; text-align: center; color: var(--text3);
  margin-bottom: 16px; background: var(--card);
}
.dropzone.dragover { border-color: var(--primary); background: #fafafa; }

.progress {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px; margin-bottom: 16px;
}
.progress-info { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.progress-track { height: 4px; background: #f0f1f3; border-radius: 2px; overflow: hidden; }
#progressFill { height: 100%; background: var(--primary); width: 0; }

/* 文件列表 */
.file-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.file-head, .file-row {
  display: grid; grid-template-columns: 1fr 70px 120px 180px;
  gap: 12px; align-items: center; padding: 11px 16px;
}
.file-head { font-size: 12px; color: var(--text3); border-bottom: 1px solid var(--border); background: #fafbfc; }
.file-row { border-bottom: 1px solid #f3f4f6; }
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: #fafbfc; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 12px; color: var(--text2); }
.file-ops { display: flex; gap: 10px; justify-content: flex-end; }
.file-ops button { background: none; border: none; color: var(--blue); font-size: 13px; cursor: pointer; padding: 0; }
.file-ops button.del { color: var(--red); }
.file-ops button:hover { text-decoration: underline; }

/* 弹窗 */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.modal-card { max-width: 380px; }
.modal-lg { max-width: 500px; }
.modal-card h3 { font-size: 16px; margin-bottom: 12px; }
.modal-sub { font-size: 13px; color: var(--text2); margin-bottom: 12px; word-break: break-all; }
.form-label { display: block; font-size: 12px; color: var(--text2); margin-bottom: 4px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.share-result { margin-top: 12px; display: flex; }
.share-result input { flex: 1; margin: 0; font-size: 12px; }

/* 预览 */
.modal-preview {
  background: #fff; border-radius: 12px; width: 100%; max-width: 800px;
  max-height: 90vh; display: flex; flex-direction: column;
}
.modal-head {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text2); }
.modal-body { padding: 16px; overflow: auto; flex: 1; text-align: center; }
.modal-body img, .modal-body video { max-width: 100%; border-radius: 8px; }
.modal-body iframe { width: 100%; height: 60vh; border: none; }

/* 分享管理列表 */
.share-list { max-height: 400px; overflow-y: auto; }
.share-item {
  padding: 12px 0; border-bottom: 1px solid #f1f5f9;
}
.share-item:last-child { border-bottom: none; }
.share-item-name { font-size: 14px; margin-bottom: 4px; }
.share-item-info { font-size: 12px; color: var(--text2); margin-bottom: 6px; }
.share-item-ops { display: flex; gap: 8px; }
.share-item-ops button { font-size: 12px; padding: 4px 10px; }

/* 分享页 */
.share-card { text-align: center; }
.share-card h2 { font-size: 18px; margin-bottom: 4px; word-break: break-all; }
.share-size { color: var(--text3); font-size: 13px; margin: 8px 0 20px; }
.share-pwd input { margin-bottom: 8px; }
.share-btns { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.share-preview { margin: 16px 0; }
.share-preview img, .share-preview video { max-width: 100%; border-radius: 8px; }

@media (max-width: 640px) {
  .file-head, .file-row { grid-template-columns: 1fr 60px; }
  .file-head span:nth-child(3), .file-row .file-meta { display: none; }
}

/* 设置页 */
.settings-section { margin-bottom: 20px; }
.settings-section h4 { font-size: 13px; color: var(--text2); margin-bottom: 10px; font-weight: 500; }
.settings-row {
  display: flex; justify-content: space-between;
  padding: 8px 0; font-size: 13px; border-bottom: 1px solid #f1f5f9;
}
.btn-block { width: 100%; margin-top: 10px; }
.update-msg { font-size: 12px; color: var(--green); margin-top: 8px; text-align: center; }
.about-tip { font-size: 12px; color: var(--text3); margin-top: 16px; line-height: 1.5; }

/* 动画 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.auth-card, .share-card, .modal-card {
  animation: scaleIn 0.2s ease-out;
}

.file-row {
  animation: fadeIn 0.2s ease-out;
  transition: background 0.15s;
}

.btn-primary, .btn-ghost {
  transition: all 0.15s ease;
}

.modal {
  animation: fadeIn 0.15s ease-out;
}

.dropzone {
  transition: all 0.2s ease;
}

input {
  transition: border-color 0.15s, box-shadow 0.15s;
}

/* 文件缩略图 */
.file-name-cell {
  display: flex; align-items: center; gap: 10px;
  overflow: hidden;
}
.file-thumb {
  width: 32px; height: 32px; object-fit: contain; flex-shrink: 0;
}
.file-name-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
