
:root {
  --bg: #0f1221;
  --bg-card: #181c2f;
  --text: #f2f4f8;
  --muted: #a7b0c3;
  --line: #2a3150;
  --blue: #4f8cff;
  --danger: #ff5b5b;
  --warn: #ffbf47;
  --ok: #42d392;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #0f1221 0%, #11162a 100%);
}
a { color: #9ec1ff; text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1280px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(12,15,28,.8);
  backdrop-filter: blur(4px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 { margin: 0 0 4px; font-size: 24px; }
.topbar p { margin: 0; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.muted { color: var(--muted); }
.filters {
  display: grid;
  grid-template-columns: 2fr repeat(5, minmax(120px, 1fr)) auto auto;
  gap: 10px;
}
input, select, button {
  width: 100%;
  border: 1px solid var(--line);
  background: #0f1428;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
}
button, .link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: white;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  text-decoration: none;
}
.link-btn { background: #2c365a; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; vertical-align: top; }
th { color: #c7d3ee; font-weight: 600; }
.pill { padding: 4px 8px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.pri-p0 { background: rgba(255,91,91,.2); color: #ff9d9d; }
.pri-p1 { background: rgba(255,191,71,.2); color: #ffd996; }
.pri-p2 { background: rgba(79,140,255,.2); color: #9ec1ff; }
.pri-p3 { background: rgba(167,176,195,.2); color: #d9deea; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(420px, 100%); }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; }
.alert { background: rgba(255,91,91,.2); border: 1px solid rgba(255,91,91,.5); color: #ffc6c6; border-radius: 10px; padding: 10px; margin-bottom: 12px; }
.hidden { display: none; }
.notice-ok { background: rgba(66,211,146,.2); border: 1px solid rgba(66,211,146,.5); color: #b7f5da; border-radius: 10px; padding: 10px; margin-bottom: 12px; }
.notice-err { background: rgba(255,91,91,.2); border: 1px solid rgba(255,91,91,.5); color: #ffc6c6; border-radius: 10px; padding: 10px; margin-bottom: 12px; }
.edit-grid { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 12px; }
.edit-grid label { display: grid; gap: 6px; }
.edit-actions { grid-column: 1 / -1; display: flex; gap: 10px; }
.meta th { width: 240px; }
.markdown h1 { font-size: 24px; }
.markdown h2 { font-size: 20px; margin-top: 18px; }
.markdown h3 { font-size: 17px; margin-top: 14px; }
.markdown p, .markdown li { line-height: 1.5; }
.markdown { overflow-wrap: anywhere; }
.task-table td[data-label]::before { display: none; }
.detail { grid-template-columns: 1fr; }
@media (max-width: 1100px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .edit-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .container { padding: 10px; gap: 12px; }
  .card { padding: 12px; border-radius: 12px; }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
  }

  .topbar h1 { font-size: 20px; }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .filters { grid-template-columns: 1fr; }

  .task-table thead { display: none; }
  .task-table, .task-table tbody, .task-table tr, .task-table td {
    display: block;
    width: 100%;
  }

  .task-table tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 8px;
    background: #141935;
  }

  .task-table td {
    border-bottom: none;
    padding: 6px 4px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
  }

  .task-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-weight: 600;
    flex: 0 0 110px;
  }

  .task-table td > * {
    flex: 1;
    min-width: 0;
    text-align: right;
  }

  .task-table td a { word-break: break-word; }

  .meta, .meta tbody, .meta tr, .meta th, .meta td {
    display: block;
    width: 100%;
  }

  .meta tr {
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
  }

  .meta th {
    width: auto;
    border-bottom: none;
    padding: 0 0 4px;
    color: var(--muted);
  }

  .meta td {
    border-bottom: none;
    padding: 0;
    word-break: break-word;
  }
}
