:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #0ea5a4;
  --primary-dark: #0f766e;
  --danger: #ef4444;
  --border: #e2e8f0;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, #e6f7f5 0%, transparent 60%),
    radial-gradient(1000px 500px at 90% 0%, #f8f3ea 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 18px 56px;
}

h1 {
  font-size: 24px;
  margin: 0 0 12px;
  letter-spacing: 0.2px;
}

h2 {
  font-size: 18px;
  margin: 20px 0 12px;
  letter-spacing: 0.2px;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-dark);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card,
.project-card,
.table,
.list-item {
  animation: rise 0.35s ease both;
}

.card {
  background: var(--surface);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 15px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.15);
}

.input-large {
  font-size: 18px;
  padding: 14px;
}

button {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.2s ease;
}

button:active {
  transform: scale(0.98);
}

button.primary,
 a.primary {
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
}

a.primary {
  font-size: 14px;
}

a.secondary {
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 10px 16px;
  border-radius: 12px;
}

button.secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}

button.danger {
  background: var(--danger);
  color: #fff;
}

.link-button {
  background: transparent;
  color: var(--primary);
  padding: 0;
  font-size: 14px;
  font-family: inherit;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-nav form {
  margin: 0;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
}

.admin-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.flash-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.flash {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
}

.flash-success {
  background: #dcfce7;
  color: #166534;
}

.flash-error {
  background: #fee2e2;
  color: #b91c1c;
}

.flash-info {
  background: #e0f2fe;
  color: #075985;
}

.form-errors {
  margin-bottom: 12px;
}

.error-item {
  background: #fee2e2;
  color: #b91c1c;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 6px;
}

.table {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.table-row {
  display: grid;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  align-items: center;
}

.table-row.table-header {
  background: var(--surface-2);
  font-weight: 600;
}

.table-row:last-child {
  border-bottom: none;
}

.table-row.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.table-row.cols-5 {
  grid-template-columns: repeat(5, 1fr);
}

.table-row.cols-6 {
  grid-template-columns: repeat(6, 1fr);
}

.table-row.cols-7 {
  grid-template-columns: repeat(7, 1fr);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.list {
  display: grid;
  gap: 12px;
}

.list-item {
  background: var(--surface);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.voter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.header-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
}

.header-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.header-actions form {
  margin: 0;
}

.dashboard-config {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
}

.dashboard-form {
  display: grid;
  gap: 14px;
}

.config-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-field {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.inline-field input {
  width: 160px;
}

.dropdown {
  position: relative;
  min-width: 260px;
}

.dropdown-toggle {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  color: var(--text);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 6px;
  display: none;
  z-index: 10;
}

.dropdown-menu.open {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--surface-2);
}

.dropdown-item input {
  width: auto;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  position: relative;
  display: inline-flex;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: auto;
}

.chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.chip input:checked + span {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.dashboard-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.dashboard-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
}

.dashboard-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.ranking-list {
  display: grid;
  gap: 10px;
}

.ranking-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

.ranking-badge {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.ranking-name {
  font-size: 14px;
  font-weight: 500;
}

.project-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.task-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.task {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
  background: #fff;
}

.vote-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.vote-actions button {
  font-size: 14px;
  color: #fff;
  font-weight: 600;
}

.vote-actions .agree {
  background: #16a34a;
}

.vote-actions .oppose {
  background: #dc2626;
}

.vote-actions .abstain {
  background: #64748b;
}

@media (max-width: 640px) {
  .table-row {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 6px;
  }

  .vote-actions {
    grid-template-columns: 1fr;
  }
}
