@import url("https://fonts.font.im/css2?family=LXGW+WenKai&display=swap");

:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.72);
  --glass-shadow: 0 28px 52px rgba(15, 23, 42, 0.14);
  --tile-bg: rgba(255, 255, 255, 0.6);
  --tile-border: rgba(255, 255, 255, 0.8);
  --tile-hover: rgba(255, 255, 255, 0.72);
  --text-primary: #1a1a1a;
  --text-secondary: rgba(26, 26, 26, 0.58);
  --divider-soft: rgba(148, 163, 184, 0.24);
  --accent-muted: rgba(255, 255, 255, 0.78);
  --accent-strong: rgba(59, 130, 246, 0.85);
  --danger: #ef4444;
  --success: #22c55e;
}

body.dark-theme,
:root[data-theme="dark"] {
  color-scheme: dark;
  --glass-bg: #2C2C2E;
  --glass-border: transparent;
  --glass-shadow: 0 28px 52px rgba(0, 0, 0, 0.28);
  --tile-bg: #2C2C2E;
  --tile-border: transparent;
  --tile-hover: #3A3A3C;
  --text-primary: #f7fafc;
  --text-secondary: rgba(247, 250, 252, 0.58);
  --divider-soft: rgba(74, 85, 104, 0.24);
  --accent-muted: #3A3A3C;
  --accent-strong: rgba(96, 165, 250, 0.85);
}

body.dark-theme {
  background: #1C1C1E;
}

body.dark-theme.admin-body {
  background: #1C1C1E;
}

body.dark-theme .site-footer-meta {
  color: rgba(226, 232, 240, 0.65);
}

body.dark-theme .site-footer-meta-value {
  color: rgba(226, 232, 240, 0.92);
}

body.dark-theme .back-to-top {
  border-color: rgba(45, 55, 72, 0.9);
  background: var(--glass-bg);
  color: var(--text-primary);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
}

body.dark-theme .back-to-top:hover,
body.dark-theme .back-to-top:focus-visible {
  box-shadow: 0 26px 52px rgba(0, 0, 0, 0.28);
  color: var(--text-primary);
  border-color: rgba(74, 85, 104, 0.9);
  background: var(--tile-hover);
}

body.dark-theme .back-to-top:focus-visible {
  box-shadow: 0 0 0 3px rgba(74, 85, 104, 0.55), 0 26px 52px rgba(0, 0, 0, 0.3);
}

body.dark-theme .glass {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.dark-theme .site-logo {
  background: #3A3A3C;
  color: rgba(247, 250, 252, 0.75);
}

body.dark-theme .badge {
  background: var(--accent-muted);
  color: white !important;
}

body.dark-theme .weather-label {
  color: rgba(247, 250, 252, 0.55);
}

body.dark-theme .search-select select {
  border-color: #3A3A3C;
  background: #3A3A3C;
  color: var(--text-primary);
}

body.dark-theme .search-select select:focus {
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16);
}

body.dark-theme .search-input {
  background: #3A3A3C;
  border-color: #3A3A3C;
}

body.dark-theme .search-input button {
  color: white;
  background: #0B84FF;
}

body.dark-theme .search-input button:hover,
body.dark-theme .search-input button:focus-visible {
  box-shadow: 0 12px 24px rgba(96, 165, 250, 0.22);
}

body.dark-theme .search-engine-toggle {
  background: #3A3A3C;
  border-color: #3A3A3C;
}

body.dark-theme .search-engine-button:hover:not(:disabled) {
  background: transparent;
}

body.dark-theme .search-engine-button.is-active {
  background: #0B84FF;
  color: white;
  box-shadow: none;
}

body.dark-theme .search-engine-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.28);
}

body.dark-theme .admin-entry {
  color: rgba(247, 250, 252, 0.72);
  border-color: rgba(247, 250, 252, 0.3);
}

body.dark-theme .admin-entry:hover,
body.dark-theme .admin-entry:focus-visible {
  color: rgba(247, 250, 252, 0.92);
  border-color: rgba(247, 250, 252, 0.45);
}

body.dark-theme .collection-toggle {
  background: #3A3A3C;
  border-color: transparent;
}

body.dark-theme .collection-toggle-button {
  color: #8E8E93;
}

body.dark-theme .collection-toggle-button:hover,
body.dark-theme .collection-toggle-button:focus-visible {
  background: #3A3A3C;
  color: white;
}

body.dark-theme .collection-toggle-button.is-active {
  background: #0B84FF;
  color: white;
  box-shadow: none;
}

body.dark-theme .site-footer-content {
  color: rgba(226, 232, 240, 0.94);
}

body.dark-theme .site-footer-content h1,
body.dark-theme .site-footer-content h2,
body.dark-theme .site-footer-content h3,
body.dark-theme .site-footer-content h4,
body.dark-theme .site-footer-content h5,
body.dark-theme .site-footer-content h6 {
  color: rgba(226, 232, 240, 0.98);
}

body.dark-theme .site-footer-content blockquote {
  color: rgba(226, 232, 240, 0.72);
}

body.dark-theme .site-footer-content code {
  background: rgba(226, 232, 240, 0.06);
}

body.dark-theme .site-footer-content a {
  color: rgba(147, 197, 253, 0.9);
  border-color: rgba(147, 197, 253, 0.4);
}

body.dark-theme .site-footer-content a:hover,
body.dark-theme .site-footer-content a:focus-visible {
  color: rgba(147, 197, 253, 1);
  border-color: rgba(147, 197, 253, 0.7);
}

body.dark-theme .bookmark-group-title {
  color: rgba(247, 250, 252, 0.78);
}

body.dark-theme .tile:hover,
body.dark-theme .tile:focus-visible {
  box-shadow: 0 26px 52px rgba(0, 0, 0, 0.22);
}

body.dark-theme .tile:focus-visible {
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.28), 0 26px 52px rgba(0, 0, 0, 0.22);
}

body.dark-theme .tile-icon {
  background: rgba(26, 32, 44, 0.82);
  color: rgba(247, 250, 252, 0.7);
}

body.dark-theme .field input,
body.dark-theme .field textarea {
  background: #1C1C1E;
  border-color: #3A3A3C;
  color: var(--text-primary);
}

body.dark-theme .field input:focus,
body.dark-theme .field textarea:focus {
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16);
}

body.dark-theme .primary-button {
  background: rgba(96, 165, 250, 0.85);
  box-shadow: 0 18px 32px rgba(96, 165, 250, 0.24);
}

body.dark-theme .primary-button:hover,
body.dark-theme .primary-button:focus-visible {
  box-shadow: 0 22px 40px rgba(96, 165, 250, 0.28);
}

body.dark-theme .ghost-button {
  background: #3A3A3C;
  border-color: #545458;
  color: var(--text-primary);
}

body.dark-theme .ghost-button:hover,
body.dark-theme .ghost-button:focus-visible {
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

body.dark-theme .modal-close {
  background: #3A3A3C;
  color: var(--text-secondary);
}

body.dark-theme .modal-close:hover,
body.dark-theme .modal-close:focus-visible {
  background: #545458;
}

body.dark-theme .auth-description {
  color: var(--text-secondary);
}

body.dark-theme .auth-hint {
  color: rgba(247, 250, 252, 0.45);
}

body.dark-theme .admin-table-wrapper {
  background: #2C2C2E;
  border-color: transparent;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.15);
}

body.dark-theme .admin-table thead {
  background: #3A3A3C;
}

body.dark-theme .admin-table th,
body.dark-theme .admin-table td {
  border-bottom-color: #3A3A3C;
}

body.dark-theme .admin-table thead th {
  color: var(--text-secondary);
}

body.dark-theme .admin-table tbody tr {
  background: #2C2C2E;
}

body.dark-theme .admin-table tbody tr:nth-child(even) {
  background: #252527;
}

body.dark-theme .admin-table tbody tr[data-clickable="true"]:hover {
  background: #3A3A3C;
}

body.dark-theme .admin-table td[data-column="url"] {
  color: var(--text-secondary);
}

body.dark-theme .admin-item-icon {
  background: #3A3A3C;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: clamp(2.6rem, 6vw, 4.5rem) clamp(1.4rem, 5vw, 3rem);
  background: linear-gradient(140deg, #fdfdfd 0%, #f5f7fb 52%, #e6ecf5 100%);
  color: var(--text-primary);
  position: relative;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body.admin-body {
  background: linear-gradient(135deg, #f8fbff 0%, #ecf2fb 46%, #e3eaf6 100%);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ambient {
  display: none;
}

.ambient-a {
  top: -8rem;
  right: -6rem;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.94), rgba(230, 236, 248, 0));
}

.ambient-b {
  bottom: -10rem;
  left: -8rem;
  background: radial-gradient(circle at center, rgba(235, 242, 252, 0.92), rgba(224, 231, 245, 0));
}

.layout {
  width: min(1140px, 100%);
  margin: 0 auto;
  display: grid;
  gap: clamp(1.6rem, 3vw, 2.4rem);
  position: relative;
  z-index: 1;
}

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: box-shadow 200ms ease, transform 200ms ease, border-color 200ms ease;
}

@supports not ((backdrop-filter: blur(1px))) {
  .glass {
    background: rgba(248, 249, 251, 0.95);
  }
}

.summary {
  position: relative;
  padding: clamp(2rem, 5vw, 2.8rem);
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.5fr);
  gap: clamp(1.8rem, 4vw, 3rem);
}

.summary-main {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.site-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-logo {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  font-size: 1.5rem;
  font-weight: 600;
  color: rgba(31, 31, 31, 0.75);
  overflow: hidden;
}

.site-logo.has-image {
  background: transparent;
}

.site-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.site-name {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  font-weight: 600;
}

.badge {
  align-self: flex-start;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--accent-muted);
  color: rgba(31, 31, 31, 0.6);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
}

body.dark-theme .badge {
  color: white;
}

.time-display {
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 600;
  margin: 0;
}

.date-display {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--text-secondary);
}

.greeting {
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  font-weight: 500;
}

.greeting.is-yiyan {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-family: "LXGW WenKai", "ZCOOL XiaoWei", "Songti SC", "SimSun", serif;
  font-weight: 500;
  line-height: 1.65;
}

.summary-meta {
  display: grid;
  gap: clamp(1.2rem, 3vw, 1.6rem);
  align-content: start;
}

.weather-block {
  display: grid;
  gap: 0.35rem;
}

.weather-label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(31, 31, 31, 0.55);
}

.weather-info {
  margin: 0;
  font-size: 1rem;
  color: var(--text-primary);
}

.search-form {
  display: grid;
  gap: 0.6rem;
}

.search-controls {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.search-select {
  display: inline-flex;
  align-items: center;
}

.search-select select {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  padding: 0.55rem 0.9rem;
  background: rgba(255, 255, 255, 0.68);
  font-size: 0.95rem;
  color: var(--text-primary);
  min-width: 150px;
  appearance: none;
}

body.dark-theme .search-select select option {
  background: var(--glass-bg);
  color: var(--text-primary);
}

.search-select select:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.search-input {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  padding: 0.35rem 0.35rem 0.35rem 1rem;
}

.search-input input {
  flex: 1;
  border: none;
  padding: 0.75rem 0.4rem;
  background: transparent;
  font-size: 1rem;
  color: var(--text-primary);
}

.search-input input:focus {
  outline: none;
}

.search-input button {
  border: none;
  border-radius: 12px;
  padding: 0.65rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--accent-strong);
  color: white;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.search-input button:hover,
.search-input button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.22);
}

.search-feedback {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding-left: 0.2rem;
}

.search-engine-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.search-engine-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.search-engine-button .engine-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
}

.search-engine-button svg {
  width: 1.4rem;
  height: 1.4rem;
}

.search-engine-button:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.12);
}

.search-engine-button.is-active {
  background: rgba(59, 130, 246, 0.16);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.28);
}

.search-engine-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.28);
}

.search-engine-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.admin-entry {
  font-size: 0.9rem;
  color: rgba(31, 41, 55, 0.72);
  text-decoration: none;
  justify-self: start;
  border-bottom: 1px dashed rgba(31, 41, 55, 0.3);
  padding-bottom: 0.1rem;
  transition: color 160ms ease, border-color 160ms ease;
}

.admin-entry:hover,
.admin-entry:focus-visible {
  color: rgba(31, 41, 55, 0.92);
  border-color: rgba(31, 41, 55, 0.45);
}

.grid-section {
  padding: clamp(1.8rem, 4vw, 2.5rem);
  display: grid;
  gap: clamp(1.4rem, 3vw, 2rem);
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.section-header-with-toggle {
  align-items: center;
  flex-wrap: wrap;
}

.section-header h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  font-weight: 600;
}

.section-header p {
  margin: 0.4rem 0 0;
  color: var(--text-secondary);
}

.collection-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.collection-toggle-button {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 0.4rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(31, 31, 31, 0.62);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.collection-toggle-button:hover,
.collection-toggle-button:focus-visible {
  outline: none;
  background: rgba(59, 130, 246, 0.12);
  color: rgba(31, 31, 31, 0.82);
}

.collection-toggle-button.is-active {
  background: rgba(59, 130, 246, 0.16);
  color: rgba(31, 31, 31, 0.92);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.28);
}

.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
  align-items: stretch;
}

.collection-panels {
  display: grid;
  gap: clamp(1.2rem, 2.8vw, 1.8rem);
}

.collection-panel {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.6rem);
}

.collection-panel[hidden] {
  display: none;
}

.site-footer {
  width: min(1140px, 100%);
  margin: clamp(1.6rem, 3vw, 2.4rem) auto 0;
  padding: 0 0 clamp(1.6rem, 4vw, 2.4rem);
  text-align: center;
  background: none;
  border: none;
  box-shadow: none;
}

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

.site-footer-inner {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
}

.site-footer-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: rgba(17, 24, 39, 0.65);
}

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

.site-footer-meta-label::after {
  content: "：";
}

.site-footer-meta-value {
  font-weight: 700;
  color: rgba(17, 24, 39, 0.92);
  font-variant-numeric: tabular-nums;
}

.site-footer-content {
  display: inline-grid;
  gap: 0.65rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.7;
  text-align: center;
  justify-items: center;
  max-width: 720px;
}

.site-footer-content > * {
  margin: 0;
  justify-self: center;
}

.site-footer-content h1,
.site-footer-content h2,
.site-footer-content h3,
.site-footer-content h4,
.site-footer-content h5,
.site-footer-content h6 {
  font-weight: 600;
  color: rgba(17, 24, 39, 0.98);
  margin-bottom: 0.1rem;
}

.site-footer-content ul,
.site-footer-content ol {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.35rem;
  text-align: left;
  justify-self: center;
}

.theme-toggle {
  position: absolute;
  top: clamp(1.5rem, 4vw, 2.2rem);
  right: clamp(1.5rem, 4vw, 2.2rem);
  width: 2.8rem;
  height: 2.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 10;
  transition: color 160ms ease, transform 160ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--text-primary);
  transform: scale(1.1);
  outline: none;
}

.theme-toggle:focus-visible {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.28);
}

.theme-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
}

.theme-toggle .sun-icon {
  display: none;
}

.theme-toggle .moon-icon {
  display: block;
}

body.dark-theme .theme-toggle .sun-icon {
  display: block;
}

body.dark-theme .theme-toggle .moon-icon {
  display: none;
}

body.dark-theme .theme-toggle {
  color: var(--text-secondary);
}

body.dark-theme .theme-toggle:hover,
body.dark-theme .theme-toggle:focus-visible {
  color: var(--text-primary);
}

body.dark-theme .theme-toggle:focus-visible {
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.28);
}

.site-footer-content blockquote {
  margin: 0;
  padding: 0;
  border: none;
  color: rgba(17, 24, 39, 0.72);
  font-style: italic;
  text-align: center;
}

.site-footer-content code {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88rem;
  background: rgba(15, 23, 42, 0.06);
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
}

.site-footer-content a {
  color: rgba(37, 99, 235, 0.9);
  text-decoration: none;
  border-bottom: 1px dashed rgba(37, 99, 235, 0.4);
  transition: color 160ms ease, border-color 160ms ease;
}

.site-footer-content a:hover,
.site-footer-content a:focus-visible {
  color: rgba(37, 99, 235, 1);
  border-color: rgba(37, 99, 235, 0.7);
  outline: none;
}

.site-footer-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.bookmark-collection {
  display: grid;
  gap: clamp(1.2rem, 2.8vw, 1.8rem);
}

.bookmark-group {
  display: grid;
  gap: 0.9rem;
}

.bookmark-group-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(31, 31, 31, 0.78);
}

.tile {
  position: relative;
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  grid-template-rows: minmax(0, auto) minmax(0, auto);
  column-gap: 0.6rem;
  row-gap: 0.2rem;
  padding: 0.7rem 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--tile-bg);
  border: 1px solid var(--tile-border);
  border-radius: 14px;
  transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
  min-height: 100px;
  align-items: start;
  align-content: start;
  overflow: hidden;
  min-width: 0;
}

.tile:hover,
.tile:focus-visible {
  transform: translateY(-6px);
  background: var(--tile-hover);
  box-shadow: 0 26px 52px rgba(15, 23, 42, 0.12);
  outline: none;
}

.tile:focus-visible {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.28), 0 26px 52px rgba(15, 23, 42, 0.12);
}

.tile-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: rgba(31, 31, 31, 0.7);
  overflow: hidden;
  flex-shrink: 0;
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: start;
  margin-top: 0.1rem;
}

.tile-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.tile-title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  min-width: 0;
}

.tile-description {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.3;
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  margin-top: 0.15rem;
  min-width: 0;
}

.tile-description.is-empty {
  visibility: hidden;
}

.tile-meta {
  margin-top: auto;
  font-size: 0.78rem;
  color: rgba(31, 41, 55, 0.55);
}

.empty-hint {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.back-to-top {
  position: fixed;
  bottom: clamp(1.4rem, 4vw, 2.4rem);
  right: clamp(1.2rem, 4vw, 2.4rem);
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(225, 227, 233, 0.9);
  border-radius: 999px;
  background: rgba(248, 249, 252, 0.92);
  color: rgba(31, 31, 31, 0.68);
  font-size: 1.12rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 1500;
  transition: transform 160ms ease, box-shadow 160ms ease, color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 26px 52px rgba(15, 23, 42, 0.18);
  color: rgba(31, 31, 31, 0.82);
  border-color: rgba(209, 213, 224, 0.9);
  background: rgba(255, 255, 255, 0.96);
  outline: none;
}

.back-to-top:focus-visible {
  box-shadow: 0 0 0 3px rgba(209, 213, 224, 0.55), 0 26px 52px rgba(15, 23, 42, 0.2);
}

.back-to-top[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .back-to-top {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1rem;
  }
}

/* Admin page */
.admin-layout {
  gap: clamp(1.4rem, 3vw, 2rem);
}

.admin-header {
  padding: clamp(1.8rem, 4vw, 2.6rem);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-header h1 {
  margin: 0.4rem 0 0;
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 600;
}

.admin-header p {
  margin: 0.6rem 0 0;
  color: var(--text-secondary);
}

.admin-return {
  align-self: center;
  font-size: 0.95rem;
  color: rgba(31, 41, 55, 0.72);
  text-decoration: none;
  border: 1px solid rgba(31, 41, 55, 0.24);
  padding: 0.6rem 1.2rem;
  border-radius: 14px;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.admin-return:hover,
.admin-return:focus-visible {
  background: rgba(255, 255, 255, 0.75);
  color: rgba(31, 41, 55, 0.9);
  border-color: rgba(31, 41, 55, 0.36);
}

.admin-section {
  padding: clamp(1.6rem, 3.8vw, 2.2rem);
  display: grid;
  gap: 1.2rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.password-form {
  display: grid;
  gap: 1.2rem;
}

.password-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .password-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.password-hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.password-actions {
  display: flex;
  justify-content: flex-start;
}

.password-message {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.password-message[data-variant="error"] {
  color: var(--danger);
}

.password-message[data-variant="success"] {
  color: var(--success);
}

.field-span-2 {
  grid-column: span 2;
}

@media (max-width: 640px) {
  .field-span-2 {
    grid-column: span 1;
  }
}

.admin-section-header {
  align-items: center;
}

.add-button {
  border: none;
  background: rgba(59, 130, 246, 0.12);
  color: rgba(37, 99, 235, 0.92);
  font-weight: 600;
  padding: 0.65rem 1.1rem;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.add-button:hover,
.add-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(59, 130, 246, 0.18);
}

.edit-list {
  display: grid;
  gap: 1rem;
}

.admin-table-wrapper {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.admin-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  background: transparent;
}

.admin-table thead {
  background: rgba(248, 249, 252, 0.9);
}

.admin-table th,
.admin-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.92rem;
  line-height: 1.5;
  vertical-align: middle;
  border-bottom: 1px solid rgba(226, 232, 240, 0.4);
}

.admin-table thead th {
  font-weight: 600;
  color: rgba(31, 41, 55, 0.72);
}

.admin-table tbody tr {
  background: rgba(255, 255, 255, 0.78);
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.admin-table tbody tr:nth-child(even) {
  background: rgba(248, 249, 252, 0.78);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr[data-clickable="true"] {
  cursor: pointer;
}

.admin-table tbody tr[data-clickable="true"]:hover {
  background: rgba(234, 243, 255, 0.82);
}

.admin-table tbody tr[data-clickable="true"]:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.35);
  outline-offset: -2px;
}

.admin-table td[data-column="description"],
.admin-table td[data-column="category"] {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.admin-table td[data-column="url"] {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.85rem;
  color: rgba(31, 41, 55, 0.68);
  word-break: break-all;
}

.admin-table td[data-column="actions"] {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}

.admin-table-actions {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.admin-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.admin-item-icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 1.05rem;
  color: rgba(31, 31, 31, 0.7);
  overflow: hidden;
  flex-shrink: 0;
}

.admin-item-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.admin-item-name {
  margin: 0;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.96rem;
  flex: 1;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .admin-table {
    min-width: 480px;
  }
}

.edit-card {
  padding: 1.4rem 1.6rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 1.1rem;
}

.edit-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.edit-card-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.delete-button {
  border: none;
  background: rgba(239, 68, 68, 0.12);
  color: rgba(220, 38, 38, 0.9);
  padding: 0.35rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.delete-button:hover,
.delete-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(239, 68, 68, 0.16);
}

.summary-card {
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.summary-card:hover,
.summary-card:focus-visible {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.12);
  outline: none;
}

.summary-card-main {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.summary-card-icon {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 1.1rem;
  color: rgba(31, 31, 31, 0.72);
  overflow: hidden;
}

.summary-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.summary-card-text {
  display: grid;
  gap: 0.35rem;
  flex: 1;
}

.summary-card-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.summary-card-title h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
}

.summary-card-description {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.summary-card-meta {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(31, 41, 55, 0.55);
  word-break: break-all;
}

.summary-card-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.secondary-button {
  border: 1px solid rgba(59, 130, 246, 0.28);
  background: rgba(59, 130, 246, 0.12);
  color: rgba(37, 99, 235, 0.92);
  padding: 0.35rem 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.secondary-button:hover,
.secondary-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.16);
  outline: none;
}

.category-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.14);
  color: rgba(37, 99, 235, 0.9);
  font-weight: 600;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field span {
  font-size: 0.85rem;
  color: rgba(31, 41, 55, 0.68);
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text-primary);
  transition: border-color 160ms ease, box-shadow 160ms ease;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.field textarea {
  min-height: 88px;
}

.field-description {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(31, 41, 55, 0.52);
}

.weather-field .weather-config-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.weather-field .weather-config-grid .field {
  gap: 0.35rem;
}

.weather-field .weather-config-grid input[type="number"],
.weather-field .weather-config-grid input[type="text"] {
  min-height: auto;
}

.footer-preview-field .footer-preview {
  min-height: 120px;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  display: grid;
  gap: 0.6rem;
  color: rgba(17, 24, 39, 0.88);
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-preview-field .footer-preview > * {
  margin: 0;
}

.footer-preview-field .footer-preview ul,
.footer-preview-field .footer-preview ol {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.3rem;
}

.footer-preview-field .footer-preview blockquote {
  margin: 0;
  padding-left: 0.9rem;
  border-left: 3px solid rgba(59, 130, 246, 0.24);
  color: rgba(17, 24, 39, 0.7);
}

.footer-preview-field .footer-preview code {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.85rem;
  background: rgba(15, 23, 42, 0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}

.footer-preview-field .footer-preview a {
  color: rgba(37, 99, 235, 0.9);
  text-decoration: none;
  border-bottom: 1px dashed rgba(37, 99, 235, 0.45);
}

.footer-preview-field .footer-preview a:hover,
.footer-preview-field .footer-preview a:focus-visible {
  text-decoration: underline;
  outline: none;
}

.footer-preview-field .footer-preview img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.footer-preview-empty {
  color: rgba(31, 41, 55, 0.45);
  font-size: 0.85rem;
}

.admin-actions {
  padding: clamp(1.4rem, 3vw, 1.8rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.status {
  font-size: 0.92rem;
  color: rgba(31, 41, 55, 0.6);
}

.status[data-variant="success"] {
  color: var(--success);
}

.status[data-variant="error"] {
  color: var(--danger);
}

.action-buttons {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.ghost-button,
.primary-button {
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 14px;
  padding: 0.7rem 1.6rem;
  cursor: pointer;
  border: none;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: rgba(31, 41, 55, 0.78);
}

.ghost-button:hover,
.ghost-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(148, 163, 184, 0.22);
}

.primary-button {
  background: rgba(59, 130, 246, 0.85);
  color: white;
  box-shadow: 0 18px 32px rgba(59, 130, 246, 0.24);
}

.primary-button:hover,
.primary-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 22px 40px rgba(59, 130, 246, 0.28);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: auto;
}

.auth-overlay[hidden] {
  display: none;
}

.auth-card {
  width: min(360px, 100%);
  display: grid;
  gap: 1.2rem;
  padding: 2.1rem 2.4rem;
  border-radius: 24px;
  box-shadow: 0 32px 68px rgba(15, 23, 42, 0.2);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.auth-card h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.auth-card .primary-button {
  width: 100%;
}

.auth-description {
  margin: 0;
  color: rgba(31, 41, 55, 0.7);
  font-size: 0.95rem;
}

.auth-hint {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(31, 41, 55, 0.6);
}

.form-error {
  margin: 0;
  font-size: 0.85rem;
  color: var(--danger);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.modal[hidden] {
  display: none;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-dialog {
  position: relative;
  width: min(520px, 100%);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 32px 68px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
  z-index: 1;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  padding: 1.8rem 2rem 2rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.modal-close {
  border: none;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  font-size: 1.2rem;
  cursor: pointer;
  color: rgba(31, 41, 55, 0.7);
  transition: background 160ms ease, transform 160ms ease;
}

.modal-close:hover,
.modal-close:focus-visible {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.05);
  outline: none;
}

.modal-body {
  display: grid;
  gap: 1rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

.modal-error {
  margin: 0;
  font-size: 0.85rem;
  color: var(--danger);
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 960px) {
  .summary {
    grid-template-columns: 1fr;
  }

  .summary-main {
    gap: 0.6rem;
  }

  .summary-meta {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .search-controls {
    flex-direction: column;
  }

  .search-select,
  .search-select select {
    width: 100%;
  }

  .search-input {
    flex-wrap: wrap;
    padding: 0.4rem 0.4rem 0.4rem 0.8rem;
  }

  .search-input input {
    width: 100%;
  }

  .search-input button {
    width: 100%;
  }

  .admin-header {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-header h1 {
    margin-top: 0.8rem;
  }

  .admin-return {
    align-self: flex-start;
  }

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

@media (max-width: 640px) {
  body {
    padding: 2.2rem 1.1rem 2.8rem;
  }

  .layout {
    gap: 1.4rem;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tile {
    min-height: 0;
  }

  .modal-dialog {
    width: min(96vw, 460px);
    border-radius: 20px;
  }

  .modal-form {
    padding: 1.4rem 1.4rem 1.6rem;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
