* {
  box-sizing: border-box;
}

:root {
  --blue: #3f7df4;
  --blue-dark: #2f66df;
  --bg: #f3f3f3;
  --card: #ffffff;
  --text: #242833;
  --muted: #7b8494;
  --line: #e5e7eb;
  --shadow: 0 4px 14px rgba(31, 41, 55, 0.07);
  --radius: 8px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  color: #fff;
  background: linear-gradient(90deg, #316fdd, #4388f8);
  box-shadow: 0 2px 8px rgba(49, 111, 221, 0.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,.35);
}

.brand-title {
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: 0;
}

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

.nav-btn {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  background: rgba(255,255,255,.12);
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
}

.nav-btn:hover,
.nav-btn.active {
  background: rgba(255,255,255,.22);
}

.shell {
  width: min(1040px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 30px 0 54px;
}

.search-wrap {
  width: min(860px, 100%);
  margin: 0 auto 28px;
}

.search-box {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 15px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.search-box svg {
  width: 20px;
  color: #9aa3b2;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: .94rem;
  background: transparent;
}

.category {
  margin-top: 30px;
}

.category-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 9px;
  border-bottom: 2px solid var(--blue);
  font-size: 1.02rem;
  font-weight: 800;
}

.category-count {
  min-width: 30px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-size: .76rem;
  font-weight: 800;
}

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

.tool-card {
  min-height: 82px;
  display: grid;
  grid-template-columns: 48px 1fr 18px;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #eef0f3;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: #cfe0ff;
  box-shadow: 0 8px 20px rgba(63, 125, 244, .13);
}

.icon-box {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, #3f7df4, #2f66df);
}

.icon-box svg {
  width: 20px;
  height: 20px;
}

.tool-name {
  margin: 0 0 2px;
  font-size: .93rem;
  font-weight: 800;
  line-height: 1.25;
}

.tool-card > span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
}

.tool-url {
  display: block;
  max-width: 100%;
  margin-bottom: 1px;
  color: #2f73dc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .82rem;
  font-weight: 600;
}

.tool-desc {
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.35;
}

.open-icon {
  color: #c5cad3;
  font-size: .95rem;
}

.login-page {
  min-height: 100vh;
}

.login-main {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 48px 20px;
}

.login-card {
  width: min(420px, 100%);
  padding: 42px 46px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(31, 41, 55, .12);
}

.login-mark {
  width: 56px;
  height: 56px;
  display: block;
  margin: 0 auto 14px;
}

.login-title {
  margin: 0;
  text-align: center;
  font-size: 1.55rem;
  font-weight: 900;
}

.login-subtitle {
  margin: 6px 0 28px;
  text-align: center;
  color: var(--muted);
}

.field {
  margin: 14px 0;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: #4b5563;
  font-weight: 700;
}

.input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #d9dde5;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  outline: 0;
}

.input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(63, 125, 244, .14);
}

.primary-btn {
  width: 100%;
  height: 50px;
  margin-top: 12px;
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(90deg, #4388f8, #2f66df);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.error {
  min-height: 22px;
  margin-top: 10px;
  color: #dc2626;
  font-size: .9rem;
}

.admin-page {
  width: min(1040px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 38px 0 72px;
}

.admin-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 34px;
  color: #2b2f38;
  font-size: 1.45rem;
  font-weight: 900;
}

.admin-section {
  margin-top: 34px;
}

.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.admin-section-head h2 {
  margin: 0;
  color: #30343b;
  font-size: 1.1rem;
  font-weight: 900;
}

.blue-action,
.gray-action,
.soft-btn,
.pill {
  border: 0;
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
}

.blue-action {
  min-height: 38px;
  padding: 0 18px;
  color: #fff;
  background: linear-gradient(90deg, #4388f8, #2f66df);
  box-shadow: 0 6px 14px rgba(63, 125, 244, .22);
}

.gray-action {
  min-height: 38px;
  padding: 0 18px;
  color: #2f343d;
  background: #dedede;
}

.edit-card {
  margin: 16px 0 18px;
  padding: 26px 28px;
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.edit-card h3 {
  margin: 0 0 18px;
  font-size: 1.05rem;
  font-weight: 900;
}

.hidden {
  display: none !important;
}

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

.form-grid .wide {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.table-card {
  overflow: hidden;
  border-radius: 0;
  background: transparent;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: #333842;
}

.admin-table thead {
  background: rgba(255, 255, 255, .55);
}

.admin-table th,
.admin-table td {
  padding: 13px 12px;
  border-bottom: 1px solid #e9ecef;
  text-align: left;
  vertical-align: middle;
  font-size: .94rem;
}

.admin-table th {
  color: #5e6775;
  font-weight: 900;
}

.admin-table td {
  font-weight: 600;
}

.admin-table th:nth-child(1),
.admin-table td:nth-child(1) {
  width: 31%;
}

.admin-table th:nth-child(2),
.admin-table td:nth-child(2) {
  width: 13%;
}

.admin-table th:nth-child(3),
.admin-table td:nth-child(3) {
  width: 16%;
}

.admin-table th:nth-child(4),
.admin-table td:nth-child(4) {
  width: 40%;
}

.link-table th:nth-child(1),
.link-table td:nth-child(1) {
  width: 18%;
}

.link-table th:nth-child(2),
.link-table td:nth-child(2) {
  width: 35%;
}

.link-table th:nth-child(3),
.link-table td:nth-child(3) {
  width: 20%;
}

.link-table th:nth-child(4),
.link-table td:nth-child(4) {
  width: 10%;
}

.link-table th:nth-child(5),
.link-table td:nth-child(5) {
  width: 17%;
}

.name-cell {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.name-cell svg {
  flex: none;
}

.blue-icon {
  color: var(--blue);
}

.soft-btn {
  min-height: 31px;
  margin-right: 6px;
  padding: 0 11px;
  font-size: .84rem;
}

.soft-btn.edit {
  color: #0f7bc2;
  background: #e8f5ff;
}

.soft-btn.delete {
  color: #d6243f;
  background: #ffe9ee;
}

.filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
  color: #4b5563;
  font-weight: 700;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  min-height: 27px;
  padding: 0 13px;
  border: 1px solid #d7dce3;
  color: #545b66;
  background: #f8fafc;
}

.pill.active {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}

.table-url {
  display: block;
  max-width: 100%;
  color: #2f73dc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  color: #2f73dc;
  background: #eef6ff;
  font-weight: 900;
}

.muted {
  color: var(--muted);
}

.aws-switch-page {
  width: min(1120px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 30px 0 60px;
}

.aws-switch-hero {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 18px;
  align-items: stretch;
  padding: 24px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.aws-switch-hero h1 {
  margin: 0 0 8px;
  font-size: 1.6rem;
  line-height: 1.2;
}

.aws-switch-hero p {
  max-width: 720px;
  margin: 0;
  color: #4b5563;
  line-height: 1.7;
}

.aws-switch-status {
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 16px;
  border: 1px solid #dbeafe;
  border-radius: var(--radius);
  color: #1d4ed8;
  background: #eff6ff;
}

.aws-switch-status span {
  color: #4b5563;
  font-size: .82rem;
  font-weight: 800;
}

.aws-switch-status strong {
  font-size: 1.18rem;
}

.aws-switch-status small {
  color: #5b6472;
  line-height: 1.45;
}

.aws-switch-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
}

.aws-switch-search {
  flex: 1;
  margin: 0;
}

.aws-main-link {
  width: auto;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  white-space: nowrap;
}

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

.aws-account-card {
  min-height: 238px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  padding: 16px;
  border: 1px solid #eef0f3;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.aws-account-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, #3f7df4, #2f66df);
}

.aws-account-main h2 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.aws-account-main p {
  min-height: 38px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.45;
}

.aws-account-main dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.aws-account-main dl div {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 8px;
  min-width: 0;
}

.aws-account-main dt {
  color: #7b8494;
  font-size: .76rem;
  font-weight: 800;
}

.aws-account-main dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #273244;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .8rem;
  font-weight: 700;
}

.aws-switch-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: #fff;
  background: #316fdd;
  font-size: .9rem;
  font-weight: 900;
}

.aws-switch-link:hover {
  background: #255fc7;
}

.aws-switch-notes {
  margin-top: 20px;
  padding: 18px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.aws-switch-notes h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

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

.aws-note-grid div {
  padding: 14px;
  border: 1px solid #eef0f3;
  border-radius: var(--radius);
  background: #f8fafc;
}

.aws-note-grid strong {
  display: block;
  margin-bottom: 5px;
}

.aws-note-grid p {
  margin: 0;
  color: #596273;
  font-size: .84rem;
  line-height: 1.55;
}

.aws-note-grid code {
  color: #1d4ed8;
  font-weight: 800;
}

@media (max-width: 900px) {
  .grid,
  .form-grid,
  .aws-account-grid,
  .aws-note-grid,
  .aws-switch-hero {
    grid-template-columns: 1fr;
  }

  .aws-switch-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .aws-main-link {
    width: 100%;
  }

  .admin-page {
    width: min(100vw - 24px, 1040px);
    padding-top: 24px;
  }

  .admin-table {
    min-width: 820px;
  }

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

  .topbar {
    padding: 0 16px;
  }

  .nav-actions {
    gap: 6px;
  }

  .nav-btn span {
    display: none;
  }
}
