/* ========================================
   全局样式
   ======================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: white;
    color: #1f2937;
}

/* ========================================
   Header 样式（所有页面共用）
   ======================================== */

header {
    background: #2563eb;
    color: white;
    padding: 1rem 1.5rem;
}

.header-container {
    max-width: 80rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: white;
    transition: opacity 0.2s;
}

.logo-section:hover {
    opacity: 0.9;
}

.logo-icon {
    width: 2rem;
    height: 2rem;
    background: white;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon span {
    color: #2563eb;
    font-weight: bold;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: bold;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: flex-end;
}

.nfl-button {
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: #1d4ed8;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .nfl-button {
        display: flex;
    }
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: opacity 0.2s;
}

.nav-link:hover {
    opacity: 0.8;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: white;
    transform: scaleX(0);
    transition: transform 0.2s;
}

.nav-link:hover::after {
    transform: scaleX(1);
}

.search-wrapper {
    position: relative;
    flex: 1;
}

@media (min-width: 640px) {
    .search-wrapper {
        flex: initial;
    }
}

.search-input {
    width: 100%;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background: white;
    color: #1f2937;
    font-size: 0.875rem;
    border: none;
    outline: none;
}

@media (min-width: 640px) {
    .search-input {
        width: 16rem;
    }
}

.search-button {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
}

.search-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #4b5563;
}

/* ========================================
   Main Content 布局
   ======================================== */

.main-content {
    max-width: 80rem;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.content-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .content-layout {
        flex-direction: row;
    }
}

/* ========================================
   Footer 样式（所有页面共用）
   ======================================== */

footer {
    background: #111827;
    color: white;
    margin-top: 4rem;
}

.footer-container {
    max-width: 80rem;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
    width: fit-content;
}

.footer-logo:hover {
    opacity: 0.8;
}

.footer-logo-text {
    font-size: 1.125rem;
    font-weight: bold;
}

.footer-tagline {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #9ca3af;
}

@media (min-width: 640px) {
    .footer-links {
        gap: 1.5rem;
    }
}

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
}

.footer-links a:hover {
    color: white;
}

.footer-links span {
    display: none;
}

@media (min-width: 640px) {
    .footer-links span {
        display: inline;
    }
}

/* ========================================
   Sidebar 样式（多个页面共用）
   ======================================== */

.sidebar {
    width: 100%;
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .sidebar {
        width: 20rem;
    }
}

.sidebar-title {
    font-size: 1rem;
    font-weight: normal;
    margin-bottom: 1rem;
}

.hot-apps-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hot-app-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem;
    border-radius: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.hot-app-item:hover {
    background: #f9fafb;
}

.hot-app-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hot-app-icon {
    width: 70px;
    height: 70px;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.hot-app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hot-app-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.hot-app-category {
    font-size: 0.9375rem;
    color: #9ca3af;
    display: inline;
}

.hot-app-rating {
    font-size: 0.9375rem;
    color: #111827;
    display: inline;
    margin-left: 0.5rem;
}

.arrow {
    color: #9ca3af;
}

/* ========================================
   通用工具类样式
   ======================================== */

.section-title {
    font-size: 1rem;
    font-weight: normal;
    margin-bottom: 1.5rem;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

button:hover {
    opacity: 0.9;
}

.bg-blue-200 { background: #bfdbfe; }
.bg-blue-300 { background: #93c5fd; }
.bg-blue-400 { background: #60a5fa; }
.bg-blue-500 { background: #3b82f6; }
.bg-blue-600 { background: #2563eb; }
.bg-blue-700 { background: #1d4ed8; }
.bg-blue-800 { background: #1e40af; }
.bg-blue-900 { background: #1e3a8a; }
.bg-red-400 { background: #f87171; }
.bg-red-500 { background: #ef4444; }
.bg-red-600 { background: #dc2626; }
.bg-red-700 { background: #b91c1c; }
.bg-green-400 { background: #4ade80; }
.bg-green-500 { background: #22c55e; }
.bg-green-600 { background: #16a34a; }
.bg-yellow-400 { background: #facc15; }
.bg-orange-400 { background: #fb923c; }
.bg-orange-500 { background: #f97316; }
.bg-purple-400 { background: #c084fc; }
.bg-purple-500 { background: #a855f7; }
.bg-purple-600 { background: #9333ea; }
.bg-pink-300 { background: #f9a8d4; }
.bg-pink-600 { background: #db2777; }
.bg-gray-200 { background: #e5e7eb; }
.bg-gray-600 { background: #4b5563; }
.bg-gray-700 { background: #374151; }
.bg-gray-800 { background: #1f2937; }
.bg-gray-900 { background: #111827; }
.bg-amber-700 { background: #b45309; }
.bg-amber-900 { background: #78350f; }
.bg-black { background: #000; }
.bg-gradient-purple-pink {
    background: linear-gradient(to bottom right, #9333ea, #ec4899);
}
.bg-gradient-pink-orange {
    background: linear-gradient(to bottom right, #f9a8d4, #fb923c);
}
.bg-gradient-red {
    background: linear-gradient(to bottom right, #b91c1c, #7f1d1d);
}
.bg-gradient-green {
    background: linear-gradient(to bottom right, #16a34a, #15803d);
}
.border-white {
    background: white;
    border: 2px solid #e5e7eb;
}

/* ========================================
   Page 1 - Apps 页面样式
   ======================================== */

.apps-section {
    flex: 1;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

@media (min-width: 640px) {
    .apps-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
}

@media (min-width: 1024px) {
    .apps-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 10px;
    }
}

.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.app-icon {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 1rem;
    margin-bottom: 0.5rem;
    object-fit: cover;
    border: 1px solid #e5e7eb;
}

.app-name {
    font-size: 0.9rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    max-width: 100%;
}

.app-rating {
    font-size: 0.75rem;
    color: #eab308;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.pagination span {
    font-size: 0.875rem;
}

.page-button {
    background: #2563eb;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    border: none;
    cursor: pointer;
}

.page-button:hover {
    background: #1d4ed8;
}

/* ========================================
   Page 2 - App Detail 页面样式
   ======================================== */

.app-detail-section {
    flex: 1;
    min-width: 0;
}

.app-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.app-logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(to bottom right, #f9a8d4, #fb923c);
    border-radius: 1rem;
    flex-shrink: 0;
    overflow: hidden;
}

.app-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.app-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
    .app-title {
        font-size: 1.875rem;
    }
}

.app-stars {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #eab308;
    margin-bottom: 0.5rem;
}

.app-stars span {
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .app-stars span {
        font-size: 1rem;
    }
}

.app-rating-text {
    color: #4b5563;
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.app-info-table {
    margin-bottom: 2rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    background: white;
}

.app-info-row {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.app-info-row:last-child {
    border-bottom: none;
}

.app-info-row:hover {
    background: #f9fafb;
}

.app-info-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #4b5563;
    width: 12rem;
    flex-shrink: 0;
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .app-info-label {
        font-size: 0.9rem;
    }
}

.info-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.app-info-value {
    flex: 1;
    font-weight: 500;
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .app-info-value {
        font-size: 0.9rem;
    }
}

.screenshots-section {
    margin-bottom: 2rem;
    overflow-x: auto;
    margin-left: -1rem;
    margin-right: -1rem;
}

@media (min-width: 640px) {
    .screenshots-section {
        margin-left: 0;
        margin-right: 0;
    }
}

.screenshots-container {
    display: flex;
    gap: 1rem;
    padding: 0 1rem 0.5rem;
    min-width: min-content;
}

@media (min-width: 640px) {
    .screenshots-container {
        padding: 0 0 0.5rem;
    }
}

.screenshot {
    max-height: 200px;
    border-radius: 0.5rem;
    flex-shrink: 0;
    overflow: hidden;
    display: block;
}

.screenshot img {
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.description-section {
    margin-bottom: 2rem;
}

.description-section p {
    color: #374151;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.description-section h3 {
    font-weight: bold;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.description-section h4 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.description-section ul {
    list-style-position: inside;
    list-style-type: decimal;
    color: #374151;
    margin-bottom: 1rem;
}

.description-section li {
    margin-bottom: 0.25rem;
}

.entry {
    color: #374151;
    line-height: 1.7;
}

.entry h1 {
    font-size: 2rem;
    font-weight: bold;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #111827;
}

.entry h2 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #111827;
}

.entry h3 {
    font-size: 1.25rem;
    font-weight: bold;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.entry h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.entry h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #374151;
}

.entry h6 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #374151;
}

.entry p {
    margin-bottom: 1rem;
}

.entry a {
    color: #2563eb;
    text-decoration: underline;
}

.entry a:hover {
    color: #1d4ed8;
}

.entry ul,
.entry ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.entry ul {
    list-style-type: disc;
}

.entry ol {
    list-style-type: decimal;
}

.entry li {
    margin-bottom: 0.5rem;
}

.entry blockquote {
    border-left: 4px solid #e5e7eb;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #6b7280;
    font-style: italic;
}

.entry code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: ui-monospace, monospace;
    font-size: 0.875em;
    color: #dc2626;
}

.entry pre {
    background-color: #1f2937;
    color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.entry pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

.entry img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.entry table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.entry table th,
.entry table td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    text-align: left;
}

.entry table th {
    background-color: #f9fafb;
    font-weight: 600;
}

.entry strong {
    font-weight: 600;
    color: #111827;
}

.entry em {
    font-style: italic;
}

.entry hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2rem 0;
}

.download-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .download-buttons {
        flex-direction: row;
    }
}

.download-button {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.download-icon {
    flex-shrink: 0;
}

.download-google {
    background: #16a34a;
    color: white;
}

.download-google:hover {
    background: #15803d;
}

.download-apple {
    background: #000;
    color: white;
}

.download-apple:hover {
    background: #1f2937;
}

.btn-disabled {
    background: #9ca3af !important;
    color: #d1d5db !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.btn-disabled:hover {
    background: #9ca3af !important;
}

.similar-apps-section h3 {
    font-size: 1rem;
    font-weight: normal;
    margin-bottom: 1rem;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.similar-apps-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.similar-app-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    text-decoration: none;
    color: inherit;
}

.similar-app-item:hover {
    background: #f9fafb;
}

.similar-app-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.similar-app-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    overflow: hidden;
}

.similar-app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.similar-app-button {
    color: #2563eb;
    border: 1px solid #2563eb;
    padding: 0.25rem 1rem;
    border-radius: 0.25rem;
    background: white;
    cursor: pointer;
}

.similar-app-button:hover {
    background: #eff6ff;
}

/* ========================================
   Page 3 - Home 页面样式
   ======================================== */

.hero-banners {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 3rem;
}

.hero-banner {
    border-radius: 1rem;
    padding: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-banner h2 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.hero-button {
    border: 2px solid white;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    background: transparent;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.hero-button:hover {
    background: white;
    color: inherit;
}

.section {
    margin-bottom: 3rem;
}

.section h3 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.app-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 1rem;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    background: white;
    border: 1px solid #f3f4f6;
    transition: all 0.2s ease;
}

.app-card:hover {
    background: #f9fafb;
    border-color: #e5e7eb;
}

.app-card-icon {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 1.25rem;
    flex-shrink: 0;
    overflow: hidden;
    background: #f3f4f6;
}

.app-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

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

.app-card-name {
    font-weight: 400;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: #000000;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-card-category {
    font-size: 0.8125rem;
    font-weight: 300;
    color: #b5b8bd;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.app-card-rating {
    font-size: 0.875rem;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}

.star-icon {
    display: inline-block;
    vertical-align: middle;
}

.app-card .arrow {
    color: #9ca3af;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 640px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
}

@media (min-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 1.5rem;
    }
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    text-align: center;
    min-height: 120px;
    text-decoration: none;
    color: inherit;
}

.category-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #d1d5db;
}

.category-icon-emoji {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    line-height: 1;
}

.category-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1f2937;
    line-height: 1.3;
}

/* ========================================
   Page 4 - Search 页面样式
   ======================================== */

.search-results-container {
    max-width: 48rem;
}

.search-result-item {
    margin-bottom: 2rem;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.result-label {
    font-size: 0.875rem;
    font-weight: 600;
}

.result-url {
    font-size: 0.75rem;
    color: #4b5563;
}

.result-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.result-title a {
    color: #2563eb;
    text-decoration: none;
}

.result-title a:hover {
    text-decoration: underline;
}

.result-description {
    color: #374151;
    line-height: 1.6;
}

.dark-mode-button {
    width: 2rem;
    height: 2rem;
    background: #1f2937;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}

.dark-mode-button:hover {
    background: #374151;
}

.logo-svg {
    width: 2rem;
    height: 2rem;
}

.highlight {
    font-weight: bold;
}

.pagination-center {
    text-align: center;
    padding: 2rem 0;
    color: #4b5563;
}

.footer-extra {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* ========================================
   Page 5 - About 页面样式
   ======================================== */

.about-page-container {
    max-width: 56rem;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    background: #f9fafb;
    min-height: 100vh;
}

.about-section {
    background: white;
    border-radius: 0.5rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.about-main-title {
    font-size: 1.875rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.about-section-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.about-text {
    color: #374151;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.about-text:last-child {
    margin-bottom: 0;
}

.about-link {
    color: #2563eb;
    text-decoration: none;
}

.about-link:hover {
    text-decoration: underline;
}

.bg-red-700 {
    background: #b91c1c;
}
