:root {
  --page-spacing: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, sans-serif;
}

body {
  background: #fff;
  color: #111;
  padding: 0 20px var(--page-spacing);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app {
  display: flex;
  flex-direction: column;
  gap: var(--page-spacing);
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--page-spacing) 0;
  border-bottom: 1px solid #eee;
}

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

.logo i {
  width: 20px;
  height: 20px;
}

.logo h1 {
  font-family: 'Grand Hotel', cursive, sans-serif;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.5px;
  line-height: 1;
}

.logo-link {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  background: #fff;
  color: #111;
  border: 1px solid #ccc;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}

.btn i,
.btn svg {
  width: 16px;
  height: 16px;
}

.btn:hover {
  background: #f5f5f5;
}

.btn-primary {
  background: #111;
  color: #fff;
  border: none;
}

.btn-primary:hover {
  background: #333;
}

.dns-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dns-item {
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  cursor: pointer;
}

.dns-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dns-title {
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
}

.ip-list {
  font-size: 12px;
  color: #555;
  font-family: monospace;
  word-break: break-all;
}

.status-box {
  padding: 60px 0;
  color: #666;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.spinner {
  width: 26px;
  height: 26px;
  border: 2.5px solid #eee;
  border-top-color: #111;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.unsupported-device {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.unsupported-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 320px;
}

.unsupported-content i,
.unsupported-content svg {
  width: 36px;
  height: 36px;
}

.unsupported-content h1 {
  font-size: 20px;
  font-weight: 600;
}

.unsupported-content p {
  font-size: 14px;
  line-height: 1.5;
  color: #666;
}

/* Detail Sub-page View */
.detail-view {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.detail-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-btn {
  width: 35px;
  height: 35px;
  padding: 0;
  justify-content: center;
  flex-shrink: 0;
}

.btn-icon-btn i,
.btn-icon-btn svg {
  width: 16px;
  height: 16px;
}

.code-preview {
  background: transparent;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 14px 16px;
  font-family: monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  color: #111;
  margin: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.hidden {
  display: none !important;
}

/* Auto Dark Mode */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #282828;
    color: #e1e1e1;
  }

  .header {
    background: rgba(40, 40, 40, 0.92);
    border-color: #3f3f3f;
  }

  .btn {
    background-color: #282828;
    color: #e1e1e1;
    border-color: #444;
  }

  .btn:hover {
    background-color: #333;
  }

  .btn-primary {
    background-color: #eee;
    color: #111;
  }

  .btn-primary:hover {
    background-color: #ccc;
  }

  .dns-item {
    border-color: #3f3f3f;
    background-color: #282828;
  }

  .ip-list {
    color: #aaa;
  }

  .unsupported-content p {
    color: #aaa;
  }

  .code-preview {
    background: transparent;
    border-color: #3f3f3f;
    color: #e1e1e1;
  }


  .spinner {
    border-color: #3f3f3f;
    border-top-color: #e1e1e1;
  }
}