/* 提示词详情页面专用样式 */
/* 版本：v1.0 */

/* 基础设置 - 只影响detail页面的content区域 */
.detail-section {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.prompt-detail {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* 详情页面卡片样式 */
.detail-section {
    background: white;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.detail-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* 卡片头部样式 */
.detail-section-header {
    background: linear-gradient(135deg, #ff6b35 0%, #e55528 100%);
    padding: 1rem 1.5rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.detail-section-header i {
    font-size: 1.1rem;
}

.detail-section-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

/* 卡片内容样式 */
.detail-section-content {
    padding: 1.5rem;
}

/* 提示词模板展示样式 */
.template-action-btn {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 6px;
    padding: 0.5rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    backdrop-filter: blur(10px);
}

.template-action-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    color: #ff6b35;
    transform: translateY(-1px);
}

.template-stats {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
}

.template-container {
    position: relative;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.template-content {
    background: #f8fafc;
    max-height: 500px;
    overflow-y: auto;
    position: relative;
}

.template-text {
    font-family: 'Fira Code', 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #1f2937;
    padding: 1.5rem;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.empty-template {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.line-numbers {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 60px;
    background: #e2e8f0;
    border-right: 1px solid #cbd5e0;
    font-family: 'Fira Code', 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.75rem;
    color: #6b7280;
    padding: 1.5rem 0.5rem;
    box-sizing: border-box;
    overflow: hidden;
    user-select: none;
}

.line-numbers.show {
    display: block;
}

.line-numbers.show + .template-content .template-text {
    padding-left: 80px;
}

.line-number {
    display: block;
    text-align: right;
    line-height: 1.6;
    padding-right: 0.5rem;
}

.template-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: white;
    border-radius: 0;
    max-height: 100vh;
}

.template-container.fullscreen .template-content {
    max-height: calc(100vh - 120px);
}

.template-analysis {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
}

.analysis-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
}

.analysis-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.analysis-value {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
}

.analysis-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: 'Fira Code', monospace;
    color: #374151;
    margin: 0.125rem;
}

.analysis-tag.param {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
}

.analysis-tag.instruction {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.analysis-tag.role {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
}

.analysis-tag.format {
    background: #e9d5ff;
    border-color: #8b5cf6;
    color: #5b21b6;
}

/* 滚动条样式 */
.template-content::-webkit-scrollbar {
    width: 8px;
}

.template-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.template-content::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.template-content::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 参数表单样式 */
.params-form {
    max-width: 100%;
}

.param-group {
    margin-bottom: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.param-group-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.param-group-title {
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

.toggle-advanced {
    margin-left: auto;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.toggle-advanced:hover {
    background: #f3f4f6;
    color: #374151;
}

.param-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.param-row:last-child {
    border-bottom: none;
}

.param-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.param-item.full-width {
    grid-column: 1 / -1;
}

.param-label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.param-label .required {
    color: #dc2626;
    font-weight: 600;
}

.param-label .optional {
    color: #6b7280;
    font-weight: 400;
    font-size: 0.8rem;
}

.param-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: white;
}

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

.param-input:invalid {
    border-color: #dc2626;
}

.param-input:valid {
    border-color: #10b981;
}

.param-input::placeholder {
    color: #9ca3af;
    font-size: 0.875rem;
}

.param-input[type="textarea"] {
    resize: vertical;
    min-height: 60px;
}

.advanced-settings {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.advanced-settings .param-row {
    background: transparent;
}

/* 参数验证状态样式 */
.params-validation,
.params-presets {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
}

.validation-header,
.presets-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.validation-item {
    background: white;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.validation-label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.validation-status {
    font-size: 0.825rem;
}

.validation-status.success {
    color: #10b981;
}

.validation-status.error {
    color: #dc2626;
}

.validation-status.warning {
    color: #f59e0b;
}

/* 预设模板样式 */
.preset-item {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-item:hover {
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preset-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.preset-name {
    font-size: 0.875rem;
}

.preset-description {
    color: #6b7280;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* 响应式样式 */
@media (max-width: 768px) {
    .param-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .param-item.full-width {
        grid-column: 1;
    }
    
    .param-group-header {
        padding: 0.625rem;
    }
    
    .toggle-advanced {
        font-size: 0.8rem;
    }
}

/* 参数错误提示 */
.param-error {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* 加载状态 */
.param-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 参数提示 */
.param-tooltip {
    position: relative;
    display: inline-block;
}

.param-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.param-tooltip:hover::after {
    opacity: 1;
}

/* 生成按钮样式 */
.generate-button {
    background: linear-gradient(135deg, #ff6b35 0%, #e55528 100%);
    color: white;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    min-width: 200px;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.generate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.4);
}

.generate-button:active {
    transform: translateY(0);
}

.generate-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 结果展示样式 */
.result-content {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #0ea5e9;
    border-radius: 8px;
    padding: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-wrap;
    min-height: 200px;
    position: relative;
    overflow-y: auto;
    max-height: 400px;
}

.result-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #0ea5e9, #0284c7);
}

/* 结果操作按钮样式 */
.result-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.action-button {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-button:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.action-button:active {
    transform: translateY(0);
}

/* 加载动画样式 */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff6b35;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误状态样式 */
.error-state {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.error-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #f59e0b;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .w-3\/4 {
        width: 100%;
    }
    
    .w-1\/4 {
        width: 100%;
    }
    
    .sidebar-container {
        margin-top: 1rem;
    }
}

@media (max-width: 768px) {
    .detail-section-header {
        padding: 0.875rem 1rem;
    }
    
    .detail-section-content {
        padding: 1rem;
    }
    
    .params-form {
        gap: 1rem;
    }
    
    .generate-button {
        padding: 0.75rem 1.5rem;
        min-width: 150px;
    }
    
    .result-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .action-button {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .detail-section {
        margin-bottom: 1rem;
    }
    
    .detail-section-header {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .detail-section-content {
        padding: 0.75rem;
    }
    
    .template-content {
        padding: 1rem;
        font-size: 0.8rem;
    }
    
    .param-input {
        padding: 0.625rem;
    }
    
    .generate-button {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
}

/* 打印样式 */
@media print {
    .detail-section {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
    
    .detail-section-header {
        background: #f3f4f6 !important;
        color: #1f2937 !important;
    }
    
    .generate-button,
    .result-actions {
        display: none !important;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .detail-section {
        border: 2px solid #000;
    }
    
    .detail-section-header {
        background: #000 !important;
        color: #fff !important;
    }
    
    .param-input {
        border: 2px solid #000;
    }
    
    .generate-button {
        background: #000 !important;
        border: 2px solid #000;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .detail-section:hover {
        transform: none;
    }
    
    .generate-button:hover {
        transform: none;
    }
} 

/* 返回按钮和标题行优化样式 */
.prompt-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding-left: 0; /* 确保左侧无额外间距 */
}

.title-with-back {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    min-width: 0; /* 允许标题文字在必要时换行 */
}

.prompt-title-row .title-with-back .back-button {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700 !important;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    flex-shrink: 0; /* 防止按钮被压缩 */
    margin-left: 0; /* 确保贴近左边 */
}

.prompt-title-row .title-with-back .back-button:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
    transform: translateX(-2px);
}

.prompt-title-row .title-with-back .back-button i {
    font-size: 0.875rem;
}

.prompt-name {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    line-height: 1.3;
    flex: 0 0 auto; /* 不伸缩，保持原始大小 */
}

.model-badge {
    flex-shrink: 0; /* 防止模型标识被压缩 */
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    margin-left: 1rem; /* 与标题保持适当间距 */
}

/* 响应式优化 */
@media (max-width: 768px) {
    .prompt-title-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .title-with-back {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .back-button {
        align-self: flex-start;
    }
    
    .prompt-name {
        font-size: 1.5rem;
    }
    
    .model-badge {
        align-self: flex-start;
        margin-left: 0; /* 移动端不需要左边距 */
        margin-top: 0.5rem; /* 移动端添加上边距 */
    }
} 