/* ===== Cat MBTI - Warm & Playful Design ===== */

/* ===== CSS Variables ===== */
:root {
 /* Colors */
 --bg-cream: #FFF9EF;
 --bg-white: #FFFFFF;

 /* Primary gradient - coral to peach */
 --primary-coral: #FF6B6B;
 --primary-peach: #FFA07A;
 --primary-gradient: linear-gradient(135deg, #FF6B6B 0%, #FFA07A 100%);

 /* Accent colors */
 --accent-warm-orange: #FF8C42;
 --accent-soft-red: #E74C3C;

 /* Text colors */
 --text-heading: #2C3E50;
 --text-body: #5A6A7A;
 --text-muted: #8B9AAB;

 /* Pastel accent colors for icons/illustrations */
 --pastel-pink: #FFB6C1;
 --pastel-orange: #FFA54F;
 --pastel-lavender: #E6E6FA;
 --pastel-mint: #E0FFFF;

 /* Borders and shadows */
 --border-color: #FFE4D0;
 --shadow-sm: 0 4px 12px rgba(255, 107, 107, 0.08);
 --shadow-md: 0 8px 24px rgba(255, 107, 107, 0.12);
 --shadow-lg: 0 16px 48px rgba(255, 107, 107, 0.16);

 /* Border radius */
 --radius-sm: 12px;
 --radius-md: 16px;
 --radius-lg: 20px;
 --radius-xl: 24px;
 --radius-full: 50%;

 /* Transitions */
 --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* ===== Base Styles ===== */
* {
 margin: 0;
 padding: 0;
 box-sizing: border-box;
}

html {
 font-size: 16px;
 scroll-behavior: smooth;
}

body {
 font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
 line-height: 1.6;
 color: var(--text-body);
 background: var(--bg-cream);
 min-height: 100vh;
 overflow-x: hidden;
}

/* Import Poppins font for headings */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

/* ===== Utility Classes ===== */
.hidden {
 display: none !important;
}

/* ===== Loading Screen ===== */
.loading-screen {
 position: fixed;
 top: 0;
 left: 0;
 width: 100%;
 height: 100%;
 background: var(--primary-gradient);
 display: flex;
 align-items: center;
 justify-content: center;
 z-index: 9999;
 transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
 opacity: 0;
 visibility: hidden;
}

.loading-content {
 text-align: center;
 color: white;
}

.cat-loader {
 font-size: 5rem;
 animation: catBounce 1s ease-in-out infinite;
 filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

@keyframes catBounce {
 0%, 100% { transform: translateY(0) rotate(-5deg); }
 50% { transform: translateY(-15px) rotate(5deg); }
}

.loading-dots {
 display: flex;
 justify-content: center;
 gap: 10px;
 margin-top: 24px;
}

.loading-dots span {
 width: 14px;
 height: 14px;
 background: white;
 border-radius: 50%;
 animation: pulse 1.4s ease-in-out infinite;
 box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
 0%, 80%, 100% { opacity: 0.4; transform: scale(0.85); }
 40% { opacity: 1; transform: scale(1); }
}

.loading-text {
 margin-top: 24px;
 font-size: 1.3rem;
 font-weight: 600;
 letter-spacing: 0.5px;
}

/* ===== Toast Notification ===== */
.toast {
 position: fixed;
 top: 100px;
 left: 50%;
 transform: translateX(-50%) translateY(-100px);
 background: var(--text-heading);
 color: white;
 padding: 14px 28px;
 border-radius: var(--radius-md);
 box-shadow: var(--shadow-lg);
 z-index: 10000;
 opacity: 0;
 transition: var(--transition);
 max-width: 90%;
 text-align: center;
 font-weight: 500;
}

.toast.show {
 opacity: 1;
 transform: translateX(-50%) translateY(0);
}

.toast.success { background: var(--primary-peach); }
.toast.error { background: var(--accent-soft-red); }
.toast.info { background: var(--accent-warm-orange); }

/* ===== Navbar ===== */
.navbar {
 position: fixed;
 top: 0;
 left: 0;
 right: 0;
 background: rgba(255, 255, 255, 0.9);
 backdrop-filter: blur(20px);
 padding: 12px 24px;
 display: flex;
 align-items: center;
 justify-content: space-between;
 z-index: 100;
 box-shadow: var(--shadow-sm);
 border-bottom: 1px solid var(--border-color);
}

.nav-container {
 display: flex;
 align-items: center;
 justify-content: space-between;
 width: 100%;
 max-width: 1200px;
 margin: 0 auto;
}

.navbar .logo {
 font-size: 1.3rem;
 font-weight: 700;
 color: var(--primary-coral);
 display: flex;
 align-items: center;
 gap: 8px;
 letter-spacing: -0.3px;
}

.logo-icon {
 font-size: 1.6rem;
}

.nav-menu {
 display: none;
}

.navbar .lang-switch {
 background: var(--bg-cream);
 border: 2px solid var(--border-color);
 border-radius: var(--radius-md);
 padding: 8px 18px;
 font-size: 0.9rem;
 font-weight: 600;
 cursor: pointer;
 transition: var(--transition);
 margin-left: 12px;
}

.navbar .lang-switch:hover {
 border-color: var(--primary-peach);
 color: var(--primary-coral);
}

/* ===== Main Content ===== */
.page {
 display: block;
 padding: 100px 20px 40px;
 max-width: 900px;
 margin: 0 auto;
 animation: fadeIn 0.5s ease;
}

.page.hidden {
 display: none;
}

@keyframes fadeIn {
 from { opacity: 0; transform: translateY(15px); }
 to { opacity: 1; transform: translateY(0); }
}

/* ===== Back Button ===== */
.back-btn {
 position: fixed;
 top: 80px;
 left: 20px;
 display: flex;
 align-items: center;
 justify-content: center;
 background: white;
 border: 2px solid var(--border-color);
 border-radius: var(--radius-md);
 box-shadow: var(--shadow-sm);
 z-index: 9999;
 width: 44px;
 height: 44px;
 -webkit-tap-highlight-color: transparent;
 -webkit-touch-callout: none;
 -webkit-user-select: none;
 user-select: none;
 cursor: pointer;
 transition: var(--transition);
}

.back-btn:active, .back-btn:focus, .back-btn:hover {
 background: white;
 border-color: var(--border-color);
 box-shadow: var(--shadow-sm);
 transform: none;
 outline: none;
}

.back-btn::before {
  content: '\2190';
  font-size: 1.5rem;
  color: var(--primary-coral);
  font-weight: bold;
}

.back-icon {
 display: none;
}

/* ===== Hero Section ===== */
.hero {
 text-align: center;
 padding: 60px 40px;
 background: white;
 border-radius: var(--radius-xl);
 box-shadow: var(--shadow-md);
 margin-bottom: 30px;
 position: relative;
 overflow: hidden;
}

/* 确保hero内所有元素有合适的间距 */
.hero > * {
 margin-bottom: 24px;
}

/* 最后一个元素不需要底部间距 */
.hero > *:last-child {
 margin-bottom: 0;
}

/* Decorative cat paws */
.hero::before {
 content: '🐾';
 position: absolute;
 top: 20px;
 left: 20px;
 font-size: 1.5rem;
 opacity: 0.3;
 transform: rotate(-15deg);
}

.hero::after {
 content: '🐾';
 position: absolute;
 bottom: 20px;
 right: 20px;
 font-size: 1.5rem;
 opacity: 0.3;
 transform: rotate(15deg);
}

.hero-title {
 font-family: 'Poppins', sans-serif;
 font-size: 2.2rem;
 font-weight: 800;
 background: linear-gradient(135deg, #FF6B6B 0%, #FFA07A 100%);
 -webkit-background-clip: text;
 -webkit-text-fill-color: transparent;
 background-clip: text;
 color: #FF6B6B;
 line-height: 1.3;
 letter-spacing: -0.5px;
}

.hero-subtitle {
 font-size: 1.1rem;
 color: var(--text-body);
 font-weight: 400;
 line-height: 1.6;
}

/* ===== Buttons ===== */
.cta-btn {
 background: var(--primary-gradient);
 color: white;
 padding: 18px 48px;
 font-size: 1.1rem;
 font-weight: 700;
 border: none;
 border-radius: var(--radius-md);
 cursor: pointer;
 transition: var(--transition);
 box-shadow: 0 6px 20px rgba(255, 107, 107, 0.35);
 position: relative;
 overflow: hidden;
 text-transform: uppercase;
 letter-spacing: 0.5px;
}

.cta-btn::before {
 content: '🐾';
 margin-right: 8px;
 font-size: 1rem;
}

.cta-btn:hover {
 transform: translateY(-3px);
 box-shadow: 0 10px 30px rgba(255, 107, 107, 0.45);
}

.secondary-actions {
 display: flex;
 justify-content: center;
 gap: 16px;
 margin-top: 24px;
 margin-bottom: 40px;
 flex-wrap: wrap;
}

.secondary-btn {
 background: white;
 color: var(--text-heading);
 padding: 14px 28px;
 font-size: 1rem;
 font-weight: 600;
 border: 2px solid var(--border-color);
 border-radius: var(--radius-md);
 cursor: pointer;
 transition: var(--transition);
 box-shadow: var(--shadow-sm);
}

.secondary-btn:hover {
 border-color: var(--primary-peach);
 color: var(--primary-coral);
 transform: translateY(-2px);
 box-shadow: var(--shadow-md);
}

/* ===== Secondary Actions Section ===== */
.secondary-actions-section {
 padding: 40px 0;
}

.action-cards {
 display: grid;
 grid-template-columns: repeat(2, 1fr);
 gap: 20px;
 max-width: 600px;
 margin: 0 auto;
}

.action-card {
 display: flex;
 align-items: center;
 gap: 16px;
 background: white;
 border: 2px solid var(--border-color);
 border-radius: var(--radius-lg);
 padding: 20px 24px;
 text-decoration: none;
 color: inherit;
 transition: var(--transition);
 box-shadow: var(--shadow-sm);
}

.action-card:hover {
 border-color: var(--pastel-pink);
 transform: translateY(-3px);
 box-shadow: var(--shadow-md);
}

.action-icon {
 font-size: 2.5rem;
 flex-shrink: 0;
}

.action-content h3 {
 font-family: 'Poppins', sans-serif;
 font-size: 1.1rem;
 font-weight: 700;
 color: var(--text-heading);
 margin-bottom: 6px;
}

.action-content p {
 font-size: 0.9rem;
 color: var(--text-body);
 margin: 0;
}

@media (max-width: 600px) {
 .action-cards {
 grid-template-columns: repeat(2, 1fr);
 gap: 10px;
 max-width: 100%;
 }

 .action-card {
 padding: 12px 16px;
 gap: 10px;
 }

 .action-icon {
 font-size: 1.8rem;
 }

 .action-content h3 {
 font-size: 0.95rem;
 }

 .action-content p {
 font-size: 0.75rem;
 }
}

/* ===== Action Buttons ===== */
.action-btn {
 padding: 14px 24px;
 border: none;
 border-radius: var(--radius-md);
 font-size: 1rem;
 font-weight: 600;
 cursor: pointer;
 transition: var(--transition);
}

.action-btn.primary {
 background: var(--primary-gradient);
 color: white;
 box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
}

.action-btn.primary:hover {
 transform: translateY(-2px);
 box-shadow: 0 6px 24px rgba(255, 107, 107, 0.4);
}

.action-btn.secondary {
 background: white;
 color: var(--text-heading);
 border: 2px solid var(--border-color);
}

.action-btn.secondary:hover {
 border-color: var(--primary-peach);
 color: var(--primary-coral);
}

/* ===== Personality Carousel ===== */
.personalities-section {
 background: white;
 border-radius: var(--radius-xl);
 padding: 12px 0 20px 0;
 box-shadow: var(--shadow-md);
 margin-bottom: 30px;
}

.section-title {
 text-align: center;
 font-family: 'Poppins', sans-serif;
 font-size: 1.1rem;
 font-weight: 700;
 color: var(--text-heading);
 margin-bottom: 25px;
}

.carousel-container {
 position: relative;
 overflow: hidden;
 padding: 10px 10px 0 10px;
}

.carousel {
 display: flex;
}

.carousel-track {
 display: flex;
 gap: 16px;
 animation: autoScroll 40s linear infinite;
}

.personality-card {
 flex: 0 0 100px;
 background: transparent;
 border-radius: var(--radius-lg);
 padding: 10px 8px;
 text-align: center;
 box-shadow: none;
 transition: var(--transition);
 border: none;
 min-width: 100px;
 display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center;
 gap: 4px;
}

.personality-card:hover {
 transform: translateY(-4px);
}

.personality-type {
 font-family: 'Poppins', sans-serif;
 font-size: 1rem;
 font-weight: 800;
 color: var(--text-heading);
 margin: 0;
 line-height: 1.2;
}

.personality-archetype {
 font-size: 0.75rem;
 font-weight: 600;
 color: var(--text-body);
 margin: 0;
 line-height: 1.3;
 display: none;
}

.personality-emoji {
 font-size: 1.4rem;
 margin: 0;
 filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.personality-group {
 display: inline-block;
 padding: 3px 10px;
 background: rgba(255, 107, 107, 0.15);
 border-radius: var(--radius-full);
 font-size: 0.65rem;
 font-weight: 600;
 color: var(--primary-coral);
 margin: 0;
}

/* Auto Scroll Animation */
@keyframes autoScroll {
 0% { transform: translateX(0); }
 100% { transform: translateX(-50%); }
}

.carousel-container:hover .carousel-track {
 animation-play-state: paused;
}

/* ===== Features ===== */
.features {
 display: grid;
 grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
 gap: 20px;
}

.feature-card {
 background: white;
 border-radius: var(--radius-lg);
 padding: 32px 24px;
 text-align: center;
 box-shadow: var(--shadow-sm);
 transition: var(--transition);
 border: 2px solid var(--border-color);
}

.feature-card:hover {
 transform: translateY(-6px);
 box-shadow: var(--shadow-md);
 border-color: var(--pastel-pink);
}

.feature-icon {
 font-size: 3rem;
 margin-bottom: 18px;
 filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.feature-card h3 {
 font-family: 'Poppins', sans-serif;
 font-size: 1.1rem;
 font-weight: 700;
 color: var(--text-heading);
 margin-bottom: 12px;
}

.feature-title {
 font-family: 'Poppins', sans-serif;
 font-size: 1.1rem;
 font-weight: 700;
 margin-bottom: 12px;
 color: var(--text-heading);
}

.feature-desc {
 font-size: 0.9rem;
 color: var(--text-body);
 line-height: 1.5;
}

/* ===== Test Page ===== */
.test-container {
 background: white;
 border-radius: var(--radius-xl);
 padding: 28px;
 box-shadow: var(--shadow-md);
}

.progress-bar {
 height: 10px;
 background: var(--border-color);
 border-radius: var(--radius-md);
 overflow: hidden;
 margin-bottom: 12px;
}

.progress-fill {
 height: 100%;
 background: var(--primary-gradient);
 border-radius: var(--radius-md);
 transition: width 0.4s ease;
 width: 0%;
}

.progress-text {
 font-size: 0.95rem;
 color: var(--text-body);
 text-align: right;
 font-weight: 600;
}

.question-card {
 margin-bottom: 28px;
}

.question-number {
 font-weight: 600;
 color: var(--text-muted);
 font-size: 0.95rem;
 margin-bottom: 8px;
}

.question-text {
 font-family: 'Poppins', sans-serif;
 font-size: 1.4rem;
 font-weight: 700;
 margin-bottom: 24px;
 line-height: 1.4;
 color: var(--text-heading);
}

.question-category {
 display: inline-block;
 padding: 4px 12px;
 background: rgba(255, 107, 107, 0.15);
 border-radius: var(--radius-md);
 font-size: 0.8rem;
 font-weight: 600;
 color: var(--primary-coral);
 margin-bottom: 12px;
}

.options-container {
 display: flex;
 flex-direction: column;
 gap: 12px;
}

.option-btn {
 padding: 16px 20px;
 background: var(--bg-cream);
 border: 2px solid var(--border-color);
 border-radius: var(--radius-md);
 text-align: left;
 font-size: 1rem;
 font-weight: 500;
 cursor: pointer;
 transition: var(--transition);
 color: var(--text-body);
}

.option-btn:hover {
 border-color: var(--pastel-pink);
 background: rgba(255, 182, 193, 0.1);
}

.option-btn.selected {
 border-color: var(--primary-coral);
 background: rgba(255, 107, 107, 0.1);
 color: var(--primary-coral);
 font-weight: 600;
}

.test-nav {
 display: flex;
 justify-content: space-between;
 gap: 12px;
 margin-top: 24px;
}

.test-nav .nav-btn {
 flex: 1;
 padding: 14px 20px;
 border: none;
 border-radius: var(--radius-md);
 font-size: 1rem;
 font-weight: 600;
 cursor: pointer;
 transition: var(--transition);
}

.test-nav .nav-btn.primary {
 background: var(--primary-gradient);
 color: white;
 box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.test-nav .nav-btn.primary:hover:not(:disabled) {
 transform: translateY(-2px);
 box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

.test-nav .nav-btn.secondary {
 background: var(--bg-cream);
 color: var(--text-heading);
 border: 2px solid var(--border-color);
}

.test-nav .nav-btn.secondary:hover:not(:disabled) {
 border-color: var(--primary-peach);
}

.test-nav .nav-btn:disabled {
 opacity: 0.5;
 cursor: not-allowed;
}

/* ===== Result Page ===== */
.result-container {
 background: white;
 border-radius: var(--radius-xl);
 padding: 32px;
 box-shadow: var(--shadow-md);
}

.result-header {
 text-align: center;
 padding: 40px 20px;
 background: linear-gradient(135deg, #FF6B6B 0%, #FFA07A 100%);
 border-radius: 20px;
 margin-bottom: 30px;
}

.result-type {
 font-family: 'Poppins', sans-serif;
 font-size: 3.5rem;
 font-weight: 800;
 color: white;
 line-height: 1;
 margin-bottom: 12px;
}

.result-subtitle {
 font-size: 1.5rem;
 font-weight: 700;
 color: white;
 margin-bottom: 8px;
}

.result-group {
 font-size: 1.1rem;
 font-weight: 600;
 color: rgba(255, 255, 255, 0.9);
 margin-bottom: 10px;
}

.result-emoji {
 font-size: 4rem;
}

.result-section {
 background: white;
 border-radius: 20px;
 padding: 24px;
 margin-bottom: 20px;
 border: 2px solid #FFE4D0;
}

.result-section h3 {
 font-size: 1.3rem;
 font-weight: 700;
 margin-bottom: 16px;
 color: #2C3E50;
}

.result-description {
 background: #FFF9EF;
 padding: 20px;
 border-radius: 16px;
 margin-bottom: 20px;
 font-size: 1.05rem;
 line-height: 1.7;
 color: #5A6A7A;
 border: 2px solid #FFE4D0;
}

.result-list {
 list-style: none;
 padding: 0;
}

.result-list li {
 background: linear-gradient(135deg, #E3F2FD 0%, #F3E5F5 100%);
 padding: 16px;
 border-radius: 12px;
 margin-bottom: 12px;
 line-height: 1.6;
}

.result-list li strong {
 color: #2C3E50;
}

/* Score Section */
.score-section {
 background: white;
 border-radius: 20px;
 padding: 24px;
 margin-bottom: 20px;
}

.score-section h3 {
 font-size: 1.3rem;
 font-weight: 700;
 margin-bottom: 16px;
 color: #2C3E50;
}

.score-grid {
 display: grid;
 gap: 20px;
}

.score-item {
 display: flex;
 flex-direction: column;
 gap: 8px;
}

.score-labels {
 display: flex;
 justify-content: space-between;
 font-weight: 700;
 font-size: 1rem;
 color: var(--text-heading);
}

.score-bar {
 height: 26px;
 background: #FFE4D0;
 border-radius: 12px;
 overflow: hidden;
 position: relative;
 display: flex;
}

.score-fill {
 height: 100%;
 transition: width 0.5s ease;
 display: flex;
 align-items: center;
 justify-content: center;
 font-weight: 700;
 font-size: 0.75rem;
 color: white;
}

.score-fill-e { background: #FF6B6B; color: white; }
.score-fill-i { background: #E6E6FA; color: #2C3E50; }
.score-fill-s { background: #E0FFFF; color: #2C3E50; }
.score-fill-n { background: #FFA54F; color: white; }
.score-fill-t { background: #FFB6C1; color: white; }
.score-fill-f { background: #FF6B6B; color: white; }
.score-fill-j { background: #FFA07A; color: white; }
.score-fill-p { background: #FFA54F; color: #2C3E50; }
.score-fill-a { background: #E6E6FA; color: #2C3E50; }
.score-fill-t-identity { background: #FFB6C1; color: white; }

.score-values {
 display: flex;
 justify-content: space-between;
 font-size: 0.9rem;
 color: #5A6A7A;
 font-weight: 600;
}

/* Breed List */
.breed-list {
 display: grid;
 grid-template-columns: repeat(4, 1fr);
 gap: 14px;
}

.breed-card {
 background: #FFF9EF;
 padding: 16px;
 border-radius: 16px;
 border: 2px solid #FFE4D0;
 text-align: center;
 display: flex;
 flex-direction: column;
 align-items: center;
 gap: 8px;
}

.breed-icon {
 font-size: 0.8rem;
 line-height: 1;
}

.breed-name {
 color: #2C3E50;
 font-size: 1rem;
 font-weight: 600;
}

.breed-match {
 font-size: 2.5rem;
 color: #FF6B6B;
 font-weight: 700;
 line-height: 1;
}

/* Compatibility Chart */
.compatibility-chart {
 display: flex;
 flex-direction: column;
 gap: 16px;
}

.compat-group {
 background: white;
 border-radius: 16px;
 padding: 16px;
}

.compat-group-label {
 font-size: 0.9rem;
 font-weight: 700;
 margin-bottom: 12px;
 color: #2C3E50;
}

.compat-group-high .compat-group-label {
 color: #FF6B6B;
}

.compat-group-medium .compat-group-label {
 color: #5A6A7A;
}

.compat-group-low .compat-group-label {
 color: #9B7EBD;
}

.compat-group-items {
 display: grid;
 grid-template-columns: repeat(4, 1fr);
 gap: 8px;
}

.compat-item {
 background: #FFF9EF;
 border-radius: 12px;
 padding: 10px 6px;
 text-align: center;
 font-size: 0.75rem;
 font-weight: 600;
 color: #2C3E50;
}

.compat-group-high .compat-item {
 background: #FFE0E6;
}

.compat-group-medium .compat-item {
 background: #FFF9EF;
}

.compat-group-low .compat-item {
 background: #E6E6FA;
}

.compat-item > div:first-child {
 font-family: 'Poppins', sans-serif;
 font-size: 0.8rem;
 font-weight: 700;
 margin-bottom: 3px;
}

.compat-name {
 font-size: 0.65rem;
 opacity: 0.85;
}

/* Result Actions */
.result-actions {
 display: grid;
 grid-template-columns: repeat(2, 1fr);
 gap: 12px;
 margin-top: 30px;
}

@media (max-width: 600px) {
 .result-actions {
 grid-template-columns: 1fr;
 }
}

/* ===== Gallery Page ===== */
.gallery-header {
 text-align: center;
 margin-bottom: 36px;
}

.gallery-header h2 {
 font-family: 'Poppins', sans-serif;
 font-size: 2rem;
 font-weight: 700;
 margin-bottom: 12px;
 color: var(--text-heading);
}

.gallery-header p {
 color: var(--text-body);
 font-size: 1.05rem;
}

/* Community Grid */
.community-grid {
 display: flex;
 flex-direction: column;
 gap: 20px;
 max-width: 600px;
 margin: 0 auto;
}

/* Community Cat Card */
.community-cat-card {
 background: white;
 border-radius: var(--radius-xl);
 padding: 20px;
 box-shadow: var(--shadow-sm);
 transition: var(--transition);
 border: 2px solid var(--border-color);
}

.community-cat-card:hover {
 transform: translateY(-3px);
 box-shadow: var(--shadow-md);
 border-color: var(--pastel-pink);
}

/* Card Header */
.card-header {
 display: flex;
 align-items: center;
 margin-bottom: 16px;
 gap: 14px;
}

.cat-avatar {
 width: 56px;
 height: 56px;
 border-radius: 50%;
 display: flex;
 align-items: center;
 justify-content: center;
 font-size: 2rem;
 flex-shrink: 0;
}

.cat-info {
 flex: 1;
 min-width: 0;
}

.cat-name-row {
 display: flex;
 align-items: center;
 gap: 8px;
 margin-bottom: 4px;
}

.cat-name {
 font-size: 1.2rem;
 font-weight: 700;
 color: var(--text-heading);
}

.mbti-tag {
 padding: 4px 10px;
 border-radius: 12px;
 font-size: 0.75rem;
 font-weight: 700;
 font-family: 'Poppins', sans-serif;
 color: white;
}

.cat-meta {
 font-size: 0.85rem;
 color: #9CA3AF;
}

/* Card Body */
.card-body {
 margin-bottom: 16px;
}

.cat-description {
 font-size: 1rem;
 color: var(--text-body);
 line-height: 1.6;
 margin-bottom: 10px;
}

.cat-title {
 font-size: 0.95rem;
 font-weight: 600;
 color: var(--primary-coral);
}

/* Card Footer */
.card-footer {
 display: flex;
 justify-content: space-between;
 align-items: center;
}

.cat-traits {
 display: flex;
 gap: 8px;
}

.trait-tag {
 padding: 5px 12px;
 background: var(--bg-cream);
 border-radius: 12px;
 font-size: 0.8rem;
 color: var(--text-body);
 font-weight: 500;
}

.like-section {
 display: flex;
 align-items: center;
 gap: 6px;
 cursor: pointer;
 transition: var(--transition);
}

.like-section:hover .like-icon {
 transform: scale(1.1);
}

.like-icon {
 font-size: 1.3rem;
 transition: var(--transition);
}

.like-icon.liked {
 color: #FF6B6B;
}

.like-count {
 font-size: 0.95rem;
 font-weight: 600;
 color: var(--text-body);
}

/* ===== Compare Page ===== */
.compare-header {
 text-align: center;
 margin-bottom: 36px;
}

.compare-header h2 {
 font-family: 'Poppins', sans-serif;
 font-size: 2rem;
 font-weight: 700;
 margin-bottom: 12px;
 color: var(--text-heading);
}

.compare-header p {
 color: var(--text-body);
 font-size: 1.05rem;
 line-height: 1.6;
}

.compare-container {
 background: white;
 border-radius: var(--radius-xl);
 padding: 32px;
 box-shadow: var(--shadow-md);
 margin-bottom: 30px;
}

.compare-input {
 margin-bottom: 30px;
}

#catInputs {
 display: flex;
 flex-direction: column;
 gap: 16px;
 margin-bottom: 20px;
}

.cat-input-row {
 display: grid;
 grid-template-columns: 2fr 3fr auto;
 gap: 12px;
 align-items: end;
}

.cat-input-row input {
 padding: 14px 16px;
 border: 2px solid var(--border-color);
 border-radius: var(--radius-md);
 font-size: 1rem;
 font-family: inherit;
 background: var(--bg-cream);
}

.cat-input-row select {
 padding: 14px 16px;
 border: 2px solid var(--border-color);
 border-radius: var(--radius-md);
 font-size: 1rem;
 font-family: inherit;
 background: var(--bg-cream);
 cursor: pointer;
}

.remove-cat-row-btn {
 padding: 14px 16px;
 background: var(--accent-soft-red);
 color: white;
 border: none;
 border-radius: var(--radius-md);
 cursor: pointer;
 font-size: 0.9rem;
 font-weight: 600;
 transition: var(--transition);
}

.remove-cat-row-btn:hover {
 background: #e74c3c;
}

.add-cat-row-btn {
 width: 100%;
 padding: 16px;
 background: var(--bg-cream);
 border: 2px dashed var(--border-color);
 border-radius: var(--radius-md);
 color: var(--text-heading);
 font-size: 1rem;
 font-weight: 600;
 cursor: pointer;
 transition: var(--transition);
 margin-bottom: 20px;
}

.add-cat-row-btn:hover {
 background: rgba(255, 107, 107, 0.05);
 border-color: var(--primary-peach);
}

.compare-submit-btn {
 width: 100%;
 padding: 18px;
 background: var(--primary-gradient);
 color: white;
 border: none;
 border-radius: var(--radius-md);
 font-size: 1.1rem;
 font-weight: 700;
 cursor: pointer;
 transition: var(--transition);
 box-shadow: 0 6px 20px rgba(255, 107, 107, 0.35);
}

.compare-submit-btn:hover {
 transform: translateY(-2px);
 box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.compare-submit-btn:disabled {
 opacity: 0.5;
 cursor: not-allowed;
 transform: none;
}

.remove-cat {
 position: absolute;
 top: 10px;
 right: 10px;
 width: 30px;
 height: 30px;
 background: var(--primary-coral);
 color: white;
 border: none;
 border-radius: 50%;
 cursor: pointer;
 font-size: 1rem;
 display: flex;
 align-items: center;
 justify-content: center;
 opacity: 0;
 transition: var(--transition);
}

.cat-item:not(.add-cat) {
 position: relative;
}

.cat-item:not(.add-cat):hover .remove-cat {
 opacity: 1;
}

.remove-cat:hover {
 background: var(--accent-soft-red);
 transform: scale(1.1);
}

.compare-result {
 background: var(--bg-cream);
 border-radius: var(--radius-lg);
 padding: 28px;
 display: none;
 border: 2px solid var(--border-color);
}

.compare-result.show {
 display: block;
 animation: fadeIn 0.5s ease;
}

.compare-result h3 {
 font-family: 'Poppins', sans-serif;
 font-size: 1.4rem;
 font-weight: 700;
 margin-bottom: 20px;
 color: var(--text-heading);
 text-align: center;
}

.match-score {
 text-align: center;
 margin-bottom: 24px;
}

.match-score .score-label {
 font-size: 1rem;
 color: var(--text-body);
 margin-bottom: 8px;
 display: block;
}

.match-score .score-value {
 font-family: 'Poppins', sans-serif;
 font-size: 3rem;
 font-weight: 800;
 background: var(--primary-gradient);
 -webkit-background-clip: text;
 -webkit-text-fill-color: transparent;
 background-clip: text;
}

.match-advice {
 background: white;
 padding: 20px;
 border-radius: var(--radius-lg);
 border: 2px solid var(--border-color);
}

/* ===== Modal ===== */
.modal {
 display: none;
 position: fixed;
 top: 0;
 left: 0;
 width: 100%;
 height: 100%;
 background: rgba(44, 62, 80, 0.5);
 z-index: 1000;
 align-items: center;
 justify-content: center;
 padding: 20px;
}

.modal.hidden {
 display: none !important;
}

.modal:not(.hidden) {
 display: flex !important;
}

.modal-content {
 background: white;
 border-radius: var(--radius-xl);
 width: 100%;
 max-width: 450px;
 max-height: 90vh;
 overflow-y: auto;
 animation: modalSlide 0.3s ease;
 box-shadow: var(--shadow-lg);
 padding: 0;
}

.modal-content form {
 padding: 24px;
}

@keyframes modalSlide {
 from { opacity: 0; transform: translateY(-20px) scale(0.95); }
 to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
 display: flex;
 justify-content: space-between;
 align-items: center;
 padding: 24px;
 border-bottom: 1px solid var(--border-color);
 position: relative;
 z-index: 1001;
}

.modal-header h3 {
 font-family: 'Poppins', sans-serif;
 font-size: 1.4rem;
 font-weight: 700;
 color: var(--text-heading);
}

.close-btn {
 background: var(--bg-cream);
 border: none;
 width: 36px;
 height: 36px;
 border-radius: 50%;
 font-size: 1.5rem;
 cursor: pointer;
 color: var(--text-body);
 transition: var(--transition);
 display: flex;
 align-items: center;
 justify-content: center;
 z-index: 1002;
 position: relative;
}

.close-btn:hover {
 background: var(--primary-coral);
 color: white;
}

.modal-body {
 padding: 24px;
}

.form-group {
 margin-bottom: 28px;
}

.form-group label {
 display: block;
 font-weight: 600;
 margin-bottom: 16px;
 color: var(--text-heading);
 font-size: 0.95rem;
}

.form-group input, .form-group select, .form-group textarea {
 width: 100%;
 padding: 14px 16px;
 border: 2px solid var(--border-color);
 border-radius: var(--radius-md);
 font-size: 1rem;
 font-family: inherit;
 transition: var(--transition);
 background: var(--bg-cream);
 color: var(--text-heading);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
 outline: none;
 border-color: var(--primary-peach);
 background: white;
}

.btn-primary {
 width: 100%;
 padding: 16px;
 background: var(--primary-gradient);
 color: white;
 border: none;
 border-radius: var(--radius-md);
 font-size: 1.1rem;
 font-weight: 700;
 cursor: pointer;
 transition: var(--transition);
 box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
}

.btn-primary:hover {
 transform: translateY(-2px);
 box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* ===== Group Colors ===== */
/* Strategist (NT) - Purple */
.personality-card.group-strategist .personality-type {
 color: #9B59B6;
}
.personality-card.group-strategist .personality-group {
 background: rgba(155, 89, 182, 0.15);
 color: #9B59B6;
}

/* Idealist (NF) - Green */
.personality-card.group-idealist .personality-type {
 color: #27AE60;
}
.personality-card.group-idealist .personality-group {
 background: rgba(39, 174, 96, 0.15);
 color: #27AE60;
}

/* Guardian (SJ) - Blue */
.personality-card.group-guardian .personality-type {
 color: #2980B9;
}
.personality-card.group-guardian .personality-group {
 background: rgba(41, 128, 185, 0.15);
 color: #2980B9;
}

/* Explorer (SP) - Yellow */
.personality-card.group-explorer .personality-type {
 color: #F1C40F;
}
.personality-card.group-explorer .personality-group {
 background: rgba(241, 196, 15, 0.15);
 color: #F1C40F;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
 html {
 font-size: 15px;
 }

 .hero-title {
 font-size: 1.8rem;
 }

 /* Features - show in one row on mobile */
 .features {
 grid-template-columns: repeat(3, 1fr);
 gap: 10px;
 }

 .feature-card {
 padding: 16px 12px;
 }

 .feature-icon {
 font-size: 2rem;
 margin-bottom: 10px;
 }

 .feature-card h3, .feature-title {
 font-size: 0.95rem;
 margin-bottom: 8px;
 }

 .feature-desc {
 font-size: 0.8rem;
 }

 .result-type {
 font-size: 2.5rem;
 }

 .result-emoji {
 font-size: 3.5rem;
 }

 .breed-list {
 grid-template-columns: repeat(2, 1fr);
 }

 .compat-group-items {
 grid-template-columns: repeat(3, 1fr);
 gap: 6px;
 }

 .compat-item {
 padding: 8px 4px;
 font-size: 0.7rem;
 }

 .compat-item > div:first-child {
 font-size: 0.75rem;
 }

 .compat-name {
 font-size: 0.6rem;
 }

 .community-cat-card {
 padding: 16px;
 }

 .cat-avatar {
 width: 48px;
 height: 48px;
 font-size: 1.6rem;
 }

 .cat-name {
 font-size: 1.1rem;
 }

 .cat-description {
 font-size: 0.95rem;
 }

 .trait-tag {
 font-size: 0.75rem;
 padding: 4px 10px;
 }
}
@media (max-width: 480px) {
 .page {
 padding: 90px 16px 40px;
 }

 .hero {
 padding: 35px 20px;
 }

 .test-container, .result-container, .compare-container {
 padding: 24px 20px;
 }

 .question-text {
 font-size: 1.2rem;
 }

 .back-btn {
 top: 80px;
 left: 20px;
 }

 /* Action cards - keep two columns on small screens */
 .action-cards {
 grid-template-columns: repeat(2, 1fr);
 gap: 8px;
 padding: 0 16px;
 }

 .action-card {
 padding: 10px 12px;
 gap: 8px;
 }

 .action-icon {
 font-size: 1.5rem;
 }

 .action-content h3 {
 font-size: 0.85rem;
 }

 .action-content p {
 font-size: 0.7rem;
 line-height: 1.3;
 }

 .compat-group-items {
 grid-template-columns: repeat(2, 1fr);
 gap: 6px;
 }

 .gallery-grid {
 grid-template-columns: repeat(2, 1fr);
 }

 .cat-input-row {
 grid-template-columns: 1fr;
 gap: 8px;
 }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
 width: 10px;
 height: 10px;
}

::-webkit-scrollbar-track {
 background: var(--bg-cream);
}

::-webkit-scrollbar-thumb {
 background: var(--primary-gradient);
 border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb:hover {
 background: var(--primary-coral);
}

/* ===== Site Footer ===== */
.site-footer {
 text-align: center;
 padding: 20px;
 color: #999;
 font-size: 0.85rem;
 margin-top: 40px;
 max-width: 900px;
 margin: 40px auto 20px;
}

/* ===== Google AdSense Placeholder ===== */
.adsense-container {
 display: none;
 margin-top: 40px;
 padding: 20px;
 text-align: center;
}

.adsense-container.active {
 display: block;
}

.adsense-container:has(> *) {
 display: block;
}

.adsense-placeholder {
 background: #f5f5f5;
 border: 1px dashed #ddd;
 border-radius: 8px;
 padding: 20px;
 min-height: 100px;
 display: flex;
 align-items: center;
 justify-content: center;
}

.adsense-placeholder p {
 color: #999;
 font-size: 0.85rem;
 margin: 0;
}

/* ===== 密码验证门样式 ===== */
/* Body lock state */
body.password-locked {
 overflow: hidden;
}

body.password-locked .page,
body.password-locked .navbar {
 display: none !important;
}

.password-gate {
 position: fixed;
 top: 0;
 left: 0;
 width: 100vw;
 height: 100vh;
 background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
 display: flex;
 justify-content: center;
 align-items: center;
 z-index: 9999;
 transition: opacity 0.3s ease;
}

.password-gate.hidden {
 display: none;
}

.gate-container {
 background: rgba(255, 255, 255, 0.95);
 border-radius: 20px;
 padding: 40px;
 max-width: 400px;
 width: 90%;
 box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
 text-align: center;
 backdrop-filter: blur(10px);
}

.gate-content {
 margin: 0 auto;
}

.gate-icon {
 font-size: 3rem;
 margin-bottom: 20px;
 display: block;
}

.gate-title {
 font-size: 1.8rem;
 font-weight: 700;
 color: #333;
 margin-bottom: 10px;
}

.gate-subtitle {
 font-size: 1rem;
 color: #666;
 margin-bottom: 30px;
}

.gate-form {
 margin-bottom: 20px;
}

.gate-input {
 width: 100%;
 padding: 15px 20px;
 border: 2px solid #e0e0e0;
 border-radius: 10px;
 font-size: 1rem;
 background: #fafafa;
 transition: all 0.3s ease;
 margin-bottom: 15px;
}

.gate-input:focus {
 outline: none;
 border-color: #667eea;
 background: #fff;
 box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.gate-button {
 width: 100%;
 padding: 15px 30px;
 background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
 color: white;
 border: none;
 border-radius: 10px;
 font-size: 1rem;
 font-weight: 600;
 cursor: pointer;
 transition: all 0.3s ease;
}

.gate-button:hover {
 transform: translateY(-2px);
 box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.gate-button:active {
 transform: translateY(0);
}

.gate-error {
 color: #e74c3c;
 font-size: 0.9rem;
 margin-top: 10px;
 min-height: 20px;
}

/* ===== Access Denied Page ===== */
.access-denied-container {
 display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center;
 min-height: 70vh;
 text-align: center;
 padding: 40px 20px;
}

.access-denied-icon {
 font-size: 5rem;
 margin-bottom: 24px;
 animation: pulse 2s infinite;
}

.access-denied-title {
 font-family: 'Poppins', sans-serif;
 font-size: 2rem;
 font-weight: 700;
 color: var(--text-heading);
 margin-bottom: 16px;
}

.access-denied-message {
 font-size: 1.1rem;
 color: var(--text-body);
 max-width: 400px;
 line-height: 1.6;
}

@keyframes pulse {
 0%, 100% { transform: scale(1); }
 50% { transform: scale(1.1); }
}

@media (max-width: 600px) {
 .access-denied-icon {
 font-size: 4rem;
 }

 .access-denied-title {
 font-size: 1.5rem;
 }

 .access-denied-message {
 font-size: 1rem;
 }
}