/* ============================================
   Robots.txt Generator - Enhanced Bootstrap Styles
   配色：青绿色系 (Teal/Emerald)
   ============================================ */

/* 全局优化 */
body {
    background: linear-gradient(135deg, #f0fdfa 0%, #e0f2fe 100%);
    min-height: 100vh;
}

/* Header 白色背景 */
.header-white {
    background: white;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.header-logo {
    flex-shrink: 0;
}

.header-logo svg {
    display: block;
}

/* 卡片增强 */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-weight: 600;
    color: #1e293b;
}

/* Lucide Icons 基础样式 */
[data-lucide] {
    width: 16px;
    height: 16px;
    stroke-width: 2;
    vertical-align: middle;
}

.card-title [data-lucide] {
    width: 20px;
    height: 20px;
}

.btn [data-lucide] {
    width: 14px;
    height: 14px;
}

.empty-hint [data-lucide] {
    width: 32px;
    height: 32px;
    opacity: 0.4;
}

/* 按钮增强 */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #0d9488 0%, #059669 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0f766e 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
}

.btn-outline-primary {
    border-color: #0d9488;
    color: #0d9488;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #0d9488 0%, #059669 100%);
    border-color: transparent;
    transform: translateY(-1px);
}

.btn-outline-secondary {
    border-color: #e2e8f0;
    color: #64748b;
    background: #f8fafc;
}

.btn-outline-secondary:hover {
    background: #0d9488;
    border-color: #0d9488;
    color: white;
    transform: translateY(-1px);
}

.btn-outline-danger {
    border-color: #fecaca;
    color: #dc2626;
    background: #fef2f2;
}

.btn-outline-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

/* 模板按钮特殊样式 */
.btn-template {
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    border: 1px solid #5eead4;
    color: #0d9488;
}

.btn-template:hover {
    background: linear-gradient(135deg, #0d9488 0%, #059669 100%);
    border-color: transparent;
    color: white;
}

/* 屏蔽爬虫按钮 */
.btn-block-ua {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
    color: #dc2626;
}

.btn-block-ua:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: transparent;
    color: white;
    transform: translateY(-1px);
}

.btn-block-ua.active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    border-color: transparent !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

/* 表单元素增强 */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s;
    background-color: #fff;
}

.form-control:focus, .form-select:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
    outline: none;
}

.form-control-sm, .form-select-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

/* 规则输入行布局修复 */
.d-flex.gap-2.flex-wrap {
    align-items: stretch;
}

.d-flex.gap-2.flex-wrap .form-select,
.d-flex.gap-2.flex-wrap .form-control {
    height: auto;
}

.d-flex.gap-2.flex-wrap .btn {
    white-space: nowrap;
}

.form-check-input {
    width: 1.2em;
    height: 1.2em;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
}

.form-check-input:checked {
    background-color: #0d9488;
    border-color: #0d9488;
}

.form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
}

/* 预览代码块 - 更现代的外观 */
.preview-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #5eead4;
    padding: 20px;
    border-radius: 12px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-y: auto;
    min-height: 300px;
    max-height: 450px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid #334155;
}

.preview-content::-webkit-scrollbar {
    width: 8px;
}

.preview-content::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 4px;
}

.preview-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0d9488 0%, #059669 100%);
    border-radius: 4px;
}

/* 规则列表增强 */
.rules-list {
    max-height: 120px;
    overflow-y: auto;
}

.rules-list::-webkit-scrollbar {
    width: 6px;
}

.rules-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.rule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid #e2e8f0;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.rule-item:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    transform: translateX(2px);
}

.rule-item:last-child {
    margin-bottom: 0;
}

.rule-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.rule-ua {
    font-weight: 600;
    color: #0d9488;
    font-size: 0.75rem;
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #5eead4;
}

.rule-ua [data-lucide] {
    width: 12px;
    height: 12px;
}

.rule-type {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rule-type.allow {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border: 1px solid #86efac;
}

.rule-type.disallow {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.rule-path {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #475569;
    word-break: break-all;
}

.rule-delete {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.2s;
}

.rule-delete:hover {
    background: #fee2e2;
    transform: scale(1.1);
}

.rule-delete [data-lucide] {
    width: 14px;
    height: 14px;
}

/* 空状态提示 */
.empty-hint {
    border: 2px dashed #cbd5e1 !important;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border-radius: 12px !important;
}

/* Toast 增强 */
.toast {
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.toast.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.toast.bg-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

.toast.bg-dark {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
}

/* Footer 增强 */
footer .card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

footer [data-lucide] {
    color: #0d9488;
}

/* 文字颜色优化 */
.text-primary {
    color: #0d9488 !important;
}

.text-muted {
    color: #94a3b8 !important;
}

/* 标签样式优化 */
.form-label {
    color: #475569;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-label [data-lucide] {
    color: #0d9488;
}

/* 响应式调整 */
@media (max-width: 991.98px) {
    .header-white {
        flex-direction: column !important;
        text-align: center;
    }
    
    .header-white .text-start {
        text-align: center !important;
    }
    
    .preview-content {
        min-height: 220px;
        max-height: 320px;
    }
}

@media (max-width: 575.98px) {
    .header-logo svg {
        width: 48px;
        height: 48px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-sm {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.3s ease-out;
}


/* 友情链接样式 */
footer a {
    color: #0d9488;
    transition: color 0.2s;
}

footer a:hover {
    color: #059669;
}
