/* Tailwind CSS 替代方案 - 本地實現 */

/* 基礎重置和佈局 */
* { box-sizing: border-box; }
body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

/* 容器和網格 */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }
.container-full { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }

/* Flexbox 佈局 */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.items-end { align-items: flex-end; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }

/* 網格系統 */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* 響應式網格 */
@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sm\:w-2\/3 { width: 66.666667%; }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:block { display: block; }
    .md\:hidden { display: none; }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .lg\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .lg\:grid-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
    .lg\:grid-cols-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
    .lg\:col-span-3 { grid-column: span 3 / span 3; }
    .lg\:col-span-4 { grid-column: span 4 / span 4; }
}

@media (min-width: 1280px) {
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .xl\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .xl\:grid-cols-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
    .xl\:grid-cols-10 { grid-template-columns: repeat(10, minmax(0, 1fr)); }
    .xl\:col-span-3 { grid-column: span 3 / span 3; }
    .xl\:col-span-4 { grid-column: span 4 / span 4; }
    .xl\:col-span-5 { grid-column: span 5 / span 5; }
}

/* 定位 */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-40 { z-index: 40; }

/* 尺寸 */
.w-full { width: 100%; }
.h-full { height: 100%; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }
.w-14 { width: 3.5rem; }
.h-14 { height: 3.5rem; }
.w-16 { width: 4rem; }
.h-16 { height: 4rem; }
.min-h-\[500px\] { min-height: 500px; }
.max-w-2xl { max-width: 42rem; }
.max-w-xl { max-width: 36rem; }

/* 背景 */
.bg-white { background-color: #ffffff; }
.bg-dark { background-color: #1a1a1a; }
.bg-darker { background-color: #0f0f0f; }
.bg-dark-card { background-color: #2a2a2a; }
.bg-dark-hover { background-color: #333333; }
.bg-primary { background-color: #3b82f6; }
.bg-secondary { background-color: #10b981; }
.bg-accent { background-color: #f59e0b; }

/* 漸變背景 */
.bg-gradient-to-t { background-image: linear-gradient(to top, var(--tw-gradient-stops)); }
.bg-gradient-to-b { background-image: linear-gradient(to bottom, var(--tw-gradient-stops)); }
.from-dark { --tw-gradient-from: #1a1a1a; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.to-darker { --tw-gradient-to: #0f0f0f; }
.from-dark\/70 { --tw-gradient-from: rgba(26, 26, 26, 0.7); }
.to-dark\/40 { --tw-gradient-to: rgba(26, 26, 26, 0.4); }

/* 文字顏色 */
.text-white { color: #ffffff; }
.text-gray-200 { color: #e5e7eb; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-primary { color: #3b82f6; }
.text-secondary { color: #10b981; }
.text-accent { color: #f59e0b; }
.text-green-500 { color: #10b981; }

/* 字體 */
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.font-display { font-family: ui-serif, Georgia, serif; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-5xl { font-size: 3rem; line-height: 1; }

/* 間距 */
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.pb-16 { padding-bottom: 4rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mr-2 { margin-right: 0.5rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }

/* 邊框 */
.border { border-width: 1px; }
.border-t { border-top-width: 1px; }
.border-gray-800 { border-color: #1f2937; }
.rounded { border-radius: 0.25rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }
.rounded-lg { border-radius: 0.5rem; }

/* 顯示/隱藏 */
.block { display: block; }
.hidden { display: none; }
.inline-block { display: inline-block; }

/* 過渡效果 */
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-opacity { transition-property: opacity; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

/* 懸停效果 */
.hover\:text-primary:hover { color: #3b82f6; }
.hover\:text-white:hover { color: #ffffff; }
.hover\:bg-gray-800:hover { background-color: #1f2937; }
.hover\:scale-110:hover { transform: scale(1.1); }
.hover\:scale-105:hover { transform: scale(1.05); }

/* 對象適配 */
.object-cover { object-fit: cover; }

/* 溢出 */
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }

/* 截斷文本 */
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 最小寬度 */
.min-w-\[800px\] { min-width: 1000px; }

/* 自定義類 */
.h-\[70vh\] { height: 70vh; }
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-video { aspect-ratio: 16 / 9; }
.backdrop-blur-md { backdrop-filter: blur(12px); }
.text-\[clamp\(1\.5rem\,3vw\,2rem\)\] { font-size: clamp(1.5rem, 3vw, 2rem); }
.text-\[clamp\(1\.8rem\,3vw\,2\.5rem\)\] { font-size: clamp(1.8rem, 3vw, 2.5rem); }
.text-\[clamp\(2\.5rem\,5vw\,4rem\)\] { font-size: clamp(2.5rem, 5vw, 4rem); }

/* 按鈕樣式 */
.btn-primary, .hero-btn-primary {
    background-color: #3b82f6;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-primary:hover, .hero-btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

.btn-secondary, .hero-btn-secondary {
    background-color: transparent;
    color: white;
    padding: 0.75rem 1.5rem;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-secondary:hover, .hero-btn-secondary:hover {
    background-color: #374151;
    border-color: #4b5563;
}

/* 卡片懸停效果 */
.card-hover {
    transition: all 0.3s ease;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* 響應式設計 */
@media (max-width: 767px) {
    .md\:hidden { display: none !important; }
    .container { padding: 0 0.5rem; }
    .grid-cols-2 { grid-template-columns: 1fr; }
    .grid-cols-3 { grid-template-columns: 1fr; }
    .grid-cols-4 { grid-template-columns: 1fr; }
    .grid-cols-5 { grid-template-columns: 1fr; }
    .grid-cols-6 { grid-template-columns: 1fr; }
}