/* ผลงาน/รางวัลและกิจกรรม: my_portfolio.php (รายการ) + portfolio_item.php (รายละเอียด) */
.pf-top2 { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.pf-top2 a { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--navy); flex: none; }
.pf-top2 a svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pf-top2 h1 { flex: 1; text-align: center; margin: 0; font-size: 17px; font-weight: 800; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf2 { padding-top: 12px; }
.pf2-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.pf2-sum > div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 4px; text-align: center; }
.pf2-sum b { display: block; font-size: 20px; color: var(--navy); }
.pf2-sum span { font-size: 11px; color: var(--muted); }
.pf2-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.pf2-tabs::-webkit-scrollbar { display: none; }
.pf2-tabs a { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 600; color: #4a5872; }
.pf2-tabs a b { font-weight: 700; color: var(--muted); margin-left: 2px; }
.pf2-tabs a.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.pf2-tabs a.on b { color: var(--gold); }
.pf2-card { margin: 0 0 14px; }
.pf2-card .achievement-header h2 small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.pf2-add { color: var(--blue); font-weight: 700; font-size: 13.5px; }
.pf2-item { text-decoration: none; color: inherit; }
.pf2-item:active { opacity: .8; }
.pf2-ph { display: grid; place-items: center; background: #eef3fb; font-size: 26px; }
.pf2-empty { text-align: center; padding: 26px 12px; color: var(--muted); }
.pf2-empty div { font-size: 34px; }
.pf2-empty p { margin: 6px 0 12px; }
.verify.rejected { background: #fde8ea; color: #b02a37; }
.verify.draft, .verify.post { background: #eef1f6; color: #4a5872; }

.pf2-edit { color: var(--navy); }
.pf2-detail { background: #fff; border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.pf2-cover { width: 100%; max-height: 300px; background: #0b1e3f; display: grid; place-items: center; overflow: hidden; }
.pf2-cover img { width: 100%; max-height: 300px; object-fit: contain; display: block; }
.pf2-cover-ph { height: 150px; background: #eef3fb; font-size: 56px; }
.pf2-body { padding: 16px; }
.pf2-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.pf2-chip { font-size: 11.5px; font-weight: 700; background: #eef3fb; color: var(--navy); border-radius: 999px; padding: 3px 10px; }
.pf2-chip.gold { background: #fff3c4; color: #8a5a00; }
.pf2-body h2 { margin: 0 0 8px; font-size: 20px; line-height: 1.3; color: var(--navy); }
.pf2-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.pf2-meta span { display: inline-flex; align-items: center; gap: 5px; }
.pf2-meta svg { width: 14px; height: 14px; fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pf2-verify { display: flex; align-items: center; gap: 12px; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; background: #eef1f6; color: #4a5872; }
.pf2-verify-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #fff; font-size: 16px; flex: none; }
.pf2-verify b { display: block; font-size: 14px; }
.pf2-verify small { font-size: 12px; opacity: .85; }
.pf2-verify.verified { background: #e4f5ec; color: #146c43; }
.pf2-verify.pending { background: #fff6d6; color: #8a5a00; }
.pf2-verify.rejected { background: #fde8ea; color: #b02a37; }
.pf2-body h4 { margin: 14px 0 6px; font-size: 14px; color: var(--navy); }
.pf2-text { font-size: 14px; line-height: 1.7; color: #1f2b45; overflow-wrap: anywhere; }
.pf2-file { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--navy); }
.pf2-file svg { width: 22px; height: 22px; fill: none; stroke: var(--blue); stroke-width: 2; flex: none; }
.pf2-file span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.pf2-file small { color: var(--blue); font-weight: 700; }
.pf2-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pf2-actions .btn { border-radius: 10px; padding: 10px 14px; font-weight: 700; font-size: 13.5px; }
.pf2-btn-line { border: 1px solid var(--line) !important; background: #fff; color: var(--navy); }
.pf2-gal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pf2-gal img { width: 100%; height: 96px; object-fit: cover; border-radius: 10px; display: block; }
/* events.php */
.ev-card { padding: 12px; }
.ev-link { display: block; color: inherit; }
.ev-cover { width: 100%; height: 160px; object-fit: cover; border-radius: 12px; margin-bottom: 10px; display: block; background: #eef3fb; }
.ev-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* my_grades.php — clean */
.mg-wrap > * { margin-bottom: 12px; } .mg-wrap > .mg-item:last-child { margin-bottom: 0; }
.mg-sum { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 18px 14px; display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; min-width: 0; }
.mg-sum-big small { font-size: 12.5px; color: var(--muted); display: block; margin-bottom: 2px; }
.mg-sum-big b { font-size: 44px; line-height: 1; color: var(--navy); font-weight: 800; letter-spacing: -.01em; }
.mg-sum-big span { font-size: 12px; color: var(--muted); margin-left: 6px; }
.mg-sum-side { margin-left: auto; display: flex; gap: 14px; flex-wrap: wrap; }
.mg-sum-side > div { text-align: right; }
.mg-sum-side b { display: block; font-size: 18px; color: var(--navy); line-height: 1.1; }
.mg-sum-side span { font-size: 11px; color: var(--muted); }
.mg-chart { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 8px; }
.mg-chart h3 { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.mg-chart svg { width: 100%; height: auto; display: block; }
.mg-grid { stroke: #eef1f6; stroke-width: 1; }
.mg-ax { font-size: 9px; fill: #a5afc0; }
.mg-line { fill: none; stroke: var(--navy); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.mg-area { fill: #eef3fb; }
.mg-dot { fill: #fff; stroke: var(--navy); stroke-width: 2; }
.mg-dot.last { fill: var(--gold2); stroke: var(--gold2); }
.mg-v { font-size: 10px; font-weight: 700; fill: var(--navy); }
.mg-tabs { display: flex; gap: 4px; background: #eef1f6; border-radius: 12px; padding: 4px; overflow-x: auto; scrollbar-width: none; }
.mg-tabs::-webkit-scrollbar { display: none; }
.mg-tabs a { flex: 1 0 auto; text-align: center; border-radius: 9px; padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.mg-tabs a.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(11, 30, 63, .08); }
.mg-item { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.mg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mg-head b { display: block; font-size: 15px; color: var(--navy); font-weight: 700; }
.mg-head small { color: var(--muted); font-size: 12.5px; }
.mg-gpa { text-align: right; }
.mg-gpa b { display: block; font-size: 26px; color: var(--navy); line-height: 1; font-weight: 800; }
.mg-gpa span { font-size: 10.5px; color: var(--muted); letter-spacing: .06em; }
.mg-status { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.mg-status i { width: 8px; height: 8px; border-radius: 50%; background: #c5ccd8; flex: none; }
.mg-status.ok i { background: #22a45d; } .mg-status.wait i { background: #ffb020; } .mg-status.no i { background: #dc3545; }
.mg-status.ok { color: #146c43; } .mg-status.no { color: #b02a37; }
.mg-status small { display: block; font-weight: 400; }
.mg-tbl { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
.mg-tbl th { font-size: 11px; color: #a5afc0; font-weight: 600; text-align: right; padding: 6px 4px; border-bottom: 1px solid var(--line); letter-spacing: .04em; }
.mg-tbl td { padding: 8px 4px; border-bottom: 1px solid #f1f3f7; text-align: right; color: #4a5872; }
.mg-tbl tr:last-child td { border-bottom: 0; }
.mg-tbl th:first-child, .mg-tbl td:first-child { text-align: left; }
.mg-tbl td:first-child { color: var(--navy); font-weight: 500; }
.mg-tbl td b { color: var(--navy); }
.mg-none { margin: 10px 0 0; font-size: 12.5px; color: #a5afc0; }/* rankings.php */
.rk-tabs { margin-bottom: 10px; }
.rk-sub { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); }
.rk-row { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; color: inherit; text-decoration: none; min-width: 0; }
.rk-row.top { border-color: #f0d68a; background: linear-gradient(90deg, #fffaf0, #fff); }
.rk-no { width: 28px; height: 28px; border-radius: 50%; background: #eef1f6; color: #4a5872; font-weight: 800; font-size: 13px; display: grid; place-items: center; flex: none; }
.rk-no.n1 { background: #ffd54f; color: #5b3d00; } .rk-no.n2 { background: #dfe3ea; color: #3b4658; } .rk-no.n3 { background: #f2c9a0; color: #6b3d0a; }
.rk-row img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: none; background: #eef3fb; }
.rk-row img.sq { border-radius: 12px; }
.rk-ph { width: 46px; height: 46px; border-radius: 12px; background: #eef3fb; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: var(--navy); flex: none; }
.rk-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rk-info b { font-size: 14.5px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-info small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-ok { font-style: normal; color: #22a45d; font-size: 12px; }
.rk-val { text-align: right; flex: none; }
.rk-val b { display: block; font-size: 16px; color: var(--navy); }
.rk-val small { font-size: 10.5px; color: var(--muted); }
.rk-bar { display: block; height: 6px; border-radius: 999px; background: #eef1f6; overflow: hidden; margin: 4px 0 2px; }
.rk-bar i { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.rk-don .rk-info small { white-space: normal; }
.rk-av { width: 40px !important; height: 40px !important; }
/* articles.php / article_item.php */
.ar-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; margin-bottom: 10px; color: inherit; text-decoration: none; }
.ar-card.ar-first { grid-template-columns: 1fr; }
.ar-card.ar-first .ar-cover { width: 100%; height: 170px; }
.ar-cover { width: 96px; height: 76px; object-fit: cover; border-radius: 10px; background: #eef3fb; display: block; }
.ar-body { min-width: 0; }
.ar-type { font-size: 10.5px; font-weight: 700; color: var(--gold2); letter-spacing: .06em; }
.ar-body h3 { margin: 2px 0 4px; font-size: 14.5px; line-height: 1.35; color: var(--navy); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ar-body p { margin: 0 0 4px; font-size: 12.5px; color: #4a5872; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ar-body small { font-size: 11.5px; color: var(--muted); }
.ar-lead { font-size: 14.5px; color: #4a5872; line-height: 1.6; margin: 0 0 12px; padding-left: 12px; border-left: 3px solid var(--gold); }
.ar-content { font-size: 15px; line-height: 1.8; }
.ar-content img { max-width: 100%; border-radius: 10px; }
.ar-more-h { margin: 18px 0 8px; font-size: 14px; color: var(--navy); }
.ar-mini { grid-template-columns: 72px minmax(0, 1fr); }
.ar-mini .ar-cover { width: 72px; height: 56px; }
/* การ์ดอัพเดตกิจกรรม (includes/activity_feed.php) */
.af{background:#fff;border-radius:10px;box-shadow:rgba(99,99,99,.2) 0 2px 8px 0;overflow:hidden;margin:0}
.af-head{display:flex;align-items:center;gap:12px;padding:14px 16px 10px}
.af-ico{width:44px;height:44px;border-radius:50%;background:#fff6d6;display:grid;place-items:center;font-size:22px;flex:none}
.af-t{flex:1;min-width:0}
.af-t b{display:block;font-size:16px;color:var(--navy)}
.af-t small{font-size:12px;color:var(--muted)}
.af-live{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:800;letter-spacing:.08em;color:#d32f2f;background:#fdecec;border-radius:999px;padding:4px 10px;flex:none}
.af-live i{width:7px;height:7px;border-radius:50%;background:#d32f2f;animation:afpulse 1.4s infinite}
@keyframes afpulse{50%{box-shadow:0 0 0 5px rgba(211,47,47,.15)}}
.af-filters{display:flex;gap:6px;padding:0 16px 10px;overflow-x:auto;scrollbar-width:none}
.af-filters::-webkit-scrollbar{display:none}
.af-filters a{flex:none;font-size:12px;padding:5px 11px;border-radius:999px;background:#f1f3f8;color:#4a5872;text-decoration:none}
.af-filters a.on{background:var(--navy);color:#fff}
.af-list{position:relative;padding:4px 16px 12px;min-height:80px;background:#fff}
.af-list::before{content:"";position:absolute;left:39px;top:8px;bottom:16px;width:2px;background:#e3e7ee}
.af-row{position:relative;display:grid;grid-template-columns:46px minmax(0,1fr);gap:10px;padding:8px 2px 8px 0;color:inherit;text-decoration:none}
.af-row.is-new .af-body{animation:afin .6s ease}
@keyframes afin{from{background:#fff6d6;transform:translateY(-6px)}to{background:#fff;transform:none}}
.af-av{position:relative;width:46px;height:46px;display:block}
.af-av img{width:46px;height:46px;border-radius:50%;object-fit:cover;border:2px solid #fff;box-shadow:0 0 0 2px #eef1f6;display:block}
.af-av i{position:absolute;right:-4px;bottom:-4px;width:22px;height:22px;border-radius:50%;display:grid;place-items:center;font-size:11px;border:2px solid #fff;font-style:normal}
.i-award{background:#fff2c2}.i-sch{background:#e3ebff}.i-act{background:#e4f5ec}.i-post{background:#e9f1fc}.i-gift{background:#fde8f0}.i-join{background:#fff0e0}.i-new{background:#eef1f6}
.af-body{display:block;background:#fff;border:1px solid #e3e7ee;border-radius:10px;padding:10px 12px;min-width:0;box-shadow:rgba(99,99,99,.28) 0 2px 8px 0}
.af-body p{margin:0;font-size:13.5px;line-height:1.5;color:#1f2b45}
.af-body p b{color:var(--navy)}
.af-body p em{font-style:normal;color:var(--blue);font-weight:600}
.af-meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;margin-top:6px;font-size:11.5px;color:var(--muted)}
.af-meta .chip{padding:2px 8px;border-radius:999px;background:#fff;border:1px solid var(--line);font-weight:600;color:#4a5872}
.af-meta .chip.gold{background:#fff6d6;color:#8a5a00;border-color:#f3e2a8}
.af-meta .chip.green{background:#e4f5ec;color:#146c43;border-color:#c7ebd6}
.af-meta .chip.pink{background:#fde8f0;color:#b8236b;border-color:#f7c9db}
.af-meta .chip.blue{background:#e9f1fc;color:#1c4fd6;border-color:#c9d8f5}
.af-thumb{display:flex;gap:6px;margin-top:8px}
.af-thumb img{width:56px;height:44px;border-radius:8px;object-fit:cover}
.af-newpill{position:relative;display:none;justify-content:center;margin:2px 0 6px}
.af-newpill.on{display:flex}
.af-newpill button{font:inherit;font-size:11.5px;color:#fff;background:var(--navy);border:0;border-radius:999px;padding:4px 12px;cursor:pointer}
.af-empty{padding:20px;text-align:center;color:var(--muted);font-size:13px}
.af-foot{border-top:1px solid var(--line);padding:10px 16px;display:flex;justify-content:space-between;align-items:center;font-size:12px;color:var(--muted)}
.af-foot a{color:var(--blue);font-weight:700;font-size:13px}
.af-page .af{box-shadow:none;border:1px solid var(--line)}
