/* ===== Hero ===== */
.skills-hero { text-align: center; padding: 48px 0 32px; }
.skills-hero h1 {
    font-size: 2.4rem; font-weight: 800; margin-bottom: 0.6rem;
    background: linear-gradient(135deg, #e0e7ff 0%, #a5b4fc 50%, #818cf8 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.skills-hero .subtitle { color: #94a3b8; font-size: 1.05rem; margin-bottom: 1.5rem; }
.hero-stats { display: flex; justify-content: center; gap: 2rem; margin-bottom: 2rem; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat .num {
    font-size: 2rem; font-weight: 700; color: #818cf8;
    display: block; line-height: 1.2;
}
.hero-stat .label { color: #64748b; font-size: 0.82rem; }

/* ===== Search ===== */
.search-bar {
    max-width: 560px; margin: 0 auto 1rem; position: relative;
}
.search-bar input {
    width: 100%; padding: 14px 48px 14px 20px; border-radius: 14px;
    border: 1px solid rgba(99,102,241,0.3); background: rgba(15,23,42,0.6);
    color: #e2e8f0; font-size: 1rem; outline: none; transition: border-color 0.3s;
}
.search-bar input:focus { border-color: #6366f1; }
.search-bar input::placeholder { color: #475569; }
.search-bar .search-icon {
    position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    color: #64748b; font-size: 1.2rem; pointer-events: none;
}

/* ===== Filters ===== */
.filter-row {
    display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
    margin-bottom: 0.8rem;
}
.filter-btn {
    padding: 7px 16px; border-radius: 20px; border: 1px solid rgba(99,102,241,0.25);
    background: transparent; color: #94a3b8; font-size: 0.85rem; cursor: pointer;
    transition: all 0.2s;
}
.filter-btn:hover { border-color: #6366f1; color: #c7d2fe; }
.filter-btn.active { background: #6366f1; border-color: #6366f1; color: white; }

.sort-row {
    display: flex; gap: 6px; justify-content: center; flex-wrap: wrap;
    margin-bottom: 2rem; font-size: 0.8rem;
}
.sort-btn {
    padding: 4px 12px; border-radius: 12px; border: none;
    background: rgba(255,255,255,0.05); color: #64748b; cursor: pointer;
    transition: all 0.2s;
}
.sort-btn:hover { color: #94a3b8; }
.sort-btn.active { background: rgba(99,102,241,0.15); color: #818cf8; }

/* ===== Why Skills ===== */
.why-skills {
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 20px;
    padding: 28px 32px 22px;
    margin: 0 auto 32px;
    max-width: 1000px;
}
.why-skills h2 {
    font-size: 1.1rem; font-weight: 600; color: #e2e8f0;
    margin-bottom: 18px; text-align: center;
}
.why-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.why-item {
    text-align: center;
    padding: 14px 10px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.4);
    transition: transform 0.2s;
}
.why-item:hover { transform: translateY(-2px); }
.why-item .icon {
    font-size: 1.6rem;
    margin-bottom: 8px;
    display: block;
}
.why-item .title {
    color: #c7d2fe;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.why-item .desc {
    color: #94a3b8;
    font-size: 0.78rem;
    line-height: 1.5;
}
.why-vs {
    margin-top: 16px;
    text-align: center;
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.6;
}
.why-vs strong { color: #818cf8; font-weight: 500; }
@media (max-width: 900px) {
    .why-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .why-skills { padding: 22px 18px 18px; margin: 0 16px 28px; }
    .why-grid { grid-template-columns: 1fr; gap: 12px; }
    .why-vs { font-size: 0.75rem; }
}

/* ===== Cards Grid ===== */
.cards-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
    margin-bottom: 2rem;
}
.skill-card {
    background: rgba(15,23,42,0.5); border: 1px solid rgba(99,102,241,0.15);
    border-radius: 16px; padding: 22px; cursor: pointer;
    transition: all 0.3s; position: relative;
}
.skill-card:hover {
    border-color: rgba(99,102,241,0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(99,102,241,0.12);
}
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.card-icon { font-size: 2rem; flex-shrink: 0; }
.card-title { font-size: 1.05rem; font-weight: 600; color: #e2e8f0; }
.card-cat {
    display: inline-block; padding: 2px 8px; border-radius: 8px;
    font-size: 0.7rem; margin-top: 2px;
    background: rgba(99,102,241,0.1); color: #818cf8;
}
.card-desc {
    color: #94a3b8; font-size: 0.85rem; line-height: 1.55;
    margin-bottom: 12px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.card-tags { display: flex; gap: 6px; align-items: center; }
.tag-diff {
    padding: 2px 8px; border-radius: 8px; font-size: 0.72rem;
}
.tag-diff.入门 { background: rgba(16,185,129,0.12); color: #34d399; }
.tag-diff.进阶 { background: rgba(245,158,11,0.12); color: #fbbf24; }
.tag-diff.高级 { background: rgba(239,68,68,0.12); color: #f87171; }
.card-price {
    font-size: 0.82rem; font-weight: 600;
}
.card-price.free { color: #34d399; }
.card-price.paid { color: #fbbf24; }
.card-meta { display: flex; gap: 12px; color: #475569; font-size: 0.75rem; margin-top: 8px; }
.card-meta .stars { color: #fbbf24; }

/* ===== Load More ===== */
.load-more-wrap { text-align: center; margin: 2rem 0; }
.load-more-btn {
    padding: 12px 32px; border-radius: 12px; border: 1px solid rgba(99,102,241,0.3);
    background: transparent; color: #818cf8; font-size: 0.95rem; cursor: pointer;
    transition: all 0.3s;
}
.load-more-btn:hover { background: rgba(99,102,241,0.1); border-color: #6366f1; }
.load-more-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== Empty / Loading ===== */
.empty-state {
    text-align: center; padding: 60px 20px; color: #64748b;
}
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.loading-spinner {
    display: inline-block; width: 24px; height: 24px;
    border: 3px solid rgba(99,102,241,0.2); border-top-color: #6366f1;
    border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Modal ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 10001;
    background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
    align-items: center; justify-content: center; padding: 20px;
    animation: fadeIn 0.2s ease;
}
.modal-overlay.open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
    background: #0f172a; border: 1px solid rgba(99,102,241,0.25);
    border-radius: 20px; max-width: 640px; width: 100%;
    max-height: 85vh; overflow-y: auto; position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.modal-box::-webkit-scrollbar { width: 4px; }
.modal-box::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }
.modal-close {
    position: sticky; top: 0; float: right; z-index: 1;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(30,41,59,0.8); border: 1px solid rgba(99,102,241,0.2);
    color: #94a3b8; font-size: 1.2rem; cursor: pointer; margin: 12px;
    display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: white; }
.modal-body { padding: 8px 28px 28px; }
.modal-icon { font-size: 3rem; margin-bottom: 8px; }
.modal-title { font-size: 1.5rem; font-weight: 700; color: #e2e8f0; margin-bottom: 4px; }
.modal-meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.modal-desc { color: #cbd5e1; line-height: 1.7; margin-bottom: 20px; font-size: 0.95rem; }
.modal-full-desc {
    background: rgba(99,102,241,0.04); border: 1px solid rgba(99,102,241,0.12);
    border-radius: 12px; padding: 20px; margin-bottom: 20px;
    color: rgba(255,255,255,0.8); line-height: 1.8; font-size: 0.92rem;
    max-height: 400px; overflow-y: auto;
}
.modal-full-desc h3 {
    color: #818cf8; font-size: 1.05rem; font-weight: 600;
    margin: 16px 0 10px 0; padding-bottom: 6px;
    border-bottom: 1px solid rgba(99,102,241,0.15);
}
.modal-full-desc h3:first-child { margin-top: 0; }
.modal-full-desc strong { color: #e2e8f0; font-weight: 600; }
.modal-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.modal-stat-box {
    background: rgba(99,102,241,0.06); border: 1px solid rgba(99,102,241,0.12);
    border-radius: 12px; padding: 14px; text-align: center;
}
.modal-stat-box .val { font-size: 1.3rem; font-weight: 700; color: #818cf8; }
.modal-stat-box .lbl { font-size: 0.75rem; color: #64748b; margin-top: 2px; }
.modal-section-title {
    font-size: 1rem; font-weight: 600; color: #e2e8f0;
    margin: 20px 0 12px; padding-bottom: 8px;
    border-bottom: 1px solid rgba(99,102,241,0.1);
}

/* Rating distribution */
.rating-dist { margin-bottom: 20px; }
.rating-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 0.82rem; }
.rating-bar-row .label { width: 30px; color: #94a3b8; text-align: right; }
.rating-bar-row .bar-wrap { flex: 1; height: 8px; background: rgba(99,102,241,0.08); border-radius: 4px; overflow: hidden; }
.rating-bar-row .bar-fill { height: 100%; background: #fbbf24; border-radius: 4px; transition: width 0.5s; }
.rating-bar-row .count { width: 24px; color: #64748b; font-size: 0.75rem; }

/* Reviews */
.review-item {
    padding: 12px 0; border-bottom: 1px solid rgba(99,102,241,0.06);
}
.review-item:last-child { border-bottom: none; }
.review-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.review-name { color: #818cf8; font-size: 0.85rem; font-weight: 500; }
.review-stars { color: #fbbf24; font-size: 0.8rem; }
.review-time { color: #475569; font-size: 0.72rem; }
.review-text { color: #94a3b8; font-size: 0.88rem; line-height: 1.5; }

/* Review form */
.review-form { margin-top: 16px; }
.review-form .stars-input { display: flex; gap: 4px; margin-bottom: 10px; }
.review-form .star-btn {
    background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #334155;
    transition: color 0.15s;
}
.review-form .star-btn.active, .review-form .star-btn:hover { color: #fbbf24; }
.review-form textarea {
    width: 100%; padding: 10px 14px; border-radius: 10px; resize: vertical; min-height: 60px;
    border: 1px solid rgba(99,102,241,0.2); background: rgba(15,23,42,0.5);
    color: #e2e8f0; font-size: 0.88rem; outline: none; font-family: inherit;
    margin-bottom: 10px;
}
.review-form textarea:focus { border-color: #6366f1; }
.review-form textarea::placeholder { color: #475569; }

/* Download button */
.btn-download {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 28px; border-radius: 12px; border: none;
    background: linear-gradient(135deg, #6366f1, #8b5cf6); color: white;
    font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 0.3s;
    margin-top: 16px;
}
.btn-download:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,0.3); }
.btn-submit {
    padding: 8px 20px; border-radius: 10px; border: none;
    background: #6366f1; color: white; font-size: 0.85rem; cursor: pointer;
    transition: background 0.2s;
}
.btn-submit:hover { background: #4f46e5; }
.btn-submit:disabled { background: #334155; cursor: not-allowed; }
.form-msg { font-size: 0.8rem; margin-top: 6px; }
.form-msg.success { color: #34d399; }
.form-msg.error { color: #f87171; }

/* Page link from card / modal */
.card-page-link {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 12px; font-size: 0.85rem; color: #818cf8;
    text-decoration: none; font-weight: 500;
    transition: color 0.2s;
}
.card-page-link:hover { color: #a5b4fc; text-decoration: underline; }
.modal-page-link {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.85rem; color: #818cf8; text-decoration: none;
    font-weight: 500; padding: 4px 10px; border-radius: 8px;
    background: rgba(99,102,241,0.08); transition: all 0.2s;
}
.modal-page-link:hover { background: rgba(99,102,241,0.15); color: #a5b4fc; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .cards-grid { grid-template-columns: 1fr; }
    .skills-hero h1 { font-size: 1.8rem; }
    .hero-stats { gap: 1.2rem; }
    .hero-stat .num { font-size: 1.5rem; }
    .modal-box { border-radius: 16px; }
    .modal-body { padding: 8px 18px 18px; }
    .modal-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
