/* Version: 1780911981 */
/* ============================================
   論壇現代響應式 CSS
   漸層主題 · 流暢動畫 · 全設備適配
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    --bg-primary: #f8f9fc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-gradient-soft: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --text-primary: #1a1d29;
    --text-secondary: #6b7280;
    --text-link: #4f46e5;
    --accent-primary: #6366f1;
    --accent-primary-hover: #4f46e5;
    --accent-secondary: #8b5cf6;
    --accent-red: #ef4444;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.03);
    --shadow-xl: 0 20px 40px -5px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    --font-sans: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans TC', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', monospace;
    --max-width: 960px;
    --nav-height: 72px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 15px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- Navbar ---------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    z-index: 100;
    display: flex;
    align-items: center;
}

.nav-inner {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}



body.admin-page .nav-inner {
    max-width: 100% !important;
    padding: 0 24px;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.3px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition);
}

.nav-logo:hover {
    transform: scale(1.02);
}

.nav-logo-icon {
    width: 38px;
    height: 38px;
    background: var(--bg-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
    flex-shrink: 0;
}

.nav-logo-text {
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 6px;
    align-items: center;
}

.nav-links a {
    font-size: 15px;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    transition: all var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-primary);
    background: rgba(99,102,241,0.08);
}

.nav-admin-link {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    padding: 8px 20px !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    border-radius: var(--radius-full) !important;
}

.nav-admin-link:hover {
    box-shadow: 0 4px 12px rgba(16,185,129,0.35) !important;
}

.nav-admin-link:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
/* Language Switch */
.lang-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    transition: all var(--transition);
    border: 2px solid rgba(255,255,255,0.3);
}

.lang-switch:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 4px 12px rgba(245,158,11,0.4);
}


/* ---------- Hamburger Menu ---------- */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 101;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}


/* ---------- Container ---------- */
.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: calc(var(--nav-height) + 24px) 24px 24px;
    min-height: calc(100vh - 80px);
}

/* ---------- Footer ---------- */
.footer {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 24px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    border-top: 1px solid var(--border-light);
}

/* ---------- Section Header ---------- */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
}

.section-title {
    font-size: 26px;
    font-weight: 800;
    flex: 1;
    letter-spacing: -0.5px;
}

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

.back-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    font-size: 16px;
    border-radius: var(--radius);
    transition: all var(--transition);
    flex-shrink: 0;
}

.back-btn:hover {
    background: var(--border-light);
    transform: translateX(-2px);
}

/* ---------- Board Cards (首頁) ---------- */
.board-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.board-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.board-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--bg-gradient);
    opacity: 0;
    transition: opacity var(--transition);
}

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

.board-card:hover::before {
    opacity: 1;
}

.board-icon {
    font-size: 40px;
    line-height: 1;
}
    font-size: 36px;
    line-height: 1;
}

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

.board-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.board-count {
    font-size: 13px;
    color: var(--accent-primary);
    font-weight: 600;
    background: rgba(99,102,241,0.08);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    margin-top: auto;
}

/* ---------- Post Cards (帖子列表) ---------- */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: block;
    transition: all var(--transition);
}

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

.post-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.post-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-excerpt {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.post-card-comments {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.post-card-comments svg {
    width: 14px;
    height: 14px;
}

/* ---------- Post Detail ---------- */
.post-detail {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.post-detail-board {
    font-size: 12px;
    color: var(--accent-primary);
    font-weight: 600;
    background: rgba(99,102,241,0.08);
    padding: 4px 12px;
    border-radius: var(--radius-full);
}

.post-detail-header {
    margin-bottom: 16px;
}

.post-detail-title {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.post-detail-time {
    font-size: 13px;
    color: var(--text-secondary);
}

.post-detail-content {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

.post-detail-stats {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text-secondary);
}

.post-detail-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---------- Comment Section ---------- */
.comment-section {
    margin-top: 4px;
}

.comment-section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

/* ---------- Comment Form ---------- */
.comment-form {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.form-row {
    margin-bottom: 12px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: all var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-secondary);
    color: var(--text-primary);
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

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

.btn-primary {
    background: var(--bg-gradient);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(99,102,241,0.35);
}

.btn-danger {
    background: var(--accent-red);
    color: #fff;
    border: none;
}

.btn-danger:hover {
    box-shadow: 0 4px 15px rgba(239,68,68,0.35);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

/* ---------- Comment List ---------- */
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-item {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    transition: all var(--transition);
}

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

.comment-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.comment-nick {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.comment-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: auto;
}

.comment-body {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.comment-image {
    margin-top: 8px;
}

.comment-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform var(--transition);
    border: 1px solid var(--border-light);
}

.comment-image img:hover {
    transform: scale(1.02);
}

.comment-reply-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: all var(--transition);
}

.comment-reply-toggle:hover {
    background: rgba(99,102,241,0.08);
    color: var(--accent-primary);
}

.comment-reply-toggle svg {
    width: 16px;
    height: 16px;
}

/* ---------- Reply System ---------- */
.reply-list {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.reply-list.open {
    display: block;
}

.reply-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
}

.reply-item + .reply-item {
    border-top: 1px solid var(--border-light);
}

.reply-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.reply-bubble {
    flex: 1;
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 10px 14px;
}

.reply-nick {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 4px;
}

.reply-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
}

.reply-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ---------- Reply Form ---------- */
.reply-form {
    display: none;
    margin-top: 12px;
    padding: 14px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.reply-form.open {
    display: block;
}

.reply-form .captcha-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.reply-form .form-input {
    font-size: 13px;
    padding: 8px 12px;
}

.reply-form .btn {
    flex-shrink: 0;
}

/* ---------- Captcha ---------- */
.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-expression {
    width: 140px;
    height: 48px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
    background: var(--bg-gradient-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    user-select: none;
    letter-spacing: 1px;
}

.captcha-expression:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
}

.captcha-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 42px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.captcha-refresh:hover {
    background: var(--border-light);
    transform: rotate(180deg);
}

.captcha-input {
    width: 72px;
    text-align: center;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 2px;
}

.captcha-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: -4px;
}

/* ---------- Image Upload ---------- */
.image-upload-label {
    display: inline-block;
    cursor: pointer;
}

.image-upload-input {
    display: none;
}

.image-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-primary);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.image-upload-btn:hover {
    background: var(--border-light);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.image-preview {
    position: relative;
    display: inline-block;
    margin-top: 10px;
}

.image-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.image-remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--accent-red);
    color: white;
    border: 2px solid #fff;
    border-radius: 50%;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.image-remove-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(239,68,68,0.4);
}

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.badge-blue {
    background: rgba(99,102,241,0.1);
    color: var(--accent-primary);
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 48px 20px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ---------- Toast ---------- */
@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.comment-item[style*="animation"] {
    animation: fadeIn 0.3s ease;
}

/* ---------- Admin Styles ---------- */
.admin-layout {
    display: flex;
    min-height: calc(100vh - var(--nav-height));
    padding-top: var(--nav-height);
}

.admin-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--bg-card);
    border-right: 1px solid var(--border-light);
    padding: 24px 0;
}

.admin-sidebar-header {
    display: none;
}

.admin-sidebar-toggle {
    display: none;
}

.admin-sidebar-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 20px;
    margin-bottom: 12px;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.admin-nav a:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.admin-nav a.active {
    background: rgba(99,102,241,0.06);
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
    font-weight: 600;
}

.admin-content {
    flex: 1;
    padding: 28px;
    background: var(--bg-primary);
    overflow-x: auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* ---------- Stat Grid ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    transition: all var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-number {
    font-size: 32px;
    font-weight: 800;
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

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

/* ---------- Data Table ---------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.data-table th {
    background: var(--bg-primary);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-light);
}

.data-table td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

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

.data-table tr:hover td {
    background: rgba(99,102,241,0.02);
}

/* ---------- Actions Row ---------- */
.actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---------- Login Page ---------- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-gradient-soft);
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-xl);
    text-align: center;
}

.login-logo {
    font-size: 48px;
    margin-bottom: 8px;
}

.login-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.login-card .btn {
    width: 100%;
    margin-top: 8px;
}

/* ---------- Flash Messages ---------- */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
}

.flash-success {
    background: rgba(16,185,129,0.1);
    color: #059669;
    border: 1px solid rgba(16,185,129,0.2);
}

.flash-error {
    background: rgba(239,68,68,0.1);
    color: #dc2626;
    border: 1px solid rgba(239,68,68,0.2);
}

/* ---------- Admin Styles ---------- */

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

/* ---------- 小型手機 (≤380px) ---------- */
@media (max-width: 380px) {
    :root {
        --nav-height: 56px;
    }
    
    .container {
        padding: calc(var(--nav-height) + 12px) 16px 12px;
    }
    
    .nav-toggle {
        display: flex !important;
    }
    
    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 12px;
        gap: 6px;
        border-bottom: 1px solid var(--border-light);
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 99;
    }
    
    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 12px;
        font-size: 15px;
        border-radius: var(--radius);
    }
    
    .nav-logo {
        font-size: 16px;
    }
    
    .nav-logo-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .nav-links a {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .nav-admin-link {
        padding: 4px 10px !important;
        font-size: 11px !important;
    }
    
    .board-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .board-card {
        padding: 14px 10px;
    }
    
    .board-icon {
    font-size: 40px;
    line-height: 1;
}

.board-icon {
    font-size: 24px;
}
    
    .board-name {
        font-size: 12px;
    }
    
    .board-desc {
        display: none;
    }
    
    .board-count {
        font-size: 10px;
        padding: 2px 8px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .post-card {
        padding: 14px;
    }
    
    .post-card-title {
        font-size: 14px;
    }
    
    .post-detail-title {
        font-size: 18px;
    }
    
    .post-detail {
        padding: 14px;
    }
    
    .comment-item {
        padding: 12px;
    }
    
    .comment-avatar {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .comment-nick {
        font-size: 13px;
    }
    
    .comment-body {
        font-size: 13px;
    }
    
    .reply-avatar {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    
    .reply-bubble {
        padding: 8px 10px;
    }
    
    .reply-text {
        font-size: 12px;
    }
    
    .captcha-expression {
        width: 100px;
        height: 36px;
        font-size: 14px;
    }
    
    .captcha-refresh {
        width: 32px;
        height: 36px;
    }
    
    .captcha-input {
        width: 50px;
        font-size: 14px;
    }
    
    .form-input {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .btn-sm {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .footer {
        padding: 16px 12px;
        font-size: 11px;
    }
}

/* ---------- 普通手機 (≤480px) ---------- */
@media (max-width: 480px) {
    .nav-toggle {
        display: flex !important;
    }
    
    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 14px;
        gap: 6px;
        border-bottom: 1px solid var(--border-light);
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 99;
    }
    
    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 12px;
        font-size: 15px;
        border-radius: var(--radius);
    }
    
    .container {
        padding: calc(var(--nav-height) + 16px) 20px 16px;
    }
    
    .board-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .board-card {
        padding: 18px 12px;
    }
    
    .board-icon {
    font-size: 40px;
    line-height: 1;
}
        font-size: 28px;
    }
    
    .board-name {
        font-size: 13px;
    }
    
    .post-detail-title {
        font-size: 20px;
    }
    
    .post-detail {
        padding: 16px;
    }
    
    .comment-form {
        padding: 16px;
    }
    
    .captcha-row {
        flex-wrap: wrap;
    }
    
    .image-preview img {
        max-width: 150px;
    }
}

/* ---------- 平板 (≤768px) ---------- */
@media (max-width: 768px) {
    :root {
        --max-width: 100%;
        --nav-height: 56px;
    }
    
    .container {
        padding: calc(var(--nav-height) + 16px) 16px 16px;
    }
    
    /* 手機版漢堡菜單 */
    .nav-toggle {
        display: flex !important;
    }
    
    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 16px;
        gap: 8px;
        border-bottom: 1px solid var(--border-light);
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 99;
    }
    
    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 14px 16px;
        font-size: 16px;
        border-radius: var(--radius);
    }
    
    .nav-admin-link {
        margin-top: 8px;
    }
    
    /* 板塊網格 */
    .board-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .board-card {
        padding: 18px 12px;
    }
    
    .board-icon {
        font-size: 32px;
    }
    
    .board-name {
        font-size: 14px;
    }
    
    .board-desc {
        font-size: 12px;
    }
    
    /* 帖子 */
    .post-card {
        padding: 14px;
    }
    
    .post-card-title {
        font-size: 15px;
    }
    
    .post-detail-title {
        font-size: 22px;
    }
    
    /* 留言 */
    .comment-item {
        padding: 12px;
    }
    
    .comment-avatar {
        width: 36px;
        height: 36px;
    }
    
    .comment-body {
        font-size: 14px;
    }
    
    /* 回覆 */
    .reply-avatar {
        width: 28px;
        height: 28px;
    }
    
    .reply-text {
        font-size: 13px;
    }
    
    /* 驗證碼 */
    .captcha-expression {
        width: 120px;
        height: 42px;
        font-size: 16px;
    }
    
    .captcha-input {
        width: 60px;
        font-size: 16px;
    }
    
    /* 管理後台 */
    /* 管理後台 - 手機版漢堡菜單 */
    .admin-layout {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding: 0;
    }
    
    .admin-sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        cursor: pointer;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-light);
    }
    
    .admin-sidebar-title {
        font-size: 14px;
        font-weight: 600;
        color: var(--text-secondary);
        margin: 0;
    }
    
    .admin-sidebar-toggle {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 4px;
        background: none;
        border: none;
        cursor: pointer;
    }
    
    .admin-sidebar-toggle span {
        display: block;
        width: 18px;
        height: 2px;
        background: var(--text-secondary);
        border-radius: 1px;
        transition: all 0.3s;
    }
    
    .admin-sidebar-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(4px, 4px);
    }
    
    .admin-sidebar-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .admin-sidebar-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(4px, -4px);
    }
    
    .admin-nav {
        display: none;
        flex-direction: column;
        padding: 0 12px 12px;
        gap: 4px;
    }
    
    .admin-nav.open {
        display: flex;
    }
    
    .admin-nav a {
        padding: 12px 16px;
        border-left: none;
        border-radius: var(--radius);
        white-space: nowrap;
        font-size: 14px;
        transition: all 0.2s;
    }
    
    .admin-nav a.active {
        border-left: none;
        background: rgba(99,102,241,0.1);
        color: var(--accent-primary);
    }
    
    .admin-content {
        padding: 16px;
    }
    
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .data-table {
        font-size: 11px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .board-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ---------- 桌面 (769px - 1024px) ---------- */
@media (min-width: 769px) {
    .board-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .post-card-excerpt {
        -webkit-line-clamp: 2;
    }
}

/* ---------- 大桌面 (≥1025px) ---------- */
@media (min-width: 769px) {
    .board-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ---------- 超大桌面 (≥1440px) ---------- */
@media (min-width: 1440px) {
    :root {
        --max-width: 900px;
    }
}

/* ---------- 暗色模式支持 ---------- */
@media (prefers-color-scheme: dark) {
    /* 可以在這裡添加暗色模式樣式 */
}

/* ---------- 減少動畫 ---------- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- 列印樣式 ---------- */
@media print {
    .navbar,
    .footer,
    .comment-form,
    .comment-reply-toggle,
    .reply-form,
    .back-btn,
    .nav-admin-link {
        display: none !important;
    }
    
    .container {
        padding-top: 0;
        max-width: 100%;
    }
    
    .post-detail,
    .comment-item {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ============================================
   按比例放大系統
   ============================================ */
.scale-wrapper {
    width: 100vw;
    overflow-x: hidden;
    overflow-y: auto;
}

.scale-content {
    width: 1000px;
    margin: 0 auto;
    transform-origin: top center;
}

/* 非手機版使用按比例放大 */
@media (min-width: 769px) {
    .scale-wrapper {
        display: flex;
        justify-content: center;
    }
    
    .scale-content {
        flex-shrink: 0;
    }
}
