:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --line: #e8edf4;
  --text: #303846;
  --muted: #788492;
  --green: #37b66b;
  --green-dark: #249354;
  --blue: #4b8df8;
  --shadow: 0 10px 28px rgba(26, 44, 72, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.nav-wrap {
  height: 66px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 800;
  color: var(--green);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green), #70d997);
  color: #fff;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-nav a,
.nav-actions a {
  color: #556171;
  padding: 9px 12px;
  border-radius: 6px;
}

.main-nav a.active,
.main-nav a:hover,
.nav-actions a:hover {
  color: var(--green-dark);
  background: #eefaf3;
}

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ghost-btn,
.primary-btn,
.link-btn {
  border: 0;
  border-radius: 6px;
  padding: 8px 13px;
}

.ghost-btn {
  background: #f2f5f8;
  color: #4d5a68;
}

.primary-btn,
.search-box button {
  background: var(--green);
  color: #fff;
}

.primary-btn:hover,
.search-box button:hover {
  background: var(--green-dark);
}

.link-btn {
  background: transparent;
  color: var(--blue);
  padding: 0;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  padding: 24px 0 36px;
}

.hero-panel,
.quick-panel,
.widget,
.category-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 24px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}

.weather-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  color: #6b7582;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 18px;
}

.weather-temp {
  font-size: 24px;
  font-weight: 700;
  color: var(--green-dark);
  margin-right: 8px;
}

.search-tabs,
.panel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.search-tabs button,
.panel-tabs button,
.widget-tabs button {
  border: 0;
  background: transparent;
  color: #647184;
  border-radius: 6px;
  padding: 8px 11px;
}

.search-tabs button.active,
.panel-tabs button.active,
.widget-tabs button.active {
  color: #fff;
  background: var(--green);
}

.search-box {
  display: grid;
  grid-template-columns: 1fr 110px;
  margin-top: 12px;
  border: 2px solid var(--green);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 16px 18px;
  font-size: 16px;
}

.search-box button {
  border: 0;
  font-size: 16px;
  letter-spacing: 2px;
}

.quick-panel {
  margin-top: 18px;
  padding: 18px;
}

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

.quick-head h1 {
  margin: 0 0 6px;
  font-size: 22px;
}

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

.quick-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.site-form {
  display: grid;
  grid-template-columns: 1fr 1.4fr 160px auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  margin-bottom: 16px;
  border: 1px solid #cfeedd;
  border-radius: 8px;
  background: #f5fcf8;
}

.site-form[hidden] {
  display: none;
}

.site-form label {
  display: grid;
  gap: 6px;
  color: #586678;
}

.site-form input,
.site-form select {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid #d8e1eb;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  outline: 0;
}

.site-form input:focus,
.site-form select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(55, 182, 107, 0.14);
}

.panel-tabs {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.site-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding-top: 16px;
}

.site-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.site-card:hover {
  border-color: #bfe8cf;
  transform: translateY(-1px);
}

.site-card-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.site-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #eefaf3;
  color: var(--green-dark);
  font-weight: 700;
  flex: 0 0 auto;
}

.site-tools {
  display: flex;
  align-items: center;
  gap: 5px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.site-card:hover .site-tools,
.site-card:focus-within .site-tools {
  opacity: 1;
}

.site-tools button {
  border: 0;
  border-radius: 5px;
  background: #f0f4f8;
  color: #657282;
  padding: 5px 7px;
}

.site-tools button:hover {
  color: var(--green-dark);
  background: #eefaf3;
}

.empty-state {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 110px;
  border: 1px dashed #c8d2de;
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfe;
}

.categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.category-card {
  padding: 16px;
}

.category-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 17px;
}

.category-card h2 span {
  width: 6px;
  height: 18px;
  border-radius: 99px;
  background: var(--green);
}

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

.category-sites a {
  color: #526071;
  padding: 8px 6px;
  border-radius: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-sites a:hover {
  color: var(--green-dark);
  background: #eefaf3;
}

.side-column {
  display: grid;
  align-content: start;
  gap: 16px;
}

.widget {
  padding: 16px;
}

.widget h2 {
  margin: 0;
  font-size: 18px;
}

.widget h3 {
  margin: 12px 0 8px;
  font-size: 16px;
}

.widget p {
  color: var(--muted);
  line-height: 1.7;
}

.widget-tabs,
.widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.weekday-row,
.date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
}

.weekday-row {
  color: var(--muted);
  margin: 14px 0 8px;
}

.date-grid span {
  display: grid;
  place-items: center;
  height: 32px;
  border-radius: 6px;
  color: #536172;
}

.date-grid .muted {
  color: #b8c0cb;
}

.date-grid .today {
  background: var(--green);
  color: #fff;
  font-weight: 700;
}

.hot-widget button {
  border: 0;
  border-radius: 5px;
  color: var(--blue);
  background: #eef4ff;
  padding: 6px 10px;
}

.hot-widget ol {
  margin: 12px 0 0;
  padding-left: 24px;
}

.hot-widget li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: #4b5664;
}

.qr-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.qr-box {
  display: grid;
  place-items: center;
  min-height: 106px;
  border-radius: 8px;
  border: 1px dashed #c8d2de;
  background:
    linear-gradient(45deg, #eef3f7 25%, transparent 25%),
    linear-gradient(-45deg, #eef3f7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef3f7 75%),
    linear-gradient(-45deg, transparent 75%, #eef3f7 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  color: #596777;
  text-align: center;
  line-height: 1.8;
}

.footer {
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 28px 0;
}

.footer-grid div {
  display: grid;
  gap: 8px;
}

.footer-grid strong {
  color: var(--text);
}

.footer-grid a:hover {
  color: var(--green-dark);
}

@media (max-width: 980px) {
  .nav-wrap {
    height: auto;
    min-height: 66px;
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .nav-actions {
    width: 100%;
    margin-left: 0;
  }

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

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

@media (max-width: 640px) {
  .container {
    width: min(100% - 20px, 1180px);
  }

  .main-nav,
  .nav-actions {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .search-box {
    grid-template-columns: 1fr;
  }

  .search-box button {
    padding: 13px;
  }

  .quick-head,
  .site-form {
    grid-template-columns: 1fr;
  }

  .quick-head {
    display: grid;
  }

  .quick-actions,
  .form-actions {
    width: 100%;
  }

  .quick-actions button,
  .form-actions button {
    flex: 1;
  }

  .site-grid,
  .categories,
  .category-sites,
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
