:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #16201d;
  --muted: #68736f;
  --line: #dce4e1;
  --green: #0f8f61;
  --green-dark: #0b5f45;
  --teal: #087b86;
  --amber: #c47b20;
  --red: #bb3d3d;
  --blue: #2f64b7;
  --shadow: 0 18px 45px rgba(22, 32, 29, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(320px, 0.95fr);
  background: #101816;
}

.login-visual {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 54px;
  color: white;
  background:
    linear-gradient(120deg, rgba(16, 24, 22, 0.78), rgba(16, 24, 22, 0.92)),
    url("assets/wonly-security-studio.png") center / cover;
}

.login-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-size: 25px;
  font-weight: 900;
}

.login-visual h1 {
  max-width: 560px;
  margin-bottom: 14px;
  font-size: 44px;
}

.login-visual p:not(.eyebrow) {
  max-width: 560px;
  color: #d5e1dd;
  font-size: 17px;
  line-height: 1.8;
}

.login-card {
  align-self: center;
  width: min(430px, calc(100% - 36px));
  margin: 0 auto;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin-bottom: 22px;
  font-size: 25px;
}

.login-card label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-card input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #f9fbfa;
  outline: 0;
}

.login-card input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 143, 97, 0.12);
}

.login-error {
  min-height: 22px;
  margin-bottom: 10px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.login-button {
  width: 100%;
  justify-content: center;
}

.login-card small {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  text-align: center;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  background: #121a18;
  color: #f4faf7;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 26px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: #a8b7b1;
  font-size: 13px;
  margin-top: 3px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: #cfe0da;
  background: transparent;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  color: white;
  background: #21302c;
}

.icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.sidebar-note {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #192521;
}

.sidebar-note span,
.sidebar-note small {
  display: block;
  color: #a8b7b1;
}

.sidebar-note strong {
  display: block;
  margin: 7px 0 5px;
  font-size: 15px;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 0;
  font-size: 32px;
  line-height: 1.16;
  letter-spacing: 0;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.admin-pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 11px;
  border: 1px solid #cce5d8;
  border-radius: 999px;
  background: #e8f7ef;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.icon-button,
.primary-button,
.ghost-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.icon-button {
  width: 42px;
  background: var(--panel);
  color: var(--ink);
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
}

.primary-button {
  border-color: var(--green);
  background: var(--green);
  color: white;
  font-weight: 700;
}

.ghost-button {
  background: var(--panel);
  color: var(--ink);
}

.hero-panel {
  position: relative;
  min-height: 286px;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
  overflow: hidden;
  border-radius: 8px;
  background: #101816;
  box-shadow: var(--shadow);
}

.hero-panel img {
  width: 100%;
  height: 100%;
  min-height: 286px;
  object-fit: cover;
}

.hero-copy {
  padding: 34px;
  color: white;
  z-index: 1;
}

.status-pill {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(15, 143, 97, 0.22);
  color: #b9f4dc;
  font-size: 13px;
  font-weight: 700;
}

.hero-copy h2 {
  margin-bottom: 12px;
  font-size: 34px;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 530px;
  color: #d5e1dd;
  line-height: 1.7;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.hero-metrics div {
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.hero-metrics strong,
.hero-metrics span {
  display: block;
}

.hero-metrics strong {
  font-size: 26px;
}

.hero-metrics span {
  color: #c8d6d1;
  font-size: 13px;
}

.view {
  display: none;
  margin-top: 26px;
}

.view.active {
  display: block;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin-bottom: 5px;
  font-size: 24px;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.segmented button {
  min-width: 58px;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
}

.segmented button.active {
  color: white;
  background: var(--ink);
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.series-card,
.panel,
.week-card,
.metric-card,
.connect-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.series-card {
  padding: 18px;
}

.series-button {
  width: 100%;
  display: block;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.series-button:hover {
  border-color: #b9d8ca;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.series-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.series-badge {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: white;
  font-weight: 800;
}

.series-card h3 {
  margin: 14px 0 5px;
  font-size: 18px;
}

.series-card p {
  min-height: 44px;
  color: var(--muted);
  line-height: 1.55;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.mini-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.mini-stats strong {
  font-size: 16px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 14px;
  margin-top: 14px;
}

.bundle-panel {
  margin-top: 14px;
}

.bundle-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.bundle-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: #f7faf9;
}

.bundle-card h4 {
  margin: 0 0 6px;
  font-size: 16px;
}

.bundle-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.bundle-format {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.panel-head h3 {
  margin-bottom: 0;
  font-size: 18px;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
}

.task-list,
.platform-list {
  display: grid;
  gap: 10px;
}

.task-item,
.platform-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: #f7faf9;
}

.checkbox {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #dcebe5;
  color: var(--green-dark);
  font-weight: 800;
}

.task-item strong,
.task-item span,
.platform-item strong,
.platform-item span {
  display: block;
}

.task-item span,
.platform-item span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #e8f2ee;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

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

select,
.search-box,
.content-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

select {
  min-height: 40px;
  padding: 0 12px;
  color: var(--ink);
}

.calendar-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 14px;
}

.week-card {
  padding: 16px;
}

.week-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.week-head h3 {
  margin-bottom: 4px;
  font-size: 17px;
}

.week-head span {
  color: var(--muted);
  font-size: 13px;
}

.platform-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.week-topics {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.topic-link {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: #ffffff;
  text-align: left;
  font-weight: 800;
}

.topic-link:hover {
  border-color: var(--green);
  color: var(--green-dark);
}

.chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef3f1;
  color: #31423d;
  font-size: 12px;
  font-weight: 700;
}

.search-box {
  min-width: 270px;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

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

.content-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.content-table th,
.content-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.content-table th {
  color: var(--muted);
  font-size: 13px;
}

.content-table tr:last-child td {
  border-bottom: 0;
}

.content-title strong,
.content-title span {
  display: block;
}

.content-title span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.status.todo {
  background: #eef3f1;
  color: #52625d;
}

.status.progress {
  background: #e7f0ff;
  color: var(--blue);
}

.status.review {
  background: #fff1dd;
  color: var(--amber);
}

.status.ready,
.status.go {
  background: #e5f5ee;
  color: var(--green-dark);
}

.status.risk {
  background: #ffe8e8;
  color: var(--red);
}

.table-action {
  min-height: 32px;
  padding: 0 10px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 24, 22, 0.54);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: min(980px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
  font-size: 24px;
}

.detail-head {
  padding: 28px 30px 20px;
  border-bottom: 1px solid var(--line);
}

.detail-head h2 {
  margin: 12px 0 6px;
  font-size: 30px;
}

.detail-head p {
  margin: 0;
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  padding: 22px 30px 30px;
}

.detail-grid section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.detail-grid h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

.detail-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.detail-script {
  grid-column: span 2;
}

.detail-script p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.75;
}

.detail-times {
  display: grid;
  gap: 10px;
}

.detail-times div {
  padding: 12px;
  border-radius: 8px;
  background: #ffffff;
}

.detail-times strong,
.detail-times span {
  display: block;
}

.detail-times span {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metric-card {
  padding: 18px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin: 8px 0 10px;
  font-size: 28px;
}

.bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eeee;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.rules div {
  padding: 14px;
  border-radius: 8px;
  background: #f7faf9;
}

.rules strong,
.rules span {
  display: block;
}

.rules span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
}

.connect-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.connect-panel p,
.connect-panel li {
  color: var(--muted);
  line-height: 1.65;
}

.connect-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 8px;
  background: #e8f2ee;
  color: var(--green-dark);
  font-weight: 900;
}

code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #eef3f1;
  color: #22332e;
}

@media (max-width: 1180px) {
  .series-grid,
  .analytics-grid,
  .bundle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-board {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
}

@media (max-width: 860px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 42vh;
    padding: 34px 22px;
  }

  .login-visual h1 {
    font-size: 32px;
  }

  .login-card {
    margin: 24px auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
    padding: 0 8px;
  }

  .nav-item span:last-child {
    display: none;
  }

  .sidebar-note {
    display: none;
  }

  .main {
    padding: 18px;
  }

  .topbar,
  .section-heading,
  .dashboard-grid,
  .connect-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 26px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-panel img {
    min-height: 220px;
  }

  .series-grid,
  .calendar-board,
  .analytics-grid,
  .rules,
  .bundle-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-script {
    grid-column: auto;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .search-box {
    min-width: 0;
  }
}
