/*
Theme Name: 123
*/

/* Additional Glass Morphism Effects */
.glass-hover {
    transition: all 0.3s ease;
}

.glass-hover:hover {
    background: rgba(255, 255, 255, 0.35) !important;
    transform: translateY(-3px);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.2);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection Colors */
::selection {
    background: rgba(110, 142, 251, 0.3);
    color: #fff;
}

::-moz-selection {
    background: rgba(110, 142, 251, 0.3);
    color: #fff;
}

/* Article Typography */
article p {
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

article h2,
article h3,
article h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

article h2 {
    font-size: 1.75rem;
}

article h3 {
    font-size: 1.5rem;
}

article h4 {
    font-size: 1.25rem;
}

/* Blockquote Styling */
blockquote {
    border-left: 4px solid rgba(110, 142, 251, 0.5);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 8px;
}

/* Code Blocks */
pre {
    background: rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Lists in Articles */
article ul,
article ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

article li {
    margin-bottom: 0.5rem;
}

/* Tables */
table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
    background: var(--glass-bg);
    border-radius: 8px;
    overflow: hidden;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
    background: rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(110, 142, 251, 0.5);
    box-shadow: 0 0 0 3px rgba(110, 142, 251, 0.1);
}

/* Buttons */
button,
input[type="submit"],
input[type="button"],
.btn {
    padding: 0.75rem 1.5rem;
    background: rgba(110, 142, 251, 0.3);
    border: 1px solid rgba(110, 142, 251, 0.5);
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.btn:hover {
    background: rgba(110, 142, 251, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(110, 142, 251, 0.3);
}

/* Comments Section */
.comment-list {
    list-style: none;
    padding: 0;
}

.comment {
    background: var(--glass-bg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.comment-author {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.comment-meta {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1rem;
}

/* Search Form */
.search-form {
    position: relative;
}

.search-form input[type="search"] {
    padding-right: 3rem;
}

.search-form button {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    padding: 0 1rem;
    background: transparent;
    border: none;
    color: #666;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Accessibility */
.screen-reader-text {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Print Styles */
@media print {
    .navbar,
    .sidebar,
    .footer-glass,
    .pagination {
        display: none !important;
    }
    
    .glass {
        background: #fff !important;
        box-shadow: none !important;
    }
    
    body {
        background: #fff !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --glass-bg: rgba(0, 0, 0, 0.3);
        --glass-border: rgba(255, 255, 255, 0.1);
        --glass-shadow: rgba(0, 0, 0, 0.5);
    }
    
    body {
        background: linear-gradient(135deg, #1a1a2e, #16213e);
        color: #e0e0e0;
    }
    
    .text-dark {
        color: #e0e0e0 !important;
    }
    
    .navbar-light {
        background: rgba(0, 0, 0, 0.4) !important;
    }
    
    input,
    textarea,
    select {
        background: rgba(0, 0, 0, 0.3);
        color: #e0e0e0;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .glass {
        margin-bottom: 1rem;
    }
    
    article {
        padding: 1.5rem !important;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utilities */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.shadow-lg {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.rounded-lg {
    border-radius: 12px;
}

/* Error 404 Page */
.error-404 {
    text-align: center;
    padding: 5rem 0;
}

.error-404 h1 {
    font-size: 6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (min-width: 992px) {

  ul.navbar-nav.ms-auto>*:nth-child(n+6) {
    display: none;
  }
}

.card-text {
  /* 设置行高，用于计算高度 */
  line-height: 1.5;

  /* 固定高度为3行文字的高度 */
  height: 4.5em;
  /* 3 * 1.5 = 4.5em */

  /* 限制最多显示3行 */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;

  /* 超出部分隐藏 */
  overflow: hidden;

  /* 文字超出时显示省略号 */
  text-overflow: ellipsis;

  /* 确保文字换行 */
  word-wrap: break-word;
  word-break: break-word;
}

h2.card-title.h5,ul.list-unstyled > li.mb-3.d-flex{
  /* 强制单行显示 */
  white-space: nowrap;

  /* 超出部分隐藏 */
  overflow: hidden;

  /* 显示省略号 */
  text-overflow: ellipsis;

  /* 移除文本装饰（如下划线） */
  text-decoration: none;
}

a{
    text-decoration: none;
}

ul.list-unstyled > li.mb-3.d-flex > a{
    color: #e0e0e0;
    text-decoration: none;
}

img.card-img-top {
  /* 设置容器长宽比为1:2 */
  aspect-ratio: 2/1;
  
  /* 设置图片填充方式，保持比例并裁剪 */
  object-fit: cover;
  
  /* 确保图片居中显示，这样裁剪时会保留中间部分 */
  object-position: center;
  
  /* 确保图片填满整个容器 */
  width: 100%;
  height: 100%;
  
  /* 防止图片超出容器 */
  overflow: hidden;
  display: block;
}

/* 默认手机样式 - 最大宽度100% */
figure.wp-block-image >img {
  max-width: 100%;
}

/* 平板设备 - 最小宽度768px */
@media (min-width: 768px) {
  figure.wp-block-image >img {
    max-width: 66%;
  }
}

/* 电脑设备 - 最小宽度992px */
@media (min-width: 992px) {
  figure.wp-block-image >img {
    max-width: 33%;
  }
}

span.pseudo-H3 {
  /* 显示为块级元素 */
  display: block;

  /* 字体大小 - h3 的默认大小 */
  font-size: 1.17em;

  /* 字体粗细 */
  font-weight: bold;

  /* 外边距 - 匹配 h3 的默认边距 */
  margin-top: 1em;
  margin-bottom: 1em;
  margin-left: 0;
  margin-right: 0;

  /* 行高 */
  line-height: normal;

  /* 继承字体 */
  font-family: inherit;

  /* 文本颜色继承 */
  color: inherit;
}

/* 当 pseudo-H3 是第一个子元素时，移除顶部边距 */
span.pseudo-H3:first-child {
  margin-top: 0;
}
