:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #172033;
  background: #eef2f8;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 5%, rgb(88 128 255 / 18%), transparent 32rem),
    radial-gradient(circle at 88% 12%, rgb(36 184 151 / 13%), transparent 28rem),
    linear-gradient(180deg, #f8fafe 0%, #eef2f8 100%);
}

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

button,
input,
textarea {
  font: inherit;
}

button,
.button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 4vw;
  border-bottom: 1px solid rgb(23 32 51 / 8%);
  background: rgb(248 250 254 / 72%);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #0f9f78);
  box-shadow: 0 8px 20px rgb(37 99 235 / 24%);
}

.actions {
  display: flex;
  gap: 8px;
}

.shell {
  width: min(1180px, 92vw);
  margin: 0 auto;
  padding: 64px 0 80px;
}

.dashboard-shell {
  padding-top: 72px;
}

.dashboard-head {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1.2fr);
  align-items: center;
  gap: 48px;
  margin-bottom: 48px;
}

.clock {
  margin-bottom: 12px;
  font-size: clamp(4.8rem, 13vw, 9rem);
  font-weight: 650;
  letter-spacing: -0.08em;
  line-height: 0.85;
}

.greeting .eyebrow {
  margin-bottom: 14px;
}

.search-panel {
  position: relative;
  display: flex;
  align-items: center;
  padding: 8px 10px 8px 52px;
  border: 1px solid rgb(23 32 51 / 10%);
  border-radius: 22px;
  background: rgb(255 255 255 / 82%);
  box-shadow: 0 20px 60px rgb(23 32 51 / 9%);
  backdrop-filter: blur(18px);
}

.search-panel .search {
  min-height: 58px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 1.04rem;
}

.search-icon {
  position: absolute;
  left: 24px;
  width: 17px;
  height: 17px;
  border: 2px solid #667085;
  border-radius: 50%;
}

.search-icon::after {
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 7px;
  height: 2px;
  border-radius: 2px;
  background: #667085;
  content: "";
  transform: rotate(45deg);
}

kbd {
  padding: 5px 8px;
  border: 1px solid #dfe4ed;
  border-radius: 8px;
  color: #7b8494;
  background: #f8fafc;
  font-size: 0.72rem;
  white-space: nowrap;
}

.hero {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 440px);
  align-items: end;
  gap: 32px;
  margin-bottom: 40px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #2563eb;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  letter-spacing: -0.055em;
  line-height: 0.98;
}

h2 {
  margin-bottom: 0;
  font-size: 1.3rem;
}

.muted {
  color: #687388;
}

.search,
input,
textarea {
  width: 100%;
  border: 1px solid #dbe1eb;
  border-radius: 14px;
  outline: none;
  background: #fff;
  transition: border-color 160ms, box-shadow 160ms;
}

.search,
input {
  min-height: 48px;
  padding: 0 15px;
}

textarea {
  padding: 12px 15px;
  resize: vertical;
}

.search:focus,
input:focus,
textarea:focus {
  border-color: #4f7df3;
  box-shadow: 0 0 0 4px rgb(79 125 243 / 12%);
}

.categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 0 18px;
  scrollbar-width: thin;
}

.category,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #dbe1eb;
  border-radius: 999px;
  background: rgb(255 255 255 / 80%);
  color: #475268;
  white-space: nowrap;
}

.category.active,
.primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.button.primary,
.primary {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
}

.button.ghost {
  background: transparent;
}

.button.small {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 0.85rem;
}

.button.danger {
  color: #be123c;
  border-color: #fecdd3;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0;
}

.count {
  color: #7b8494;
  font-size: 0.9rem;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.link-card {
  display: flex;
  min-height: 176px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid rgb(23 32 51 / 8%);
  border-radius: 18px;
  background: rgb(255 255 255 / 78%);
  box-shadow: 0 10px 35px rgb(23 32 51 / 5%);
  transition: transform 160ms, border-color 160ms, box-shadow 160ms;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  color: #315cc4;
  background: linear-gradient(145deg, #eef3ff, #dfe8ff);
  font-size: 1rem;
  font-weight: 800;
}

.card-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.card-icon.has-image {
  color: transparent;
}

.link-card:hover {
  transform: translateY(-3px);
  border-color: rgb(37 99 235 / 35%);
  box-shadow: 0 16px 38px rgb(37 99 235 / 11%);
}

.link-card h3 {
  margin: 16px 0 8px;
  font-size: 1.05rem;
  line-height: 1.35;
}

.card-category,
.table-badge {
  align-self: flex-start;
  padding: 4px 8px;
  border-radius: 7px;
  background: #eef3ff;
  color: #315cc4;
  font-size: 0.75rem;
  font-weight: 700;
}

.card-host {
  margin: auto 0 0;
  overflow: hidden;
  color: #8590a3;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-description {
  display: -webkit-box;
  margin: 8px 0 0;
  overflow: hidden;
  color: #687388;
  font-size: 0.85rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.empty {
  padding: 50px 20px;
  text-align: center;
  color: #7b8494;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  padding: 38px;
  border: 1px solid rgb(23 32 51 / 8%);
  border-radius: 24px;
  background: rgb(255 255 255 / 90%);
  box-shadow: 0 30px 80px rgb(23 32 51 / 12%);
}

.login-card h1 {
  font-size: 2.4rem;
}

.login-card form {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.login-card label,
.link-form label {
  display: grid;
  gap: 7px;
  color: #526075;
  font-size: 0.88rem;
  font-weight: 700;
}

.login-card button {
  margin-top: 4px;
}

.error {
  margin: 0;
  color: #be123c;
  font-size: 0.88rem;
}

.message {
  color: #0f766e;
  font-size: 0.88rem;
}

.admin-shell {
  display: grid;
  gap: 24px;
}

.panel {
  padding: 26px;
  border: 1px solid rgb(23 32 51 / 8%);
  border-radius: 20px;
  background: rgb(255 255 255 / 86%);
  box-shadow: 0 12px 40px rgb(23 32 51 / 5%);
}

.panel h1 {
  font-size: 2rem;
}

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

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

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

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #edf0f5;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #6e788a;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td {
  max-width: 330px;
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

td a:hover {
  color: #2563eb;
  text-decoration: underline;
}

.row-actions {
  display: flex;
  gap: 7px;
}

@media (max-width: 900px) {
  .dashboard-head {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (max-width: 760px) {
  .shell {
    padding-top: 36px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .dashboard-shell {
    padding-top: 40px;
  }

  .clock {
    font-size: 5.4rem;
  }

  .topbar {
    padding: 0 4vw;
  }

  .brand > span:last-child {
    display: none;
  }

  .button.ghost {
    padding: 0 10px;
  }

  .link-form {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }

  .panel {
    padding: 20px;
  }
}

[hidden] {
  display: none !important;
}

body.home-page {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  color: #fff;
  background: #173025;
}

.wallpaper {
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: #173025 url("/wallpaper.svg") center / cover no-repeat;
  transform: scale(1.01);
}

.desktop-topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 clamp(24px, 4vw, 64px);
}

.brand.light {
  color: #fff;
  text-shadow: 0 2px 14px rgb(0 0 0 / 30%);
}

.brand.light .brand-mark {
  color: #275339;
  background: rgb(255 255 255 / 88%);
  box-shadow: 0 12px 30px rgb(0 0 0 / 18%);
}

.admin-link {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: 50%;
  background: rgb(255 255 255 / 10%);
  backdrop-filter: blur(12px);
  transition: background 160ms, transform 160ms;
}

.admin-link:hover {
  background: rgb(255 255 255 / 20%);
  transform: rotate(12deg);
}

.gear {
  position: relative;
  width: 15px;
  height: 15px;
  border: 3px solid rgb(255 255 255 / 88%);
  border-radius: 50%;
}

.gear::before,
.gear::after {
  position: absolute;
  inset: -5px 4px;
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: 2px;
  content: "";
}

.gear::after {
  transform: rotate(90deg);
}

.desktop-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, 92vw);
  margin: 0 auto;
  padding: 58px 0 72px;
}

.search-center {
  width: min(720px, 100%);
  margin: 0 auto 42px;
}

.home-page .search-panel {
  padding: 4px 14px 4px 54px;
  border-color: rgb(255 255 255 / 34%);
  border-radius: 16px;
  background: rgb(255 255 255 / 76%);
  box-shadow: 0 18px 48px rgb(9 31 20 / 22%);
}

.home-page .search-icon {
  border-color: #58645e;
}

.home-page .search-icon::after {
  background: #58645e;
}

.home-page .search-panel .search {
  min-height: 48px;
  color: #28312d;
}

.home-page .search-panel .search::placeholder {
  color: #6d7872;
}

.widget-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 0 auto 54px;
}

.glass-widget {
  display: flex;
  min-height: 112px;
  align-items: center;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 22px;
  background: rgb(33 53 42 / 54%);
  box-shadow: 0 16px 40px rgb(7 24 15 / 20%);
  backdrop-filter: blur(18px);
}

.weather-widget {
  display: grid;
  grid-template-columns: auto auto;
  min-width: 340px;
  gap: 4px 16px;
  padding: 18px 22px;
}

.weather-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  font-size: 2.1rem;
}

.weather-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.weather-main strong {
  font-size: 2.35rem;
  font-weight: 520;
  letter-spacing: -0.06em;
}

.weather-main span,
.weather-meta {
  color: rgb(255 255 255 / 74%);
  font-size: 0.82rem;
}

.weather-meta {
  display: flex;
  grid-column: 1 / -1;
  justify-content: space-between;
  gap: 18px;
  padding-left: 4px;
}

.date-widget {
  min-width: 240px;
  gap: 18px;
  padding: 18px 24px;
}

.date-widget > strong {
  font-size: 2.7rem;
  font-weight: 520;
  letter-spacing: -0.07em;
}

.date-widget > div {
  display: grid;
  gap: 5px;
}

.date-widget span {
  font-size: 0.92rem;
}

.date-widget small {
  color: rgb(255 255 255 / 68%);
  font-size: 0.8rem;
}

.content-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto 22px;
}

.content-heading h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 560;
  letter-spacing: -0.025em;
}

.content-heading .eyebrow {
  margin-bottom: 5px;
  color: rgb(255 255 255 / 58%);
}

.count {
  color: rgb(255 255 255 / 64%);
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(122px, 1fr));
  gap: 32px 20px;
  width: min(1040px, 100%);
  margin: 0 auto;
}

.folder {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 0;
  color: #fff;
  background: transparent;
  text-align: center;
}

.folder-tile {
  display: grid;
  width: 108px;
  height: 96px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 26px;
  background: rgb(255 255 255 / 72%);
  box-shadow: 0 15px 35px rgb(5 25 14 / 25%);
  backdrop-filter: blur(14px);
  transition: transform 160ms, background 160ms;
}

.folder:hover .folder-tile {
  background: rgb(255 255 255 / 86%);
  transform: translateY(-4px) scale(1.025);
}

.folder-preview {
  display: grid;
  grid-template-columns: repeat(2, 36px);
  gap: 8px;
}

.folder-name {
  max-width: 126px;
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 650;
  text-overflow: ellipsis;
  text-shadow: 0 2px 10px rgb(0 0 0 / 45%);
  white-space: nowrap;
}

.folder small {
  color: rgb(255 255 255 / 58%);
  font-size: 0.72rem;
  text-shadow: 0 1px 8px rgb(0 0 0 / 40%);
}

.site-icon,
.mini-icon {
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #315cc4;
  background: linear-gradient(145deg, #f0f5ff, #dbe6ff);
  font-weight: 800;
}

.site-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  font-size: 1.2rem;
}

.mini-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 0.78rem;
}

.site-icon img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.mini-icon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.site-icon.has-image,
.mini-icon.has-image {
  color: transparent;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(94px, 1fr));
  gap: 28px 14px;
  width: min(1040px, 100%);
  margin: 0 auto;
}

.app-tile {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-align: center;
}

.app-tile:hover .site-icon {
  transform: translateY(-3px) scale(1.035);
}

.app-tile .site-icon {
  box-shadow: 0 14px 32px rgb(6 24 14 / 26%);
  transition: transform 160ms;
}

.app-name {
  display: -webkit-box;
  max-width: 100px;
  overflow: hidden;
  font-size: 0.82rem;
  line-height: 1.35;
  text-shadow: 0 2px 10px rgb(0 0 0 / 45%);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.light-text {
  color: rgb(255 255 255 / 72%);
  text-shadow: 0 2px 9px rgb(0 0 0 / 38%);
}

.modal {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgb(8 21 14 / 58%);
  backdrop-filter: blur(8px);
}

.folder-panel {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(640px, 82vh);
  overflow-y: auto;
  padding: 28px;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 28px;
  background: rgb(27 49 36 / 84%);
  box-shadow: 0 30px 100px rgb(0 0 0 / 36%);
  backdrop-filter: blur(24px);
}

.folder-panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.folder-panel-header h2 {
  font-size: 1.5rem;
}

.folder-panel .eyebrow {
  color: rgb(255 255 255 / 56%);
}

.close-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 50%;
  color: #fff;
  background: rgb(255 255 255 / 8%);
  font-size: 1.4rem;
}

.modal-open {
  overflow: hidden;
}

@media (max-width: 720px) {
  .desktop-shell {
    padding-top: 32px;
  }

  .search-center {
    margin-bottom: 28px;
  }

  .widget-row {
    display: grid;
    grid-template-columns: 1fr;
    margin-bottom: 38px;
  }

  .weather-widget,
  .date-widget {
    min-width: 0;
  }

  .folder-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 10px;
  }

  .folder-tile {
    width: 92px;
    height: 84px;
    border-radius: 22px;
  }

  .folder-preview {
    grid-template-columns: repeat(2, 31px);
    gap: 7px;
  }

  .mini-icon {
    width: 31px;
    height: 31px;
  }

  .mini-icon img {
    width: 17px;
    height: 17px;
  }

  .folder-name {
    max-width: 100px;
  }

  .folder-panel {
    padding: 22px;
  }
}
