/* ===== YHEMT Design System – Inspired by secai.ai ===== */

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root{
  --bg:#F7F7F7;
  --surface:#FFFFFF;
  --surface-alt:#F3F3F3;
  --primary:#1A1A1A;
  --primary-light:#F3F3F3;
  --primary-hover:#333333;
  --accent:#D32F2F;
  --accent-light:#FEF0F0;
  --accent-glow:rgba(229,57,53,.12);
  --text:#1A1A1A;
  --text-2:#4A4A4A;
  --text-muted:#717171;
  --border:#E0E0E0;
  --border-light:#EBEBEB;
  --success:#52C41A;
  --error:#D32F2F;
  --link:#1A1A1A;
  --font-sans:'Mona Sans Variable','Inter',system-ui,-apple-system,sans-serif;
  --font-heading:'Mona Sans Variable','Inter',system-ui,-apple-system,sans-serif;
  --shadow-sm:0 1px 3px rgba(0,0,0,.04);
  --shadow-md:0 4px 16px rgba(0,0,0,.06);
  --shadow-lg:0 8px 30px rgba(0,0,0,.08);
  --radius:8px;
  --radius-lg:12px;
  --max-w:1120px;
  --transition:all .2s ease;
}

html{scroll-behavior:smooth}
body{font-family:var(--font-sans);background:var(--bg);color:var(--text);line-height:1.65;font-size:14px;-webkit-font-smoothing:antialiased}
img{max-width:100%;height:auto;display:block}
a{color:var(--text-2);text-decoration:none;transition:var(--transition)}
a:hover{color:var(--accent)}
h1,h2,h3,h4{font-family:var(--font-heading);font-weight:700;line-height:1.25;color:var(--text);letter-spacing:-.02em}
h1{font-size:2rem}
h2{font-size:1.6rem}
h3{font-size:1.25rem}
h4{font-size:1.05rem}

/* --- Header --- */
.site-header{
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(12px);
  border-bottom:1px solid var(--border-light);
  padding:0 1.5rem;
  position:sticky;top:0;z-index:100;
}
.site-header .header-inner{
  max-width:var(--max-w);
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  height:60px;
}
.site-header h1{font-size:1.15rem;margin:0}
.site-header h1 a{
  color:var(--text);
  font-family:var(--font-heading);
  font-weight:700;
  letter-spacing:-.03em;
  display:inline-flex;align-items:center;min-height:44px;
}
.site-header .logo-accent{color:var(--accent)}

nav ul{list-style:none;display:flex;gap:.15rem;align-items:center}
nav a{
  color:var(--text-2);
  font-size:.85rem;
  font-weight:500;
  padding:.45rem .8rem;
  border-radius:6px;
  transition:var(--transition);
}
nav a:hover{color:var(--text);background:var(--primary-light)}
nav a.active{color:var(--text);background:var(--primary-light);font-weight:600}

/* --- Hero (SecAI-style with accent glow) --- */
.hero{
  background:var(--surface);
  padding:5.5rem 1.5rem 4.5rem;
  text-align:center;
  color:var(--text);
  position:relative;
  overflow:hidden;
}
.hero::before{
  content:'';
  position:absolute;
  inset:0;
  background:
    radial-gradient(ellipse 500px 500px at 50% 60%,rgba(229,57,53,.06),transparent 70%),
    radial-gradient(ellipse 800px 400px at 20% 80%,rgba(0,0,0,.02),transparent),
    radial-gradient(ellipse 600px 300px at 80% 20%,rgba(0,0,0,.015),transparent);
}
.hero::after{
  content:'';
  position:absolute;
  width:280px;height:280px;
  top:50%;left:50%;
  transform:translate(-50%,-50%);
  border-radius:50%;
  background:radial-gradient(circle,rgba(229,57,53,.08) 0%,rgba(229,57,53,.03) 40%,transparent 70%);
  pointer-events:none;
}
.hero-inner{max-width:660px;margin:0 auto;position:relative;z-index:1}
.hero .badge{
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  background:var(--accent-light);
  color:var(--accent);
  font-size:.72rem;
  font-weight:600;
  letter-spacing:.05em;
  text-transform:uppercase;
  padding:.4rem .9rem;
  border-radius:20px;
  margin-bottom:1.5rem;
  border:1px solid rgba(229,57,53,.15);
}
.badge-dot{
  width:6px;height:6px;
  background:var(--accent);
  border-radius:50%;
  animation:pulse 2s ease-in-out infinite;
}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.4}}
.hero h2{
  font-size:2.5rem;
  color:var(--text);
  margin-bottom:.85rem;
  text-wrap:balance;
}
.hero p{
  font-size:1rem;
  color:var(--text-muted);
  line-height:1.7;
  margin-bottom:2rem;
}
.cta-button{
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  background:var(--accent);
  color:#fff;
  font-weight:600;
  font-size:.9rem;
  padding:.75rem 1.8rem;
  border-radius:var(--radius);
  transition:var(--transition);
  box-shadow:0 2px 8px rgba(229,57,53,.2);
}
.cta-button:hover{
  background:#B71C1C;
  color:#fff;
  transform:translateY(-1px);
  box-shadow:0 4px 16px rgba(211,47,47,.3);
}
.cta-secondary{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  color:var(--text-muted);
  font-size:.88rem;
  font-weight:500;
  padding:.7rem 1rem;
  transition:var(--transition);
}
.cta-secondary:hover{color:var(--text)}

/* --- Stats --- */
.stats-bar{
  max-width:var(--max-w);
  margin:-1.5rem auto 0;
  padding:0 1.5rem;
  position:relative;z-index:2;
}
.stats-inner{
  background:var(--surface);
  border:1px solid var(--border-light);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-md);
  display:grid;
  grid-template-columns:repeat(3,1fr);
  padding:1.35rem 0;
}
.stat{text-align:center;padding:.5rem 1rem}
.stat+.stat{border-left:1px solid var(--border-light)}
.stat-value{
  font-family:var(--font-heading);
  font-size:1.65rem;
  font-weight:700;
  color:var(--text);
  letter-spacing:-.02em;
  font-variant-numeric:tabular-nums;
}
.stat-value .stat-plus{color:var(--accent);font-weight:700}
.stat-label{font-size:.78rem;color:var(--text-muted);margin-top:.15rem}

/* --- Features --- */
.features{
  max-width:var(--max-w);
  margin:0 auto;
  padding:4rem 1.5rem 2rem;
}
.features>h3{text-align:center;margin-bottom:.3rem;font-size:1.5rem}
.features>.subtitle{text-align:center;color:var(--text-muted);margin-bottom:2.5rem;font-size:.9rem}
.feature-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:1rem;
}
.feature-card{
  background:var(--surface);
  border:1px solid var(--border-light);
  border-radius:var(--radius-lg);
  padding:1.6rem;
  transition:var(--transition);
}
.feature-card:hover{
  border-color:rgba(229,57,53,.2);
  box-shadow:0 4px 20px var(--accent-glow);
  transform:translateY(-2px);
}
.feature-icon{
  width:44px;height:44px;
  border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  font-size:1.15rem;
  margin-bottom:1rem;
  border:1px solid var(--border-light);
}
.feature-icon.blue{background:var(--surface);color:var(--text)}
.feature-icon.indigo{background:var(--accent-light);color:var(--accent)}
.feature-icon.emerald{background:var(--surface);color:var(--text)}
.feature-icon.rose{background:var(--accent-light);color:var(--accent)}
.feature-card h4{margin-bottom:.4rem}
.feature-card p{color:var(--text-2);font-size:.87rem;line-height:1.55}

/* --- Articles --- */
.articles{
  max-width:var(--max-w);
  margin:0 auto;
  padding:1rem 1.5rem 4rem;
}
.articles>h3{margin-bottom:.25rem}
.articles>.subtitle{color:var(--text-muted);margin-bottom:2rem;font-size:.9rem}
.article-list{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(320px,1fr));
  gap:1.25rem;
}
.article-card{
  background:var(--surface);
  border:1px solid var(--border-light);
  border-radius:var(--radius-lg);
  overflow:hidden;
  transition:var(--transition);
}
.article-card:hover{
  border-color:rgba(229,57,53,.15);
  box-shadow:0 6px 24px var(--accent-glow);
  transform:translateY(-3px);
}
.article-card .article-img{
  width:100%;height:190px;object-fit:cover;
  background:var(--surface-alt);
}
.article-card .card-body{padding:1.15rem}
.article-card h4{margin-bottom:.4rem}
.article-card h4 a{color:var(--text);transition:var(--transition)}
.article-card h4 a:hover{color:var(--text-2)}
.article-card .tag{
  display:inline-block;
  font-size:.68rem;
  font-weight:600;
  color:var(--accent);
  background:var(--accent-light);
  padding:.2rem .55rem;
  border-radius:4px;
  margin-bottom:.5rem;
  text-transform:uppercase;
  letter-spacing:.03em;
}
.article-card .meta{
  font-size:.78rem;
  color:var(--text-muted);
  margin-bottom:.4rem;
  display:flex;
  align-items:center;
  gap:.4rem;
}
.article-card .meta .divider{color:var(--border)}
.article-card .excerpt{
  color:var(--text-2);
  font-size:.87rem;
  line-height:1.55;
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

/* --- Footer --- */
.site-footer{
  background:var(--primary);
  color:rgba(255,255,255,.7);
  padding:2.5rem 1.5rem;
  text-align:center;
  border-top:3px solid var(--accent);
}
.footer-inner{max-width:var(--max-w);margin:0 auto}
.site-footer .footer-brand{
  font-family:var(--font-heading);
  font-weight:700;
  font-size:1.05rem;
  color:#fff;
  margin-bottom:.4rem;
}
.site-footer .footer-brand .logo-accent{color:var(--accent)}
.site-footer p{color:rgba(255,255,255,.6);font-size:.8rem;margin:0}
.site-footer .footer-links{
  display:flex;
  justify-content:center;
  gap:1.5rem;
  margin-bottom:1rem;
}
.site-footer .footer-links a{color:rgba(255,255,255,.6);font-size:.82rem;transition:var(--transition)}
.site-footer .footer-links a:hover{color:#fff}

/* --- Forms --- */
.form-section{
  max-width:600px;
  margin:0 auto;
  padding:3rem 1.5rem;
}
.form-section>h2{margin-bottom:.25rem}
.form-section>.subtitle{color:var(--text-muted);font-size:.9rem;margin-bottom:2rem}

.form-group{margin-bottom:1.15rem}
.form-group label{
  display:block;
  font-size:.82rem;
  font-weight:600;
  color:var(--text);
  margin-bottom:.3rem;
}
.form-group label .required{color:var(--error)}
.form-group input,
.form-group textarea,
.form-group select{
  width:100%;
  padding:.6rem .85rem;
  font-size:.88rem;
  font-family:var(--font-sans);
  color:var(--text);
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  transition:var(--transition);
  line-height:1.5;
}
.form-group input:focus,
.form-group textarea:focus{
  outline:none;
  border-color:var(--text);
  box-shadow:0 0 0 3px rgba(26,26,26,.08);
}
.form-group input::placeholder,
.form-group textarea::placeholder{color:#B3B3B3}
.form-group textarea{resize:vertical;min-height:120px}
.form-group .hint{font-size:.78rem;color:var(--text-muted);margin-top:.25rem}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.35rem;
  font-family:var(--font-sans);
  font-size:.88rem;
  font-weight:600;
  padding:.6rem 1.4rem;
  border-radius:var(--radius);
  border:none;
  cursor:pointer;
  transition:var(--transition);
}
.btn-primary{background:var(--accent);color:#fff;box-shadow:0 2px 8px rgba(229,57,53,.15)}
.btn-primary:hover{background:#D32F2F;box-shadow:0 4px 12px rgba(229,57,53,.25)}
.btn-secondary{background:var(--surface);color:var(--text);border:1px solid var(--border)}
.btn-secondary:hover{background:var(--surface-alt);border-color:#B3B3B3}
.btn-danger{background:transparent;color:var(--error);border:1px solid var(--error)}
.btn-danger:hover{background:var(--error);color:#fff}
.btn-sm{font-size:.78rem;padding:.35rem .75rem}

/* --- Admin --- */
.admin-layout{
  max-width:var(--max-w);
  margin:0 auto;
  padding:2rem 1.5rem;
  display:grid;
  grid-template-columns:360px 1fr;
  gap:1.75rem;
  align-items:start;
}
.admin-form-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:1.35rem;
  position:sticky;top:76px;
}
.admin-form-card h2{font-size:1.1rem;margin-bottom:1.15rem;display:flex;align-items:center;gap:.4rem}
.admin-list-section h2{font-size:1.1rem;margin-bottom:.85rem;display:flex;align-items:center;gap:.45rem}
.admin-count{
  font-family:var(--font-sans);
  font-size:.7rem;
  font-weight:600;
  background:var(--primary-light);
  color:var(--text);
  padding:.12rem .45rem;
  border-radius:10px;
}
.admin-article-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:1.1rem;
  margin-bottom:.65rem;
  transition:var(--transition);
}
.admin-article-card:hover{border-color:#B3B3B3}
.admin-article-card h4{margin-bottom:.3rem;font-size:.95rem}
.admin-article-card .meta{font-size:.78rem;color:var(--text-muted);margin-bottom:.4rem}
.admin-article-card .excerpt{font-size:.83rem;color:var(--text-2);margin-bottom:.65rem;line-height:1.5}
.actions{display:flex;gap:.4rem}

/* --- About --- */
.about-section{max-width:680px;margin:0 auto;padding:3rem 1.5rem}
.about-section h2{margin-bottom:.85rem}
.about-section h3{margin-top:1.5rem;margin-bottom:.5rem}
.about-section p{color:var(--text-2);line-height:1.75;margin-bottom:.85rem}
.about-section .highlight{
  background:var(--accent-light);
  border-left:3px solid var(--accent);
  padding:.9rem 1.15rem;
  border-radius:0 var(--radius) var(--radius) 0;
  margin:1.25rem 0;
  color:var(--text);
  font-size:.92rem;
  line-height:1.65;
}

/* --- Article Detail --- */
.article-detail{max-width:720px;margin:0 auto;padding:2.5rem 1.5rem 4rem}
.article-header{margin-bottom:2rem}
.back-link{
  display:inline-flex;align-items:center;gap:.3rem;
  font-size:.82rem;font-weight:500;color:var(--text-muted);margin-bottom:1.25rem;
  transition:var(--transition);
}
.back-link:hover{color:var(--text)}
.article-title{
  font-size:2rem;font-weight:700;line-height:1.25;
  letter-spacing:-.03em;margin-bottom:.75rem;text-wrap:balance;
}
.article-meta{
  display:flex;align-items:center;flex-wrap:wrap;gap:.4rem;
  font-size:.82rem;color:var(--text-muted);
}
.article-meta .author{font-weight:600;color:var(--text-2)}
.article-meta .divider{color:var(--border)}
.article-content{line-height:1.8;color:var(--text-2);font-size:.95rem}
.article-content h2{font-size:1.45rem;margin:2rem 0 .75rem;color:var(--text)}
.article-content h3{font-size:1.2rem;margin:1.5rem 0 .6rem;color:var(--text)}
.article-content h4{font-size:1.05rem;margin:1.25rem 0 .5rem;color:var(--text)}
.article-content p{margin-bottom:1rem}
.article-content a{color:var(--accent);text-decoration:underline;text-underline-offset:2px}
.article-content a:hover{color:#D32F2F}
.article-content ul,.article-content ol{margin:0 0 1rem 1.5rem}
.article-content li{margin-bottom:.35rem}
.article-content blockquote{
  border-left:3px solid var(--accent);
  background:var(--accent-light);
  padding:.85rem 1.15rem;
  margin:1.25rem 0;
  border-radius:0 var(--radius) var(--radius) 0;
  color:var(--text);
  font-size:.92rem;
}
.article-content pre{
  background:var(--primary);
  color:#E0E0E0;
  padding:1rem 1.15rem;
  border-radius:var(--radius);
  overflow-x:auto;
  margin:1rem 0;
  font-size:.85rem;
  line-height:1.6;
}
.article-content code{
  font-family:'SF Mono','Fira Code',monospace;
  font-size:.85em;
}
.article-content p code{
  background:var(--surface-alt);
  padding:.1rem .35rem;
  border-radius:3px;
  font-size:.83em;
  color:var(--text);
}
.article-content img{
  border-radius:var(--radius);
  margin:1rem 0;
}
.article-content table{
  width:100%;border-collapse:collapse;margin:1rem 0;font-size:.88rem;
}
.article-content th,.article-content td{
  padding:.55rem .75rem;border:1px solid var(--border);text-align:left;
}
.article-content th{background:var(--surface-alt);font-weight:600;color:var(--text)}
@media(max-width:768px){
  .article-title{font-size:1.55rem}
  .article-detail{padding:1.5rem 1.25rem 3rem}
}

/* --- Breadcrumbs --- */
.breadcrumbs{
  font-size:.82rem;color:var(--text-muted);margin-bottom:1.25rem;
}
.breadcrumbs a{color:var(--text-muted);transition:var(--transition)}
.breadcrumbs a:hover{color:var(--text)}
.bc-sep{margin:0 .35rem;color:var(--border)}

/* --- Pagination --- */
.pagination{
  display:flex;justify-content:center;align-items:center;gap:.35rem;
  margin-top:2rem;padding:1rem 0;
}
.pagination button{
  font-family:var(--font-sans);font-size:.82rem;font-weight:500;
  padding:.4rem .8rem;border-radius:var(--radius);border:1px solid var(--border);
  background:var(--surface);color:var(--text-2);cursor:pointer;transition:var(--transition);
}
.pagination button:hover{border-color:var(--accent);color:var(--accent)}
.pagination button.active{background:var(--accent);color:#fff;border-color:var(--accent)}
.pagination button:disabled{opacity:.4;cursor:default}

/* --- Alert --- */
.alert{padding:.75rem .9rem;border-radius:var(--radius);font-size:.88rem;margin-top:1rem}
.alert-success{background:#F6FFED;color:var(--success);border:1px solid #B7EB8F}
.alert-error{background:#FFF2F0;color:var(--error);border:1px solid #FFCCC7}

/* --- Responsive --- */
@media(max-width:768px){
  .site-header .header-inner{height:56px}
  nav ul{gap:.05rem}
  nav a{font-size:.75rem;padding:.4rem .5rem;min-height:44px;display:inline-flex;align-items:center}
  .auth-item{min-width:auto;min-height:auto}
  .auth-link{font-size:.68rem !important;padding:.3rem .5rem !important;white-space:nowrap}
  .login-link{font-size:.68rem !important;padding:.3rem .6rem !important}
  .hero{padding:3rem 1.5rem 2.5rem}
  .hero h2{font-size:1.75rem}
  .stats-inner{grid-template-columns:1fr;padding:.75rem 0}
  .stat+.stat{border-left:none;border-top:1px solid var(--border-light)}
  .feature-grid{grid-template-columns:1fr}
  .article-list{grid-template-columns:1fr}
  .admin-layout{grid-template-columns:1fr}
  .admin-form-card{position:static}
}
@media(max-width:420px){
  nav a{font-size:.7rem;padding:.35rem .35rem}
  .login-link{font-size:.65rem !important;padding:.28rem .45rem !important}
  .site-header h1{font-size:1.05rem}
}

.container{max-width:var(--max-w);margin:0 auto;padding:0 1.5rem}

/* --- Auth UI --- */
.auth-item{margin-left:.5rem;min-width:140px;min-height:32px}
.user-menu{display:flex;align-items:center;gap:.5rem}
.user-avatar{width:28px;height:28px;border-radius:50%;border:2px solid var(--border)}
.user-name{font-size:.82rem;font-weight:500;color:var(--text-2)}
.auth-link{
  font-size:.8rem;font-weight:600;padding:.35rem .75rem;border-radius:6px;transition:var(--transition);
}
.login-link{background:var(--accent);color:#fff !important;box-shadow:0 1px 4px rgba(229,57,53,.2)}
.login-link:hover{background:#D32F2F}
.logout-link{color:var(--text-muted) !important;border:1px solid var(--border)}
.logout-link:hover{color:var(--error) !important;border-color:var(--error)}
