/* style.css - V16 (修復 Logo 標題風格被誤殺的問題) */

/* =========================================
   ★ 1. 強制引入字型 & 全域設定
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box !important;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
li,
figure,
blockquote,
dl,
dd {
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Noto Sans TC', sans-serif !important;
    background-color: var(--bg-body);
    background-image: var(--bg-pattern);
    background-size: var(--bg-size);
    background-attachment: fixed;
    color: var(--text-main);
    padding-left: var(--sidebar-width);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 400;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* =========================================
   ★ 2. 變數定義
   ========================================= */
:root {
    --bg-container: #f8f9fa;
    --text-main: #212529;
    --text-secondary: #6c757d;
    --color-primary: #0d6efd;
    --color-primary-hover: #0b5ed7;
    --color-accent: #ffc107;
    --border-color: #dee2e6;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --sidebar-width: 250px;
    --backdrop-blur: 10px;
}

/* 主題設定 */
[data-theme="light"] {
    --bg-body: #f3f4f6;
    --bg-pattern: radial-gradient(#cfd8dc 1.5px, transparent 1.5px);
    --bg-size: 24px 24px;
    --bg-sidebar: rgba(255, 255, 255, 0.95);
    --bg-card: rgba(255, 255, 255, 0.8);
    --text-main: #333;
    --text-secondary: #666;
    --color-primary: #4a90e2;
    --color-primary-hover: #357abd;
    --color-accent: #f5a623;
    --border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-body: #121212;
    --bg-pattern: radial-gradient(circle at top left, #2a2a2a, #121212);
    --bg-size: 100% 100%;
    --bg-sidebar: rgba(30, 30, 30, 0.95);
    --bg-card: rgba(45, 45, 45, 0.7);
    --text-main: #e0e0e0;
    --text-secondary: #a0a0a0;
    --color-primary: #bb86fc;
    --color-primary-hover: #9965f4;
    --color-accent: #03dac6;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
}

[data-theme="blue"] {
    --bg-body: #e3f2fd;
    --bg-pattern: linear-gradient(rgba(25, 118, 210, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(25, 118, 210, 0.05) 1px, transparent 1px);
    --bg-size: 40px 40px;
    --bg-sidebar: rgba(13, 71, 161, 0.95);
    --bg-card: rgba(255, 255, 255, 0.85);
    --text-main: #002147;
    --text-secondary: #2c5282;
    --color-primary: #1565c0;
    --color-primary-hover: #0d47a1;
    --color-accent: #ff6f00;
    --border-color: rgba(21, 101, 192, 0.3);
}

[data-theme="blue"] .sidebar .logo-text {
    color: #fff !important;
}

[data-theme="blue"] .nav-text {
    color: rgba(255, 255, 255, 0.7) !important;
}

[data-theme="pink"] {
    --bg-body: #fff0f5;
    --bg-pattern: linear-gradient(135deg, #fff0f5 0%, #ffe4e1 100%);
    --bg-size: 100% 100%;
    --bg-sidebar: rgba(255, 240, 245, 0.95);
    --bg-card: rgba(255, 255, 255, 0.6);
    --text-main: #5d4037;
    --text-secondary: #8c5a5a;
    --color-primary: #ff69b4;
    --color-primary-hover: #ff1493;
    --color-accent: #ffb6c1;
    --border-color: rgba(255, 105, 180, 0.2);
    --radius: 20px;
}

/* =========================================
   ★ 3. Sidebar Logo 修復區 (重點修改處)
   ========================================= */
.sidebar {
    width: var(--sidebar-width) !important;
    min-width: var(--sidebar-width) !important;
    max-width: var(--sidebar-width) !important;
    background-color: var(--bg-sidebar);
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));
    padding: 20px 15px !important;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    text-align: left !important;
}

.logo-area {
    margin-bottom: 20px !important;
    padding: 10px 5px !important;
}

/* ★★★ 1. 針對大標題 (h2 裡面的 .logo-text) 設定大字體 ★★★ */
.logo-area h2 {
    margin: 0 !important;
    line-height: 1.2 !important;
    display: flex !important;
    align-items: center !important;
}

.logo-area h2 .logo-text {
    font-size: 24px !important;
    /* 恢復大字體 */
    font-weight: 700 !important;
    /* 恢復粗體 */
    color: var(--color-primary) !important;
    text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.5);
    /* 恢復陰影風格 */
}

/* 黑暗模式取消陰影 */
[data-theme="dark"] .logo-area h2 .logo-text {
    text-shadow: none !important;
}

/* ★★★ 2. 針對小副標題 (small 裡面的 .logo-text) 設定小字體 ★★★ */
.logo-area small.logo-text {
    display: block !important;
    font-size: 13px !important;
    /* 鎖定小字體 */
    font-weight: 400 !important;
    /* 鎖定細體 */
    margin-top: 5px !important;
    color: var(--text-secondary) !important;
    opacity: 0.9;
    text-shadow: none !important;
    /* 副標題不要陰影 */
}

/* 導覽連結 */
.nav-links {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 auto 0 !important;
}

.nav-links li {
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
}

.nav-links a {
    display: flex !important;
    align-items: center !important;
    padding: 10px 15px !important;
    border-radius: var(--radius);
    color: var(--text-main);
    font-weight: 500 !important;
    font-size: 16px !important;
    text-decoration: none !important;
    transition: 0.2s;
    width: 100% !important;
}

.nav-icon {
    margin-right: 10px !important;
    font-size: 1.2em !important;
    width: 24px !important;
    text-align: center !important;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--color-primary);
    box-shadow: inset 0 0 0 1px var(--border-color);
}

/* ====================
   手機版修正
   ==================== */
@media (max-width: 768px) {
    body {
        padding-left: 0 !important;
        padding-top: 20px;
        padding-bottom: 100px;
    }

    .sidebar {
        transform: translateX(-110%);
        width: 280px !important;
        min-width: 280px !important;
        max-width: 280px !important;
        z-index: 2147483646 !important;
        box-shadow: none;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.5);
    }
}

/* ====================
   通用元件
   ==================== */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-primary-hover);
}

h1,
h2,
h3 {
    color: var(--color-primary);
    font-weight: 700 !important;
    margin-bottom: 1rem !important;
    line-height: 1.3 !important;
}

.text-3xl {
    font-size: 1.875rem !important;
}

.text-xl {
    font-size: 1.25rem !important;
}

.font-bold {
    font-weight: 700 !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mb-4 {
    margin-bottom: 1rem !important;
}

.btn {
    background-color: var(--color-primary);
    color: #fff !important;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 700 !important;
    transition: all 0.2s ease;
    display: inline-block;
    text-align: center;
    box-shadow: 0 4px 6px rgba(var(--color-primary), 0.3);
    font-size: 1rem !important;
}

.btn:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-2px);
}

.card {
    background-color: var(--bg-card);
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--color-primary);
}

.theme-switcher {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.theme-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    cursor: pointer;
    display: inline-block;
    transition: transform 0.2s;
}

.theme-btn:hover {
    transform: scale(1.1);
}

.theme-btn.selected {
    border-color: var(--color-primary);
    transform: scale(1.2);
    box-shadow: 0 0 8px var(--color-primary);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

input,
select,
textarea {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    border-radius: var(--radius);
    width: 100%;
    margin-bottom: 15px;
    outline: none;
    border-color: var(--color-primary);
    background-color: #fff;
}

.nav-logo-img {
    height: 40px;
    width: auto;
    vertical-align: middle;
    margin-right: 5px;
    display: inline-block;
}

.about-logo-img {
    width: 100px;
    height: auto;
    margin-bottom: 15px;
    display: inline-block;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* =========================================
   ★ 4. 共用版面樣式 (Layout Utilities)
   ========================================= */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    min-height: 80vh;
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    font-size: 2.25rem;
    /* 36px */
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
}

.page-description {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* =========================================
   ★ 5. 整合各頁面特殊樣式
   ========================================= */

/* 寵物與飾品卡片共用 */
.info-card,
.pet-card,
.item-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-main);
    padding: 1.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(var(--backdrop-blur));
    height: 100%;
    display: flex;
    flex-direction: column;
}

.info-card:hover,
.pet-card:hover,
.item-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--color-primary);
}

.info-card h3,
.pet-card h2,
.item-card h3 {
    color: var(--color-primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

/* 篩選按鈕 (searchmomTw.html) */
.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-color: var(--color-primary);
}

.filter-btn.active {
    background-color: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 成就表格 (achievement.html) */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    max-height: 70vh;
    overflow-y: auto;
    background-color: var(--bg-card);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
    font-size: 0.95em;
}

.data-table th {
    background-color: var(--bg-sidebar);
    color: var(--color-primary);
    padding: 12px;
    text-align: left;
    font-weight: bold;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid var(--border-color);
    backdrop-filter: blur(5px);
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
    color: var(--text-main);
}

.data-table tr:hover td {
    background-color: rgba(0, 0, 0, 0.03);
}

/* 徽章樣式 */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    color: #fff;
    text-align: center;
    min-width: 45px;
}

.badge-gold {
    background: linear-gradient(135deg, #ffd700, #ffb900);
    color: #6a4e05;
}

.badge-silver {
    background: linear-gradient(135deg, #e0e0e0, #bdbdbd);
    color: #555;
}

.badge-bronze {
    background: linear-gradient(135deg, #cd7f32, #a05a2c);
}

.badge-blue {
    background: linear-gradient(135deg, #4a90e2, #0056b3);
}

.badge-default {
    background-color: var(--text-secondary);
}

/* 關於本站 (about.html) */
.about-profile-header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(var(--color-primary), 0.1), transparent);
    border-bottom: 1px solid var(--border-color);
}

.update-log {
    max-height: 300px;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: var(--radius);
    padding: 15px;
    list-style: none;
}

.update-log li {
    margin-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 8px;
}

.update-date {
    font-size: 0.85em;
    color: var(--color-primary);
    font-weight: bold;
    margin-right: 5px;
}