/* ==========================================
   AI 技巧文 - 樣式
   ========================================== */

/* Hero */
.aitips-hero {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
    padding: 120px 0 60px;
    text-align: center;
    color: white;
}

.aitips-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #C4B5FD;
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.aitips-hero-content h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 900;
    margin-bottom: 16px;
}

.aitips-hero-content p {
    font-size: 1.05rem;
    opacity: 0.8;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Main */
.aitips-main {
    padding: 60px 0 100px;
    background: #F5F3FF;
    min-height: 60vh;
}

/* Toolbar */
.aitips-toolbar {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.aitips-search-wrap {
    flex: 1;
    min-width: 260px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 1.5px solid #DDD6FE;
    border-radius: 50px;
    padding: 10px 20px;
}

.aitips-search-wrap i {
    color: #8B5CF6;
    flex-shrink: 0;
}

.aitips-search-wrap input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.95rem;
    font-family: inherit;
    color: #374151;
    background: transparent;
}

/* Tag Filter */
.aitips-tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    min-height: 10px;
}

.aitips-tag-btn {
    background: white;
    border: 1.5px solid #DDD6FE;
    color: #6B7280;
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aitips-tag-btn:hover, .aitips-tag-btn.active {
    background: #8B5CF6;
    border-color: #8B5CF6;
    color: white;
}

/* Posts Grid */
.aitips-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.aitips-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: #9CA3AF;
    font-size: 1rem;
}

.aitips-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #9CA3AF;
}

.aitips-empty i {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
    color: #DDD6FE;
}

/* Post Card */
.aitips-post-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #EDE9FE;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.aitips-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.15);
    border-color: #8B5CF6;
}

.aitips-post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 10px;
}

.aitips-post-date {
    font-size: 0.75rem;
    color: #9CA3AF;
    white-space: nowrap;
}

.aitips-post-delete {
    background: none;
    border: none;
    color: #D1D5DB;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.aitips-post-delete:hover {
    color: #EF4444;
    background: #FEE2E2;
}

.aitips-post-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 8px;
    line-height: 1.4;
}

.aitips-post-url {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #8B5CF6;
    text-decoration: none;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.aitips-post-url:hover {
    color: #6D28D9;
    text-decoration: underline;
}

.aitips-post-content {
    font-size: 0.88rem;
    color: #6B7280;
    line-height: 1.6;
    flex: 1;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aitips-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.aitips-post-tag {
    background: #F5F3FF;
    color: #6D28D9;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.aitips-read-more {
    background: none;
    border: none;
    color: #8B5CF6;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    font-family: inherit;
}

/* Modal */
.aitips-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.aitips-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.aitips-modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.aitips-modal-large {
    max-width: 700px;
}

.aitips-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid #EDE9FE;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.aitips-modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1F2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aitips-modal-header h3 i {
    color: #8B5CF6;
}

.aitips-modal-close {
    background: #F3F4F6;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    color: #6B7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.aitips-modal-close:hover {
    background: #EF4444;
    color: white;
}

.aitips-modal-body {
    padding: 24px 28px;
}

.aitips-modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 28px;
    border-top: 1px solid #EDE9FE;
}

/* Form */
.aitips-form-group {
    margin-bottom: 18px;
}

.aitips-form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.aitips-form-group .required {
    color: #EF4444;
}

.aitips-form-group input,
.aitips-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #DDD6FE;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
    color: #374151;
}

.aitips-form-group input:focus,
.aitips-form-group textarea:focus {
    border-color: #8B5CF6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.aitips-url-row {
    display: flex;
    gap: 10px;
}

.aitips-url-row input {
    flex: 1;
}

.btn-autofill {
    background: linear-gradient(135deg, #8B5CF6, #6D28D9);
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.btn-autofill:hover {
    background: linear-gradient(135deg, #7C3AED, #5B21B6);
}

/* View Post Body */
.aitips-view-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #EDE9FE;
}

.aitips-view-url {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #8B5CF6;
    text-decoration: none;
    font-size: 0.88rem;
    word-break: break-all;
}

.aitips-view-url:hover {
    text-decoration: underline;
}

.aitips-view-date {
    font-size: 0.82rem;
    color: #9CA3AF;
}

.aitips-view-content {
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.8;
    white-space: pre-wrap;
    margin-bottom: 20px;
}

.aitips-view-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .aitips-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .aitips-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .aitips-search-wrap {
        min-width: unset;
    }
    
    .aitips-url-row {
        flex-direction: column;
    }
}
