*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, -sans-serif;
  background: #0f172a;
  color: #e5e7eb;
}

a {
  color: #38bdf8;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: linear-gradient(to right, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.9));
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.app-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-logo {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1rem;
}

.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.app-nav a {
  font-size: 0.88rem;
  white-space: nowrap;
}

.app-main {
  max-width: 960px;
  margin: 1.25rem auto 2.5rem;
  padding: 0 1rem;
}

.page-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.page-title {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
}

.card {
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent 48%),
              radial-gradient(circle at bottom right, rgba(236, 72, 153, 0.08), transparent 55%),
              rgba(15, 23, 42, 0.96);
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  padding: 1rem 1.1rem 1.1rem;
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.95),
    0 0 0 1px rgba(15, 23, 42, 0.9);
}

.card-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.auth-card {
  max-width: 420px;
  margin: 3rem auto 0;
}

.form-vertical {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-label span {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  color: #9ca3af;
}

input[type="text"],
input[type="password"],
input[type="number"] {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.94);
  color: #e5e7eb;
  font-size: 0.9rem;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.7);
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #0b1120;
  font-weight: 600;
}

.btn-secondary {
  background: rgba(30, 64, 175, 0.7);
  color: #e5e7eb;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.8);
  color: #fee2e2;
}

.btn-sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
}

.btn-block {
  width: 100%;
}

.flash-container {
  margin-bottom: 0.75rem;
}

.flash {
  padding: 0.4rem 0.6rem;
  border-radius: 0.75rem;
  font-size: 0.78rem;
  margin-bottom: 0.35rem;
}

.flash-success {
  background: rgba(22, 163, 74, 0.25);
  color: #bbf7d0;
}

.flash-danger {
  background: rgba(239, 68, 68, 0.22);
  color: #fecaca;
}

.flash-info {
  background: rgba(59, 130, 246, 0.25);
  color: #bfdbfe;
}

.qa-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  font-size: 0.9rem;
  color: #9ca3af;
}

.qa-footer-nav {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.qa-footer-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-nav-placeholder {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}

.qa-footer-hint {
  margin: 0.6rem 0 0;
  font-size: 0.82rem;
  color: #fbbf24;
  line-height: 1.45;
}

.qa-footer-hint-warn {
  color: #fcd34d;
}

.score-tip {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  color: #94a3b8;
}

.btn-submit-score:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-submitted {
  opacity: 0.75;
  cursor: default;
}

.card-question {
  margin-top: 0.3rem;
}

.question-text {
  font-size: 1rem;
  line-height: 1.6;
}

.answers-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card-answer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.answer-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: #a5b4fc;
}

.answer-content {
  font-size: 0.9rem;
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.score-section {
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.55);
}

.score-title {
  font-size: 0.92rem;
  margin: 0 0 0.6rem;
}

.score-dimensions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}

.score-row span {
  display: inline-block;
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 0.05rem;
}

.score-row input[type="range"] {
  width: 100%;
}

.score-row .score-value {
  font-size: 0.8rem;
  margin-left: 0.35rem;
  color: #e5e7eb;
}

.score-remark {
  margin-bottom: 0.6rem;
}

.score-remark-label > span {
  display: block;
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 0.25rem;
}

.score-remark-input {
  width: 100%;
  resize: vertical;
  min-height: 2.4rem;
  max-height: 8rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.94);
  color: #e5e7eb;
  font-size: 0.84rem;
}

.score-remark-input::placeholder {
  color: #64748b;
}

.score-remark-input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.7);
}

.score-hint {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  min-height: 1rem;
}

.score-hint-success {
  color: #4ade80;
}

.score-hint-error {
  color: #f97373;
}

.auth-hint {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: #9ca3af;
}

code {
  font-family: Menlo, Consolas, monospace;
  font-size: 0.8rem;
  padding: 0.08rem 0.3rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.table th,
.table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid rgba(30, 64, 175, 0.7);
}

.table th {
  text-align: left;
  font-weight: 500;
  color: #9ca3af;
}

.inline-form {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  margin: 0.15rem 0;
}

.inline-form input[type="password"],
.inline-form input[type="text"] {
  max-width: 160px;
}

.inline-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  font-size: 0.78rem;
}

.page-auth {
  min-height: calc(100vh - 4rem);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin: 0.4rem 0 0.25rem;
  font-weight: 650;
  line-height: 1.4;
}

.markdown-body h1 {
  font-size: 1.2rem;
}

.markdown-body h2 {
  font-size: 1.1rem;
}

.markdown-body h3 {
  font-size: 1rem;
}

.markdown-body p {
  margin: 0 0 0.35rem;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.2rem;
  margin: 0.25rem 0 0.5rem;
}

.markdown-body li {
  margin: 0.1rem 0;
}

.markdown-body strong {
  font-weight: 650;
}

.markdown-body em {
  font-style: italic;
}

.markdown-body blockquote {
  margin: 0.4rem 0;
  padding: 0.35rem 0.6rem;
  border-left: 3px solid rgba(148, 163, 184, 0.8);
  background: rgba(15, 23, 42, 0.9);
  border-radius: 0.4rem;
  color: #cbd5f5;
}

.markdown-body code {
  font-family: Menlo, Consolas, monospace;
  font-size: 0.8rem;
  padding: 0.08rem 0.3rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.markdown-body pre code {
  display: block;
  padding: 0.6rem 0.8rem;
  border-radius: 0.6rem;
  white-space: pre-wrap;
}

.markdown-body hr {
  border: none;
  border-top: 1px dashed rgba(148, 163, 184, 0.5);
  margin: 0.75rem 0;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.6rem 0 0.8rem;
  font-size: 0.82rem;
  overflow: hidden;
  border-radius: 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.7);
}

.markdown-body thead {
  background: rgba(30, 64, 175, 0.85);
}

.markdown-body th,
.markdown-body td {
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid rgba(30, 64, 175, 0.7);
}

.markdown-body th {
  font-weight: 600;
  text-align: left;
  color: #e5e7eb;
}

.markdown-body tbody tr:nth-child(odd) {
  background: rgba(15, 23, 42, 0.98);
}

.markdown-body tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.94);
}

.markdown-body caption {
  caption-side: top;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  color: #c7d2fe;
}

.scoring-users-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.5rem;
}

.scoring-user-tag {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #e0f2fe;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.stat-meta {
  margin: 0;
  font-size: 0.8rem;
  color: #94a3b8;
}

.card-stat-users {
  margin-bottom: 0.5rem;
}

.stat-filter-hint {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: #94a3b8;
}

.table-stat-filter .stat-filter-row th {
  padding: 0.35rem 0.45rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(30, 64, 175, 0.5);
}

.table-stat-filter .stat-filter-input {
  width: 100%;
  min-width: 0;
  padding: 0.35rem 0.45rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  font-size: 0.78rem;
}

.table-stat-filter .stat-filter-input::placeholder {
  color: #64748b;
}

.table-stat-filter .stat-filter-input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
}

@media (max-width: 640px) {
  .app-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .app-main {
    padding: 0 0.75rem;
  }

  .card {
    border-radius: 0.9rem;
    padding: 0.9rem 0.9rem 1rem;
  }

  .auth-card {
    margin-top: 2rem;
  }

  .qa-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

