/* SOPAN 核心样式 - 基于code.html内联样式提取 */

/* CSS变量系统 - 双主题支持 */
:root {
    --background: #f4f5f7;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --card-background: #ffffff;
    --border-color: #e5e7eb;
    --link-color: #2563eb;
    --link-hover-color: #1d4ed8;
    --button-report: #ef4444;
    --button-report-hover: #dc2626;
    --green-text: #16a34a;
    --header-text: #1f2937;
    --active-tab-border: #2563eb;
    --active-tab-text: #2563eb;
    --search-icon: #9ca3af;
    --button-bg: #ffffff;
    --button-text: #1f2937;
    --button-hover-bg: #f9fafb;
}

.dark {
    --background: #111827;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --card-background: #1f2937;
    --border-color: #374151;
    --link-color: #60a5fa;
    --link-hover-color: #3b82f6;
    --button-report: #f87171;
    --button-report-hover: #ef4444;
    --green-text: #4ade80;
    --header-text: #f9fafb;
    --active-tab-border: #60a5fa;
    --active-tab-text: #60a5fa;
    --search-icon: #6b7280;
    --button-bg: #1f2937;
    --button-text: #f9fafb;
    --button-hover-bg: #374151;
}

/* 基础样式 */
body {
    color: var(--text-primary);
    /* 确保body占满整个视口 */
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.light body {
    background-image: linear-gradient(to bottom, 
        #fafbff 0%, 
        #f5f6ff 25%, 
        #efefff 50%, 
        #e7e7fb 75%, 
        #e6e6f7 100%);
    /* 确保渐变背景固定且覆盖整个页面 */
    background-attachment: fixed;
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

.dark body {
    background-image: linear-gradient(to bottom, 
        #000000 0%, 
        #0f172a 25%, 
        #1e293b 50%, 
        #273344 75%, 
        #2f3947 100%);
    /* 确保渐变背景固定且覆盖整个页面 */
    background-attachment: fixed;
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

/* Logo相关样式 */
.logo-container {
    transition: all 0.3s ease;
}

.logo-container img {
    transition: opacity 0.3s ease;
}

.logo-container a:hover {
    opacity: 0.8;
}

/* 桌面端Logo高度增强 */
@media (min-width: 769px) {
    /* 搜索页面Logo高度从h-8(32px)增加到h-10(40px) */
    .logo-container .h-8 {
        height: 2.5rem !important; /* 40px */
    }
    
    /* 首页Logo高度从h-16(64px)增加到h-20(80px) */
    .logo-container .h-16 {
        height: 5rem !important; /* 80px */
    }
}

/* 响应式Logo样式 */
@media (max-width: 768px) {
    .logo-container img {
        max-width: 240px;
        height: 3.5rem; /* 增加到3.5rem (56px)，与平板端更协调 */
    }
    
    .logo-container h1 {
        font-size: 2rem; /* 增加到2rem，与图片Logo协调 */
        line-height: 2.25rem;
    }
}

@media (max-width: 480px) {
    .logo-container img {
        max-width: 200px;
        height: 3rem; /* 增加到3rem (48px)，保持合理比例 */
    }
    
    .logo-container h1 {
        font-size: 1.75rem; /* 增加到1.75rem，保持协调 */
        line-height: 2rem;
    }
}

/* 搜索框样式优化 */
.search-input {
    width: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1) !important;
    border-radius: 22px !important;
    transition: box-shadow 0.3s ease;
    border: 1px solid #e2e8f0 !important;
    background-color: var(--card-background);
}

.search-input:focus {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    outline: none !important;
}

.search-input:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
    border-color: #cbd5e1 !important;
}

/* 搜索框与Logo间距 */
.search-spacing {
    margin-left: 2rem;
    min-width: 400px;
    width: 500px;
    max-width: 600px;
}

/* 暗黑主题下的搜索框样式 */
.dark .search-input {
    border: 1px solid #374151 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3) !important;
    background-color: var(--card-background);
}

.dark .search-input:focus {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

.dark .search-input:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35) !important;
    border-color: #4b5563 !important;
}

/* 暗黑主题下的Logo样式调整 */
.dark .logo-container img {
    filter: brightness(0.9);
}

.dark .logo-container a:hover {
    opacity: 0.7;
}

/* 工具类样式 */
.bg-card { 
    background-color: var(--card-background); 
}

.text-primary { 
    color: var(--text-primary); 
}

.text-secondary { 
    color: var(--text-secondary); 
}

.border-default { 
    border-color: var(--border-color); 
}

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

.link:hover { 
    color: var(--link-hover-color); 
}

/* 热搜标签样式 - 深浅色主题适配 */
.hot-search-tag {
    background-color: var(--card-background);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.hot-search-tag:hover {
    background-color: var(--button-hover-bg);
    color: var(--text-primary);
}

.text-header { 
    color: var(--header-text); 
}

.search-icon { 
    color: var(--search-icon); 
}

.input-bg { 
    background-color: var(--card-background); 
    border-color: var(--border-color); 
}

.input-focus:focus { 
    ring-color: var(--link-color); 
}

.report-button { 
    color: var(--button-report); 
}

.report-button:hover { 
    color: var(--button-report-hover); 
}

.active-tab { 
    color: var(--active-tab-text); 
    border-color: var(--active-tab-border); 
}

.result-count { 
    color: var(--text-primary); 
}

.list-hover {
    border-left: 1px solid transparent; /* 透明边框占位 */
    border-right: 1px solid transparent; /* 透明边框占位 */
}

.list-hover:hover { 
    background-color: rgba(59, 130, 246, 0.08); /* 优雅的蓝色半透明背景 */
    border-left: 1px solid rgba(59, 130, 246, 0.2); /* 左侧边框 */
    border-right: 1px solid rgba(59, 130, 246, 0.2); /* 右侧边框 */
}

.divide-color { 
    border-color: var(--border-color); 
}

.text-green { 
    color: var(--green-text); 
}

.rank-number-muted { 
    background-color: #e5e7eb; 
    color: #4b5563; 
}

.dark .rank-number-muted { 
    background-color: #4b5563; 
    color: #d1d5db; 
}

.button-theme {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: 1px solid var(--border-color);
}

.button-theme:hover {
    background-color: var(--button-hover-bg);
}

/* 深色模式下增强按钮可见性 */
.dark .button-theme {
    background-color: #374151;
    border: 1px solid #4b5563;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dark .button-theme:hover {
    background-color: #4b5563;
    border-color: #6b7280;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
}

/* 增大右下角按钮中的图标尺寸 */
.button-theme i {
    font-size: 1.125rem; /* 18px，从默认的16px增大 */
}

/* 在更大屏幕上进一步增大图标 */
@media (min-width: 768px) {
    .button-theme i {
        font-size: 1.25rem; /* 20px */
    }
}

/* 特殊比例样式 */
.aspect-3-1 {
    aspect-ratio: 3 / 1;
}

/* 滚动条隐藏 */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 动画相关 */
.animate-spin {
    animation: spin 1s linear infinite;
}

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

/* 边框工具 */
.border-3 {
    border-width: 3px;
}

/* 阴影效果 */
.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 圆角 */
.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-full {
    border-radius: 9999px;
}

/* 间距 */
.space-y-2\.5 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.625rem;
}

.space-y-4 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 1rem;
}

.gap-x-4 {
    column-gap: 1rem;
}

.gap-y-2 {
    row-gap: 0.5rem;
}

.gap-x-6 {
    column-gap: 1.5rem;
}

.gap-y-4 {
    row-gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-2 {
    gap: 0.5rem;
}

/* 布局相关 */
.container {
    width: 100%;
}

@media (min-width: 640px) {
    .container {
        max-width: 640px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
}

@media (min-width: 1536px) {
    .container {
        max-width: 1536px;
    }
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* Flexbox 布局 */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-row {
    flex-direction: row;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.justify-start {
    justify-content: flex-start;
}

.flex-grow {
    flex-grow: 1;
}

.flex-1 {
    flex: 1 1 0%;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

/* 宽度和高度 */
.w-full {
    width: 100%;
}

.w-auto {
    width: auto;
}

.w-1\/3 {
    width: 33.333333%;
}

.w-2\/3 {
    width: 66.666667%;
}

.w-4 {
    width: 1rem;
}

.w-6 {
    width: 1.5rem;
}

.w-8 {
    width: 2rem;
}

.w-10 {
    width: 2.5rem;
}

.w-12 {
    width: 3rem;
}

.w-16 {
    width: 4rem;
}

.h-4 {
    height: 1rem;
}

.h-6 {
    height: 1.5rem;
}

.h-8 {
    height: 2rem;
}

.h-10 {
    height: 2.5rem;
}

.h-12 {
    height: 3rem;
}

.h-16 {
    height: 4rem;
}

.h-auto {
    height: auto;
}

.min-h-screen {
    min-height: 100vh;
}

.max-w-xl {
    max-width: 36rem;
}

.max-w-2xl {
    max-width: 42rem;
}

/* 内边距 */
.p-4 {
    padding: 1rem;
}

.p-12 {
    padding: 3rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.py-6 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.pl-4 {
    padding-left: 1rem;
}

.pl-6 {
    padding-left: 1.5rem;
}

.pr-10 {
    padding-right: 2.5rem;
}

.pr-14 {
    padding-right: 3.5rem;
}

.pb-1 {
    padding-bottom: 0.25rem;
}

.pb-2 {
    padding-bottom: 0.5rem;
}

/* 外边距 */
.m-0 {
    margin: 0;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.ml-1 {
    margin-left: 0.25rem;
}

.ml-3 {
    margin-left: 0.75rem;
}

.ml-4 {
    margin-left: 1rem;
}

.ml-auto {
    margin-left: auto;
}

.mr-1\.5 {
    margin-right: 0.375rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-8 {
    margin-top: 2rem;
}

.mt-auto {
    margin-top: auto;
}

/* 定位 */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.top-1\/2 {
    top: 50%;
}

.right-3 {
    right: 0.75rem;
}

.right-8 {
    right: 2rem;
}

.bottom-8 {
    bottom: 2rem;
}

.-translate-y-1\/2 {
    transform: translateY(-50%);
}

/* 文本样式 */
.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-base {
    font-size: 1rem;
    line-height: 1.5rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.text-6xl {
    font-size: 3.75rem;
    line-height: 1;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.font-sans {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.whitespace-nowrap {
    white-space: nowrap;
}

.break-words {
    overflow-wrap: break-word;
}

.break-all {
    word-break: break-all;
}

/* 边框 */
.border {
    border-width: 1px;
}

.border-b {
    border-bottom-width: 1px;
}

.border-b-2 {
    border-bottom-width: 2px;
}

.border-t {
    border-top-width: 1px;
}

.divide-y > :not([hidden]) ~ :not([hidden]) {
    border-top-width: 1px;
}

/* 显示控制 */
.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.hidden {
    display: none;
}

/* 溢出控制 */
.overflow-hidden {
    overflow: hidden;
}

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

.overflow-y-auto {
    overflow-y: auto;
}

/* 对象适应 */
.object-cover {
    object-fit: cover;
}

/* 光标 */
.cursor-pointer {
    cursor: pointer;
}

/* 过渡效果 */
.transition-colors {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-opacity {
    transition-property: opacity;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* 焦点样式 */
.focus\:outline-none:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.focus\:ring-2:focus {
    --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
    --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
    box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}

/* 悬停效果 */
.hover\:underline:hover {
    text-decoration-line: underline;
}

.hover\:bg-blue-600:hover {
    background-color: #2563eb;
}

/* 背景颜色 */
.bg-white {
    background-color: #ffffff;
}

.bg-gray-100 {
    background-color: #f3f4f6;
}

.bg-gray-600 {
    background-color: #4b5563;
}

.bg-gray-900 {
    background-color: #111827;
}

.bg-blue-50 {
    background-color: #eff6ff;
}

.bg-blue-500 {
    background-color: #3b82f6;
}

.bg-red-500 {
    background-color: #ef4444;
}

.bg-orange-500 {
    background-color: #f97316;
}

.bg-yellow-500 {
    background-color: #eab308;
}

/* 文本颜色 */
.text-white {
    color: #ffffff;
}

.text-gray-400 {
    color: #9ca3af;
}

.text-gray-500 {
    color: #6b7280;
}

.text-gray-600 {
    color: #4b5563;
}

/* Z-index */
.z-10 {
    z-index: 10;
}

.z-50 {
    z-index: 50;
}

/* 特定组件样式 */
.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* 反馈和举报模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--card-background);
    border-radius: 0.5rem;
    padding: 1.5rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    margin-bottom: 1.5rem;
}

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

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.btn-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}

.btn-secondary {
    background-color: var(--card-background);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--button-hover-bg);
}

.btn-danger {
    background-color: #ef4444;
    color: white;
    border-color: #ef4444;
}

.btn-danger:hover {
    background-color: #dc2626;
    border-color: #dc2626;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background-color: var(--card-background);
    color: var(--text-primary);
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.char-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: right;
    margin-top: 0.25rem;
}

/* 消息提示样式 */
.message-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-width: 300px;
    word-wrap: break-word;
}

.message-toast.show {
    transform: translateX(0);
}

.message-toast.success {
    background-color: #10b981;
}

.message-toast.error {
    background-color: #ef4444;
}

.message-toast.info {
    background-color: #3b82f6;
}

/* 响应式设计 */
@media (max-width: 640px) {
    .modal-content {
        padding: 1rem;
        width: 95%;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn {
        width: 100%;
    }
    
    .message-toast {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100%);
    }
    
    .message-toast.show {
        transform: translateY(0);
    }
}