/* ============================================
   心测试 - 心理测试平台首页样式
   Version: 2.0 | 2026
   ============================================ */

/* ========== Reset ========== */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}
body{font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',sans-serif;background:#fff;color:#333;font-size:14px;line-height:1.6;-webkit-font-size-adjust:100%}
a{text-decoration:none;color:inherit}
ul,ol{list-style:none}
img{max-width:100%;display:block}
.container{max-width:1200px;margin:0 auto;padding:0 15px}

/* ========== Header ========== */
.site-header{background:#fff;border-bottom:1px solid #eee;position:sticky;top:0;z-index:100}
.header-top{display:flex;align-items:center;justify-content:space-between;height:70px}
.logo{display:flex;align-items:center;gap:10px;margin:0;font-size:inherit}
.logo a{display:flex;align-items:center;gap:10px;text-decoration:none}
.logo-img{width:44px;height:44px;border-radius:10px;background:linear-gradient(135deg,#667eea,#764ba2);display:flex;align-items:center;justify-content:center;color:#fff;font-size:22px;font-weight:700}
.logo-text{font-size:22px;font-weight:700;color:#333}
.logo-text span{color:#667eea}
.main-nav{display:flex;align-items:center;gap:2px}
.main-nav a{padding:8px 14px;font-size:15px;color:#555;border-radius:6px;transition:all .2s;white-space:nowrap}
.main-nav a:hover,.main-nav a.active{color:#667eea;background:#f0f0ff}

/* mobile menu toggle */
.menu-btn{display:none;flex-direction:column;gap:5px;cursor:pointer;padding:6px}
.menu-btn span{width:22px;height:2px;background:#333;border-radius:2px;transition:.3s}

/* ========== New Tests Banner ========== */
.new-banner{background:linear-gradient(135deg,#f0f4ff,#fff);border-bottom:1px solid #eee;padding:12px 0}
.new-banner-inner{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.new-banner-label{font-size:13px;font-weight:700;color:#667eea;white-space:nowrap;display:flex;align-items:center;gap:4px}
.new-banner-items{display:flex;gap:10px;flex:1;flex-wrap:wrap}
.new-tag{display:inline-flex;align-items:center;gap:4px;padding:4px 14px;font-size:13px;color:#555;background:#fff;border:1px solid #e0e0f0;border-radius:20px;transition:all .2s}
.new-tag:hover{border-color:#667eea;color:#667eea;background:#f5f5ff}
.new-tag::before{content:'NEW';font-size:10px;font-weight:700;color:#fff;background:#ff6b6b;padding:1px 5px;border-radius:3px;margin-right:2px}

/* ========== Sidebar ========== */
.side-nav{position:fixed;left:20px;top:50%;transform:translateY(-50%);z-index:90;background:#fff;border:1px solid #eee;border-radius:12px;padding:10px 0;box-shadow:0 4px 16px rgba(0,0,0,.06);min-width:120px}
.side-nav a{display:block;padding:8px 18px;font-size:13px;color:#888;transition:all .2s;border-left:3px solid transparent}
.side-nav a:hover{color:#667eea;background:#f5f5ff}
.side-nav a.active{color:#667eea;border-left-color:#667eea;background:#f0f0ff;font-weight:600}

/* ========== Section ========== */
.content-section{padding:30px 0;scroll-margin-top:80px}
.section-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px;border-bottom:2px solid #667eea;padding-bottom:10px}
.section-header h2{font-size:20px;font-weight:700;color:#333;display:flex;align-items:center;gap:8px}
.section-header h2::before{content:'';width:4px;height:20px;background:#667eea;border-radius:2px}
.section-more{font-size:13px;color:#999;transition:color .2s}
.section-more:hover{color:#667eea}

/* ========== Section Thumbnail ========== */
.section-thumb{width:100%;height:120px;border-radius:10px;overflow:hidden;margin-bottom:16px;background:linear-gradient(135deg,#f0f4ff,#e8ecff);display:flex;align-items:center;justify-content:center}
.section-thumb-link{display:flex;flex-direction:column;align-items:center;justify-content:center;text-decoration:none;color:#fff;text-shadow:0 2px 8px rgba(0,0,0,.15)}
.section-thumb-title{font-size:22px;font-weight:700}
.section-thumb-desc{font-size:13px;opacity:.9;margin-top:4px}
.section-thumb img{width:100%;height:100%;object-fit:cover}

/* ========== Category Card Grid ========== */
.card-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}
.test-card{background:#fff;border:1px solid #eee;border-radius:10px;overflow:hidden;transition:all .25s;cursor:pointer}
.test-card:hover{box-shadow:0 6px 20px rgba(102,126,234,.12);transform:translateY(-3px);border-color:transparent}
.test-card-img{width:100%;aspect-ratio:16/9;display:flex;align-items:center;justify-content:center;font-size:40px;color:#fff;font-weight:600;overflow:hidden;position:relative}
.test-card-img img{width:100%;height:100%;object-fit:cover;position:absolute;top:0;left:0}
.test-card-img .fallback{z-index:1;position:relative}
.test-card-body{padding:14px}
.test-card-body h3{font-size:15px;font-weight:600;margin-bottom:8px;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
.test-card-meta{display:flex;gap:14px;font-size:13px;color:#999}
.test-card-meta span{display:flex;align-items:center;gap:3px}
.card-more{grid-column:1/-1;margin-top:6px}
.card-more a{display:flex;align-items:center;justify-content:center;padding:12px;border:1px dashed #ccc;border-radius:8px;font-size:14px;color:#999;transition:all .2s}
.card-more a:hover{border-color:#667eea;color:#667eea;background:#f5f5ff}

/* ========== Hot Tests ========== */
.hot-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:16px}
.hot-card{border-radius:10px;overflow:hidden;transition:all .25s;cursor:pointer;background:#fff;border:1px solid #eee}
.hot-card:hover{box-shadow:0 6px 20px rgba(255,107,107,.15);transform:translateY(-3px)}
.hot-card-img{width:100%;aspect-ratio:1;display:flex;align-items:center;justify-content:center;font-size:36px;color:#fff;font-weight:600;position:relative;overflow:hidden}
.hot-card-img img{width:100%;height:100%;object-fit:cover;position:absolute;top:0;left:0}
.hot-card-img .fallback{position:relative;z-index:1}
.hot-card-img .rank{position:absolute;top:0;left:0;width:28px;height:28px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:700;color:#fff;border-radius:0 0 8px 0;z-index:2}
.hot-card-body{padding:12px}
.hot-card-body h3{font-size:14px;font-weight:600;margin-bottom:6px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.4}
.hot-card-meta{font-size:12px;color:#999;display:flex;flex-direction:column;gap:3px}

/* ========== Recommend Tests ========== */
.rec-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:14px}
.rec-card{border-radius:10px;overflow:hidden;transition:all .25s;cursor:pointer}
.rec-card:hover{transform:translateY(-3px);box-shadow:0 6px 16px rgba(0,0,0,.1)}
.rec-card-img{width:100%;aspect-ratio:1;display:flex;align-items:center;justify-content:center;font-size:30px;color:#fff;font-weight:600;overflow:hidden;position:relative}
.rec-card-img img{width:100%;height:100%;object-fit:cover;position:absolute;top:0;left:0}
.rec-card-img .fallback{position:relative;z-index:1}
.rec-card-body{padding:10px}
.rec-card-body h4{font-size:13px;font-weight:600;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}

/* ========== Text Lists (2-column) ========== */
.text-list-2col{display:grid;grid-template-columns:repeat(2,1fr);gap:0 30px}
.text-list-2col li{padding:10px 0;border-bottom:1px dashed #eee;display:flex;align-items:center;justify-content:space-between;gap:8px;transition:all .15s}
.text-list-2col li:hover{padding-left:6px}
.text-list-2col li:hover a{color:#667eea}
.text-list-2col li a{font-size:14px;color:#555;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.text-list-2col li .meta{font-size:12px;color:#bbb;white-space:nowrap;flex-shrink:0}
.text-list-2col li::before{content:'·';color:#667eea;font-weight:700;margin-right:4px;flex-shrink:0}

/* ========== Footer ========== */
.site-footer{background:#f8f8f8;border-top:1px solid #eee;padding:36px 0 80px;margin-top:30px}
.footer-text{text-align:center;font-size:13px;color:#999;line-height:2}
.footer-text a{color:#999;transition:color .2s}
.footer-text a:hover{color:#667eea}
.footer-text .declare{max-width:800px;margin:8px auto 0;font-size:12px;color:#bbb;line-height:1.7}

/* ========== Bottom Nav ========== */
.bottom-nav{display:none;position:fixed;bottom:0;left:0;right:0;background:#fff;border-top:1px solid #eee;z-index:200}
.bottom-nav-inner{display:flex;max-width:480px;margin:0 auto}
.bottom-nav a{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 0;font-size:12px;color:#999;transition:color .2s}
.bottom-nav a.active{color:#667eea}
.bottom-nav a svg{width:22px;height:22px}

/* ========== Responsive ========== */
@media(max-width:768px){
  .header-top{height:56px}
  .main-nav{display:none;position:absolute;top:56px;left:0;right:0;background:#fff;flex-direction:column;padding:10px 15px;box-shadow:0 4px 12px rgba(0,0,0,.1);border-bottom:1px solid #eee}
  .main-nav.open{display:flex}
  .main-nav a{width:100%;padding:12px 14px}
  .menu-btn{display:flex}
  .logo-text{font-size:18px}
  .logo-img{width:36px;height:36px;font-size:18px}
  .side-nav{display:none}
  .card-grid{grid-template-columns:repeat(2,1fr)}
  .text-list-2col{grid-template-columns:repeat(2,1fr)}
  .content-section{padding:20px 0}
  .section-header h2{font-size:18px}
  .bottom-nav{display:block}
  .hide-on-mobile{display:none}
  .section-thumb{height:80px}
}
@media(max-width:480px){
  .card-grid{grid-template-columns:repeat(2,1fr)}
  .text-list-2col{grid-template-columns:1fr}
}

/* ========== List Page Layout ========== */
.list-layout{display:flex;gap:30px;align-items:flex-start}
.list-main{flex:1;min-width:0}
.list-sidebar{width:320px;flex-shrink:0}

/* ========== Breadcrumb ========== */
.breadcrumb{display:flex;align-items:center;gap:6px;font-size:13px;color:#999;margin-bottom:20px;flex-wrap:wrap;margin-top:12px}
.breadcrumb a{color:#667eea}
.breadcrumb a:hover{text-decoration:underline}
.breadcrumb .sep{color:#ccc}

/* ========== Test Item Description ========== */
.test-item-desc{font-size:13px;color:#888;line-height:1.5;margin-top:6px;margin-bottom:8px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* ========== Test Item Description ========== */
.test-item-desc{font-size:13px;color:#888;line-height:1.5;margin-top:6px;margin-bottom:8px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* ========== List Page Title ========== */
.list-head{margin-bottom:24px;padding-bottom:16px;border-bottom:2px solid #667eea}
.list-head h1{font-size:24px;font-weight:700;color:#333;display:flex;align-items:center;gap:10px}
.list-head h1::before{content:'';width:4px;height:24px;background:linear-gradient(180deg,#667eea,#764ba2);border-radius:2px}
.list-head .count{font-size:14px;color:#999;font-weight:400;margin-left:auto}

/* ========== Test List Items ========== */
.test-list{display:flex;flex-direction:column;gap:16px}
.test-item{display:flex;gap:16px;padding:16px;background:#fff;border:1px solid #eee;border-radius:10px;transition:all .25s}
.test-item:hover{box-shadow:0 4px 16px rgba(102,126,234,.1);border-color:transparent;transform:translateY(-2px)}
.test-item-thumb{width:160px;height:110px;border-radius:8px;overflow:hidden;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:36px;color:#fff;font-weight:600}
.test-item-thumb img{width:100%;height:100%;object-fit:cover}
.test-item-info{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center}
.test-item-info h3{font-size:16px;font-weight:600;color:#333;margin-bottom:10px;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;line-height:1.4}
.test-item-info h3 a{color:inherit}
.test-item-info h3 a:hover{color:#667eea}
.test-item-meta{display:flex;align-items:center;gap:16px;font-size:13px;color:#999;flex-wrap:wrap}
.test-item-meta span{display:flex;align-items:center;gap:4px}
.test-item-meta .tag{background:#f0f4ff;color:#667eea;padding:2px 8px;border-radius:4px;font-size:12px}

/* ========== Pagination ========== */
.pagination{display:flex;align-items:center;justify-content:center;gap:6px;margin-top:30px;padding-top:20px;border-top:1px dashed #eee;flex-wrap:wrap}
.pagination a,.pagination span{padding:8px 14px;border-radius:6px;font-size:14px;color:#666;background:#f5f5f5;transition:all .2s;text-decoration:none;min-width:36px;text-align:center}
.pagination a:hover{background:#667eea;color:#fff}
.pagination .current{background:#667eea;color:#fff;font-weight:600}
.pagination .prev,.pagination .next{padding:8px 16px}
.pagination .disabled{color:#ccc;background:#f9f9f9;cursor:not-allowed}

/* ========== Sidebar Widgets ========== */
.sidebar-widget{background:#fff;border:1px solid #eee;border-radius:10px;padding:18px;margin-bottom:20px}
.sidebar-widget h4{font-size:16px;font-weight:700;color:#333;margin-bottom:14px;padding-bottom:10px;border-bottom:2px solid #667eea;display:flex;align-items:center;gap:6px}
.sidebar-widget h4::before{content:'';width:4px;height:16px;background:linear-gradient(180deg,#667eea,#764ba2);border-radius:2px}
.sidebar-widget ul{display:flex;flex-direction:column;gap:10px}
.sidebar-widget li{display:flex;align-items:center;gap:10px;font-size:14px}
.sidebar-widget li a{color:#555;transition:color .2s;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
.sidebar-widget li a:hover{color:#667eea}

/* Hot rank badges: gold / silver / bronze — applies to both hot & rec widgets */
.sidebar-widget li:nth-child(1) i{width:24px;height:24px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#FFD700,#FFA500);color:#fff;border-radius:50%;font-size:12px;font-weight:800;flex-shrink:0;font-style:normal;box-shadow:0 2px 6px rgba(255,165,0,.35)}
.sidebar-widget li:nth-child(2) i{width:24px;height:24px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#E8E8E8,#B0B0B0);color:#fff;border-radius:50%;font-size:12px;font-weight:800;flex-shrink:0;font-style:normal;box-shadow:0 2px 6px rgba(176,176,176,.3)}
.sidebar-widget li:nth-child(3) i{width:24px;height:24px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#CD7F32,#A0522D);color:#fff;border-radius:50%;font-size:12px;font-weight:800;flex-shrink:0;font-style:normal;box-shadow:0 2px 6px rgba(205,127,50,.3)}
/* 4-10: subtle flat number */
.sidebar-widget li:nth-child(n+4) i{width:22px;height:22px;display:flex;align-items:center;justify-content:center;background:#f5f7fa;color:#b0b4be;border-radius:50%;font-size:11px;font-weight:600;flex-shrink:0;font-style:normal;border:1px solid #e8ecf1}

/* ========== List Page Responsive ========== */
@media(max-width:768px){
  .list-layout{flex-direction:column}
  .list-sidebar{display:none}
  .test-item{flex-direction:row;gap:12px;align-items:center;padding:12px}
  .test-item-thumb{width:100px;height:75px}
  .test-item-info h3{font-size:14px;margin-bottom:0}
  .test-item-desc{display:none}
  .test-item-meta{font-size:12px;gap:10px;margin-top:6px}
  .pagination a,.pagination span{padding:6px 10px;font-size:13px}
  .list-head h1{font-size:20px}
  .breadcrumb{margin-top:12px}
  .list-main{width:100%}
}
@media(max-width:480px){
  .test-item{gap:10px;padding:10px}
  .test-item-thumb{width:80px;height:60px;font-size:24px}
  .test-item-thumb img{font-size:24px}
  .test-item-info h3{font-size:13px;margin-bottom:0}
  .test-item-meta{font-size:12px;gap:10px}
}
