/* ===== Kotoo Main Style (CNET-inspired) =====
   Default theme. White surfaces, bold black type,
   CNET blue links, yellow/green brand accents. */
/* Reset & Base */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
  --primary:#0056d6;
  --primary-dark:#003da5;
  --primary-light:#e7efff;
  --accent:#f3a712;
  --accent-green:#00a651;
  --bg:#f4f4f4;
  --card-bg:#fff;
  --text:#111111;
  --text-secondary:#4a4a4a;
  --text-muted:#8a8a8a;
  --border:#e5e5e5;
  --radius:6px;
  --radius-sm:4px;
  --shadow:0 1px 3px rgba(0,0,0,.08);
  --shadow-hover:0 6px 18px rgba(0,0,0,.12);
  --header-h:60px;
  --max-w:1200px;
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
}
html{font-size:16px;scroll-behavior:smooth}
body{font-family:var(--font);background:var(--bg);color:var(--text);line-height:1.6;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none;transition:color .15s}
a:hover{color:var(--primary)}
img{max-width:100%;height:auto;display:block}
ul,ol{list-style:none}

/* Container */
.container{max-width:var(--max-w);margin:0 auto;padding:0 16px}

/* Header - CNET style: white bar, black bold logo, thin bottom border */
.header{background:#fff;border-bottom:1px solid var(--border);position:sticky;top:0;z-index:100;height:var(--header-h)}
.header .container{display:flex;align-items:center;height:100%;gap:24px}
.logo{font-size:24px;font-weight:900;color:#111;letter-spacing:-1.5px;flex-shrink:0;display:inline-flex;align-items:center;gap:6px}
.logo::after{content:"";display:inline-block;width:9px;height:9px;border-radius:2px;background:var(--accent)}
.logo:hover{color:var(--primary)}
.nav{display:flex;gap:2px;flex:1}
.nav a{padding:8px 14px;border-radius:var(--radius-sm);font-weight:600;font-size:15px;color:#222;transition:all .15s}
.nav a:hover,.nav a.active{background:var(--primary-light);color:var(--primary)}
.header-actions{display:flex;align-items:center;gap:10px}
.search-box{position:relative;display:flex;align-items:center}
.search-box input{width:200px;padding:8px 12px 8px 34px;border:1px solid var(--border);border-radius:var(--radius-sm);font-size:14px;outline:none;transition:border-color .2s;background:#fafafa}
.search-box input:focus{border-color:var(--primary);background:#fff}
.search-box .icon{position:absolute;left:10px;color:var(--text-muted);font-size:13px}
.btn{display:inline-flex;align-items:center;justify-content:center;padding:8px 20px;border-radius:var(--radius-sm);font-size:14px;font-weight:600;cursor:pointer;border:none;transition:all .15s;white-space:nowrap}
.btn-primary{background:var(--primary);color:#fff}
.btn-primary:hover{background:var(--primary-dark);color:#fff}
.btn-outline{border:1px solid var(--border);background:#fff;color:var(--text)}
.btn-outline:hover{border-color:var(--primary);color:var(--primary)}
.btn-sm{padding:4px 12px;font-size:13px}
.btn-danger{background:#dc2626;color:#fff}
.btn-danger:hover{background:#b91c1c;color:#fff}
.avatar{width:36px;height:36px;border-radius:50%;object-fit:cover;background:var(--primary-light)}

/* Mobile menu toggle */
.menu-toggle{display:none;font-size:24px;cursor:pointer;background:none;border:none;color:var(--text)}

/* Main content */
.main{min-height:calc(100vh - var(--header-h) - 200px);padding:24px 0}

/* Hero banner - CNET blue gradient with yellow accent */
.hero-banner{background:linear-gradient(135deg,#003da5 0%,#0056d6 55%,#1a6bff 100%);color:#fff;border-radius:var(--radius);padding:40px 32px;margin-bottom:32px;text-align:center;position:relative;overflow:hidden}
.hero-banner::before{content:"";position:absolute;width:220px;height:220px;border-radius:50%;background:rgba(243,167,18,.25);top:-70px;right:-50px}
.hero-banner::after{content:"";position:absolute;width:160px;height:160px;border-radius:50%;background:rgba(0,0,0,.12);bottom:-60px;left:-40px}
.hero-banner h1,.hero-banner form{position:relative;z-index:1}
.hero-banner h1{font-size:30px;margin-bottom:16px;font-weight:900;letter-spacing:-1px}
.hero-search{background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.3)}

/* Grid */
.grid{display:grid;gap:16px}
.grid-2{grid-template-columns:repeat(2,1fr)}
.grid-3{grid-template-columns:repeat(3,1fr)}
.grid-4{grid-template-columns:repeat(4,1fr)}
.grid-5{grid-template-columns:repeat(5,1fr)}
.grid-6{grid-template-columns:repeat(6,1fr)}
.home-two-col{min-width:0}
.home-two-col > div{min-width:0;max-width:100%}

/* Card - CNET style: white, small radius, light border */
.card{background:var(--card-bg);border-radius:var(--radius);border:1px solid var(--border);box-shadow:var(--shadow);overflow:hidden;transition:box-shadow .15s,transform .15s,border-color .15s}
.card:hover{box-shadow:var(--shadow-hover);transform:translateY(-2px);border-color:#cfcfcf}
.card-body{padding:14px}
.card-title{font-size:15px;font-weight:700;margin-bottom:4px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.card-meta{font-size:12px;color:var(--text-muted)}

/* Section title - CNET style: bold black with blue bar */
.section-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;padding-left:10px;border-left:4px solid var(--primary)}
.section-title h2{font-size:20px;font-weight:800;letter-spacing:-.5px}
.section-title a{font-size:14px;color:var(--primary);font-weight:600}
.section-title a:hover{color:var(--primary-dark);text-decoration:underline}

/* Game card */
.game-card{cursor:pointer}
.game-card .game-icon{width:100%;aspect-ratio:1;object-fit:cover;border-radius:var(--radius-sm);background:var(--primary-light)}
.game-card .game-name{font-size:14px;font-weight:600;margin-top:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.game-card .game-name:hover{color:var(--primary)}
.game-card .game-cat{font-size:12px;color:var(--text-muted)}

/* News card */
.news-card{display:flex;gap:16px;padding:16px;background:#fff}
.news-card .news-cover{width:160px;height:100px;object-fit:cover;border-radius:var(--radius-sm);flex-shrink:0}
.news-card .news-info{flex:1;min-width:0}
.news-card .news-title{font-size:16px;font-weight:700;margin-bottom:8px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.4}
.news-card .news-title:hover{color:var(--primary)}
.news-card .news-summary{font-size:13px;color:var(--text-secondary);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-bottom:8px}
.news-card .news-meta{font-size:12px;color:var(--text-muted)}
/* News card - simple (homepage: image + title only, one per row) */
.news-card-simple{align-items:center;padding:10px 14px}
.news-card-simple .news-cover{width:120px;height:72px}
.news-card-simple .news-title{margin-bottom:0;font-size:15px;-webkit-line-clamp:1;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
/* News card - grid (homepage: card, image on top, title below, no date/author) */
.news-card-grid{flex-direction:column;padding:0;min-width:0;overflow:hidden}
.news-card-grid .news-cover{width:100%;min-width:0;height:auto;aspect-ratio:16/10;object-fit:cover;border-radius:0;max-height:220px}
.news-card-grid .news-info{padding:12px 16px}
.news-card-grid .news-title{margin-bottom:0;font-size:15px;-webkit-line-clamp:2;white-space:normal}

/* Filter tabs */
.filter-tabs{display:flex;gap:8px;margin-bottom:20px;flex-wrap:wrap}
.filter-tabs a{padding:6px 16px;border-radius:20px;font-size:14px;background:#fff;border:1px solid var(--border);color:var(--text-secondary);transition:all .15s;font-weight:500}
.filter-tabs a:hover{border-color:var(--primary);color:var(--primary)}
.filter-tabs a.active{background:var(--primary);color:#fff;border-color:var(--primary)}

/* Pagination */
.pagination{display:flex;justify-content:center;gap:8px;margin-top:32px}
.pagination a,.pagination span{padding:8px 14px;border-radius:var(--radius-sm);font-size:14px;border:1px solid var(--border);background:#fff;font-weight:500}
.pagination .current{background:var(--primary);color:#fff;border-color:var(--primary)}
.pagination a:hover{border-color:var(--primary);color:var(--primary)}

/* Game detail */
.game-detail{background:#fff;border-radius:var(--radius);padding:24px;box-shadow:var(--shadow);border:1px solid var(--border)}
.game-header{display:flex;gap:20px;margin-bottom:24px}
.game-header .game-icon-lg{width:100px;height:100px;border-radius:16px;object-fit:cover;flex-shrink:0}
.game-header .game-info{flex:1}
.game-header h1{font-size:24px;margin-bottom:8px;font-weight:800;letter-spacing:-.5px}
.game-header .game-tags{display:flex;gap:8px;margin-bottom:12px;flex-wrap:wrap}
.game-header .game-tags span{padding:2px 10px;border-radius:12px;font-size:12px;background:var(--primary-light);color:var(--primary);font-weight:600}
.download-btns{display:flex;gap:12px;margin-top:12px}
.download-btn{display:inline-flex;align-items:center;gap:6px;padding:10px 24px;border-radius:var(--radius-sm);font-weight:600;font-size:14px}
.download-btn.ios{background:#111;color:#fff}
.download-btn.android{background:#00a651;color:#fff}

/* Article */
.article{background:#fff;border-radius:var(--radius);padding:32px;box-shadow:var(--shadow);border:1px solid var(--border);max-width:800px;margin:0 auto}
.article h1{font-size:26px;margin-bottom:12px;font-weight:800;letter-spacing:-.5px}
.article .article-meta{font-size:13px;color:var(--text-muted);margin-bottom:24px;padding-bottom:16px;border-bottom:1px solid var(--border)}
.article .article-content{font-size:16px;line-height:1.8}
.article .article-content p{margin-bottom:16px}
.article .article-content img{border-radius:var(--radius-sm);margin:16px 0}
.article .article-content h2,.article .article-content h3{margin:24px 0 12px}
/* Rich text (UEditor) - works without .article parent (game description etc.) */
.article-content{font-size:16px;line-height:1.8;word-break:break-word}
.article-content p{margin-bottom:16px}
.article-content img{max-width:100%;height:auto;border-radius:var(--radius-sm);margin:16px 0}
.article-content h2,.article-content h3,.article-content h4{margin:24px 0 12px;color:var(--text)}
.article-content ul,.article-content ol{margin:0 0 16px;padding-left:24px}
.article-content li{margin-bottom:4px}
.article-content blockquote{border-left:4px solid var(--primary);margin:16px 0;padding:8px 16px;background:var(--primary-light)}
.article-content a{color:var(--primary)}
.article-content table{width:100%;border-collapse:collapse;margin:16px 0}
.article-content table td,.article-content table th{border:1px solid var(--border);padding:8px 12px}
.article-content code{background:#f5f5f5;padding:2px 6px;border-radius:var(--radius-sm);font-size:14px}
.article-content iframe{max-width:100%}

/* Comment section */
.comment-section{margin-top:32px}
.comment-form textarea{width:100%;padding:12px;border:1px solid var(--border);border-radius:var(--radius-sm);font-size:14px;resize:vertical;min-height:80px;font-family:var(--font)}
.comment-form textarea:focus{outline:none;border-color:var(--primary)}
.comment-item{display:flex;gap:12px;padding:16px 0;border-bottom:1px solid var(--border)}
.comment-item .comment-avatar{width:36px;height:36px;border-radius:50%;flex-shrink:0}
.comment-item .comment-body{flex:1}
.comment-item .comment-author{font-weight:700;font-size:14px}
.comment-item .comment-author a:hover{color:var(--primary)}
.comment-item .comment-text{font-size:14px;color:var(--text-secondary);margin-top:4px}
.comment-item .comment-time{font-size:12px;color:var(--text-muted);margin-top:4px}

/* Like buttons */
.like-group{display:flex;gap:12px;align-items:center}
.like-btn{display:inline-flex;align-items:center;gap:6px;padding:8px 16px;border-radius:20px;border:1px solid var(--border);background:#fff;cursor:pointer;font-size:14px;transition:all .15s;font-weight:500}
.like-btn:hover{border-color:var(--primary);color:var(--primary)}
.like-btn.liked{background:var(--primary-light);border-color:var(--primary);color:var(--primary)}
.like-btn.disliked{background:#fef2f2;border-color:#dc2626;color:#dc2626}

/* User center */
.user-header{background:#fff;border-radius:var(--radius);padding:32px;box-shadow:var(--shadow);border:1px solid var(--border);display:flex;gap:24px;align-items:center;margin-bottom:24px}
.user-header .user-avatar{width:80px;height:80px;border-radius:50%;object-fit:cover}
.user-header h2{font-size:22px;margin-bottom:4px;font-weight:800}
.user-header .user-bio{color:var(--text-secondary);font-size:14px}
.user-tabs{display:flex;gap:4px;margin-bottom:20px;border-bottom:2px solid var(--border)}
.user-tabs a{padding:12px 20px;font-weight:600;color:var(--text-secondary);border-bottom:2px solid transparent;margin-bottom:-2px}
.user-tabs a.active{color:var(--primary);border-color:var(--primary)}

/* Admin (shared classes, used by some frontend tables) */
.data-table{width:100%;background:#fff;border-radius:var(--radius);border:1px solid var(--border);box-shadow:var(--shadow);overflow:hidden}
.data-table table{width:100%;border-collapse:collapse}
.data-table th,.data-table td{padding:12px 16px;text-align:left;border-bottom:1px solid var(--border);font-size:14px}
.data-table th{background:var(--bg);font-weight:700;color:var(--text-secondary);font-size:13px}
.data-table tr:hover{background:var(--bg)}

/* Form */
.form-group{margin-bottom:16px}
.form-group label{display:block;font-size:14px;font-weight:600;margin-bottom:6px}
.form-group input,.form-group select,.form-group textarea{width:100%;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius-sm);font-size:14px;outline:none;transition:border-color .2s;font-family:var(--font);background:#fff}
.form-group input:focus,.form-group select:focus,.form-group textarea:focus{border-color:var(--primary)}
.form-group textarea{min-height:120px;resize:vertical}

/* Footer - CNET style: near-black */
.footer{background:#0d0d0d;color:#9a9a9a;padding:40px 0 20px;margin-top:60px}
.footer .container{display:flex;justify-content:space-between;flex-wrap:wrap;gap:20px}
.footer-links{display:flex;gap:24px}
.footer-links a{font-size:13px;color:#9a9a9a;font-weight:500}
.footer-links a:hover{color:#fff}
.footer-bottom{text-align:center;padding-top:20px;border-top:1px solid #2a2a2a;font-size:12px}

/* Toast */
.toast{position:fixed;top:80px;right:20px;padding:12px 24px;border-radius:var(--radius-sm);background:#111;color:#fff;font-size:14px;z-index:9999;animation:slideIn .3s ease}
.toast.success{background:#00a651}
.toast.error{background:#dc2626}
@keyframes slideIn{from{transform:translateX(100%);opacity:0}to{transform:translateX(0);opacity:1}}

/* Mobile search (shown inside nav on mobile) */
.mobile-search{display:none}

/* H5 Game player */
.h5-player{width:100%;aspect-ratio:16/9;border:none;border-radius:var(--radius);background:#000}

/* Homepage news grid: never overflow viewport */
.news-grid{min-width:0;max-width:100%}

/* Homepage featured games (hot games + h5 games) - tablet & phone: ONE-LINE horizontal scroll (max 1024px covers tablets/landscape) */
@media(max-width:1024px){
  .grid.featured-games{display:flex !important;flex-wrap:nowrap !important;overflow-x:auto;gap:10px;padding-bottom:6px;-webkit-overflow-scrolling:touch;grid-template-columns:none !important}
  .featured-games .game-card{min-width:72px;width:72px;flex:0 0 72px}
  .featured-games .game-card .card-body{padding:8px}
  .featured-games .game-icon{width:72px;height:72px;aspect-ratio:auto}
  .featured-games .game-name{font-size:12px;margin-top:6px}
  .featured-games .game-cat{display:none}
}
/* Desktop (>1024px): featured games as normal 5-col grid */
@media(min-width:1025px){
  .grid.featured-games{display:grid;grid-template-columns:repeat(5,1fr);overflow-x:visible;gap:16px}
  .featured-games .game-card{min-width:0;width:auto;flex:none}
  .featured-games .game-card .card-body{padding:12px}
  .featured-games .game-icon{width:100%;height:auto;aspect-ratio:1}
  .featured-games .game-name{font-size:14px;margin-top:8px}
  .featured-games .game-cat{display:block}
}

/* Responsive */
@media(max-width:768px){
  :root{--header-h:56px}
  .nav{display:none;position:fixed;top:var(--header-h);left:0;right:0;background:#fff;flex-direction:column;padding:16px;box-shadow:var(--shadow);z-index:99}
  .nav.open{display:flex}
  .nav a{padding:12px 16px}
  .menu-toggle{display:block}
  .search-box input{width:140px}
  .mobile-search{display:block;margin-bottom:8px}
  .home-two-col{grid-template-columns:1fr !important}
  .home-two-col > div{min-width:0;max-width:100%}
  .grid-4,.grid-5,.grid-6{grid-template-columns:repeat(3,1fr)}
  .grid-3{grid-template-columns:repeat(2,1fr)}
  .news-card .news-cover{width:120px;height:80px}
  .news-card-simple .news-cover{width:96px;height:60px}
  .news-card-simple .news-title{font-size:14px}
  .hero-banner{padding:24px 16px !important}
  .game-header{flex-direction:column;align-items:flex-start}
  .game-header .game-icon-lg{width:80px;height:80px}
  .article{padding:20px}
  .article h1{font-size:20px}
  .footer .container{flex-direction:column;text-align:center}
}
@media(max-width:480px){
  .grid-4,.grid-5,.grid-6,.grid-3,.grid-2{grid-template-columns:repeat(2,1fr)}
  .search-box{display:none}
  .download-btns{flex-direction:column}
}
