/* ==================== 公共页面基线 ====================
   作用：统一所有页面（about/contact/api-docs/iana/cctlds）的容器宽度、Hero、卡片与标题风格
   依赖：全局变量来源于 assets/style.css（--card-bg / --border-color / --shadow-* 等）
====================================================== */

/* ==================== Hero 区域 ==================== */
.hero h1 .page-icon {
  color: rgba(255, 255, 255, 0.9);
  margin-right: 12px;
}

/* 内容卡片：通用内容容器 */
.content-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

.content-card:hover {
  border-color: rgba(0, 102, 252, 0.25);
  box-shadow: 0 6px 20px rgba(0, 102, 252, 0.08);
}

.content-card h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.content-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.content-card p,
.content-card li {
  color: var(--text-primary);
  line-height: 1.75;
  margin-bottom: 8px;
  font-size: 14px;
}

.content-card p:last-child,
.content-card li:last-child {
  margin-bottom: 0;
}

.content-card ul {
  margin: 8px 0 0 24px;
  list-style-type: disc;
}

.content-card ol {
  margin: 8px 0 0 24px;
  list-style-type: decimal;
}

/* 两列栅格布局 */
.content-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 16px;
}

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

/* ==================== About 页面 - 功能特点 ==================== */
.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border-radius: 8px;
  transition: var(--transition);
}

.feature-item:hover {
  background: var(--bg-tertiary);
}

.feature-icon-wrapper {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.feature-icon-wrapper.blue {
  background: rgba(0, 102, 252, 0.1);
  color: var(--accent-black);
}

.feature-icon-wrapper.green {
  background: rgba(0, 200, 81, 0.1);
  color: var(--success);
}

.feature-icon-wrapper.purple {
  background: rgba(156, 39, 176, 0.1);
  color: #9c27b0;
}

.feature-icon-wrapper.orange {
  background: rgba(255, 187, 51, 0.1);
  color: var(--warning);
}

.feature-item-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.feature-item-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* ==================== Contact 页面 ==================== */
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 8px;
  transition: var(--transition);
}

.contact-item:hover {
  background: var(--bg-tertiary);
}

.contact-icon-wrapper {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.contact-icon-wrapper.blue {
  background: rgba(0, 102, 252, 0.1);
  color: var(--accent-black);
}

.contact-icon-wrapper.green {
  background: rgba(0, 200, 81, 0.1);
  color: var(--success);
}

.contact-item-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.contact-item-content a {
  color: var(--accent-black);
  text-decoration: none;
  transition: var(--transition);
}

.contact-item-content a:hover {
  text-decoration: underline;
}

.contact-item-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* FAQ 样式 */
.faq-item {
  border-left: 4px solid var(--accent-black);
  padding-left: 16px;
  margin-bottom: 16px;
}

.faq-item h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.faq-item p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* ==================== API Docs 页面 ==================== */
.api-section {
  margin-bottom: 24px;
}

.api-section-header {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.api-section-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 102, 252, 0.1);
  color: var(--accent-black);
  margin-right: 16px;
  flex-shrink: 0;
}

.api-section-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.api-section-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.api-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.api-info-item h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.api-info-item ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.api-info-item li {
  padding: 8px 0;
  color: var(--text-primary);
  font-size: 14px;
  border-bottom: 1px solid var(--border-color);
}

.api-info-item li:last-child {
  border-bottom: none;
}

.api-code-block {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  font-family: "SF Mono", "Monaco", "Inconsolata", monospace;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
}

.api-support-card {
  background: linear-gradient(135deg, var(--accent-black) 0%, #7c3aed 100%);
  color: #ffffff;
  border-radius: 8px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

.api-support-card h2 {
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 16px;
}

.api-support-card p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 16px;
}

.api-support-card a {
  color: #ffffff;
  text-decoration: none;
}

.api-support-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  transition: var(--transition);
}

.api-support-link:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ==================== IANA / ccTLDs 页面 ==================== */
/* 页面标题区域 */
.page-title-section {
  text-align: center;
  margin-bottom: 48px;
}

.page-title-section h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.page-title-section h1 .page-icon {
  color: var(--accent-black);
  margin-right: 8px;
}

.page-title-section p {
  font-size: 15px;
  color: var(--text-secondary);
}

/* 说明卡片 */
.info-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.info-card p {
  color: var(--text-primary);
  line-height: 1.75;
  font-size: 14px;
  margin-bottom: 16px;
}

.info-card p:last-child {
  margin-bottom: 0;
}

/* 表格样式 */
.table-wrapper {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
}

table thead {
  background: var(--bg-secondary);
}

table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 14px;
}

table tbody tr {
  transition: var(--transition);
}

table tbody tr:hover {
  background: var(--bg-tertiary);
}

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

table a {
  color: var(--accent-black);
  text-decoration: none;
  font-family: "SF Mono", "Monaco", monospace;
  font-weight: 500;
}

table a:hover {
  text-decoration: underline;
}

/* 徽章样式 */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.badge-blue {
  background: rgba(0, 102, 252, 0.1);
  color: var(--accent-black);
}

.badge-green {
  background: rgba(0, 200, 81, 0.1);
  color: var(--success);
}

.badge-purple {
  background: rgba(156, 39, 176, 0.1);
  color: #9c27b0;
}

.badge-orange {
  background: rgba(255, 187, 51, 0.1);
  color: var(--warning);
}

.badge-red {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.badge-yellow {
  background: rgba(234, 179, 8, 0.1);
  color: #eab308;
}

.badge-gray {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--accent-black);
  box-shadow: var(--shadow-md);
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent-black);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
}

/* 信息提示框 */
.info-box {
  background: rgba(0, 102, 252, 0.1);
  border: 1px solid rgba(0, 102, 252, 0.2);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
}

[data-theme="dark"] .info-box {
  background: rgba(0, 102, 252, 0.15);
  border-color: rgba(0, 102, 252, 0.3);
}

.info-box p {
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 16px;
}

.info-box a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-black);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.info-box a:hover {
  text-decoration: underline;
}

.info-box .info-icon {
  color: var(--accent-black);
  margin-right: 8px;
}

/* 域名类型说明卡片 */
.type-explanation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.type-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.type-card:hover {
  border-color: var(--accent-black);
  box-shadow: var(--shadow-md);
}

.type-card-badge {
  margin-bottom: 12px;
}

.type-card h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.type-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

/* ==================== 深色模式适配 ==================== */
[data-theme="dark"] .content-card {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .info-card {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .table-wrapper {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] table {
  background: var(--card-bg);
}

[data-theme="dark"] table thead {
  background: var(--bg-secondary);
}

[data-theme="dark"] table th {
  color: var(--text-primary);
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] table td {
  color: var(--text-primary);
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] table tbody tr:hover {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .stat-card {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .type-card {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .api-code-block {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .feature-icon-wrapper.blue {
  background: rgba(0, 102, 252, 0.15);
  color: var(--accent-black-light);
}

[data-theme="dark"] .contact-icon-wrapper.blue {
  background: rgba(0, 102, 252, 0.15);
  color: var(--accent-black-light);
}

/* ==================== 响应式优化 ==================== */
@media (max-width: 768px) {
  .content-card {
    padding: 24px;
  }

  .content-card h2 {
    font-size: 16px;
  }

  .table-container {
    font-size: 12px;
  }

  table th,
  table td {
    padding: 8px 12px;
  }

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

  .type-explanation-grid {
    grid-template-columns: 1fr;
  }

  .api-info-grid {
    grid-template-columns: 1fr;
  }

  .api-support-card {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .content-card {
    padding: 16px;
  }

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

  .stat-value {
    font-size: 24px;
  }

  .info-box {
    padding: 16px;
  }

  .type-card {
    padding: 16px;
  }
}

/* ==================== Search 页面样式 ==================== */
.search-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.search-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-black);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 24px;
  transition: var(--transition);
}

.search-back-link:hover {
  text-decoration: underline;
}

.search-result-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 32px;
  margin-bottom: 32px;
}

.search-header {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.search-icon-wrapper {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-right: 16px;
  flex-shrink: 0;
}

.search-icon-wrapper.blue {
  background: rgba(0, 102, 252, 0.1);
  color: var(--accent-black);
}

.search-icon-wrapper.green {
  background: rgba(0, 200, 81, 0.1);
  color: var(--success);
}

.search-icon-wrapper.purple {
  background: rgba(156, 39, 176, 0.1);
  color: #9c27b0;
}

.search-icon-wrapper.orange {
  background: rgba(255, 187, 51, 0.1);
  color: var(--warning);
}

.search-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.search-subtitle {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
  gap: 16px;
  flex-wrap: wrap;
}

.search-error-box {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-error-icon {
  color: #ef4444;
  font-size: 20px;
}

.search-error-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: #dc2626;
  margin-bottom: 4px;
}

.search-error-content p {
  color: #b91c1c;
  margin-top: 4px;
  font-size: 14px;
}

.search-result-content {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 24px;
}

.search-actions {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.search-btn.primary {
  background: var(--accent-black);
  color: #ffffff;
}

.search-btn.primary:hover {
  background: var(--accent-hover);
}

.search-btn.secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.search-btn.secondary:hover {
  background: var(--border-color);
}

.search-btn.blue {
  background: var(--accent-black);
  color: #ffffff;
}

.search-btn.blue:hover {
  background: var(--accent-hover);
}

.search-btn.green {
  background: var(--success);
  color: #ffffff;
}

.search-btn.green:hover {
  background: rgba(0, 200, 81, 0.9);
}

.search-btn.purple {
  background: #9c27b0;
  color: #ffffff;
}

.search-btn.purple:hover {
  background: #7b1fa2;
}

.search-btn.orange {
  background: var(--warning);
  color: #ffffff;
}

.search-btn.orange:hover {
  background: rgba(255, 187, 51, 0.9);
}

.search-btn.gray {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.search-btn.gray:hover {
  background: var(--border-color);
}

.search-code-block {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  font-family: "SF Mono", "Monaco", "Inconsolata", monospace;
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--text-primary);
  margin-top: 16px;
}

.search-section-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: 16px;
}

.search-record-item {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.search-record-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.search-record-item strong {
  color: var(--text-primary);
  font-weight: 600;
}

.search-record-item div {
  margin-bottom: 8px;
  color: var(--text-primary);
}

.search-record-item div:last-child {
  margin-bottom: 0;
}

.search-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.search-info-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-info-section h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.search-info-section div {
  color: var(--text-primary);
  font-size: 14px;
}

.search-info-section strong {
  font-weight: 600;
  color: var(--text-primary);
}

.search-space-y-4 > * + * {
  margin-top: 16px;
}

.search-space-y-3 > * + * {
  margin-top: 12px;
}

.search-mt-6 {
  margin-top: 24px;
}

.search-mt-1 {
  margin-top: 4px;
}

.search-mt-8 {
  margin-top: 32px;
}

.search-mb-2 {
  margin-bottom: 8px;
}

.search-relative {
  position: relative;
}

.search-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.search-copy-btn:hover {
  background: var(--bg-tertiary);
}

.ip-link,
.domain-link {
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.ip-link {
  color: var(--accent-black);
}

.domain-link {
  color: var(--success);
}

.ip-link:hover,
.domain-link:hover {
  text-decoration: underline;
}

/* 响应式 */
@media (max-width: 768px) {
  .search-container {
    padding: 24px 16px;
  }

  .search-result-card {
    padding: 24px;
  }

  .search-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-icon-wrapper {
    margin-bottom: 16px;
    margin-right: 0;
  }

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

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

  .search-btn {
    width: 100%;
    justify-content: center;
  }
}
