/* ====================================
   AequiLex Chat Interface - CSS Styles
   配色：深綠色 + 米白色優雅風格
   ==================================== */

/* ========== CSS Variables ========== */
:root {
    /* 深綠色 + 米白色優雅配色系統 */
    --bg-primary: #F5F3EE;     /* 主背景 - 米白色 */
    --bg-secondary: #EBE8E1;   /* 次背景 - 淺米色 */
    --bg-card: #FFFFFF;        /* 卡片背景 - 純白 */
    --border: #D4CFC4;         /* 邊框 - 淺棕灰 */
    --primary: #013220;        /* 主色 - 深森林綠 */
    --primary-light: #1A4D2E;  /* 主色淺 - 墨綠 */
    --accent: #2D5F3F;         /* 強調色 - 橄欖綠 */
    --text-primary: #1A1A1A;   /* 主文字 - 深灰黑 */
    --text-secondary: #4A4A4A; /* 次文字 - 中灰 */
    --text-muted: #6A6A6A;     /* 弱文字 - 淺灰 */
    --hover-bg: rgba(1, 50, 32, 0.08);  /* Hover 背景 */
    --white: #FFFFFF;
    
    /* 字體 - 優雅經典組合 */
    --font-heading: 'Playfair Display', 'Cinzel', serif;      /* 優雅襯線標題 */
    --font-body: 'Lora', 'Georgia', serif;                     /* 優雅襯線正文 */
    --font-mono: 'Courier New', monospace;                     /* 等寬字體 */
    --font-logo: 'Playfair Display', 'Cinzel', 'Georgia', serif; /* LOGO 優雅襯線 */
    
    /* 間距 */
    --sidebar-width: 60px;
    --container-max-width: 800px;
    
    /* 過渡 */
    --transition-fast: 200ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
    
    /* 陰影 */
    --shadow-sm: 0 2px 4px rgba(1, 50, 32, 0.08);
    --shadow-md: 0 4px 8px rgba(1, 50, 32, 0.12);
    --shadow-lg: 0 8px 16px rgba(1, 50, 32, 0.16);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    transition: all var(--transition-fast);
}

button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

textarea {
    font-family: inherit;
    resize: none;
}

/* ========== 左側邊欄 ========== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    z-index: 1000;
    transition: transform var(--transition-normal);
    backdrop-filter: blur(20px);
}

/* Logo 區域 */
.sidebar-logo {
    margin-bottom: 40px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform var(--transition-fast);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(1, 50, 32, 0.3);
}

.logo-icon:hover {
    transform: scale(1.1);
}

/* 導航按鈕 */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nav-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 12px;
    position: relative;
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none; /* For <a> tags */
}

.nav-btn:hover {
    background-color: var(--hover-bg);
    color: var(--primary-light);
    transform: scale(1.05);
}

.nav-btn.active {
    background-color: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.nav-btn svg {
    pointer-events: none; /* Ensure SVG doesn't interfere with link clicks */
}

/* Tooltip */
.nav-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    background-color: var(--bg-card);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-5px);
    transition: all var(--transition-fast);
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.nav-btn:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* 底部功能 */
.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: auto;
}

/* ========== 手機版選單按鈕 ========== */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    background-color: var(--bg-card);
    color: var(--primary-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ========== 語言切換按鈕 ========== */
.language-switcher {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 16px;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    animation: fadeInRight 0.5s ease;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all var(--transition-fast);
    position: relative;
}

.lang-btn:hover {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.1);
}

.lang-btn.active {
    color: var(--primary-light);
    text-shadow: 
        0 0 5px rgba(99, 102, 241, 0.6),
        0 0 10px rgba(99, 102, 241, 0.4);
}

.lang-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 8px;
    right: 8px;
    height: 2px;
    background: var(--primary-light);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.8);
}

.lang-divider {
    color: var(--border);
    font-size: 14px;
    user-select: none;
}

.lang-text {
    display: inline-block;
}

/* ========== 主內容區 ========== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: var(--bg-primary);  /* 米白色背景 */
}

.container {
    width: 100%;
    max-width: var(--container-max-width);
    animation: fadeInUp var(--transition-slow) ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 標題區域 ========== */
.hero-header {
    text-align: center;
    margin-bottom: 40px;
}

/* ========== 品牌 LOGO - 圖片版本 ========== */
.brand-logo {
    text-align: center;
    margin-bottom: 48px;
    animation: fadeInDown var(--transition-slow) ease;
    position: relative;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* LOGO 圖片樣式 */
.logo-image {
    max-width: 500px;
    width: 90%;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 2px 4px rgba(1, 50, 32, 0.15));
    transition: all 0.4s ease;
}

/* Hover 效果 */
.logo-image:hover {
    transform: translateY(-3px);
    filter: drop-shadow(0 4px 8px rgba(1, 50, 32, 0.25));
}

/* 響應式設計 - LOGO */

.hero-title {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.3;
    letter-spacing: 0.02em;  /* 數碼字體更寬鬆間距 */
    text-transform: uppercase;  /* 數碼風格大寫 */
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.03em;  /* 數碼風格字間距 */
}

/* ========== 主輸入框 ========== */
.input-container {
    margin-bottom: 24px;
}

.input-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-normal);
}

.input-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4), 0 0 0 1px var(--primary);
}

.main-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: transparent;
    margin-bottom: 16px;
    min-height: 60px;
}

.main-input::placeholder {
    color: var(--text-muted);
}

/* 工具列 */
.input-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.toolbar-btn:hover {
    background-color: var(--hover-bg);
    color: var(--primary-light);
    transform: scale(1.05);
}

.char-count {
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-right: 8px;
}

.submit-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.submit-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.submit-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== 增強版輸入框樣式 ========== */

/* 增強版工具欄 */
.input-toolbar-enhanced {
    background: #f9fafb;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 48px;
}

.toolbar-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar-btn-enhanced {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.toolbar-btn-enhanced:hover {
    background: #f3f4f6;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.toolbar-btn-enhanced .btn-icon {
    font-size: 18px;
    line-height: 1;
}

.toolbar-btn-enhanced .btn-text {
    font-weight: 500;
}

.toolbar-btn-enhanced.recording {
    border-color: #ef4444;
    background: #fef2f2;
}

.toolbar-btn-enhanced.recording .btn-icon {
    color: #ef4444;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.toolbar-status {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 已上傳文件顯示 */
.uploaded-files {
    margin-bottom: 16px;
}

.file-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.file-icon {
    font-size: 24px;
}

.file-details {
    flex: 1;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.file-size {
    font-size: 12px;
    color: var(--text-secondary);
}

.file-remove {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 18px;
}

.file-remove:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* 圖片預覽區域 */
.image-preview {
    margin-bottom: 16px;
    position: relative;
}

.preview-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.preview-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: block;
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.preview-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s;
}

.preview-remove:hover {
    background: #ef4444;
    transform: scale(1.1);
}

/* 增強版輸入框 */
.enhanced-input {
    min-height: 120px;
    max-height: 400px;
    resize: none;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.6;
}

.enhanced-input::-webkit-scrollbar {
    width: 8px;
}

.enhanced-input::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.enhanced-input::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.enhanced-input::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 輸入框底部 */
.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.char-count-display {
    display: flex;
    align-items: baseline;
    gap: 2px;
    font-family: 'Monaco', 'Courier New', monospace;
}

.char-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.char-count.warning {
    color: #f59e0b;
}

.char-count.danger {
    color: #ef4444;
}

.char-limit {
    font-size: 13px;
    color: #9ca3af;
}

/* 增強版快捷提示 */
.enhanced-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 8px;
}

.hint-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.hint-item kbd {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    color: #6b7280;
}

.hint-divider {
    color: #d1d5db;
}

/* 快速插入動畫 */
@keyframes quickInsert {
    0% {
        opacity: 0.5;
        transform: scale(0.98);
    }
    50% {
        opacity: 1;
        transform: scale(1.01);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.quick-insert-animation {
    animation: quickInsert 0.4s ease-out;
}

/* 響應式設計 - 增強輸入框 */
@media (max-width: 767px) {
    .input-toolbar-enhanced {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .toolbar-buttons {
        width: 100%;
    }
    
    .toolbar-btn-enhanced {
        flex: 1;
        justify-content: center;
        min-width: 0;
    }
    
    .toolbar-btn-enhanced .btn-text {
        font-size: 13px;
    }
    
    .enhanced-input {
        min-height: 100px;
        max-height: 300px;
        font-size: 14px;
    }
    
    .file-card {
        padding: 10px 12px;
    }
    
    .file-name {
        font-size: 13px;
    }
    
    .preview-image {
        max-height: 150px;
    }
}

/* ========== 範例查詢區域 ========== */
.examples-section {
    margin-bottom: 24px;
}

.examples-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 12px;
    transition: all var(--transition-fast);
}

.examples-toggle:hover {
    background-color: var(--hover-bg);
    color: var(--primary-light);
}

.toggle-icon {
    transition: transform var(--transition-normal);
}

.examples-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

.examples-list {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all var(--transition-normal);
    margin-top: 0;
}

.examples-list[aria-hidden="false"] {
    max-height: 500px;
    opacity: 1;
    margin-top: 16px;
}

.example-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-align: left;
    color: var(--text-secondary);
    font-size: 15px;
    border-radius: 10px;
    margin-bottom: 8px;
    background-color: rgba(99, 102, 241, 0.05);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.example-item:hover {
    background-color: var(--hover-bg);
    border-color: var(--primary);
    color: var(--text-primary);
    transform: translateX(4px);
}

.example-icon {
    color: var(--accent);
    font-size: 16px;
    flex-shrink: 0;
}

.example-text {
    flex: 1;
}

/* ========== 快捷提示 ========== */
.keyboard-hint {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.keyboard-hint kbd {
    display: inline-block;
    padding: 4px 8px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

/* ========== 分頁預覽區域 ========== */
.pages-preview {
    margin-top: 80px;
    padding-top: 60px;
    border-top: 1px solid var(--border);
}

.preview-title {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 48px;
    letter-spacing: 0.01em;
}

.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.page-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-decoration: none;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.page-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.page-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 12px;
    margin-bottom: 20px;
    transition: transform var(--transition-fast);
}

.page-card:hover .page-icon {
    transform: scale(1.1) rotate(5deg);
}

.page-icon svg {
    stroke: var(--white);
}

.page-card-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.page-card-description {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 20px;
    flex: 1;
}

.page-card-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    transition: gap var(--transition-fast);
}

.page-card:hover .page-card-link {
    gap: 12px;
}

.page-card-link svg {
    stroke: var(--primary);
    transition: transform var(--transition-fast);
}

.page-card:hover .page-card-link svg {
    transform: translateX(4px);
}

/* ========== 內頁樣式 ========== */

/* 頁面容器 */
.page-container {
    max-width: 1000px;
}

/* 頁面標題 */
.page-header {
    text-align: center;
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-family: var(--font-heading);
    font-size: 42px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: 0.01em;
}

.page-subtitle {
    font-family: var(--font-body);
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* 搜索與篩選 */
.search-filter-section {
    margin-bottom: 48px;
}

.search-box {
    position: relative;
    margin-bottom: 24px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    stroke: var(--text-muted);
}

.search-input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(1, 50, 32, 0.1);
}

.filter-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-select {
    flex: 1;
    min-width: 150px;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-select:hover {
    border-color: var(--primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(1, 50, 32, 0.1);
}

/* 案例網格 */
.cases-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 48px;
}

.case-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: all var(--transition-normal);
}

.case-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.case-badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--primary);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    margin-bottom: 12px;
}

.case-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.case-summary {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.case-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-muted);
}

.meta-item svg {
    stroke: var(--text-muted);
}

.case-btn {
    padding: 10px 20px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

/* 分頁導航 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
}

.page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--hover-bg);
}

.page-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 設定頁面樣式 */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
}

.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
}

.settings-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.settings-title svg {
    stroke: var(--primary);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info {
    flex: 1;
}

.setting-label {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.setting-description {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-secondary);
}

.setting-select {
    min-width: 180px;
    padding: 10px 16px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.setting-select:hover {
    border-color: var(--primary);
}

.setting-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(1, 50, 32, 0.1);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    display: inline-block;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: var(--transition-fast);
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: var(--white);
    transition: var(--transition-fast);
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Action Buttons */
.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.action-btn.danger {
    background: #DC2626;
}

.action-btn.danger:hover {
    background: #B91C1C;
}

.action-btn svg {
    stroke: var(--white);
}

/* Settings Actions */
.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
}

.btn-secondary {
    padding: 12px 24px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: var(--hover-bg);
}

.btn-primary {
    padding: 12px 24px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

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

.btn-primary.large {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-primary svg {
    stroke: var(--white);
}

/* 關於頁面樣式 */
.about-section {
    margin-bottom: 80px;
}

.about-title {
    font-family: var(--font-heading);
    font-size: 40px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.3;
}

.about-lead {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-secondary);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 40px;
    text-align: center;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
}

.feature-card {
    text-align: center;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 12px;
}

.feature-icon svg {
    stroke: var(--white);
}

.feature-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.feature-description {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Advantages List */
.advantages-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.advantage-item {
    display: flex;
    gap: 24px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all var(--transition-normal);
}

.advantage-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.advantage-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    border-radius: 8px;
}

.advantage-content {
    flex: 1;
}

.advantage-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.advantage-description {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
}

.stat-card {
    text-align: center;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.stat-label {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text-secondary);
}

/* Contact Info */
.contact-info {
    text-align: center;
    padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.contact-text {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 400px;
    margin: 0 auto;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--text-primary);
}

.contact-item svg {
    stroke: var(--primary);
    flex-shrink: 0;
}

.contact-item a {
    color: var(--primary);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.contact-item a:hover {
    opacity: 0.7;
}

/* About CTA */
.about-cta {
    text-align: center;
    margin-top: 60px;
}

/* 文檔頁面樣式 */
.docs-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 48px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: 12px;
    flex-wrap: wrap;
}

.docs-nav-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.docs-nav-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.docs-nav-btn.active {
    background: var(--primary);
    color: var(--white);
}

.docs-content {
    max-width: 900px;
}

.docs-section {
    display: none;
}

.docs-section.active {
    display: block;
}

.docs-heading {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 40px;
}

.docs-block {
    margin-bottom: 48px;
}

.docs-subheading {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.docs-mini-heading {
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 12px;
}

.docs-text {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.docs-list {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-left: 24px;
    margin-bottom: 16px;
}

.docs-list li {
    margin-bottom: 8px;
}

.code-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    overflow-x: auto;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-primary);
    white-space: pre;
}

.docs-text code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--primary);
}

/* Docs Table */
.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.docs-table thead {
    background: var(--bg-secondary);
}

.docs-table th {
    padding: 16px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.docs-table td {
    padding: 16px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.docs-table tbody tr:last-child td {
    border-bottom: none;
}

.docs-table tbody tr:hover {
    background: var(--bg-secondary);
}

/* FAQ */
.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    transition: all var(--transition-normal);
}

.faq-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.faq-question {
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.faq-answer {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Docs Help */
.docs-help {
    text-align: center;
    padding: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 16px;
    margin-top: 80px;
}

.docs-help-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 12px;
}

.docs-help-text {
    font-family: var(--font-body);
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 24px;
}

.docs-help .btn-primary {
    background: var(--white);
    color: var(--primary);
}

.docs-help .btn-primary:hover {
    background: var(--bg-secondary);
}

.docs-help .btn-primary svg {
    stroke: var(--primary);
}

/* ========== 社交媒體分享區域 ========== */
.social-share-section {
    position: relative;
    text-align: center;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.share-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.share-trigger-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.share-trigger-btn svg {
    stroke: var(--white);
}

.share-text {
    font-family: var(--font-body);
}

/* 社交媒體彈出窗口 */
.social-share-popup {
    position: absolute;
    bottom: calc(100% + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 1000;
    min-width: 320px;
}

.social-share-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.social-share-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.share-popup-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.share-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.share-close-btn:hover {
    background: var(--hover-bg);
    color: var(--primary);
}

.share-close-btn svg {
    stroke: currentColor;
}

/* 社交媒體按鈕網格 */
.social-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.social-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.social-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.social-icon {
    width: 32px;
    height: 32px;
    transition: transform var(--transition-fast);
}

.social-btn:hover .social-icon {
    transform: scale(1.1);
}

.social-name {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 各平台特定顏色 */
.social-btn.tiktok:hover {
    background: #000000;
    border-color: #000000;
}

.social-btn.tiktok:hover .social-icon {
    color: #ffffff;
}

.social-btn.tiktok:hover .social-name {
    color: #ffffff;
}

.social-btn.facebook:hover {
    background: #1877F2;
    border-color: #1877F2;
}

.social-btn.facebook:hover .social-icon {
    color: #ffffff;
}

.social-btn.facebook:hover .social-name {
    color: #ffffff;
}

.social-btn.instagram:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border-color: #dc2743;
}

.social-btn.instagram:hover .social-icon {
    color: #ffffff;
}

.social-btn.instagram:hover .social-name {
    color: #ffffff;
}

.social-btn.twitter:hover {
    background: #000000;
    border-color: #000000;
}

.social-btn.twitter:hover .social-icon {
    color: #ffffff;
}

.social-btn.twitter:hover .social-name {
    color: #ffffff;
}

/* 彈出窗口箭頭 */
.social-share-popup::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--bg-card);
}

.social-share-popup::before {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 9px solid var(--border);
}

/* ========== 升級方案彈窗 ========== */

.upgrade-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.upgrade-modal.active {
    display: flex;
}

.upgrade-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.upgrade-modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: 20px;
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.upgrade-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.upgrade-modal-title {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.upgrade-close-btn {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.upgrade-close-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
    transform: rotate(90deg);
}

/* 定價卡片網格 */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.pricing-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    position: relative;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(45, 95, 63, 0.15);
    border-color: var(--primary);
}

.pricing-card.popular {
    border-color: var(--primary);
    border-width: 3px;
    box-shadow: 0 10px 40px rgba(45, 95, 63, 0.2);
}

/* 徽章 */
.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-body);
    border: 1px solid var(--border);
}

.popular-badge {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.save-badge {
    background: #2D5F3F;
    color: white;
    border-color: #2D5F3F;
}

/* 方案標題 */
.pricing-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin: 24px 0 16px 0;
    text-align: center;
}

/* 價格 */
.pricing-price {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 2px solid var(--border);
}

.price-currency {
    font-family: var(--font-body);
    font-size: 20px;
    font-weight: 600;
    color: var(--text-secondary);
    vertical-align: super;
}

.price-amount {
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.price-period {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text-secondary);
    margin-left: 4px;
}

/* 功能列表 */
.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 32px 0;
    flex-grow: 1;
}

.pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--text-primary);
}

.pricing-features li svg {
    flex-shrink: 0;
    margin-top: 2px;
    stroke: var(--primary);
}

.pricing-features li.disabled {
    opacity: 0.4;
}

.pricing-features li.disabled svg {
    stroke: var(--text-secondary);
}

/* 升級按鈕 */
.pricing-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: center;
}

.pricing-btn:hover {
    background: #2D5F3F;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(45, 95, 63, 0.3);
}

.pricing-btn.current {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.pricing-btn.current:hover {
    transform: none;
    box-shadow: none;
}

/* 彈窗底部 */
.upgrade-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 2px solid var(--border);
}

.upgrade-footer p {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* ========== 響應式設計 ========== */

/* 平板 (768px - 1023px) */
@media (max-width: 1023px) {
    :root {
        --sidebar-width: 50px;
    }
    
    /* 品牌 LOGO 響應式 - 平板 */
    .logo-image {
        max-width: 400px;
        width: 85%;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .container {
        max-width: 90%;
    }
    
    /* 語言切換按鈕 - 平板 */
    .language-switcher {
        top: 20px;
        right: 20px;
        padding: 6px 12px;
    }
    
    .lang-btn {
        font-size: 13px;
        padding: 3px 6px;
    }
    
    /* 升級彈窗 - 平板 */
    .upgrade-modal-content {
        padding: 30px;
        width: 90%;
    }
    
    .upgrade-modal-title {
        font-size: 26px;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* 手機 (< 767px) */
@media (max-width: 767px) {
    :root {
        --sidebar-width: 0;
    }
    
    /* 側邊欄變為抽屜 */
    .sidebar {
        width: 240px;  /* 手機抽屜寬度固定 */
        transform: translateX(-100%);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);  /* 增加陰影增強層次感 */
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    /* 顯示手機選單按鈕 */
    .mobile-menu-btn {
        display: flex;
    }
    
    /* 主內容區無左邊距 */
    .main-content {
        margin-left: 0;
        padding: 80px 20px 40px;
    }
    
    /* 品牌 LOGO 響應式 - 手機 */
    .brand-logo {
        margin-bottom: 32px;
    }
    
    .logo-image {
        max-width: 300px;
        width: 80%;
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .hero-subtitle {
        font-size: 14px;
    }
    
    .input-box {
        padding: 16px;
    }
    
    .main-input {
        font-size: 15px;
        min-height: 50px;
    }
    
    .example-item {
        font-size: 14px;
        padding: 12px 14px;
    }
    
    .keyboard-hint {
        display: none;
    }
    
    /* 語言切換按鈕 - 手機 */
    .language-switcher {
        top: 16px;
        right: 60px;  /* 避開手機選單按鈕 */
        padding: 6px 10px;
    }
    
    .lang-btn {
        font-size: 12px;
        padding: 2px 4px;
    }
    
    .lang-divider {
        font-size: 12px;
    }
    
    /* 升級彈窗 - 手機 */
    .upgrade-modal-content {
        padding: 20px;
        width: 95%;
        max-height: 95vh;
        border-radius: 16px;
    }
    
    .upgrade-modal-title {
        font-size: 22px;
    }
    
    .upgrade-close-btn {
        width: 36px;
        height: 36px;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .pricing-card {
        padding: 24px;
    }
    
    .pricing-title {
        font-size: 20px;
    }
    
    .price-amount {
        font-size: 36px;
    }
    
    .pricing-features li {
        font-size: 14px;
    }
    
    .upgrade-footer {
        padding-top: 16px;
    }
    
    .upgrade-footer p {
        font-size: 12px;
    }
}

/* ========== 無障礙設計 ========== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* 高對比模式 */
@media (prefers-contrast: high) {
    :root {
        --border: #2D6A4F;
        --text-light: #52B788;
    }
    
    .input-box {
        border-width: 3px;
    }
}

/* ========== 載入動畫 ========== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ========== 滾動條樣式 ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ========== 選取文字樣式 ========== */
::selection {
    background-color: var(--primary);
    color: var(--white);
}

/* ========== 性能優化相關樣式 ========== */

/* 1. 頁面加載進度條 */
.loading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #52B788);
    z-index: 99999;
    transition: width 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 0 10px rgba(45, 95, 63, 0.5);
}

/* 2. 返回頂部按鈕 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(45, 95, 63, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #2D5F3F;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(45, 95, 63, 0.4);
}

.back-to-top:active {
    transform: translateY(-2px);
}

/* 3. 滾動動畫 */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* 4. 頁面過渡效果 */
body {
    transition: opacity 0.3s ease;
}

body.page-transitioning {
    opacity: 0;
}

body.page-loaded {
    animation: pageLoad 0.5s ease-out;
}

@keyframes pageLoad {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 5. 骨架屏加載 */
.skeleton-container {
    position: relative;
    overflow: hidden;
}

.skeleton-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.6) 50%,
        transparent 100%
    );
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.skeleton-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 12px;
}

.skeleton-text {
    height: 16px;
    width: 100%;
    background: var(--bg-secondary);
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-text:last-child {
    width: 60%;
}

/* 6. 圖片懶加載 */
img[data-src] {
    opacity: 0;
    transition: opacity 0.5s ease;
}

img.loaded {
    opacity: 1;
}

/* 7. 波紋效果 */
button, .btn {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 8. 增強的工具提示 */
.enhanced-tooltip {
    position: fixed;
    background: rgba(26, 26, 26, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font-body);
    z-index: 10001;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.enhanced-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.enhanced-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(26, 26, 26, 0.95);
}

/* 9. 卡片增強效果 */
.page-card,
.pricing-card,
.case-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* 10. 表單焦點增強 */
.input-wrapper {
    position: relative;
}

.input-wrapper.focused .input-label {
    color: var(--primary);
    transform: translateY(-24px) scale(0.85);
}

.input-wrapper .input-label {
    position: absolute;
    top: 16px;
    left: 16px;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 16px;
    pointer-events: none;
    transition: all 0.2s ease;
    transform-origin: left top;
}

/* 11. 平滑滾動 */
html {
    scroll-behavior: smooth;
}

/* 12. 性能優化 - 硬件加速 */
.page-card,
.pricing-card,
.nav-btn,
.back-to-top,
.sidebar {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* 13. 移動端優化 */
@media (max-width: 767px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .animate-on-scroll {
        /* 移動端減少動畫 */
        transform: translateY(15px);
    }
}

/* 14. 預加載動畫 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* 15. 加載狀態 */
.loading-state {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading-state::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 16. 內容淡入效果 */
.content-section {
    opacity: 0;
    animation: contentFadeIn 0.6s ease-out forwards;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 17. 降低移動端動畫負擔 */
@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll,
    .page-loaded,
    .ripple-effect,
    .enhanced-tooltip {
        animation: none !important;
        transition: none !important;
    }
}

/* ========== 對話框系統 ========== */

/* 對話容器 */
.chat-container {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 9000;
    display: none;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

.chat-container.active {
    display: flex;
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* 對話頭部 */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    background: var(--bg-card);
    border-bottom: 2px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chat-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-title svg {
    stroke: var(--primary);
}

.chat-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.chat-close-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

/* 對話主體 */
.chat-main {
    flex: 1;
    overflow-y: auto;
    padding: 30px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 消息氣泡 */
.message-wrapper {
    display: flex;
    gap: 16px;
    animation: messageSlideIn 0.4s ease-out;
}

@keyframes messageSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    60% {
        opacity: 1;
        transform: translateY(-2px) scale(1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message-wrapper.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}

.message-wrapper.user .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.message-wrapper.assistant .message-avatar {
    background: var(--primary);
}

.message-content {
    flex: 1;
    max-width: 70%;
}

.message-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 20px;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.message-bubble:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.message-wrapper.user .message-bubble {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.message-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    padding: 0 4px;
    font-family: var(--font-body);
}

/* 工作流步驟 */
.workflow-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-top: 12px;
}

.workflow-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.workflow-header svg {
    stroke: var(--primary);
    animation: spin 2s linear infinite;
}

.workflow-header.completed svg {
    animation: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.workflow-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

.workflow-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.workflow-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--bg-secondary);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateX(-20px);
    animation: stepFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    border: 1px solid transparent;
}

@keyframes stepFadeIn {
    0% {
        opacity: 0;
        transform: translateX(-20px) scale(0.9);
    }
    60% {
        transform: translateX(5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.workflow-step.active {
    background: linear-gradient(135deg, rgba(45, 95, 63, 0.08) 0%, rgba(45, 95, 63, 0.12) 100%);
    border: 1px solid rgba(45, 95, 63, 0.3);
    box-shadow: 0 2px 12px rgba(45, 95, 63, 0.15);
    transform: scale(1.02);
}

.workflow-step.completed {
    opacity: 0.7;
    background: var(--bg-hover);
    transform: scale(0.98);
}

.step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.workflow-step.pending .step-icon {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.workflow-step.active .step-icon {
    background: var(--primary);
    color: white;
}

.workflow-step.active .step-icon svg {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.1) rotate(90deg);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.95) rotate(180deg);
    }
    75% {
        transform: scale(1.1) rotate(270deg);
    }
}

.workflow-step.completed .step-icon {
    background: #52B788;
    color: white;
}

.step-text {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
}

.workflow-step.active .step-text {
    font-weight: 600;
    color: var(--primary);
}

.workflow-step.completed .step-text {
    color: var(--text-secondary);
}

/* 打字動畫 */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 16px 20px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: typingDot 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-8px);
    }
}

/* AI 回復動畫 */
.ai-response {
    animation: responseReveal 0.6s ease-out;
}

@keyframes responseReveal {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* AI 回覆內容樣式 */
.ai-response-content h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin: 20px 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-response-content h3:first-child {
    margin-top: 0;
}

.ai-response-content p {
    margin: 10px 0;
    line-height: 1.7;
}

.ai-response-content ul {
    margin: 12px 0;
    padding-left: 0;
    list-style: none;
}

.ai-response-content ul li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

.ai-response-content ul li:before {
    content: "•";
    position: absolute;
    left: 8px;
    color: var(--primary);
    font-weight: bold;
}

.legal-areas {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.area-badge {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, rgba(45, 95, 63, 0.1) 0%, rgba(45, 95, 63, 0.15) 100%);
    border: 1px solid rgba(45, 95, 63, 0.3);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    margin-right: 8px;
}

/* 案例引用卡片 */
.case-reference {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 18px;
    margin: 16px 0;
    transition: all 0.3s ease;
}

.case-reference:hover {
    box-shadow: 0 4px 16px rgba(1, 50, 32, 0.1);
    transform: translateX(4px);
}

.case-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.case-icon {
    font-size: 20px;
}

.case-header strong {
    font-family: var(--font-heading);
    font-size: 15px;
    color: var(--primary);
}

.case-details {
    display: flex;
    gap: 16px;
    margin: 8px 0;
    flex-wrap: wrap;
}

.case-citation,
.case-court {
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.case-citation {
    background: rgba(45, 95, 63, 0.1);
    color: var(--primary);
    border: 1px solid rgba(45, 95, 63, 0.2);
}

.case-court {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.case-principle {
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    font-style: italic;
}

/* 建議框 */
.advice-box {
    background: linear-gradient(135deg, rgba(82, 183, 136, 0.05) 0%, rgba(82, 183, 136, 0.1) 100%);
    border: 2px solid rgba(82, 183, 136, 0.3);
    border-radius: 12px;
    padding: 18px;
    margin: 16px 0;
}

.advice-box p strong {
    color: #52B788;
    font-size: 15px;
}

.advice-box ol {
    margin: 12px 0;
    padding-left: 24px;
}

.advice-box ol li {
    padding: 6px 0;
    line-height: 1.6;
}

/* 後續跟進框 */
.follow-up {
    background: var(--bg-secondary);
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 18px;
    margin-top: 20px;
}

.follow-up p strong {
    color: var(--primary);
}

.follow-up ul {
    margin: 12px 0;
    padding-left: 0;
}

.follow-up ul li {
    padding: 6px 0 6px 24px;
    position: relative;
}

.follow-up ul li:before {
    content: "✓";
    position: absolute;
    left: 4px;
    color: #52B788;
    font-weight: bold;
}

/* 代碼塊樣式 */
.message-bubble pre {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 12px;
    overflow-x: auto;
    margin: 12px 0;
}

.message-bubble code {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--primary);
}

/* ========== AI 模型選擇器與查詢模式 ========== */

/* AI 模型選擇器 */
.ai-model-selector {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    transition: all var(--transition-normal);
}

.ai-model-selector:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(45, 95, 63, 0.08);
}

.ai-model-selector label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.ai-model-selector label svg {
    width: 18px;
    height: 18px;
    fill: var(--primary);
}

#aiModelSelect {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-family: var(--font-serif);
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-normal);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232D5F3F' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

#aiModelSelect:hover {
    border-color: var(--primary);
}

#aiModelSelect:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.1);
}

#aiModelSelect option {
    padding: 12px;
    font-size: 14px;
}

#aiModelSelect option:disabled {
    color: #999;
}

/* 查詢模式選擇器 */
.query-mode-selector {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
}

.query-mode-selector h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.query-mode-selector h3 svg {
    width: 18px;
    height: 18px;
    fill: var(--primary);
}

.mode-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.mode-btn {
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: center;
}

.mode-btn:hover {
    border-color: var(--primary);
    background: rgba(45, 95, 63, 0.05);
    transform: translateY(-2px);
}

.mode-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 600;
}

.mode-btn.active:hover {
    background: #265239;
    transform: translateY(0);
}

/* ========== 增強版 AI 模型選擇器（卡片式網格）========== */

.model-selector-enhanced {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.model-card {
    position: relative;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.model-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(45, 95, 63, 0.15);
    border-color: #93c5fd;
}

.model-card.selected {
    border: 3px solid #3b82f6;
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

.model-card.locked {
    cursor: not-allowed;
}

.model-card.locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    pointer-events: none;
}

/* 自定義單選按鈕 */
.model-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.model-radio {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    background: white;
    transition: all 0.2s;
}

.model-card.selected .model-radio {
    border-color: #3b82f6;
    background: #3b82f6;
}

.model-card.selected .model-radio::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* 徽章 */
.model-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.model-badge.free {
    background: #d1fae5;
    color: #065f46;
}

.model-badge.pro {
    background: #dbeafe;
    color: #1e40af;
}

.model-badge.new {
    background: #fee2e2;
    color: #991b1b;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* 模型內容區域 */
.model-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.model-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 4px;
}

.model-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.model-description {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* 星級評分 */
.model-ratings {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.rating-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.rating-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.rating-stars {
    display: flex;
    gap: 2px;
    color: #fbbf24;
    font-size: 14px;
}

.star-filled {
    color: #fbbf24;
}

.star-empty {
    color: #d1d5db;
}

/* 鎖定遮罩 */
.model-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 10;
}

.lock-icon {
    font-size: 32px;
    color: #6b7280;
}

.unlock-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.unlock-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: scale(1.05);
}

/* 資訊圖標與 Tooltip */
.model-info-icon {
    position: absolute;
    top: 16px;
    right: 50px;
    width: 20px;
    height: 20px;
    background: #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #6b7280;
    cursor: help;
    z-index: 5;
}

.model-info-icon:hover {
    background: #d1d5db;
}

.model-tooltip {
    position: absolute;
    top: 45px;
    right: 16px;
    background: #1f2937;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.6;
    width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.model-info-icon:hover .model-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.model-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: #1f2937;
    transform: rotate(45deg);
}

.tooltip-section {
    margin-bottom: 8px;
}

.tooltip-section:last-child {
    margin-bottom: 0;
}

.tooltip-section strong {
    display: block;
    margin-bottom: 4px;
    color: #93c5fd;
}

/* 模型切換通知 */
.model-switch-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.model-switch-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.notification-icon {
    font-size: 20px;
}

/* 響應式設計 */
@media (max-width: 1024px) {
    .model-selector-enhanced {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .model-selector-enhanced {
        grid-template-columns: 1fr;
    }
    
    .model-card {
        padding: 16px;
    }
    
    .model-icon {
        font-size: 40px;
    }
    
    .model-name {
        font-size: 15px;
    }
    
    .model-tooltip {
        width: 200px;
        font-size: 11px;
        padding: 10px 12px;
    }
}

/* 搜尋技巧提示框 */
.search-tips {
    margin-bottom: 32px;
}

.search-tips-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    width: 100%;
    text-align: left;
}

.search-tips-toggle:hover {
    border-color: var(--primary);
    background: rgba(45, 95, 63, 0.03);
}

.search-tips-toggle.active {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.search-tips-toggle svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.search-tips-toggle.active svg {
    transform: rotate(180deg);
}

.search-tips-content {
    display: none;
    padding: 20px;
    background: var(--bg-card);
    border: 2px solid var(--primary);
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-tips-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-tips-content li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    line-height: 1.6;
}

.search-tips-content li:last-child {
    border-bottom: none;
}

.search-tips-content li strong {
    color: var(--primary);
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.search-tips-content li code {
    background: rgba(45, 95, 63, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--primary);
}

/* AI Toast 通知 */
.ai-toast {
    position: fixed;
    top: 100px;
    right: 32px;
    padding: 16px 24px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(45, 95, 63, 0.25);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    max-width: 400px;
}

.ai-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.ai-toast-success {
    background: #52B788;
}

.ai-toast-warning {
    background: #F4A261;
}

.ai-toast-error {
    background: #E63946;
}

.ai-toast-info {
    background: var(--primary);
}

/* ========== 法例庫頁面樣式 ========== */

.legislation-page {
    padding: 40px 0;
}

.legislation-page .page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.legislation-page .page-title {
    font-size: 36px;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 600;
}

.legislation-page .page-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

/* 法例庫控制區域 */
.legislation-controls {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    align-items: center;
}

.search-bar {
    flex: 1;
    min-width: 280px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 14px 48px 14px 20px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 82, 68, 0.1);
}

.search-bar i {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.category-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 10px 20px;
    border: 2px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.category-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-controls label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.sort-controls select {
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.sort-controls select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 結果計數 */
.result-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.result-count {
    font-size: 15px;
    color: var(--text-secondary);
}

.result-count strong {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 18px;
}

/* 法例網格 */
.legislation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* 法例卡片 */
.legislation-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s;
    cursor: pointer;
}

.legislation-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.legislation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.legislation-chapter {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(26, 82, 68, 0.1);
    padding: 6px 12px;
    border-radius: 6px;
}

.category-badge {
    font-size: 12px;
    font-weight: 600;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
}

.legislation-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.legislation-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.legislation-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.meta-item i {
    color: var(--primary-color);
    width: 16px;
}

.legislation-actions {
    display: flex;
    gap: 12px;
}

.btn-view {
    flex: 1;
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-view:hover {
    background: #164637;
    transform: scale(1.02);
}

.btn-bookmark {
    padding: 12px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-bookmark:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-bookmark i.fas {
    color: var(--primary-color);
}

/* 空狀態 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 15px;
}

/* Toast 通知動畫 */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ========== 個人中心頁面樣式 ========== */

.settings-page {
    padding: 40px 0;
}

.settings-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.page-header-content h1 {
    font-size: 32px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.page-header-content p {
    font-size: 16px;
    color: var(--text-secondary);
}

.page-header-actions {
    display: flex;
    gap: 12px;
}

/* 標籤導航 */
.settings-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
    overflow-x: auto;
}

.settings-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.settings-tab:hover {
    color: var(--primary);
    background: rgba(45, 95, 63, 0.05);
}

.settings-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* 標籤內容 */
.settings-tab-content {
    display: none;
}

.settings-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 用戶資訊卡片 */
.user-profile-card {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 16px;
    margin-bottom: 32px;
}

.user-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(45, 95, 63, 0.1), rgba(45, 95, 63, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar svg {
    stroke: var(--primary);
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.user-email {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.user-tier-badge {
    display: inline-block;
    padding: 6px 16px;
    background: #F0F0F0;
    color: #666;
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
}

.user-tier-badge.pro {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #333;
}

.user-actions {
    display: flex;
    gap: 12px;
}

/* 統計卡片網格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(45, 95, 63, 0.12);
    border-color: var(--primary);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: rgba(52, 152, 219, 0.1);
}

.stat-icon.blue svg {
    stroke: #3498db;
}

.stat-icon.green {
    background: rgba(45, 95, 63, 0.1);
}

.stat-icon.green svg {
    stroke: var(--primary);
}

.stat-icon.purple {
    background: rgba(155, 89, 182, 0.1);
}

.stat-icon.purple svg {
    stroke: #9b59b6;
}

.stat-icon.orange {
    background: rgba(243, 156, 18, 0.1);
}

.stat-icon.orange svg {
    stroke: #f39c12;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-change {
    font-size: 12px;
    font-weight: 600;
}

.stat-change.positive {
    color: #52B788;
}

.stat-change.negative {
    color: #E63946;
}

.stat-change.neutral {
    color: #999;
}

/* 圖表容器 */
.chart-container {
    padding: 32px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 16px;
    margin-bottom: 32px;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
}

/* 會員資訊區域 */
.membership-section {
    margin-bottom: 32px;
}

.membership-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.membership-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    background: linear-gradient(135deg, rgba(45, 95, 63, 0.05), rgba(45, 95, 63, 0.1));
    border-bottom: 2px solid var(--border);
}

.membership-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.membership-badge {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 20px;
}

.membership-badge.free {
    background: #F0F0F0;
    color: #666;
}

.membership-badge.pro {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #333;
}

.membership-body {
    padding: 32px;
}

.membership-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 600;
}

.btn-upgrade {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), #1e4d2f);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(45, 95, 63, 0.3);
}

/* 設定區域 */
.settings-section {
    padding: 32px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 16px;
    margin-bottom: 24px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.section-title svg {
    stroke: var(--primary);
}

/* 設定項目 */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item.danger {
    background: rgba(230, 57, 70, 0.03);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(230, 57, 70, 0.2);
}

.setting-info {
    flex: 1;
}

.setting-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.setting-label.danger {
    color: #E63946;
}

.setting-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.setting-select {
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-normal);
    min-width: 200px;
}

.setting-select:hover {
    border-color: var(--primary);
}

.setting-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.1);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    display: inline-block;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* 按鈕樣式 */
.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-danger {
    padding: 10px 20px;
    background: #E63946;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-danger:hover {
    background: #c62828;
    transform: translateY(-2px);
}

.btn-primary {
    padding: 10px 20px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

/* Toast 通知 */
.settings-toast {
    position: fixed;
    top: 100px;
    right: 32px;
    padding: 16px 24px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(45, 95, 63, 0.25);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
}

.settings-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.settings-toast-success {
    background: #52B788;
}

.settings-toast-info {
    background: #3498db;
}

.settings-toast-warning {
    background: #f39c12;
}

.settings-toast-error {
    background: #E63946;
}

/* ========== 簡化版主頁樣式 ========== */

/* 簡化版主內容 */
.simplified-main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.centered-container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

/* 品牌 LOGO - 圖片版本 */
.brand-logo-wrapper {
    text-align: center;
    margin-bottom: 40px;
}

.brand-logo-image {
    max-width: 600px;
    width: 100%;
    height: auto;
    display: inline-block;
    filter: drop-shadow(0 4px 12px rgba(45, 95, 63, 0.1));
    transition: all 0.3s ease;
}

.brand-logo-image:hover {
    filter: drop-shadow(0 6px 16px rgba(45, 95, 63, 0.15));
    transform: translateY(-2px);
}

/* 簡化版 Hero */
.simplified-hero {
    text-align: center;
    margin-bottom: 32px;
}

.simplified-hero .hero-title {
    font-size: 32px;
    margin-bottom: 12px;
}

.simplified-hero .hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
}

/* 選擇按鈕區域 */
.selection-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

.selection-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
}

.selection-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(45, 95, 63, 0.1);
    transform: translateY(-2px);
}

.selection-btn svg:first-child {
    stroke: var(--primary);
    flex-shrink: 0;
}

.selection-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.selection-value {
    color: var(--primary);
    font-weight: 600;
}

.dropdown-icon {
    stroke: var(--text-secondary);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.selection-btn:hover .dropdown-icon {
    transform: translateY(2px);
}

/* 選擇下拉框 */
.selection-dropdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 500px;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.selection-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid var(--border);
}

.dropdown-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.dropdown-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.dropdown-close:hover {
    background: var(--bg-hover);
    color: var(--primary);
    transform: rotate(90deg);
}

.dropdown-options {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.dropdown-option:last-child {
    margin-bottom: 0;
}

.dropdown-option:hover {
    border-color: var(--primary);
    background: rgba(45, 95, 63, 0.03);
}

.dropdown-option input[type="radio"] {
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
}

.option-content {
    flex: 1;
}

.option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.option-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.option-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.option-badge.free {
    background: #52B788;
    color: white;
}

.option-badge.pro {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #333;
}

.option-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.dropdown-option input[type="radio"]:checked + .option-content .option-name {
    color: var(--primary);
}

/* ========== 對話訊息展示區域 ========== */

/* 對話容器 */
.conversation-display {
    margin-top: 40px;
    margin-bottom: 40px;
    max-height: 600px;
    overflow-y: auto;
    background: #f9fafb;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    scroll-behavior: smooth;
}

.conversation-display::-webkit-scrollbar {
    width: 8px;
}

.conversation-display::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.conversation-display::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.conversation-display::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 空狀態 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.6;
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.empty-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.empty-desc {
    font-size: 16px;
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto;
}

/* 訊息基礎樣式 */
.message {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    animation: messageSlideIn 0.4s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 用戶訊息 */
.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    background: #dbeafe;
    border-radius: 12px 12px 4px 12px;
    max-width: 70%;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.user-message .message-avatar {
    order: 2;
    font-size: 32px;
    flex-shrink: 0;
}

/* AI 訊息 */
.ai-message {
    justify-content: flex-start;
}

.ai-message .message-content {
    background: #f3f4f6;
    border-radius: 12px 12px 12px 4px;
    max-width: 80%;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ai-message .message-avatar {
    order: 1;
    font-size: 32px;
    flex-shrink: 0;
}

/* 訊息頭像 */
.message-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
}

/* 訊息內容 */
.message-text {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 12px;
    word-wrap: break-word;
}

.message-text p {
    margin: 0 0 12px 0;
}

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

.message-text strong {
    font-weight: 600;
    color: var(--text-primary);
}

.message-text em {
    font-style: italic;
}

.message-text code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 14px;
}

.message-text ul, .message-text ol {
    margin: 12px 0;
    padding-left: 24px;
}

.message-text li {
    margin: 6px 0;
}

/* 判例引用框 */
.citation-box {
    background: #fff7ed;
    border-left: 4px solid #fb923c;
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
}

.citation-title {
    font-size: 14px;
    font-weight: 600;
    color: #ea580c;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.citation-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.citation-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* 時間戳 */
.message-time {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 8px;
    display: block;
}

/* 訊息操作按鈕 */
.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.action-button {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.action-button:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.action-button.active {
    color: var(--primary);
    background: rgba(26, 82, 68, 0.1);
}

.action-button svg {
    width: 16px;
    height: 16px;
}

/* AI 思考中狀態 */
.ai-thinking {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
    animation: messageSlideIn 0.4s ease-out;
}

.ai-thinking .message-avatar {
    font-size: 32px;
}

.thinking-bubble {
    background: #f3f4f6;
    border-radius: 12px 12px 12px 4px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.thinking-text {
    font-size: 15px;
    color: var(--text-secondary);
}

.thinking-dots {
    display: flex;
    gap: 4px;
}

.thinking-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: dotBounce 1.4s infinite ease-in-out;
}

.thinking-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.thinking-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* 分隔線 */
.conversation-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
    margin: 32px 0;
}

/* AI 模型與查詢模式選擇器容器 */
.selector-container {
    display: flex;
    gap: 16px;
    margin-top: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.selector-group {
    flex: 1;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.selector-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.selector-label svg {
    width: 16px;
    height: 16px;
    stroke: var(--primary);
}

.selector-dropdown {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-serif);
    color: var(--text-primary);
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232D5F3F' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.selector-dropdown:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(45, 95, 63, 0.08);
}

.selector-dropdown:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.1);
}

.selector-dropdown option {
    padding: 12px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.selector-dropdown option[data-tier="pro"] {
    color: #1976d2;
}

/* 選擇器通知 */
.selector-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: linear-gradient(135deg, #2d5f3f, #1e4027);
    color: white;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(45, 95, 63, 0.3);
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.selector-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* 響應式設計 - 選擇器 */
@media (max-width: 768px) {
    .selector-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .selector-group {
        min-width: 100%;
    }
}

/* 底部操作按鈕 */
.bottom-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 32px;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 95, 63, 0.1);
}

.action-btn svg {
    stroke: currentColor;
}

.bug-report-btn {
    background: linear-gradient(135deg, rgba(211, 47, 47, 0.1), rgba(183, 28, 28, 0.1));
    border-color: rgba(211, 47, 47, 0.3);
    color: #D32F2F;
}

.bug-report-btn:hover {
    background: linear-gradient(135deg, rgba(211, 47, 47, 0.15), rgba(183, 28, 28, 0.15));
    border-color: #D32F2F;
    color: #B71C1C;
}

/* 側邊欄功能卡片 */
.sidebar-features {
    padding: 16px 12px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    width: 100%;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    margin-bottom: 4px;
}

.feature-item:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.feature-item svg {
    stroke: currentColor;
    flex-shrink: 0;
}

/* 響應式設計 */
@media (max-width: 1023px) {
    .chat-header {
        padding: 16px 24px;
    }
    
    .chat-main {
        padding: 20px 24px;
    }
    
    .message-content {
        max-width: 80%;
    }
}

@media (max-width: 767px) {
    .chat-container {
        left: 0;
    }
    
    .chat-header {
        padding: 16px 20px;
    }
    
    .chat-title {
        font-size: 18px;
    }
    
    .chat-main {
        padding: 16px 20px;
        gap: 20px;
    }
    
    .message-wrapper {
        gap: 12px;
    }
    
    .message-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .message-bubble {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .workflow-container {
        padding: 16px;
    }
}

/* ========== 錯誤回報系統 ========== */

/* 社交分享區域調整 - 平排兩個按鈕 */
.social-share-section {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

/* 回報錯誤按鈕 */
.bug-report-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
    z-index: 10;
}

.bug-report-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(211, 47, 47, 0.4);
    background: linear-gradient(135deg, #E53935 0%, #C62828 100%);
}

.bug-report-btn:active {
    transform: translateY(-1px);
}

.bug-report-btn svg {
    transition: transform 0.3s ease;
}

.bug-report-btn:hover svg {
    transform: rotate(10deg) scale(1.1);
}

/* 錯誤回報彈窗 */
.bug-report-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bug-report-modal.active {
    display: flex;
    opacity: 1;
}

.bug-report-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.bug-report-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: bugModalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10001;
}

@keyframes bugModalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 錯誤回報頭部 */
.bug-report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 30px;
    border-bottom: 2px solid var(--border);
    background: linear-gradient(135deg, rgba(211, 47, 47, 0.05) 0%, rgba(183, 28, 28, 0.05) 100%);
}

.bug-report-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: #D32F2F;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bug-report-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.bug-report-close:hover {
    background: rgba(211, 47, 47, 0.1);
    color: #D32F2F;
    transform: rotate(90deg);
}

/* 錯誤回報主體 */
.bug-report-body {
    padding: 30px;
}

.bug-report-desc {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
}

/* 表單樣式 */
.bug-report-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-select,
.form-input,
.form-textarea {
    font-family: var(--font-body);
    font-size: 15px;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-select:focus,
.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #D32F2F;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.char-counter {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
}

.form-hint {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
}

/* 表單按鈕 */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #D32F2F;
    color: white;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
}

.btn-primary:hover {
    background: #B71C1C;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(211, 47, 47, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    color: var(--primary);
}

/* 加載動畫 */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 成功提示 */
.bug-success-message {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    gap: 20px;
}

.bug-success-message svg {
    color: #52B788;
    stroke-width: 2;
}

.bug-success-message h4 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: #52B788;
    margin: 0;
}

.bug-success-message p {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
    max-width: 400px;
}

/* 錯誤提示 Toast */
.bug-error-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #D32F2F;
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(211, 47, 47, 0.4);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    z-index: 10002;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bug-error-toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* 響應式設計 - 錯誤回報 */
@media (max-width: 767px) {
    .social-share-section {
        flex-direction: column;
        gap: 12px;
    }
    
    .bug-report-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 24px;
    }
    
    .bug-report-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 16px;
    }
    
    .bug-report-header {
        padding: 20px;
    }
    
    .bug-report-title {
        font-size: 20px;
    }
    
    .bug-report-body {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .bug-error-toast {
        left: 20px;
        right: 20px;
        transform: translateY(-100px);
    }
    
    .bug-error-toast.show {
        transform: translateY(0);
    }
}

/* ========== 對話管理側邊欄 ========== */

/* 對話側邊欄容器 */
.chat-sidebar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    width: 320px;
    height: 100vh;
    background: var(--bg-card);
    border-right: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 900;
    overflow: hidden;
}

.chat-sidebar.collapsed {
    transform: translateX(-100%);
}

/* 對話側邊欄頭部 */
.chat-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 2px solid var(--border);
    background: var(--bg-primary);
}

.chat-sidebar-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.chat-sidebar-toggle {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.chat-sidebar-toggle:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

/* 新建對話按鈕 */
.new-chat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 16px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, #2D5F3F 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 12px rgba(1, 50, 32, 0.2);
}

.new-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(1, 50, 32, 0.3);
}

.new-chat-btn:active {
    transform: translateY(0);
}

/* 搜尋對話 */
.chat-search {
    position: relative;
    margin: 0 16px 16px 16px;
}

.chat-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.chat-search-input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.chat-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(1, 50, 32, 0.1);
}

.chat-search-input::placeholder {
    color: var(--text-secondary);
}

/* 對話標籤 */
.chat-tabs {
    display: flex;
    gap: 8px;
    padding: 0 16px 16px 16px;
    border-bottom: 2px solid var(--border);
}

.chat-tab {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chat-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.chat-tab.active {
    background: var(--primary);
    color: white;
}

/* 對話列表 */
.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* 空狀態 */
.chat-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.chat-list-empty svg {
    opacity: 0.3;
    margin-bottom: 16px;
}

.chat-list-empty p {
    margin: 8px 0;
    font-size: 15px;
}

.chat-list-empty-hint {
    font-size: 13px;
    opacity: 0.7;
}

/* 對話項目 */
.chat-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.chat-item:hover {
    background: var(--bg-hover);
    border-color: var(--border);
}

.chat-item:active {
    transform: scale(0.98);
}

.chat-item-content {
    flex: 1;
    min-width: 0;
}

.chat-item-title {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-item-preview {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 6px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-item-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.chat-item-date,
.chat-item-messages {
    display: flex;
    align-items: center;
}

/* 對話項目操作 */
.chat-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.chat-item:hover .chat-item-actions {
    opacity: 1;
}

.chat-item-action {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.chat-item-action:hover {
    background: var(--bg-secondary);
    color: var(--primary);
}

.chat-item-action[data-action="delete"]:hover {
    background: rgba(211, 47, 47, 0.1);
    color: #D32F2F;
}

/* ========== 對話側邊欄增強樣式 v2.0 ========== */

/* 搜尋框樣式 */
.chat-search {
    position: relative;
    margin: 0 16px 12px 16px;
}

.chat-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.chat-search input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.chat-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(1, 50, 32, 0.1);
}

.chat-search input::placeholder {
    color: var(--text-secondary);
}

/* 篩選選項 */
.chat-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px 16px 16px;
    border-bottom: 2px solid var(--border);
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.filter-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-checkbox:hover .filter-label {
    color: var(--text-primary);
}

/* 標籤頁頭部（包含排序） */
.chat-tabs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 16px 16px;
    border-bottom: 2px solid var(--border);
}

.chat-tabs {
    display: flex;
    gap: 8px;
    flex: 1;
}

/* 排序按鈕 */
.chat-sort {
    position: relative;
}

.sort-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.sort-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.sort-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    min-width: 140px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.sort-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-option {
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.sort-option:hover {
    background: var(--bg-hover);
}

.sort-option.active {
    background: var(--primary);
    color: white;
}

/* 對話卡片重構 */
.chat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

.chat-card:active {
    transform: scale(0.98);
}

/* 釘選卡片 */
.chat-card.pinned {
    background: #fef3c7;
    border-color: #fbbf24;
}

/* 卡片頭部 */
.chat-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.chat-title {
    flex: 1;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 標題輸入框（重命名時） */
.chat-title-input {
    width: 100%;
    padding: 6px 10px;
    border: 2px solid var(--primary);
    border-radius: 6px;
    background: var(--bg-primary);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(1, 50, 32, 0.1);
}

/* 高亮搜尋關鍵詞 */
mark {
    background-color: #fef08a;
    color: inherit;
    padding: 2px 4px;
    border-radius: 3px;
}

/* 操作按鈕組 */
.chat-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.chat-card:hover .chat-actions {
    opacity: 1;
}

.chat-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-size: 14px;
    padding: 0;
}

.chat-action-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: scale(1.1);
}

.chat-action-btn[data-action="delete"]:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* 預覽文字 */
.chat-preview {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 標籤行 */
.chat-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.chat-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chat-tag:hover {
    transform: translateY(-1px);
    filter: brightness(0.95);
}

.chat-tag-more {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: #e5e7eb;
    color: #6b7280;
}

/* 卡片底部 */
.chat-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.chat-time,
.chat-messages,
.chat-model {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 空狀態 */
.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 48px;
    opacity: 0.3;
    margin-bottom: 16px;
}

.empty-message {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0;
}

/* 滑出動畫 */
.slide-out {
    animation: slideOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

/* 提示訊息 */
.chat-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 12px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.chat-toast-success {
    border-color: #10b981;
    background: #ecfdf5;
    color: #059669;
}

.chat-toast-undo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-undo-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toast-undo-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

/* 刪除確認對話框 */
.chat-delete-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-delete-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-delete-modal.show .modal-content {
    transform: scale(1);
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.modal-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-btn-cancel {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-btn-cancel:hover {
    background: var(--bg-hover);
}

.modal-btn-delete {
    background: #ef4444;
    color: white;
}

.modal-btn-delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* 響應式設計 - 對話側邊欄 */

/* 響應式設計 - 法例庫 */
@media (max-width: 1200px) {
    .legislation-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    }
}

@media (max-width: 1023px) {
    .legislation-page {
        padding: 32px 0;
    }
    
    .legislation-controls {
        flex-direction: column;
        gap: 16px;
    }
    
    .search-bar {
        width: 100%;
    }
    
    .category-filters {
        width: 100%;
        justify-content: center;
    }
    
    .sort-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .legislation-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .legislation-page .page-title {
        font-size: 28px;
    }
    
    .legislation-page .page-subtitle {
        font-size: 14px;
    }
    
    .legislation-controls {
        gap: 12px;
    }
    
    .category-filters {
        gap: 8px;
    }
    
    .category-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .legislation-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .legislation-card {
        padding: 20px;
    }
    
    .legislation-title {
        font-size: 16px;
    }
    
    .legislation-desc {
        font-size: 13px;
    }
    
    .btn-view {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* 響應式設計 - 對話側邊欄 */
@media (max-width: 1280px) {
    .chat-sidebar {
        width: 280px;
    }
}

@media (max-width: 1023px) {
    .chat-sidebar {
        left: 0;
        width: 280px;
        transform: translateX(-100%);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }
    
    .chat-sidebar.active {
        transform: translateX(0);
    }
    
    .chat-sidebar.collapsed {
        transform: translateX(-100%);
    }
}

@media (max-width: 767px) {
    .chat-sidebar {
        width: 85%;
        max-width: 320px;
    }
    
    .chat-sidebar-header {
        padding: 16px;
    }
    
    .chat-sidebar-title {
        font-size: 16px;
    }
    
    .new-chat-btn {
        margin: 12px;
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .chat-search {
        margin: 0 12px 12px 12px;
    }
    
    .chat-filters {
        padding: 0 12px 12px 12px;
    }
    
    .chat-tabs-header {
        padding: 0 12px 12px 12px;
    }
    
    .chat-tabs {
        padding: 0;
    }
    
    .chat-list {
        padding: 12px;
    }
}

/* 響應式設計 - 對話展示區域 */
@media (max-width: 1023px) {
    .conversation-display {
        max-height: 500px;
        padding: 20px;
    }
    
    .user-message .message-content {
        max-width: 75%;
    }
    
    .ai-message .message-content {
        max-width: 85%;
    }
}

@media (max-width: 767px) {
    .conversation-display {
        max-height: 400px;
        padding: 16px;
        margin-top: 32px;
        margin-bottom: 32px;
    }
    
    .empty-icon {
        font-size: 48px;
    }
    
    .empty-title {
        font-size: 20px;
    }
    
    .empty-desc {
        font-size: 14px;
    }
    
    .message {
        gap: 8px;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    
    .user-message .message-content {
        max-width: 85%;
        padding: 12px 16px;
    }
    
    .ai-message .message-content {
        max-width: 90%;
        padding: 12px 16px;
    }
    
    .message-text {
        font-size: 14px;
    }
    
    .message-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .action-button {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .citation-box {
        padding: 12px;
        margin: 12px 0;
    }
    
    .citation-title {
        font-size: 13px;
    }
    
    .thinking-bubble {
        padding: 12px 16px;
    }
    
    .thinking-text {
        font-size: 14px;
    }
}

