/* 全局樣式 */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --background-color: #f5f6fa;
    --text-color: #2c3e50;
    --border-color: #dcdde1;
    --success-color: #2ecc71;
    --error-color: #e74c3c;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    scroll-padding-top: 80px;
}

/* 導航欄樣式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar:hover,
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    transition: var(--transition);
}

.logo a:hover {
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.login-link {
    background: var(--primary-color);
    color: white !important;
    padding: 0.5rem 1.5rem !important;
    border-radius: 50px;
    transition: var(--transition);
}

.login-link:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.login-link::after {
    display: none !important;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 2px;
    background: var(--text-color);
    transition: var(--transition);
}

/* 英雄區域樣式 */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    color: white;
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease 0.2s forwards;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease 0.4s forwards;
}

.primary-btn,
.secondary-btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.primary-btn {
    background: white;
    color: var(--primary-color);
}

.secondary-btn {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.secondary-btn:hover {
    background: white;
    color: var(--primary-color);
}

/* 區段樣式 */
.section {
    padding: 6rem 0;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--primary-color);
    margin: 1rem auto;
}

/* 關於區塊樣式 */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.about-card {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: left;
    transition: transform 0.3s ease;
}

.about-card:hover {
    transform: translateY(-5px);
}

.about-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.about-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.about-text {
    margin-top: 1rem;
}

.about-text p {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.about-text p:last-child {
    margin-bottom: 0;
}

/* 作品集樣式 */
.gallery-filter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 50px;
    background: white;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary-color);
    color: white;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.gallery-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    transform: translateY(100%);
    transition: var(--transition);
}

.gallery-item:hover .gallery-content {
    transform: translateY(0);
}

/* 團隊成員樣式 */
.team-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    padding: 2rem;
}

.team-member {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    overflow: hidden;
    transition: transform 0.3s ease;
    width: 100%;
    max-width: 800px;
}

.team-member:hover {
    transform: translateY(-5px);
}

.member-profile {
    display: flex;
    padding: 30px;
    gap: 30px;
}

.member-left {
    flex: 0 0 250px;
    text-align: center;
}

.member-photo {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid var(--primary-color);
}

.member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-left h3 {
    margin: 10px 0 5px;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.member-left .title {
    color: #666;
    font-size: 1rem;
    margin-bottom: 15px;
}

.member-contact {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.contact-link {
    color: #666;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: var(--primary-color);
}

.member-right {
    flex: 1;
    padding-top: 20px;
}

.member-section {
    margin-bottom: 25px;
}

.member-section h4 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--primary-color);
}

.member-section p {
    color: #666;
    line-height: 1.6;
    white-space: pre-line;
    word-wrap: break-word;
}

.skills-list,
.responsibilities-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.skills-list li,
.responsibilities-list li {
    display: inline-block;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 15px;
    margin: 0 8px 8px 0;
    font-size: 0.9rem;
}

/* 頁尾樣式 */
.footer {
    background: var(--secondary-color);
    color: white;
    padding: 4rem 0 2rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* 登入頁面樣式 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #357abd 100%);
    padding: 1rem;
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    overflow: hidden;
}

.login-container {
    padding: 2rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.75rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.back-link {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
}

.back-link:hover {
    opacity: 0.8;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    position: relative;
}

.input-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon i {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
}

.input-icon input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.input-icon input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
    outline: none;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
}

.toggle-password:hover {
    color: var(--text-color);
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.checkbox-container input {
    width: 16px;
    height: 16px;
}

.form-error {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border-radius: 8px;
    font-size: 0.875rem;
}

.form-error i {
    font-size: 1rem;
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.login-btn:hover {
    background: #357abd;
}

.login-btn i {
    font-size: 0.875rem;
    transition: transform 0.2s ease;
}

.login-btn:hover i {
    transform: translateX(4px);
}

.login-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.login-footer p {
    margin: 0.25rem 0;
}

/* 動畫 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 響應式設計 - 完全優化 ========== */

/* 基礎 768px 以下 導航和基礎佈局 */
@media (max-width: 768px) {
    body {
        scroll-padding-top: 70px;
    }
    
    .nav-toggle {
        display: block;
        cursor: pointer;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        padding: 2rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        transform: translateY(-100%);
        transition: var(--transition);
    }

    .nav-menu.active {
        transform: translateY(0);
    }

    .dark .nav-menu {
        background: rgba(42, 42, 42, 0.95);
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .section {
        padding: 4rem 0;
    }

    .section-title {
        font-size: 2rem;
    }

    .member-profile {
        flex-direction: column;
        padding: 20px;
    }

    .member-left {
        flex: 0 0 auto;
    }

    .member-photo {
        width: 150px;
        height: 150px;
    }

    .about-card {
        padding: 1.5rem;
    }

    /* 指標卡片 - 平板 2 列 */
    .results-card {
        padding: 1.5rem;
    }
    
    .metrics-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .metric-card {
        padding: 1.5rem 1rem;
    }
    
    .metric-icon {
        font-size: 2rem;
    }
    
    .metric-value {
        font-size: 2.2rem;
    }
    
    .metric-label {
        font-size: 0.9rem;
    }
    
    .metric-change {
        font-size: 0.8rem;
        padding: 0.3rem 0.8rem;
    }
    
    /* 表格 */
    .results-table-container {
        padding: 1.2rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .results-table {
        font-size: 0.9rem;
        min-width: 650px;
    }
    
    .results-table thead th,
    .results-table td {
        padding: 1rem;
    }
    
    .results-table-container h4 {
        font-size: 1.3rem;
    }
}

/* 小平板尺寸 (600px - 768px) */
@media (max-width: 600px) {
    .results-card {
        padding: 1.2rem;
    }
    
    .metrics-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .metric-card {
        padding: 1.5rem;
        display: grid;
        grid-template-areas:
            "icon value"
            "label label"
            "change change";
        grid-template-columns: auto 1fr;
        gap: 0.8rem;
        text-align: left;
    }
    
    .metric-icon {
        grid-area: icon;
        font-size: 2.5rem;
        margin: 0;
    }
    
    .metric-value {
        grid-area: value;
        font-size: 2.5rem;
        margin: 0;
        text-align: right;
    }
    
    .metric-label {
        grid-area: label;
        font-size: 1rem;
        margin: 0;
        text-align: left;
    }
    
    .metric-change {
        grid-area: change;
        text-align: center;
        margin-top: 0.5rem;
    }
    
    .results-table-container {
        padding: 1rem;
        margin: 2rem -0.5rem;
    }
    
    .results-table {
        font-size: 0.85rem;
        min-width: 600px;
    }
    
    .results-table thead th,
    .results-table td {
        padding: 0.8rem 0.6rem;
    }
    
    .results-table-container h4 {
        font-size: 1.2rem;
        margin-bottom: 1.5rem;
    }
    
    .table-note {
        font-size: 0.85rem;
        padding: 0.8rem 1rem;
    }
}

/* 手機尺寸 (480px - 600px) */
@media (max-width: 480px) {
    .results-card {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .metric-card {
        padding: 1.2rem;
        border-radius: 12px;
    }
    
    .metric-icon {
        font-size: 2rem;
    }
    
    .metric-value {
        font-size: 2rem;
    }
    
    .metric-label {
        font-size: 0.9rem;
    }
    
    .metric-change {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    
    .results-table-container {
        padding: 0.8rem;
        border-radius: 12px;
    }
    
    .results-table {
        font-size: 0.8rem;
        min-width: 550px;
    }
    
    .results-table thead th,
    .results-table td {
        padding: 0.7rem 0.5rem;
    }
    
    .results-table-container h4 {
        font-size: 1.1rem;
        padding-bottom: 0.8rem;
    }
    
    .results-table-container h4::before {
        font-size: 1.5rem;
    }
}

/* 超小手機 (< 360px) */
@media (max-width: 360px) {
    .results-card {
        padding: 0.8rem;
    }
    
    .metrics-cards {
        gap: 0.8rem;
    }
    
    .metric-card {
        padding: 1rem;
    }
    
    .metric-icon {
        font-size: 1.8rem;
    }
    
    .metric-value {
        font-size: 1.8rem;
    }
    
    .metric-label {
        font-size: 0.85rem;
    }
    
    .results-table {
        font-size: 0.75rem;
        min-width: 500px;
    }
    
    .results-table thead th,
    .results-table td {
        padding: 0.6rem 0.4rem;
    }
}

/* 橫屏模式優化 */
@media (max-height: 600px) and (orientation: landscape) {
    .metric-card {
        padding: 1rem 1.5rem;
    }
    
    .metric-icon {
        font-size: 1.8rem;
        margin-bottom: 0.3rem;
    }
    
    .metric-value {
        font-size: 2rem;
        margin: 0.3rem 0;
    }
    
    .metric-label {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
    }
}
}

/* 深色模式優化 */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #1a1a1a;
        --text-color: #ffffff;
        --border-color: #333333;
    }

    .navbar:hover,
    .navbar.scrolled {
        background: rgba(42, 42, 42, 0.95);
    }

    .about-card,
    .team-member {
        background: #2a2a2a;
    }
    
    .results-card {
        background: linear-gradient(135deg, #1a1a2e 0%, #2a2a2a 100%);
    }
    
    .results-table-container {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .results-table {
        background: #2a2a2a;
        box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    }
    
    .results-table tbody tr {
        border-bottom-color: #444;
    }
    
    .results-table tbody tr:hover {
        background: linear-gradient(90deg, #333 0%, #2a2a2a 100%);
    }
    
    .results-table td {
        color: #e0e0e0;
    }
    
    .results-table td:first-child {
        color: #fff;
    }
    
    .highlight-good {
        background: linear-gradient(120deg, rgba(46, 204, 113, 0.25) 0%, rgba(46, 204, 113, 0.15) 100%);
        color: #2ecc71;
        border-left-color: #2ecc71;
    }
    
    .highlight-row {
        background: linear-gradient(120deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.1) 100%);
    }
    
    .table-note {
        background: linear-gradient(120deg, rgba(102, 126, 234, 0.15) 0%, rgba(102, 126, 234, 0.1) 100%);
        color: #b0b0b0;
        border-left-color: #667eea;
    }
    
    .improvement {
        color: #2ecc71;
    }

    .filter-btn {
        background: #2a2a2a;
    }

    .login-wrapper {
        background: #2a2a2a;
    }

    .login-header h1 {
        color: white;
    }

    .input-icon input {
        background: #333;
        border-color: #444;
        color: white;
    }

    .input-icon input:focus {
        border-color: var(--primary-color);
    }

    .form-error {
        background: rgba(231, 76, 60, 0.2);
    }

    .logo a {
        color: white;
    }

    .nav-menu a {
        color: white;
    }

    .team-member {
        background: #2a2a2a;
    }

    .member-section p,
    .responsibilities-list li {
        color: #e0e0e0;
    }

    .skills-list li {
        background: rgba(var(--primary-rgb), 0.2);
        color: #e0e0e0;
    }

    .about-text p {
        color: #e0e0e0;
    }

    .project-section {
        background: #2a2a2a;
    }

    .project-header {
        background: var(--primary-dark);
    }

    .project-content h3 {
        color: var(--primary-color);
    }

    .project-content p {
        color: #e0e0e0;
    }

    .features-list {
        background: rgba(255, 255, 255, 0.05);
    }

    .features-list li {
        color: #e0e0e0;
    }

    .layer-card {
        background: #2a2a2a;
    }

    .layer-card h4 {
        color: var(--primary-color);
    }

    .layer-card p {
        color: #e0e0e0;
    }

    .results-table-container {
        background: #2a2a2a;
    }
    
    .results-table {
        background: #2a2a2a;
    }
    
    .results-table tbody tr {
        border-bottom-color: #444;
    }
    
    .results-table tbody tr:hover {
        background-color: #333;
    }
    
    .results-table td {
        color: #e0e0e0;
    }
    
    .highlight-good {
        background: rgba(46, 204, 113, 0.2);
        color: #2ecc71;
    }
    
    .highlight-row {
        background: rgba(102, 126, 234, 0.1);
    }
    
    .table-note {
        background: rgba(102, 126, 234, 0.1);
        color: #b0b0b0;
    }
}

/* 專題介紹部分 */
.project-sections {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-top: 2rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
    padding: 2rem;
    border-radius: 12px;
}

.project-section {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.project-header {
    padding: 2rem;
    background: var(--primary-color);
    color: white;
}

.project-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.project-content {
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
}

.project-content h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.project-content p {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.features-list {
    background: rgba(var(--primary-rgb), 0.05);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1.5rem;
}

.features-list h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.features-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.features-list li i {
    color: var(--primary-color);
    font-size: 0.9em;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .project-header {
        padding: 1.5rem;
    }

    .project-content {
        padding: 1.5rem;
    }

    .project-gallery {
        gap: 1.5rem;
    }

    .project-image {
        width: 100%;
    }
}

/* 深色模式支援 */
@media (prefers-color-scheme: dark) {
    .project-section {
        background: #2a2a2a;
    }

    .project-header {
        background: var(--primary-dark);
    }

    .project-content h3 {
        color: var(--primary-color);
    }

    .project-content p {
        color: #e0e0e0;
    }

    .features-list {
        background: rgba(255, 255, 255, 0.05);
    }

    .features-list li {
        color: #333;
    }

    .layer-card {
        background: #2a2a2a;
    }

    .layer-card h4 {
        color: var(--primary-color);
    }

    .layer-card p {
        color: #e0e0e0;
    }
}

/* 管理員後台團隊成員樣式 */
.member-layout {
    display: flex;
    gap: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.member-item {
    position: relative;
    margin-bottom: 30px;
}

.member-item .delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
}

.member-left,
.member-right {
    padding: 15px;
}

.member-left {
    flex: 0 0 300px;
}

.member-right {
    flex: 1;
}

.member-right .form-group {
    margin-bottom: 20px;
}

.mt-2 {
    margin-top: 10px;
}

@media (max-width: 768px) {
    .member-layout {
        flex-direction: column;
    }

    .member-left {
        flex: 0 0 auto;
    }
}

.member-bio-text {
    color: #333;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.95rem;
    text-align: justify;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.member-bio-text br {
    display: block;
    content: "";
    margin-bottom: 0.8em;
}

.member-bio-text strong {
    color: var(--primary-color);
    font-weight: 600;
    display: inline-block;
    margin: 0.2em 0;
}

@media (prefers-color-scheme: dark) {
    .member-bio-text {
        color: #e0e0e0;
        background: rgba(255, 255, 255, 0.03);
    }
    
    .member-bio-text strong {
        color: var(--primary-color);
    }
}

/* 專題介紹圖片集樣式 */
.project-text {
    margin-bottom: 2rem;
}

.project-text p {
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.project-text img {
    width: 80%;
    max-width: 800px;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    margin: 1.5rem 0;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.project-text p:last-child {
    margin-bottom: 0;
}

/* 系統架構區塊樣式 */
.architecture-content {
    text-align: center;
}

.architecture-description {
    margin-top: 3rem;
    text-align: left;
}

.architecture-description h3 {
    text-align: center;
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 2rem;
}

.architecture-layers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.layer-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.layer-card:hover {
    transform: translateY(-5px);
}

.layer-card h4 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.layer-card h4 i {
    font-size: 1.5rem;
}

.layer-card p {
    color: var(--text-color);
    line-height: 1.6;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tech-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* 成果數據展示 */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.result-item {
    background: rgba(74, 144, 226, 0.1);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
}

.result-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.result-label {
    color: var(--text-color);
    font-size: 0.9rem;
}

/* ========== 研究成果卡片特殊樣式 ========== */
.results-card {
    grid-column: 1 / -1;
    max-width: 1200px;
    margin: 0 auto;
}

/* ========== 研究成果卡片特殊樣式 ========== */
.results-card {
    grid-column: 1 / -1;
    max-width: 100%;
    margin: 0 auto;
    padding: 2.5rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
}

/* 核心指標卡片網格 - 優化版 */
.metrics-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.metric-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 1.5rem;
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.metric-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.5);
}

.metric-card:hover::before {
    transform: translate(-25%, -25%) scale(1.2);
}

.metric-icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
    opacity: 0.95;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.metric-value {
    font-size: 3rem;
    font-weight: 800;
    margin: 0.8rem 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    line-height: 1;
}

.metric-unit {
    font-size: 1.3rem;
    font-weight: 500;
    margin-left: 0.3rem;
    opacity: 0.9;
}

.metric-label {
    font-size: 1rem;
    opacity: 0.95;
    margin-bottom: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.metric-change {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.metric-change.positive {
    background: rgba(46, 204, 113, 0.35);
    border-color: rgba(46, 204, 113, 0.5);
}

/* ========== 表格容器樣式 - 現代化設計 ========== */
.results-table-container {
    margin: 3rem 0;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.05);
}

.results-table-container h4 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 700;
}

.results-table-container h4::before {
    content: '📊';
    font-size: 1.8rem;
}

/* ========== 表格樣式 - 完全重構 ========== */
.results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.5rem 0;
    font-size: 1rem;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.results-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.results-table thead th {
    padding: 1.2rem 1.5rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.results-table thead th:first-child {
    border-radius: 12px 0 0 0;
}

.results-table thead th:last-child {
    border-radius: 0 12px 0 0;
}

.results-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.results-table tbody tr:hover {
    background: linear-gradient(90deg, #f8f9ff 0%, #fff 100%);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.results-table tbody tr:last-child {
    border-bottom: none;
}

.results-table tbody tr:last-child td:first-child {
    border-radius: 0 0 0 12px;
}

.results-table tbody tr:last-child td:last-child {
    border-radius: 0 0 12px 0;
}

.results-table td {
    padding: 1.2rem 1.5rem;
    color: var(--text-color);
    font-size: 0.95rem;
}

.results-table td:first-child {
    font-weight: 600;
    color: var(--secondary-color);
}

.results-table td i {
    margin-right: 0.8rem;
    color: var(--primary-color);
    font-size: 1rem;
}

/* 高亮樣式 - 更鮮明 */
.highlight-good {
    background: linear-gradient(120deg, rgba(46, 204, 113, 0.15) 0%, rgba(46, 204, 113, 0.08) 100%);
    font-weight: 700;
    color: #27ae60;
    border-left: 3px solid #27ae60;
    padding-left: 1.2rem !important;
}

.highlight-row {
    background: linear-gradient(120deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-left: 3px solid var(--primary-color);
}

.highlight-row td:first-child {
    font-weight: 700;
    padding-left: 1.2rem;
}

.improvement {
    color: #27ae60;
    font-weight: 700;
    font-size: 1rem;
}

.improvement::before {
    content: '✓ ';
    margin-right: 0.3rem;
    font-size: 1.1rem;
}

/* 表格註釋 - 更突出 */
.table-note {
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(120deg, rgba(102, 126, 234, 0.08) 0%, rgba(102, 126, 234, 0.05) 100%);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    font-size: 0.9rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    line-height: 1.6;
}

.table-note i {
    color: var(--primary-color);
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* ========== 額外視覺增強 ========== */

/* 指標卡片動態背景 - 每張卡片不同顏色 */
.metric-card:nth-child(1) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.metric-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.metric-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.metric-card:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

/* 表格斑馬紋效果 */
.results-table tbody tr:nth-child(even) {
    background: rgba(0,0,0,0.02);
}

.results-table tbody tr:nth-child(even):hover {
    background: linear-gradient(90deg, #f8f9ff 0%, #fff 100%);
}

/* 表格滾動提示 */
.results-table-container::after {
    content: '← 左右滑動查看更多 →';
    display: none;
    text-align: center;
    padding: 0.5rem;
    color: #999;
    font-size: 0.8rem;
    font-style: italic;
}

@media (max-width: 768px) {
    .results-table-container::after {
        display: block;
    }
}

/* 打印樣式優化 */
@media print {
    .metric-card {
        break-inside: avoid;
        box-shadow: none;
        border: 2px solid #ddd;
        page-break-inside: avoid;
    }
    
    .results-table-container {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .results-table {
        box-shadow: none;
    }
}

/* 高對比度模式 */
@media (prefers-contrast: high) {
    .metric-card {
        border: 2px solid white;
    }
    
    .results-table {
        border: 2px solid var(--primary-color);
    }
    
    .highlight-good {
        border: 2px solid #27ae60;
    }
}

/* 減少動畫模式 */
@media (prefers-reduced-motion: reduce) {
    .metric-card,
    .results-table tbody tr {
        transition: none;
    }
    
    .metric-card:hover {
        transform: none;
    }
    
    .metric-card::before {
        display: none;
    }
}

/* ========== 語言切換器樣式 ========== */
.language-switcher {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 25px;
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
}

.lang-btn:hover {
    background: var(--primary-color);
    color: white;
}

.lang-btn i:first-child {
    font-size: 1rem;
}

.lang-btn i:last-child {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.lang-btn.active i:last-child {
    transform: rotate(180deg);
}

.current-lang {
    font-weight: 600;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.lang-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 0.8rem 1.2rem;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 1px solid #f0f0f0;
}

.lang-option:last-child {
    border-bottom: none;
}

.lang-option:hover {
    background: rgba(74, 144, 226, 0.15);
    color: var(--primary-color);
    font-weight: 600;
}

.lang-option.active {
    background: var(--primary-color);
    color: white;
}

.lang-flag {
    font-size: 1.5rem;
}

/* ========== 語言切換通知 ========== */
.lang-notification {
    position: fixed;
    top: 100px;
    right: -300px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    z-index: 10000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.lang-notification.show {
    right: 2rem;
}

.lang-notification i {
    font-size: 1.2rem;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .language-switcher {
        width: 100%;
    }
    
    .lang-btn {
        width: 100%;
        justify-content: center;
    }
    
    .lang-dropdown {
        left: 0;
        right: 0;
        width: 100%;
    }
    
    .lang-notification {
        top: 80px;
        right: -100%;
        left: auto;
        width: calc(100% - 2rem);
        margin: 0 1rem;
    }
    
    .lang-notification.show {
        right: 0;
        left: 1rem;
    }
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    .lang-dropdown {
        background: #2a2a2a;
        border: 1px solid #444;
    }
    
    .lang-option {
        color: #e0e0e0;
        border-bottom-color: #444;
    }
    
    .lang-option:hover {
        background: rgba(74, 144, 226, 0.2);
    }
}

/* 英文字體優化 */
html[lang="en"] {
    font-family: 'Inter', 'Segoe UI', 'Roboto', sans-serif;
}

html[lang="en"] .hero-content h1 {
    font-size: 3rem;
    line-height: 1.2;
}

html[lang="en"] .section-title {
    font-size: 2.2rem;
}

@media (max-width: 768px) {
    html[lang="en"] .hero-content h1 {
        font-size: 2rem;
    }
}