/**
 * 朕已阅 - 统一样式表
 * @author winma
 * @version 1.0
 */

/* ==================== 公共样式 ==================== */

/* CSS 变量定义 */
:root {
    --zyy-imperial-yellow: #FFD700;
    --zyy-imperial-yellow-light: #FFE44D;
    --zyy-imperial-yellow-dark: #E5C100;
}

/* 基础样式 */
* {
    font-family: 'Noto Sans SC', sans-serif;
}

/* 帝国黄背景 - 兼容 Tailwind 类名 */
.bg-imperial,
.zyy-bg-imperial { 
    background-color: var(--zyy-imperial-yellow); 
}

.bg-imperial-light,
.zyy-bg-imperial-light { 
    background-color: var(--zyy-imperial-yellow-light); 
}

.bg-imperial-dark,
.zyy-bg-imperial-dark { 
    background-color: var(--zyy-imperial-yellow-dark); 
}

/* 帝国黄文字 - 兼容 Tailwind 类名 */
.text-imperial,
.zyy-text-imperial { 
    color: var(--zyy-imperial-yellow); 
}

.text-imperial-dark,
.zyy-text-imperial-dark { 
    color: var(--zyy-imperial-yellow-dark); 
}

/* 帝国黄边框 - 兼容 Tailwind 类名 */
.border-imperial,
.zyy-border-imperial { 
    border-color: var(--zyy-imperial-yellow); 
}

/* 悬停状态 */
.hover\:bg-imperial:hover,
.hover\:bg-imperial-dark:hover {
    background-color: var(--zyy-imperial-yellow-dark);
}

.hover\:text-imperial:hover {
    color: var(--zyy-imperial-yellow);
}

.focus\:border-imperial:focus,
.focus\:border-imperial-dark:focus {
    border-color: var(--zyy-imperial-yellow-dark);
}

/* 加载动画 */
@keyframes zyy-loading {
    0% { width: 0%; }
    100% { width: 100%; }
}

.zyy-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--zyy-imperial-yellow), var(--zyy-imperial-yellow-light));
    animation: zyy-loading 1.5s ease-in-out;
    z-index: 1000;
}

/* 自定义滚动条 */
.zyy-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.zyy-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.zyy-scrollbar::-webkit-scrollbar-thumb {
    background: var(--zyy-imperial-yellow);
    border-radius: 3px;
}

.zyy-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--zyy-imperial-yellow-dark);
}

/* 模态框动画 */
@keyframes zyy-modal-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.zyy-modal-enter {
    animation: zyy-modal-in 0.3s ease-out;
}

/* iframe 容器 - 兼容旧类名 */
.iframe-container,
.zyy-iframe-container {
    position: relative;
    width: 100%;
    flex: 1;
    overflow: hidden;
}

.iframe-container iframe,
.zyy-iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ==================== 首页样式 ==================== */

/* 左侧导航项 */
.zyy_idx-nav-item {
    transition: all 0.2s ease;
}

.zyy_idx-nav-item:hover {
    transform: translateX(4px);
}

.zyy_idx-nav-item.active {
    background: linear-gradient(135deg, var(--zyy-imperial-yellow-light), var(--zyy-imperial-yellow));
    color: #1a1a1a;
    font-weight: 500;
}

/* 网站列表项 */
.zyy_idx-website-item {
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.zyy_idx-website-item:hover {
    background-color: #fef9e7;
    border-left-color: var(--zyy-imperial-yellow);
}

.zyy_idx-website-item.active {
    background-color: #fff9c4;
    border-left-color: var(--zyy-imperial-yellow-dark);
    font-weight: 500;
}

/* 浮层工具栏 */
.zyy_idx-floating-toolbar {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.zyy_idx-floating-toolbar .zyy_idx-subpage-btn {
    transition: all 0.2s ease;
}

.zyy_idx-floating-toolbar .zyy_idx-subpage-btn:hover {
    background-color: var(--zyy-imperial-yellow);
    color: #1a1a1a;
}

/* ==================== 用户管理页样式 ==================== */

/* 左侧导航项 */
.zyy_user-nav-item {
    transition: all 0.2s ease;
}

.zyy_user-nav-item:hover {
    transform: translateX(4px);
}

.zyy_user-nav-item.active {
    background: linear-gradient(135deg, var(--zyy-imperial-yellow-light), var(--zyy-imperial-yellow));
    color: #1a1a1a;
    font-weight: 500;
}

/* 网站卡片 */
.zyy_user-site-card {
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.zyy_user-site-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.15);
    border-color: var(--zyy-imperial-yellow);
}

/* 拖拽样式 */
.zyy_user-draggable-item {
    cursor: move;
    transition: all 0.2s ease;
}

.zyy_user-draggable-item:hover {
    transform: translateX(2px);
}

.zyy_user-draggable-item.dragging {
    opacity: 0.5;
}

.zyy_user-drag-over {
    background-color: #fef9e7 !important;
    border-left: 3px solid var(--zyy-imperial-yellow) !important;
}

/* 拖拽排序样式 */
.sortable-ghost {
    opacity: 0.4;
    background: #f0f0f0;
}

.sortable-chosen {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.zyy-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    min-width: 300px;
    max-width: 500px;
    padding: 12px 24px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: fadeInOut 1.5s ease;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* ==================== 后台管理页样式 ==================== */

/* 表格行悬停效果 */
.zyy_admin-table-row-hover:hover {
    background-color: #fef9e7;
}

/* 选中状态 */
.zyy_admin-selected-row {
    background-color: #fff9c4 !important;
}

/* 激活的筛选按钮 */
.zyy_admin-filter-btn.active {
    background-color: var(--zyy-imperial-yellow);
    color: #1a1a1a;
    font-weight: 500;
}

/* ==================== 浏览记录页样式 ==================== */

/* 统计卡片 */
.zyy_history-stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.zyy_history-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2);
}

/* 激活的筛选按钮 */
.zyy_history-filter-btn.active {
    background-color: var(--zyy-imperial-yellow);
    color: #1a1a1a;
    font-weight: 500;
}

/* 排名项 */
.zyy_history-ranking-item {
    transition: all 0.2s ease;
}

.zyy_history-ranking-item:hover {
    background-color: #fef9e7;
}

/* 前三名特殊样式 */
.zyy_history-ranking-item.top-1 {
    background: linear-gradient(135deg, #FFD700, #FFE44D);
    color: #1a1a1a;
    font-weight: 600;
}

.zyy_history-ranking-item.top-2 {
    background: linear-gradient(135deg, #C0C0C0, #D3D3D3);
    color: #1a1a1a;
    font-weight: 600;
}

.zyy_history-ranking-item.top-3 {
    background: linear-gradient(135deg, #CD7F32, #E6A86C);
    color: #1a1a1a;
    font-weight: 600;
}

/* ==================== 信息速递页样式 ==================== */

/* 顶部菜单 */
.zyy_read-top-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    background: linear-gradient(90deg, #2b6ef6, #7b61ff);
    color: #fff;
    box-shadow: 0 2px 8px rgba(43, 62, 85, 0.08);
}

.zyy_read-top-menu .header.item {
    color: #fff;
    font-weight: 600;
}

/* 左侧面板 */
.zyy_read-left-pane {
    height: calc(100vh - 3.5rem);
    overflow-y: auto;
    background: #ffffff;
    border-right: 1px solid rgba(34, 36, 38, 0.06);
    box-shadow: 2px 0 12px rgba(34, 36, 38, 0.03);
}

/* 右侧面板 */
.zyy_read-right-pane {
    height: calc(100vh - 3.5rem);
    padding: 1rem;
}

/* 站点项 */
.zyy_read-site-item {
    cursor: pointer;
    padding: 0.6rem;
    border-radius: 6px;
}

.zyy_read-site-item.active,
.zyy_read-site-item:hover {
    background: rgba(43, 110, 246, 0.04);
}

.zyy_read-site-item .header {
    font-weight: 600;
}

.zyy_read-site-item .description {
    color: #6b7785;
    font-size: 0.86rem;
}

/* iframe容器 */
.zyy_read-iframe-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
}

.zyy_read-iframe-wrap.loading {
    border-top: 4px solid #ffd700;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
}

.zyy_read-iframe-full {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* 手机模拟容器 */
.zyy_read-iframe-mobile {
    width: 375px;
    height: 812px;
    border: 1px solid #e6eefc;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(46, 61, 73, 0.08);
}

.zyy_read-iframe-mobile .zyy_read-iframe-full {
    width: 375px;
    height: 812px;
}

/* 分类按钮 */
.zyy_read-category-btn {
    color: #fff !important;
    border-radius: 20px !important;
    box-shadow: 0 2px 6px rgba(34, 36, 38, 0.06);
}

.zyy_read-category-btn.active {
    box-shadow: 0 6px 18px rgba(11, 84, 166, 0.18);
    transform: translateY(-1px);
}

/* 加载和错误覆盖层 */
.zyy_read-loading-overlay,
.zyy_read-error-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    display: none;
}

.zyy_read-error-message {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.zyy_read-error-message i {
    font-size: 48px;
    color: #ff6b6b;
    margin-bottom: 15px;
    display: block;
}

/* ==================== AI会话页样式 ==================== */

/* 会话容器 */
.zyy_chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #f8fafc;
}

/* 顶部工具栏 */
.zyy_chat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.zyy_chat-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.zyy_chat-new-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--zyy-imperial-yellow);
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zyy_chat-new-btn:hover {
    background: var(--zyy-imperial-yellow-dark);
    transform: translateY(-1px);
}

.zyy_chat-toolbar-right {
    width: 100px;
}

/* 消息区域 */
.zyy_chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* 欢迎消息 */
.zyy_chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px 20px;
}

.zyy_chat-welcome-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--zyy-imperial-yellow-light), var(--zyy-imperial-yellow));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.zyy_chat-welcome-icon i {
    font-size: 36px;
    color: #1a1a1a;
}

.zyy_chat-welcome h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 10px 0;
}

.zyy_chat-welcome p {
    font-size: 15px;
    color: #6b7280;
    margin: 0 0 30px 0;
}

/* 预设案例 */
.zyy_chat-presets {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
    width: 100%;
}

.zyy_chat-preset-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.zyy_chat-preset-item:hover {
    border-color: var(--zyy-imperial-yellow);
    background: #fffbeb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.15);
}

.zyy_chat-preset-item i {
    font-size: 18px;
    color: var(--zyy-imperial-yellow-dark);
    flex-shrink: 0;
}

.zyy_chat-preset-item span {
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
}

/* 消息样式 */
.zyy_chat-message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    max-width: 85%;
}

.zyy_chat-message-user {
    margin-left: auto;
    flex-direction: row-reverse;
}

.zyy_chat-message-ai {
    margin-right: auto;
}

.zyy_chat-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.zyy_chat-message-user .zyy_chat-message-avatar {
    background: #e5e7eb;
    color: #6b7280;
}

.zyy_chat-message-ai .zyy_chat-message-avatar {
    background: linear-gradient(135deg, var(--zyy-imperial-yellow-light), var(--zyy-imperial-yellow));
    color: #1a1a1a;
}

.zyy_chat-message-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}

.zyy_chat-message-user .zyy_chat-message-content {
    background: var(--zyy-imperial-yellow);
    color: #1a1a1a;
    border-bottom-right-radius: 4px;
}

.zyy_chat-message-ai .zyy_chat-message-content {
    background: #fff;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.zyy_chat-message-content pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 10px 0;
}

.zyy_chat-message-content code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
}

.zyy_chat-message-content pre code {
    background: transparent;
    padding: 0;
}

.zyy_chat-message-content strong {
    font-weight: 600;
}

/* 打字动画 */
.zyy_chat-typing {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.zyy_chat-typing span {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: zyy_chat-typing-bounce 1.4s infinite ease-in-out both;
}

.zyy_chat-typing span:nth-child(1) {
    animation-delay: -0.32s;
}

.zyy_chat-typing span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes zyy_chat-typing-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* 输入区域 */
.zyy_chat-input-area {
    padding: 16px 20px 20px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.zyy_chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: #f3f4f6;
    border-radius: 16px;
    padding: 8px 8px 8px 16px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.zyy_chat-input-wrapper:focus-within {
    border-color: var(--zyy-imperial-yellow);
    background: #fff;
}

.zyy_chat-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    line-height: 1.5;
    resize: none;
    outline: none;
    max-height: 150px;
    padding: 6px 0;
}

.zyy_chat-input::placeholder {
    color: #9ca3af;
}

.zyy_chat-send-btn {
    width: 40px;
    height: 40px;
    background: var(--zyy-imperial-yellow);
    color: #1a1a1a;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.zyy_chat-send-btn:hover:not(:disabled) {
    background: var(--zyy-imperial-yellow-dark);
    transform: scale(1.05);
}

.zyy_chat-send-btn:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.zyy_chat-input-hint {
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 8px;
}

/* 响应式适配 */
@media (max-width: 640px) {
    .zyy_chat-message {
        max-width: 95%;
    }
    
    .zyy_chat-welcome h2 {
        font-size: 20px;
    }
    
    .zyy_chat-preset-item {
        padding: 12px 14px;
    }
    
    .zyy_chat-preset-item span {
        font-size: 13px;
    }
}
.zyy_chat-history-panel {
        position: absolute;
        top: 60px;
        left: 10px;
        width: 320px;
        max-height: calc(100% - 80px);
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.15);
        z-index: 100;
        display: none;
        overflow: hidden;
    }
    
    .zyy_chat-history-panel.active {
        display: block;
    }
    
    .zyy_chat-history-header {
        padding: 16px;
        border-bottom: 1px solid #e5e7eb;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .zyy_chat-history-header h3 {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
        color: #1f2937;
    }
    
    .zyy_chat-history-close {
        background: none;
        border: none;
        font-size: 20px;
        color: #6b7280;
        cursor: pointer;
        padding: 4px;
    }
    
    .zyy_chat-history-close:hover {
        color: #1f2937;
    }
    
    .zyy_chat-history-list {
        max-height: 400px;
        overflow-y: auto;
    }
    
    .zyy_chat-history-item {
        padding: 12px 16px;
        border-bottom: 1px solid #f3f4f6;
        cursor: pointer;
        transition: background-color 0.2s;
    }
    
    .zyy_chat-history-item:hover {
        background-color: #f9fafb;
    }
    
    .zyy_chat-history-item.active {
        background-color: #eff6ff;
    }
    
    .zyy_chat-history-title {
        font-size: 14px;
        color: #1f2937;
        margin-bottom: 4px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .zyy_chat-history-time {
        font-size: 12px;
        color: #9ca3af;
    }
    
    .zyy_chat-history-empty {
        padding: 40px 16px;
        text-align: center;
        color: #9ca3af;
    }
    
    .zyy_chat-message-avatar img {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        object-fit: cover;
    }
