* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f3f5f8;
  color: #1f2937;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

h1, h2 { margin: 0 0 8px; }

.subtitle {
  margin: 0 0 20px;
  color: #6b7280;
  font-size: 14px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 24px 32px;
  background: #111827;
  color: #fff;
}

.header .subtitle { color: #9ca3af; margin-bottom: 0; }

.header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px 32px;
  display: grid;
  gap: 20px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.upload-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.upload-actions {
  margin-top: 12px;
}

.upload-progress {
  margin-top: 16px;
}

.progress-bar {
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  border-radius: 999px;
  transition: width 0.15s ease;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 14px;
  color: #4b5563;
}

.upload-form.is-uploading .upload-actions,
.upload-form.is-uploading input {
  opacity: 0.6;
  pointer-events: none;
}

.upload-form.is-uploading #uploadProgress,
.upload-form.is-uploading #btnCancelUpload {
  opacity: 1;
  pointer-events: auto;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="file"],
textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
}

textarea {
  width: 100%;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font: inherit;
  cursor: pointer;
}

.btn.primary { background: #2563eb; color: #fff; }
.btn.secondary { background: #e5e7eb; color: #111827; }
.btn.ghost { background: transparent; color: inherit; border: 1px solid rgba(255,255,255,0.2); }
.header .btn.ghost { color: #fff; }
.card .btn.ghost { color: #374151; border-color: #d1d5db; }
.btn.danger { background: #fee2e2; color: #b91c1c; }

.hint {
  color: #6b7280;
  font-size: 13px;
  margin: 12px 0;
}

.message {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.message.success { background: #ecfdf5; color: #047857; }
.message.error { background: #fef2f2; color: #b91c1c; }
.error { color: #b91c1c; font-size: 14px; }
.hidden { display: none !important; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}

th { background: #f9fafb; font-weight: 600; }

td code, .url-box code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  word-break: break-all;
}

.empty {
  text-align: center;
  color: #9ca3af;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-content {
  width: 100%;
  max-width: 900px;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  max-height: 90vh;
  overflow: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.url-box {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .upload-form .form-row {
    grid-template-columns: 1fr;
  }
}
