/* 重置和基本樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* 主題變數：深色 zinc + 綠色點綴 */
:root {
    --bg: #09090b;           /* zinc-950 */
    --bg-card: #18181b;      /* zinc-900 */
    --border: #27272a;       /* zinc-800 */
    --text: #fafafa;         /* zinc-50 */
    --text-muted: #a1a1aa;   /* zinc-400 */
    --primary: #22c55e;      /* green-500 */
    --primary-hover: #16a34a;/* green-600 */
    --accent: #22c55e;
    --muted: #71717a;        /* zinc-500 */
    --surface: #18181b;
    --surface-glass: rgba(24, 24, 27, 0.8);
    --border-glow: rgba(34, 197, 94, 0.25);
}

[data-theme="light"] {
    --bg: #fafafa;
    --bg-card: #f4f4f5;
    --border: #e4e4e7;
    --text: #09090b;
    --text-muted: #52525b;
    --primary: #16a34a;
    --primary-hover: #15803d;
    --accent: #16a34a;
    --muted: #71717a;
    --surface: #f4f4f5;
    --surface-glass: rgba(244, 244, 245, 0.9);
    --border-glow: rgba(34, 197, 94, 0.35);
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    position: relative;
    overflow-x: hidden;
    cursor: none;
}

body a,
body button {
    cursor: none;
}

/* 自訂游標：圓點 + 外圈（綠色） */
.cursor-dot,
.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 99999;
    border-radius: 50%;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    transform: translate(-50%, -50%);
}

.cursor-ring {
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary);
    background: transparent;
    transform: translate(-50%, -50%);
    opacity: 0.6;
    transition: transform 0.08s ease-out, width 0.2s, height 0.2s, opacity 0.2s;
}

body:hover .cursor-ring {
    opacity: 0.85;
}

/* 可點擊元素上外圈放大（由 JS 加 .cursor-hover） */
body.cursor-hover .cursor-ring {
    width: 52px;
    height: 52px;
    opacity: 0.5;
}

/* 觸控裝置顯示預設游標 */
@media (hover: none) {
    body, body a, body button {
        cursor: auto;
    }
    .cursor-dot,
    .cursor-ring {
        display: none !important;
    }
}

/* 粒子背景容器 */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* 主要內容 - 分頁式 */
main.main-tabs {
    margin-top: 72px;
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 72px);
}

.tab-panel {
    display: none;
    animation: tabFadeIn 0.25s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes tabFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 導航欄 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.navbar-scrolled {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

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

.nav-logo a {
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-logo a:hover {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: 1.5rem;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text);
    background: var(--border);
}

.nav-link.active {
    color: var(--primary);
    font-weight: 600;
    background: transparent;
    border-bottom: 2px solid var(--primary);
    border-radius: 0;
    padding-bottom: 6px;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--text);
    margin: 3px 0;
    transition: 0.3s;
}


/* 首頁區域 */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--bg);
    color: var(--text);
    position: relative;
    overflow: hidden;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: var(--text);
}

.highlight {
    color: var(--primary);
}

.hero-subtitle {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.05rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
    line-height: 1.75;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* 名片正反面旋轉容器（原尺寸 548.01 × 281.8） */
.name-card-wrap {
    perspective: 1000px;
    width: 100%;
    max-width: 548px;
}

.name-card-inner {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 51.42%; /* 281.8 / 548.01 */
    transition: transform 0.7s ease;
    transform-style: preserve-3d;
}

.name-card-wrap:hover .name-card-inner {
    transform: rotateY(180deg);
}

/* 正面、反面共用卡片大小（還原原本較大尺寸） */
.name-card {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 2rem;
    padding: 2.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* 預設看到反面（LXY），hover 翻到正面（詳細內容） */
.name-card-front {
    transform: rotateY(180deg);
    z-index: 0;
}

.name-card-back {
    transform: rotateY(0);
    z-index: 1;
}

.name-card-back-text {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: var(--primary);
}

.name-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.name-card-avatar {
    font-size: 2.5rem;
    color: var(--primary);
    line-height: 1;
}

.name-card-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
}

.name-card-name {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--text);
    margin: 0 0 0.75rem 0;
}

.name-card-divider {
    width: 48px;
    height: 2px;
    background: var(--primary);
    margin-bottom: 0.75rem;
}

.name-card-tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem 0;
}

.name-card-link {
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.name-card-link:hover {
    color: var(--primary-hover);
}

/* 區塊標題 */
.section-title {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text);
}

/* 關於我 */
.about {
    padding: 5rem 0;
    background: var(--bg);
    position: relative;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-text p {
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.about-text a {
    color: var(--primary);
    text-decoration: none;
}

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

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.stat {
    text-align: center;
}

.stat h3 {
    font-size: 2.25rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.stat p {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
}

.about-location {
    margin-top: 2rem;
    text-align: center;
}

.location-info {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    padding: 0.75rem 1.25rem;
    border-radius: 2rem;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    margin: 0.5rem;
}

.location-info:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.location-info i {
    color: var(--primary);
    font-size: 1rem;
}

/* 技能 */
.skills {
    padding: 5rem 0;
    background: var(--bg);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.skill-category {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 2rem;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.skill-category:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.skill-category h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-category h3 i {
    color: var(--primary);
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-item {
    background: var(--border);
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: 1.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.skill-item:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-1px);
}

/* 獲獎紀錄 */
.awards {
    padding: 5rem 0;
    background: var(--bg);
}

.awards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.award-card {
    background: var(--bg-card);
    border-radius: 2rem;
    padding: 2rem;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.award-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.award-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    color: #fff;
    font-size: 1.25rem;
}

.award-content h3 {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.award-title {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.award-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.award-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.award-date {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.award-level {
    background: var(--primary);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* 專案區域 */
.projects {
    padding: 5rem 0;
    background: var(--surface);
}

/* 農產分析 */
.agriculture {
    padding: 5rem 0;
    background: var(--bg);
}

.agriculture-content {
    max-width: 1200px;
    margin: 0 auto;
}

.agriculture-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-bottom: 4rem;
}

.agriculture-text h3 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 1rem;
}

.agriculture-description {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.agriculture-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-radius: 1.5rem;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.feature-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.feature-item i {
    color: var(--primary);
    font-size: 1rem;
    width: 1.25em;
    min-width: 20px;
    flex-shrink: 0;
    text-align: center;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-item span {
    font-weight: 500;
    color: var(--text);
    font-size: 0.9rem;
}

.agriculture-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.download-btn {
    background: var(--primary);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.download-btn i {
    font-size: 1.1rem;
}

.agriculture-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.agriculture-image {
    width: 100%;
    max-width: 560px;
    position: relative;
    border-radius: 2rem;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.agriculture-image:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.agriculture-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 2rem;
}

.app-mockup {
    position: relative;
    transform: perspective(1000px) rotateY(-15deg) rotateX(5deg);
    transition: transform 0.3s ease;
}

.app-mockup:hover {
    transform: perspective(1000px) rotateY(-10deg) rotateX(2deg);
}

.phone-frame {
    width: 280px;
    height: 560px;
    background: #1a1a1a;
    border-radius: 35px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.phone-frame::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 6px;
    background: #333;
    border-radius: 3px;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 25px;
    overflow: hidden;
    position: relative;
}

.app-interface {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.app-header h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #27ae60;
    margin: 0;
}

.signal-bars {
    display: flex;
    gap: 2px;
    align-items: end;
}

.signal-bars span {
    width: 3px;
    background: #27ae60;
    border-radius: 1px;
}

.signal-bars span:nth-child(1) { height: 4px; }
.signal-bars span:nth-child(2) { height: 6px; }
.signal-bars span:nth-child(3) { height: 8px; }

.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: white;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    color: #6c757d;
    font-size: 0.9rem;
}

.search-bar i {
    color: #27ae60;
}

.price-chart {
    height: 120px;
    background: white;
    border-radius: 15px;
    padding: 15px;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chart-line {
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    height: 2px;
    background: linear-gradient(90deg, #27ae60 0%, #2ecc71 100%);
    border-radius: 1px;
}

.chart-points {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.point {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #27ae60;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.point:nth-child(1) { top: 30%; left: 20%; }
.point:nth-child(2) { top: 20%; left: 40%; }
.point:nth-child(3) { top: 40%; left: 60%; }
.point:nth-child(4) { top: 25%; left: 80%; }

.market-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.market-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.crop-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.price {
    font-weight: 700;
    color: #27ae60;
    font-size: 0.9rem;
}

/* 詳細功能區域 */
.agriculture-details {
    margin-top: 4rem;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.detail-card {
    background: var(--bg-card);
    padding: 0;
    border-radius: 2rem;
    text-align: center;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.detail-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.detail-image {
    width: 100%;
    height: 300px;
    overflow: hidden;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.detail-card > .detail-icon,
.detail-card > h4,
.detail-card > p {
    padding: 0 1.5rem;
}

.detail-card > .detail-icon {
    padding-top: 1.5rem;
}

.detail-card > p {
    padding-bottom: 1.5rem;
}

.detail-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 1rem;
    margin: 0 auto 1rem;
    color: #fff;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* 圖示填滿綠框並置中，修正 FA 字型視覺偏移 */
.detail-icon i,
.detail-icon .fas,
.detail-icon .fa {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    line-height: 1 !important;
}

/* FA 圖示在字型中偏下，用 translateY 微調與圓形對齊 */
.detail-icon i::before {
    display: block;
    line-height: 1;
    transform: translateY(-0.12em);
}

.detail-card h4 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.detail-card p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.9rem;
}


/* MC 插件 */
.plugins {
    padding: 5rem 0;
    background: var(--bg);
}

.plugins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.plugin-card {
    background: var(--bg-card);
    border-radius: 2rem;
    border: 1px solid var(--border);
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.plugin-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.plugin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.plugin-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plugin-tag {
    background: var(--primary);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.plugin-desc {
    color: var(--text-muted);
    margin: 0.5rem 0 0.75rem;
    line-height: 1.6;
    font-size: 0.9rem;
}

.plugin-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.plugin-links {
    display: flex;
    gap: 0.75rem;
}

.plugin-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
}

.plugin-link:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.plugins-note {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--muted);
}

/* 友站 */
.friends-section {
    padding: 3rem 0 5rem;
    background: var(--bg);
}

.friends-intro {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    max-width: 900px;
    margin: 0 auto;
}

.friend-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
}

.friend-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.friend-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.friend-url {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 載入狀態 */
.projects-loading {
    text-align: center;
    padding: 3rem 0;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.projects-loading p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* 錯誤狀態 */
.projects-error {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-muted);
}

.projects-error i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.projects-error p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* 專案滑動器 */
.projects-container {
    position: relative;
}

.projects-slider {
    overflow: hidden;
    border-radius: 15px;
    margin-bottom: 2rem;
}

.projects-track {
    display: flex;
    transition: transform 0.5s ease;
    gap: 2rem;
}

.project-card {
    background: var(--surface-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--border-glow);
    box-shadow: 
        0 8px 32px rgba(0, 212, 255, 0.1),
        inset 0 0 40px rgba(0, 212, 255, 0.03);
    transition: all 0.3s ease;
    min-width: 350px;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    transition: left 0.5s;
    z-index: 1;
}

.project-card:hover::before {
    left: 100%;
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--primary-glow);
    box-shadow: 
        0 20px 50px rgba(0, 212, 255, 0.2),
        inset 0 0 60px rgba(0, 212, 255, 0.05);
}

.project-card > * {
    position: relative;
    z-index: 2;
}

.project-image {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-image .project-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    opacity: 0.8;
}

.language-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.project-content {
    padding: 2rem;
}

.project-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.owner-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
}

.meta-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.meta-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: #ecf0f1;
    color: var(--text);
}

.project-content h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-content h3 .repo-icon {
    color: var(--primary);
}

.project-description {
    color: var(--muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--muted);
    flex-wrap: wrap;
}

.project-meta {
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #888;
}

.update-time {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.update-time i {
    color: var(--primary);
}

.project-stat {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.project-stat i {
    color: var(--primary);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.project-tech span {
    background: #ecf0f1;
    color: var(--text);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-tech .main-language {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.project-links {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.project-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
    flex: 1;
    justify-content: center;
    padding: 0.5rem;
    border: 1px solid var(--primary);
    border-radius: 8px;
    text-align: center;
}

.project-link:hover {
    background: var(--primary);
    color: white;
}


.live-btn {
    background: #27ae60;
    color: white;
    border: 1px solid #27ae60;
}

.live-btn:hover {
    background: #229954;
    border-color: #229954;
}

/* 滑動控制 */
.slider-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.slider-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-btn:hover:not(:disabled) {
    background: var(--primary-600);
    transform: scale(1.1);
}

.slider-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.slider-dots {
    display: flex;
    gap: 0.5rem;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #bdc3c7;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-dot.active {
    background: var(--primary);
    transform: scale(1.2);
}



/* 個人連結 */
.social-links {
    padding: 3rem 0;
    background: var(--bg);
    text-align: center;
    border-top: 1px solid var(--border);
}

.social-links h3 {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    max-width: 480px;
    margin: 0 auto;
}

.social-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 2rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
}

.social-link:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.social-link i {
    font-size: 1.5rem;
}

.social-link.github:hover { background: var(--border); color: var(--text); }
.social-link.instagram:hover { background: var(--border); color: var(--text); }

/* 頁尾 */
.footer {
    background: var(--bg-card);
    color: var(--text);
    padding: 2rem 0;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-text p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--surface);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

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

    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .about-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .awards-grid {
        grid-template-columns: 1fr;
    }

    .agriculture-hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .agriculture-features {
        grid-template-columns: 1fr;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }


    .phone-frame {
        width: 240px;
        height: 480px;
    }

    .projects-track {
        gap: 1rem;
    }
    
    .project-card {
        min-width: 280px;
    }
    
    .slider-controls {
        gap: 1rem;
    }
    
    .slider-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    


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

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .friends-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

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

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .social-grid {
        grid-template-columns: 1fr;
    }


    .phone-frame {
        width: 200px;
        height: 400px;
    }

    .agriculture-text h3 {
        font-size: 2rem;
    }
}

/* 動畫效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* 滾動動畫 */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}
