* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #eef5ff 0%, #f8fbff 45%, #f5fbff 100%);
  color: #1f2937;
}
a { color: inherit; }
.page { max-width: 1160px; margin: 0 auto; padding: 24px 16px 56px; }
.narrow { max-width: 760px; }
.back-link { display: inline-block; margin: 0 0 14px; color: #2563eb; text-decoration: none; font-size: 15px; }
.hero { text-align: center; }
.hero h1 { margin: 6px 0 10px; font-size: 34px; color: #1d4ed8; }
.hero p { margin: 0; color: #64748b; line-height: 1.8; }
.card {
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(219,234,254,.9);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 14px 36px rgba(37,99,235,.11);
  margin-bottom: 18px;
}
.toolbar { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.search-box { display: flex; gap: 10px; }
input, select, textarea {
  width: 100%; border: 1px solid #cbd5e1; border-radius: 14px; padding: 12px 14px;
  font-size: 16px; outline: none; background: #f8fafc;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.14); }
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 999px; padding: 11px 18px; background: #e0ecff; color: #1d4ed8;
  text-decoration: none; font-size: 15px; cursor: pointer; transition: .2s; white-space: nowrap;
}
.btn:hover, button:hover { transform: translateY(-1px); background: #c7dcff; }
.primary { background: #2563eb; color: #fff; font-weight: 700; }
.primary:hover { background: #1d4ed8; }
.danger { background: #fee2e2; color: #b91c1c; }
.category-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.category-chip { padding: 8px 13px; border-radius: 999px; text-decoration: none; background: #eef5ff; color: #2563eb; font-size: 14px; }
.category-chip.active { background: #2563eb; color: #fff; font-weight: 700; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.file-card { display: flex; flex-direction: column; gap: 12px; min-height: 220px; }
.file-top { display: flex; gap: 12px; align-items: flex-start; }
.file-icon { width: 48px; height: 48px; border-radius: 16px; background: #eef5ff; display: flex; align-items: center; justify-content: center; font-size: 25px; flex: 0 0 48px; }
.file-title { margin: 0; font-size: 20px; color: #0f172a; line-height: 1.4; word-break: break-word; }
.file-desc { color: #64748b; line-height: 1.7; margin: 0; flex: 1; word-break: break-word; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; color: #64748b; font-size: 13px; }
.meta span { background: #f1f5f9; border-radius: 999px; padding: 5px 9px; }
.empty { text-align: center; color: #94a3b8; padding: 36px 12px; line-height: 1.8; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { border-bottom: 1px solid #e2e8f0; padding: 12px 8px; text-align: left; vertical-align: top; }
.admin-table th { color: #475569; background: #f8fafc; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-weight: 700; margin-bottom: 8px; }
.notice { padding: 12px 14px; border-radius: 14px; margin-bottom: 14px; line-height: 1.7; }
.notice.ok { background: #dcfce7; color: #166534; }
.notice.err { background: #fee2e2; color: #991b1b; }
footer { text-align: center; color: #94a3b8; font-size: 14px; margin-top: 24px; }
.exe-warning { color: #92400e; background: #fef3c7; border-radius: 12px; padding: 9px 11px; font-size: 13px; line-height: 1.6; }
@media (max-width: 720px) {
  .page { padding: 18px 12px 42px; }
  .hero h1 { font-size: 28px; }
  .toolbar { grid-template-columns: 1fr; }
  .search-box { flex-direction: column; }
  .btn, button { width: 100%; }
  .file-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
}
