/* Resources 統一頁面樣式 - 支援所有 Resources 頁面 */

/* =============================================================================
   基礎佈局和容器
   ============================================================================= */

/* 容器寬度限制 */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 頁面標題區域 - 精簡設計 */
.page-header {
    background: var(--card-bg, white);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

[data-theme="dark"] .page-header {
    background: var(--card-bg);
    border-bottom-color: var(--border-color);
}

.page-header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted, #64748b);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.back-link:hover {
    color: var(--primary-color, #2563eb);
    background: var(--hover-color, #f8fafc);
}

[data-theme="dark"] .back-link:hover {
    background: var(--hover-color);
}

.back-link i {
    font-size: 0.75rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.01em;
    color: var(--text-color, #1e293b);
}

[data-theme="dark"] .page-header h1 {
    color: var(--text-color);
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted, #64748b);
    font-weight: 400;
    margin: 0;
    padding-left: 1rem;
    border-left: 2px solid var(--border-color, #e2e8f0);
}

[data-theme="dark"] .page-subtitle {
    color: var(--text-muted);
    border-left-color: var(--border-color);
}

/* =============================================================================
   三欄佈局系統
   ============================================================================= */

/* 主要內容區域 */
.research-content,
.resources-content {
    padding: 2rem 1rem;
    background: var(--primary-bg, white);
    min-height: 60vh;
    position: relative;
}

/* 添加專業的內容區域背景 */
.research-content::before,
.resources-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color, #2563eb), transparent);
    opacity: 0.3;
}

/* 三欄網格佈局 */
.research-layout,
.resources-layout,
.documentation-layout,
.content-layout {
    display: grid;
    grid-template-columns: 250px 1fr 280px;
    gap: 2rem;
    align-items: start;
}

/* 主要內容區域 */
.research-main,
.resources-main,
.documentation-main,
.content-main {
    min-height: 500px;
    padding-bottom: 3rem;
}

/* 文檔內容包裝器 */
.documentation-content {
    padding: 2rem 1rem;
    background: var(--primary-bg, white);
    min-height: 60vh;
}

/* 文檔工具列 */
.documentation-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--card-bg, white);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    gap: 1rem;
}

[data-theme="dark"] .documentation-toolbar {
    background: var(--card-bg);
    border-color: var(--border-color);
}

/* 搜尋框 */
.search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    max-width: 500px;
    background: var(--secondary-bg, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

[data-theme="dark"] .search-box {
    background: var(--secondary-bg);
    border-color: var(--border-color);
}

.search-box:focus-within {
    border-color: var(--primary-color, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box i {
    color: var(--text-muted, #64748b);
    font-size: 1rem;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    color: var(--text-color, #1e293b);
    font-size: 0.9375rem;
}

[data-theme="dark"] .search-box input {
    color: var(--text-color);
}

.search-box input::placeholder {
    color: var(--text-muted, #64748b);
}

/* =============================================================================
   側邊欄樣式
   ============================================================================= */

.sidebar {
    position: sticky;
    top: 6rem;
    height: fit-content;
}

.sidebar-section {
    background: var(--card-bg, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.sidebar-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

[data-theme="dark"] .sidebar-section {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .sidebar-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color, #1e293b);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color, #2563eb);
}

/* 側邊欄導航 */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted, #64748b);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

[data-theme="dark"] .sidebar-nav-item {
    color: var(--text-color);
    opacity: 0.7;
}

.sidebar-nav-item:hover {
    background: var(--hover-color, white);
    color: var(--primary-color, #2563eb);
}

[data-theme="dark"] .sidebar-nav-item:hover {
    background: var(--hover-color);
    color: var(--primary-color);
    opacity: 1;
}

.sidebar-nav-item.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color, #2563eb);
    font-weight: 600;
}

[data-theme="dark"] .sidebar-nav-item.active {
    background: rgba(37, 99, 235, 0.15);
    color: var(--primary-color);
    opacity: 1;
}

.sidebar-nav-item i {
    width: 20px;
    font-size: 1rem;
    text-align: center;
}

/* 分類列表 */
.sidebar-categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-categories li {
    margin-bottom: 0.5rem;
}

.sidebar-categories a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    color: var(--text-muted, #64748b);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.sidebar-categories a:hover,
.sidebar-categories a.active {
    background: var(--hover-color, white);
    color: var(--primary-color, #2563eb);
}

.sidebar-categories .count {
    background: var(--secondary-bg, #e2e8f0);
    color: var(--text-muted, #64748b);
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.sidebar-categories a.active .count {
    background: var(--primary-color, #2563eb);
    color: white;
}

/* 側邊欄連結 */
.sidebar-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-links li {
    margin-bottom: 0.5rem;
}

.sidebar-links a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    color: var(--text-muted, #64748b);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.sidebar-links a:hover {
    background: var(--hover-color, white);
    color: var(--primary-color, #2563eb);
}

.sidebar-links a.active {
    background: var(--hover-color, white);
    color: var(--primary-color, #2563eb);
    font-weight: 600;
}

.sidebar-links a i {
    width: 18px;
    text-align: center;
}

/* 標籤 */
.sidebar-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    padding: 0.375rem 0.75rem;
    background: var(--hover-color, white);
    color: var(--text-muted, #64748b);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color, #e2e8f0);
    transition: all 0.2s ease;
}

.tag:hover {
    background: var(--primary-color, #2563eb);
    color: white;
    border-color: var(--primary-color, #2563eb);
}

/* =============================================================================
   文檔內容區域樣式
   ============================================================================= */

/* 文檔內容區域 */
.documentation-content-area {
    line-height: 1.8;
    color: #374151;
}

[data-theme="dark"] .documentation-content-area {
    color: var(--text-color);
}

.doc-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

[data-theme="dark"] .doc-section {
    border-bottom: 1px solid var(--border-color);
}

.doc-section:last-child {
    border-bottom: none;
}

.doc-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

[data-theme="dark"] .doc-section h2 {
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

.doc-section h2:first-child {
    margin-top: 0;
}

.doc-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

[data-theme="dark"] .doc-section h3 {
    color: var(--text-color);
}

.doc-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 1.5rem 0 0.75rem 0;
}

[data-theme="dark"] .doc-section h4 {
    color: var(--text-color);
}

.doc-content p {
    margin-bottom: 1rem;
    color: #374151;
}

[data-theme="dark"] .doc-content p {
    color: var(--text-color);
}

.doc-content ul,
.doc-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.doc-content li {
    margin-bottom: 0.5rem;
    color: #374151;
}

[data-theme="dark"] .doc-content li {
    color: var(--text-color);
}

/* =============================================================================
   程式碼區塊 - 終端機樣式
   ============================================================================= */

.code-block {
    background: #0d1117;
    border-radius: var(--border-radius-sm, 0.375rem);
    margin: 1.5rem 0;
    overflow: hidden;
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
    border: 1px solid #30363d;
}

.code-header {
    background: #21262d;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #30363d;
    color: #f0f6fc;
    position: relative;
}

.code-header::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #ff5f56;
    border-radius: 50%;
    box-shadow: 20px 0 0 #ffbd2e, 40px 0 0 #27ca3f;
}

.code-header span {
    color: #f0f6fc;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 4rem;
}

.copy-btn {
    background: none;
    border: none;
    color: #8b949e;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: #30363d;
    color: #f0f6fc;
}

.code-block pre {
    margin: 0;
    padding: 1.5rem;
    color: #e6edf3;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    overflow-x: auto;
    background: #0d1117;
    position: relative;
}

.code-block pre::after {
    content: '█';
    color: #e6edf3;
    animation: blink 1s infinite;
    font-weight: normal;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.code-block code {
    color: #e6edf3;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* 內聯程式碼 */
.doc-content code {
    background: #0d1117;
    color: var(--error-color, #ef4444);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* =============================================================================
   資訊框樣式 - 與 about.html 保持一致
   ============================================================================= */

.info-box,
.warning-box,
.success-box {
    margin: 2rem 0;
    padding: 1rem 1.25rem;
    display: flex;
    gap: 0.75rem;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid rgba(14, 165, 233, 0.2);
    background-color: rgba(240, 249, 255, 0.5);
}

[data-theme="dark"] .info-box,
[data-theme="dark"] .warning-box,
[data-theme="dark"] .success-box {
    border-color: rgba(14, 165, 233, 0.3);
    background-color: rgba(14, 165, 233, 0.1);
}

.warning-box {
    border: 1px solid rgba(234, 179, 8, 0.2);
    background-color: rgba(254, 252, 232, 0.5);
}

[data-theme="dark"] .warning-box {
    border-color: rgba(234, 179, 8, 0.3);
    background-color: rgba(234, 179, 8, 0.1);
}

.success-box {
    border: 1px solid rgba(34, 197, 94, 0.2);
    background-color: rgba(240, 253, 244, 0.5);
}

[data-theme="dark"] .success-box {
    border-color: rgba(34, 197, 94, 0.3);
    background-color: rgba(34, 197, 94, 0.1);
}

.info-box-icon,
.warning-box-icon,
.success-box-icon {
    margin-top: 0.125rem;
    width: 1rem;
    min-width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.info-box-icon svg,
.warning-box-icon svg,
.success-box-icon svg {
    width: 1rem;
    height: 1rem;
    color: rgb(14, 165, 233);
}

.warning-box-icon svg {
    color: rgb(234, 179, 8);
}

.success-box-icon svg {
    color: rgb(34, 197, 94);
}

.info-box-content,
.warning-box-content,
.success-box-content {
    font-size: 0.875rem;
    line-height: 1.75;
    color: rgb(12, 74, 110);
    min-width: 0;
    width: 100%;
}

[data-theme="dark"] .info-box-content,
[data-theme="dark"] .warning-box-content,
[data-theme="dark"] .success-box-content {
    color: rgb(186, 230, 253);
}

.warning-box-content {
    color: rgb(113, 63, 18);
}

[data-theme="dark"] .warning-box-content {
    color: rgb(254, 240, 138);
}

.success-box-content {
    color: rgb(22, 101, 52);
}

[data-theme="dark"] .success-box-content {
    color: rgb(187, 247, 208);
}

.info-box-content p,
.warning-box-content p,
.success-box-content p {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.info-box-content strong,
.warning-box-content strong,
.success-box-content strong {
    font-weight: 600;
    color: inherit;
}

/* =============================================================================
   功能列表樣式
   ============================================================================= */

.feature-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-list li::before {
    content: '✓';
    color: var(--success-color, #10b981);
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

/* =============================================================================
   API 端點樣式
   ============================================================================= */

.api-endpoints {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.endpoint-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #0d1117;
    border-radius: var(--border-radius-sm, 0.375rem);
    border: 1px solid #30363d;
    transition: all 0.2s ease;
    color: #e6edf3;
}

.endpoint-item:hover {
    background: #161b22;
    border-color: #58a6ff;
}

.endpoint-method {
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 60px;
    text-align: center;
}

.endpoint-method.get {
    background: #dbeafe;
    color: #1d4ed8;
}

.endpoint-method.post {
    background: #dcfce7;
    color: #166534;
}

.endpoint-path {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    color: #e6edf3;
    font-weight: 600;
}

.endpoint-desc {
    color: #8b949e;
    font-size: 0.9rem;
    margin-left: auto;
}

/* =============================================================================
   頁面大綱樣式 - Claude Code 風格
   ============================================================================= */

.outline-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin: 0;
    max-height: calc(100vh - 400px);
    overflow-y: auto;
}

.outline-item {
    padding: 0;
    margin: 0;
}

/* 主標題連結 - 簡潔的 Claude Code 風格 */
.outline-link {
    position: relative;
    color: var(--text-muted, #71717a);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 400;
    transition: color 0.15s ease;
    display: block;
    padding: 0.375rem 0.5rem 0.375rem 1rem;
    line-height: 1.4;
    border-left: 2px solid transparent;
}

[data-theme="dark"] .outline-link {
    color: #a1a1aa;
}

/* 左側邊框指示器 */
.outline-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: transparent;
    transition: background-color 0.15s ease;
}

.outline-link:hover {
    color: var(--text-color, #18181b);
}

[data-theme="dark"] .outline-link:hover {
    color: #e4e4e7;
}

.outline-link:hover::before {
    background: var(--border-color, #e4e4e7);
}

[data-theme="dark"] .outline-link:hover::before {
    background: #52525b;
}

/* 活動狀態 - 簡潔明確 */
.outline-link.active {
    color: var(--primary-color, #2563eb);
    font-weight: 500;
}

[data-theme="dark"] .outline-link.active {
    color: #3b82f6;
}

.outline-link.active::before {
    background: var(--primary-color, #2563eb);
}

[data-theme="dark"] .outline-link.active::before {
    background: #3b82f6;
}

/* 子標題列表 - 更清晰的層級 */
.outline-sublist {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.outline-subitem {
    padding: 0;
    margin: 0;
}

.outline-sublink {
    position: relative;
    color: var(--text-muted, #71717a);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 400;
    transition: color 0.15s ease;
    display: block;
    padding: 0.3125rem 0.5rem 0.3125rem 1.75rem;
    line-height: 1.4;
    border-left: 2px solid transparent;
}

[data-theme="dark"] .outline-sublink {
    color: #a1a1aa;
}

.outline-sublink::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: transparent;
    transition: background-color 0.15s ease;
}

.outline-sublink:hover {
    color: var(--text-color, #18181b);
}

[data-theme="dark"] .outline-sublink:hover {
    color: #e4e4e7;
}

.outline-sublink:hover::before {
    background: var(--border-color, #e4e4e7);
}

[data-theme="dark"] .outline-sublink:hover::before {
    background: #52525b;
}

.outline-sublink.active {
    color: var(--primary-color, #2563eb);
    font-weight: 500;
}

[data-theme="dark"] .outline-sublink.active {
    color: #3b82f6;
}

.outline-sublink.active::before {
    background: var(--primary-color, #2563eb);
}

[data-theme="dark"] .outline-sublink.active::before {
    background: #3b82f6;
}

/* 當沒有內容時隱藏 */
.outline-list:empty {
    display: none;
}

/* 滾動條樣式 - 更細更低調 */
.outline-list::-webkit-scrollbar {
    width: 3px;
}

.outline-list::-webkit-scrollbar-track {
    background: transparent;
}

.outline-list::-webkit-scrollbar-thumb {
    background: var(--border-color, #e4e4e7);
    border-radius: 1.5px;
}

[data-theme="dark"] .outline-list::-webkit-scrollbar-thumb {
    background: #3f3f46;
}

.outline-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted, #71717a);
}

[data-theme="dark"] .outline-list::-webkit-scrollbar-thumb:hover {
    background: #52525b;
}

/* =============================================================================
   視圖選項樣式
   ============================================================================= */

.view-options {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

[data-theme="dark"] .view-btn {
    background: var(--primary-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.view-btn:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

[data-theme="dark"] .view-btn:hover {
    background: var(--hover-color);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.view-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

[data-theme="dark"] .view-btn.active {
    background: var(--hover-color);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* =============================================================================
   頁面導航樣式
   ============================================================================= */

.page-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #f1f5f9;
}

[data-theme="dark"] .page-navigation {
    border-top: 2px solid var(--border-color);
}

.nav-prev,
.nav-next {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #f8fafc;
    color: #64748b;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    font-weight: 500;
}

[data-theme="dark"] .nav-prev,
[data-theme="dark"] .nav-next {
    background: var(--primary-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.nav-prev:hover,
.nav-next:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

[data-theme="dark"] .nav-prev:hover,
[data-theme="dark"] .nav-next:hover {
    background: var(--hover-color);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* =============================================================================
   下載按鈕樣式
   ============================================================================= */

.download-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    color: #64748b;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

[data-theme="dark"] .download-btn {
    background: var(--primary-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.download-btn:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

[data-theme="dark"] .download-btn:hover {
    background: var(--hover-color);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.download-btn i {
    color: #2563eb;
}

[data-theme="dark"] .download-btn i {
    color: var(--primary-color);
}

.download-btn:hover i {
    color: white;
}

[data-theme="dark"] .download-btn:hover i {
    color: var(--primary-color);
}

/* =============================================================================
   內容樣式
   ============================================================================= */

/* 內容標題 */
.resources-content h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.resources-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.resources-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.resources-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

/* 段落和文字 */
.resources-content p {
    color: var(--text-color);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.resources-content ul, .resources-content ol {
    color: var(--text-color);
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.resources-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* 代碼塊 */
.resources-content pre {
    background: var(--code-bg, #0d1117);
    border: 1px solid var(--code-border, #30363d);
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.resources-content code {
    background: var(--code-bg, #0d1117);
    color: var(--code-color, #e6edf3);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
}

.resources-content pre code {
    background: none;
    padding: 0;
    color: var(--code-color, #e6edf3);
}

/* 內聯代碼 */
.resources-content p code,
.resources-content li code {
    background: var(--code-bg, #0d1117);
    color: var(--code-color, #e6edf3);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
}

/* 表格 */
.resources-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.resources-content th,
.resources-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.resources-content th {
    background: var(--secondary-bg);
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.resources-content td {
    color: var(--text-color);
    font-size: 0.95rem;
}

.resources-content tr:hover {
    background: var(--hover-color);
}

/* 引用塊 */
.resources-content blockquote {
    border-left: 4px solid var(--primary-color);
    background: var(--secondary-bg);
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
    color: var(--text-color);
    font-style: italic;
}

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

@media (max-width: 1400px) {
    .research-layout,
    .resources-layout,
    .documentation-layout,
    .content-layout {
        grid-template-columns: 220px 1fr 240px;
        gap: 1.5rem;
    }
}

@media (max-width: 1200px) {
    .research-layout,
    .resources-layout,
    .documentation-layout,
    .content-layout {
        grid-template-columns: 200px 1fr 220px;
        gap: 1.25rem;
    }
}

@media (max-width: 1024px) {
    .research-layout,
    .resources-layout,
    .documentation-layout,
    .content-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-left,
    .sidebar-right {
        display: none;
    }

    .resources-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }

    .page-subtitle {
        font-size: 1rem;
    }

    .doc-section h2 {
        font-size: 1.75rem;
    }

    .doc-section h3 {
        font-size: 1.25rem;
    }

    .endpoint-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .endpoint-desc {
        margin-left: 0;
    }

    .page-navigation {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-prev,
    .nav-next {
        width: 100%;
        justify-content: center;
    }
}
