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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", sans-serif;
  background: #f0f2f5;
  color: #1a1a1a;
  line-height: 1.5;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  width: 360px;
}

.login-card h1 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.login-card label {
  display: block;
  margin-bottom: 1rem;
  font-size: .875rem;
  color: #555;
}

.login-card input {
  display: block;
  width: 100%;
  margin-top: .25rem;
  padding: .5rem .75rem;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: .9375rem;
}

.login-card button {
  width: 100%;
  margin-top: .5rem;
}

.topbar {
  background: #1677ff;
  color: #fff;
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar h1 { font-size: 1.125rem; font-weight: 600; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .875rem;
}

.topbar-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: .8125rem;
}

.topbar-link:hover {
  color: #fff;
  text-decoration: underline;
}

.form-field {
  display: block;
  margin-bottom: .75rem;
  font-size: .8125rem;
  color: #555;
}

.form-field input,
.form-field select {
  display: block;
  width: 100%;
  margin-top: .25rem;
  padding: .45rem .6rem;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: .875rem;
}

.tag-admin { background: #e6f4ff; color: #1677ff; }
.tag-user { background: #f5f5f5; color: #666; }

.password-display {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .75rem 0;
  padding: .75rem;
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  border-radius: 6px;
}

.password-display code {
  flex: 1;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: .05em;
  color: #389e0d;
  word-break: break-all;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem;
}

.panel {
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.panel h2 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem 1rem;
}

.search-grid label {
  font-size: .8125rem;
  color: #555;
}

.search-grid input,
.search-grid select {
  display: block;
  width: 100%;
  margin-top: .25rem;
  padding: .4rem .6rem;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: .875rem;
}

.date-field {
  min-width: 200px;
}

.date-input-wrap {
  position: relative;
  margin-top: .25rem;
}

.date-input-wrap input {
  width: 100%;
  padding: .45rem 2rem .45rem .65rem;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: .875rem;
  background: #fff;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}

.date-input-wrap input:hover {
  border-color: #91caff;
}

.date-input-wrap input:focus {
  outline: none;
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.15);
}

.date-icon {
  position: absolute;
  right: .55rem;
  top: 50%;
  transform: translateY(-50%);
  color: #1677ff;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.date-input-wrap input::placeholder {
  color: #bbb;
}

.search-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: .5rem;
  margin-top: .25rem;
}

button {
  padding: .45rem 1rem;
  border: none;
  border-radius: 4px;
  background: #1677ff;
  color: #fff;
  font-size: .875rem;
  cursor: pointer;
}

button:hover { background: #4096ff; }
button:disabled { opacity: .5; cursor: not-allowed; }

.btn-secondary {
  background: #fff;
  color: #333;
  border: 1px solid #d9d9d9;
}

.btn-secondary:hover { background: #fafafa; }

.btn-danger {
  background: #fff;
  color: #ff4d4f;
  border: 1px solid #ffccc7;
}

.btn-danger:hover { background: #fff1f0; }

.btn-sm { padding: .25rem .5rem; font-size: .8125rem; }

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .75rem;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8125rem;
}

th, td {
  padding: .5rem .6rem;
  border-bottom: 1px solid #f0f0f0;
  text-align: left;
  white-space: nowrap;
}

th { background: #fafafa; font-weight: 600; color: #555; }

.empty { text-align: center; color: #999; padding: 2rem !important; }

.tag {
  display: inline-block;
  padding: .1rem .4rem;
  border-radius: 3px;
  font-size: .75rem;
}

.tag-done { background: #f6ffed; color: #52c41a; }
.tag-pending { background: #fffbe6; color: #faad14; }
.tag-failed { background: #fff2f0; color: #ff4d4f; }
.tag-none { background: #f5f5f5; color: #999; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.player-ctrl {
  display: flex;
  align-items: center;
  gap: .2rem;
}

.player-empty {
  color: #ccc;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fff;
  color: #555;
}

.icon-btn:hover {
  background: #e6f4ff;
  border-color: #91caff;
  color: #1677ff;
}

.icon-btn.active,
.player-ctrl.playing .icon-btn[data-action="play"] {
  background: #1677ff;
  border-color: #1677ff;
  color: #fff;
}

.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1.5rem;
  background: #fff;
  border-top: 1px solid #e8e8e8;
  box-shadow: 0 -2px 8px rgba(0,0,0,.06);
  z-index: 100;
}

.player-bar-label {
  font-size: .8125rem;
  color: #555;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-time {
  font-size: .75rem;
  color: #888;
  white-space: nowrap;
  min-width: 80px;
}

.player-seek {
  flex: 1;
  height: 4px;
  accent-color: #1677ff;
  cursor: pointer;
}

body { padding-bottom: 3rem; }

.muted { color: #888; font-size: .875rem; }
.error { color: #ff4d4f; font-size: .875rem; margin-top: .5rem; }
.hidden { display: none !important; }

.actions { display: flex; gap: .35rem; flex-wrap: wrap; }

.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.modal-box {
  position: relative;
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  width: 400px;
  max-width: calc(100vw - 2rem);
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
}
.modal-box h3 { font-size: 1rem; margin-bottom: .75rem; }
.modal-warn { color: #ff4d4f; font-size: .8125rem; margin-bottom: .75rem; }
.modal-info {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .25rem .75rem;
  font-size: .8125rem;
  margin-bottom: .75rem;
  padding: .75rem;
  background: #fafafa;
  border-radius: 4px;
}
.modal-info dt { color: #888; }
.modal-info dd { color: #333; word-break: break-all; }
.modal-confirm-text { font-size: .875rem; margin-bottom: 1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; }

.btn-danger-solid {
  background: #ff4d4f;
  color: #fff;
  border: none;
}
.btn-danger-solid:hover { background: #ff7875; }

@media (max-width: 640px) {
  .topbar { flex-direction: column; gap: .5rem; text-align: center; }
}
