/* ==================== CSS 變數 ==================== */
:root {
    --font-sans:  "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
    --font-serif: "Noto Serif TC", Georgia, serif;
    --color-primary:   #1a3260;
    --color-accent:    #005bac;
    --color-text:      #1a1a2e;
    --color-muted:     #64748b;
    --color-border:    #e2e8f0;
    --color-bg:        #f5f5f5;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

/* ==================== ?��?�?? ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    line-height: 1.6;
    padding-top: 92px;
    overflow-x: hidden;
}

/* ==================== 導航?�樣�?==================== */

/* ?��?導航?��??��???*/
nav.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-bottom: 2px solid #e0e0e0;
}

/* 導航?��?�?*/
.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 1rem;
}

/* Logo?��??�左??*/
.logo {
    display: flex;
    align-items: center;
    max-width: 320px;
}

.logo a {
    display: block;
    line-height: 0;
}

.logo img {
    height: 80px;
    width: auto;
    max-width: 310px;
    object-fit: contain;
    display: block;
}

/* ?��??�單?�塊�??�含上�??��?�?*/
.nav-menus {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    align-items: flex-end;
}

/* 上層?�單 */
.nav-top-menu {
    list-style: none;
    display: flex;
    gap: 1rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-top-menu li a {
    color: #333333;
    text-decoration: none;
    font-size: 0.95rem;
}

.nav-top-menu li a:hover {
    color: #333333;
    font-weight: 900;
}

/* 導航?�中?�表?�樣式�??�於?�出?��?�?*/
.nav-top-menu form {
    display: inline;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
}

/* ?�入?��??��?�?? */
.btn-login {
    background: var(--color-accent);
    color: white !important;
    padding: 0.3rem 1.5rem;
    border-radius: 20px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: all 0.3s;
}

.btn-login:hover {
    background: #004a8f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 91, 172, 0.4);
}

/* 下層?�單 */
.nav-bottom-menu {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-bottom-menu > li {
    position: relative;
}

.nav-bottom-menu > li > a {
    color: #333333;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.25rem 0;
    padding-bottom: 0.15rem;
    display: block;
    position: relative;
}

/* Hover?��?：�?�?+ 粗�?線直?�出??*/
.nav-bottom-menu > li > a:hover {
    color: #333333;
    font-weight: 900;
}

.nav-bottom-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--color-accent);
}

.nav-bottom-menu > li > a:hover::after {
    width: 100%;
}

/* 下�??�單�?? */
.has-dropdown {
    position: relative;
}

.dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    padding: 0.5rem 0;
    list-style: none;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

.has-dropdown:hover .dropdown {
    opacity: 1;
    visibility: visible;
}

.dropdown li {
    padding: 0;
    margin: 0;
}

.dropdown li a {
    display: block;
    padding: 0.6rem 1.2rem;
    color: #555555;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-align: left;
    white-space: nowrap;
}

.dropdown li a:hover {
    background-color: #f0f0f0;
    color: #333333;
    font-weight: 700;
}

/* 漢堡?�單?��? */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: #333333;
    transition: all 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ==================== 主�??�容?�??==================== */
.container {
    max-width: 1100px;
    margin: 1.4rem auto 2rem;
    padding: 0 2rem;
}

/* ?��?統�??�容寬度
   .page-content      ??一?�內容�?�?200px�?
   .page-content--sm  ??表單／�??�面�?200px�?
*/
.page-content {
    max-width: 1100px;
    margin: 0 auto;
}

/* 寬�??�容?�：�? footer ??1200px + 2rem ?��??�白一??*/
.page-content--wide {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

.page-content--sm {
    max-width: 1100px;
    margin: 0 auto;
}

/* ?��?標�??��?*/
.page-header {
    margin-bottom: 1.4rem;
    display: block;
    width: 100%;
}

.page-header h1 {
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: 0.03em;
    line-height: 1;
    margin-bottom: 0;
}

.page-header p {
    color: #666;
    font-size: 0.95rem;
    margin-top: 0.6rem;
    display: none;
}

.page-header .page-en-label {
    width: auto;
}

/* ?��??�面：英?��?字�??��??��??��?題�?下方?��?一?��? */
.page-header.page-header--top-gap {
    padding-top: 1.4rem;
}

.page-header.page-header--top-gap .page-en-label {
    margin-top: 0;
}

/* 標�??��?標�? + ?�側 CTA ?��?並�?�?*/
.page-header-row {
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    margin-bottom: 1.4rem;
    gap: 1rem;
}

.page-header-row .page-header {
    margin-bottom: 0;
}

.page-header-row .create-btn {
    margin-left: auto;
}

/* 標�?上方?��?小�?（通用�?*/
.page-en-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

/* ==================== 訊息?�示�?? ==================== */
.messages {
    max-width: 1100px;
    margin: 0.75rem auto 0;
    padding: 0 2rem;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    margin-bottom: 0.6rem;
    border-radius: 3px;
    font-size: 0.875rem;
    line-height: 1.5;
    background: #fff;
    border: 1px solid #e4e8f0;
    border-left-width: 4px;
    color: #2c3e50;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.alert::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.35rem;
}

.alert-success {
    border-left-color: #27ae60;
}
.alert-success::before { background: #27ae60; }

.alert-error {
    border-left-color: #c0392b;
}
.alert-error::before { background: #c0392b; }

.alert-warning {
    border-left-color: #e67e22;
}
.alert-warning::before { background: #e67e22; }

.alert-info {
    border-left-color: #2980b9;
}
.alert-info::before { background: #2980b9; }
.alert-error-modal[hidden] {
    display: none;
}

.alert-error-modal {
    position: fixed;
    top: calc(92px + 1rem);
    right: 1.25rem;
    z-index: 2000;
    width: min(420px, calc(100vw - 2rem));
}

.alert-error-modal__panel {
    position: relative;
    padding: 1.25rem 2.75rem 1.25rem 1.25rem;
    border: 1px solid rgba(192, 57, 43, 0.18);
    border-left: 5px solid #c0392b;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
    text-align: left;
    animation: alertFloatIn 0.2s ease-out;
}

.alert-error-modal.is-hiding {
    animation: alertFloatOut 0.25s ease-in forwards;
}

.alert-error-modal__close {
    position: absolute;
    top: 0.65rem;
    right: 0.75rem;
    width: 1.8rem;
    height: 1.8rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.35rem;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease;
}

.alert-error-modal__close:hover {
    background: #fff1f0;
    color: #c0392b;
}

.alert-error-modal__close:focus {
    outline: 3px solid rgba(192, 57, 43, 0.18);
    outline-offset: 2px;
}

.alert-error-modal__mark {
    width: 2rem;
    height: 2rem;
    margin: 0 0 0.75rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff1f0;
    color: #c0392b;
    font-size: 1.25rem;
    font-weight: 900;
}

.alert-error-modal__title {
    margin: 0 0 0.5rem;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 800;
}

.alert-error-modal__message {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.7;
}

@keyframes alertFloatIn {
    from {
        opacity: 0;
        transform: translateY(-0.5rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes alertFloatOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-0.5rem);
    }
}

@media (max-width: 640px) {
    .alert-error-modal {
        top: calc(92px + 0.75rem);
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
    }
}
/* ==================== ?��?�?? ==================== */
.btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* ==================== ?��?�?? ==================== */
.card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

/* ==================== 表單�?? ==================== */
/* Use .form-card on forms that should display as a white card.
   Default form element has no background so auth pages stay transparent. */
.form-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* .form-card ?��??��?表單?�輸?��?位樣�?
   不�? .form-card ?�表?��?auth?�search）�??�影??*/
.form-card label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.form-card input[type="text"],
.form-card input[type="email"],
.form-card input[type="password"],
.form-card input[type="number"],
.form-card input[type="date"],
.form-card textarea,
.form-card select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-card textarea {
    min-height: 100px;
    resize: vertical;
}

.errorlist {
    color: #e74c3c;
    list-style: none;
    margin-top: 0.25rem;
    font-size: 0.9rem;
}

/* ==================== ?�?��?�?==================== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
}

.badge-pending {
    background-color: #fff3cd;
    color: #856404;
}

.badge-approved {
    background-color: #d4edda;
    color: #155724;
}

.badge-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-company {
    background-color: #d1ecf1;
    color: #0c5460;
}

.badge-teacher {
    background-color: #e2e3e5;
    color: #383d41;
}

/* ==================== Footer�?? ==================== */
footer {
    background-color: #ffffff;
    border-top: 2px solid #e0e0e0;
    margin-top: 3rem;
    padding: 2rem 0 0.5rem;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

.footer-menu-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-menu-grid {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-menu-col {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
}

.footer-menu-title {
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid var(--color-accent);
    display: inline-block;
    width: fit-content;
}

.footer-menu-title a {
    color: var(--color-accent);
    text-decoration: none;
    transition: all 0.3s;
}

.footer-menu-title a:hover {
    color: #004a8f;
    font-weight: 900;
}

.footer-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.footer-menu-list li {
    margin-bottom: 0.4rem;
    width: 100%;
}

.footer-menu-list a {
    color: #333333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: inline-block;
    position: relative;
}

.footer-menu-list a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-accent);
    transition: width 0.3s ease;
}

.footer-menu-list a:hover {
    color: var(--color-accent);
    font-weight: 700;
}

.footer-menu-list a:hover::after {
    width: 100%;
}

.footer-separator {
    border: none;
    border-top: 1px solid #dee2e6;
    margin: 1.5rem 0;
}

.footer-info-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.footer-logo {
    display: flex;
    align-items: center;
}

.footer-logo a {
    display: block;
    line-height: 0;
}

.footer-logo img {
    height: 80px;
    width: auto;
    transition: transform 0.3s;
    display: block;
}

.footer-logo a:hover img {
    transform: scale(1.05);
}

.footer-contact {
    color: #555555;
    font-size: 0.85rem;
    line-height: 1.8;
}

.footer-contact strong {
    color: var(--color-accent);
    font-size: 0.95rem;
}

.footer-copyright {
    text-align: center;
    color: #777777;
    font-size: 0.8rem;
    padding: 1rem 2rem;
    border-top: 1px solid #dee2e6;
    margin: 0;
}

.footer-copyright strong {
    color: var(--color-accent);
}

/* ==================== 首�?輪播�?? ==================== */
.carousel-container {
    width: 100vw;
    max-width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-top: -2rem;
    padding: 0;
}

.carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-inner {
    position: relative;
    width: 100%;
    height: 500px;
}

.carousel-item {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none;
}

.carousel-item.active {
    opacity: 1;
    pointer-events: auto;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 輪播?�示?��??��?�?*/
.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    z-index: 15;
}

.carousel-indicators li {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

.carousel-indicators li.active {
    background-color: #ffffff;
}

.carousel-indicators li a {
    display: block;
    width: 100%;
    height: 100%;
    text-indent: -9999px;
    overflow: hidden;
}

/* 左右箭頭 */
.carousel-control-prev,
.carousel-control-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 0.7;
}

.carousel-control-prev {
    left: 20px;
}

.carousel-control-next {
    right: 20px;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
}

.carousel-control-prev-icon:before {
    content: '‹';
    font-size: 40px;
    line-height: 1;
}

.carousel-control-next-icon:before {
    content: '›';
    font-size: 40px;
    line-height: 1;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* ==================== 案件?�表�?? ==================== */
.case-module-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.case-module-tab {
    display: inline-block;
    padding: 0.38rem 0.95rem;
    border: 1px solid #d0d5dd;
    border-radius: 999px;
    color: #666;
    background: #fff;
    text-decoration: none;
    font-size: 0.84rem;
    transition: all 0.15s;
}

.case-module-tab:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.case-module-tab.active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
}

.search-section {
    padding: 0;
    margin-bottom: 2rem;
    background: none;
    border: none;
}

.search-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-btn {
    padding: 0.42rem 0.95rem;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    transition: background-color 0.15s;
    white-space: nowrap;
}

.search-btn:hover {
    background-color: #0f1d3b;
}

.search-input {
    padding: 0.45rem 1rem;
    border: 1px solid #d0d7e2;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-family: var(--font-sans);
    outline: none;
    background: #fff;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.filter-select {
    appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23808a98' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 0.6rem center;
    border: 1px solid #d0d7e2;
    border-radius: 9px;
    padding: 0.38rem 1.9rem 0.38rem 0.72rem;
    font-size: 0.8rem;
    font-family: var(--font-sans);
    color: #4b5563;
    cursor: pointer;
    transition: border-color 0.15s;
}

.case-table-header {
    background-color: #e3f2fd;
    padding: 1rem 1.5rem;
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr 0.8fr;
    gap: 1rem;
    font-weight: 600;
    color: #333;
    border-radius: 4px 4px 0 0;
    align-items: center;
}

.case-table-row {
    background-color: white;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr 0.8fr;
    gap: 1rem;
    border-bottom: 1px solid #e0e0e0;
    align-items: center;
    transition: background-color 0.2s;
}

.case-table-row:hover {
    background-color: #f8f9fa;
}

.case-title {
    color: #333;
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
}

.case-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.case-title a:hover {
    color: var(--color-accent);
}

.case-meta {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.3rem;
}

.case-company {
    color: #555;
    font-size: 1rem;
}

.case-date {
    color: var(--color-accent);
    font-size: 0.95rem;
}

.view-btn {
    padding: 0.6rem 1.2rem;
    background-color: white;
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.view-btn:hover {
    background-color: var(--color-accent);
    color: white;
}

.badge-tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background-color: #ffebcc;
    color: #d97706;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-right: 0.5rem;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-approved {
    background-color: #d4edda;
    color: #155724;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.match-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.match-matching {
    background-color: transparent;
    color: inherit;
    padding: 0;
    font-size: inherit;
    font-weight: normal;
}

.match-matched {
    background-color: #d4edda;
    color: #155724;
}

.match-closed {
    background-color: #e2e3e5;
    color: #383d41;
}

.result-count {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.result-count strong {
    color: var(--color-accent);
}

.create-btn {
    padding: 0.8rem 1.5rem;
    background-color: var(--color-accent);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s;
}

.create-btn:hover {
    background-color: #004080;
    color: white;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

.empty-state img {
    width: 200px;
    opacity: 0.5;
    margin-bottom: 1rem;
}

/* ==================== ?��?式設�?==================== */

/* 小於992px：漢?�選??*/
@media (max-width: 992px) {
    /* 顯示漢堡?��? */
    .mobile-menu-toggle {
        display: flex;
    }

    /* ?�單?�設?��? */
    .nav-menus {
        position: fixed;
        top: 92px;
        left: -100%;
        width: 280px;
        height: calc(100vh - 92px);
        background-color: #ffffff;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
        overflow-y: auto;
        transition: left 0.3s ease;
        gap: 0;
    }

    .nav-menus.active {
        left: 0;
    }

    /* 上層?�單?�直?��? */
    .nav-top-menu {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0;
        border-bottom: 1px solid #e0e0e0;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    .nav-top-menu li {
        width: 100%;
    }

    .nav-top-menu li a,
    .nav-top-menu li button {
        display: block;
        width: 100%;
        text-align: left;
        padding: 0.6rem 1rem;
        border-radius: 4px;
        position: relative;
    }

    .nav-top-menu li a:hover {
        font-weight: 900;
    }

    .nav-top-menu li a::after {
        content: '';
        position: absolute;
        bottom: 0.3rem;
        left: 1rem;
        width: 0;
        height: 4px;
        background-color: var(--color-accent);
    }

    .nav-top-menu li a:hover::after {
        width: calc(100% - 2rem);
    }

    /* 下層?�單?�直?��? */
    .nav-bottom-menu {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0;
    }

    .nav-bottom-menu > li {
        width: 100%;
    }

    .nav-bottom-menu > li > a {
        display: block;
        width: 100%;
        padding: 0.6rem 1rem;
        border-radius: 4px;
        position: relative;
    }

    .nav-bottom-menu > li > a:hover {
        font-weight: 900;
    }

    .nav-bottom-menu > li > a::after {
        content: '';
        position: absolute;
        bottom: 0.3rem;
        left: 1rem;
        width: 0;
        height: 4px;
        background-color: var(--color-accent);
        display: block;
    }

    .nav-bottom-menu > li > a:hover::after {
        width: calc(100% - 2rem);
    }

    /* 子選?�樣式調??*/
    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-radius: 0;
        padding: 0.5rem 0;
        margin: 0;
        max-height: none;
        overflow: visible;
    }

    .dropdown li a {
        padding: 0.6rem 1rem 0.6rem 2rem !important;
        font-size: 0.85rem;
        color: #666666;
        position: relative;
    }

    .dropdown li a::after {
        content: '';
        position: absolute;
        bottom: 0.3rem;
        left: 2rem;
        width: 0;
        height: 4px;
        background-color: var(--color-accent);
    }

    .dropdown li a:hover {
        color: #333333;
        font-weight: 900;
    }

    .dropdown li a:hover::after {
        width: calc(100% - 3rem);
    }

    /* ?�入?��??��??�調??*/
    .btn-login {
        width: 100%;
        text-align: center;
        margin: 0;
    }

    /* 案件?�表?��?�?*/
    .case-table-header {
        display: none;
    }

    .case-table-row {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        padding: 1.2rem;
        border-left: 4px solid var(--color-accent);
    }

    .case-table-row > div {
        display: flex;
        flex-direction: column;
    }

    .case-table-row > div::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--color-accent);
        margin-bottom: 0.3rem;
        font-size: 0.9rem;
    }

    .case-title {
        font-size: 1.1rem;
    }

    .view-btn {
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* 小於768px */
@media (max-width: 768px) {
    .carousel-inner {
        height: 300px;
    }

    .carousel-control-prev,
    .carousel-control-next {
        width: 40px;
        height: 40px;
    }

    .carousel-control-prev {
        left: 10px;
    }

    .carousel-control-next {
        right: 10px;
    }

    .footer-menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .footer-info-section {
        grid-template-columns: 1fr;
    }
}

/* ?��?式顯�??��?類別 */
.d-none {
    display: none !important;
}

.d-sm-block {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-sm-none {
    display: block !important;
}

@media (min-width: 576px) {
    .d-none.d-sm-block {
        display: block !important;
    }
    .d-block.d-sm-none {
        display: none !important;
    }
}

/* ==================== 認�??��??�入 / 註�? / 密碼?�設�?=================== */

/* ?�面容器：無?�景，�??�灰�?*/
.auth-page {
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 5rem;
}

.auth-page-wide {
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 5rem;
}

/* ?��?：EN 標籤 + 大�?�?*/
.auth-header {
    margin-top: 2.8rem;
    margin-bottom: 2.5rem;
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    width: fit-content;
    max-width: 100%;
}

.auth-header .page-en-label {
    width: 100%;
}

.auth-header > p {
    display: none;
}

/* 大�?�????�代??auth template ?��?�?inline style */
.auth-page-title {
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    line-height: 1;
}

/* 欄�? */
.auth-field {
    margin-bottom: 1.8rem;
}

.auth-field label {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #555;
    display: block;
    margin-bottom: 0.55rem;
}

/* 必填?��? */
.auth-req {
    color: var(--color-accent);
    font-weight: 900;
    margin-left: 0.1em;
}

/* ?�塊�?題�?企業資�??�帳?�設定�? */
.auth-section-title {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--color-accent);
    text-transform: uppercase;
    margin-bottom: 1.2rem;
}

/* 輸入框�??��?�?+ 下�?�?*/
.auth-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1.5px solid #d0d0d0;
    border-radius: 0;
    padding: 0.55rem 0.4rem;
    font-size: 1rem;
    color: var(--color-text);
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.2s;
}

.auth-input:focus {
    border-bottom-color: var(--color-accent);
}

.auth-input::placeholder {
    color: #bbb;
    font-size: 0.9rem;
}

/* ?�誤訊息 */
.auth-error {
    color: #c0392b;
    font-size: 0.8rem;
    margin-top: 0.4rem;
    display: block;
}

/* 輔助?��? */
.auth-hint {
    color: #aaa;
    font-size: 0.78rem;
    margin-top: 0.35rem;
    display: block;
}

/* ?�交?��? */
.auth-submit {
    width: 100%;
    background: var(--color-text);
    color: #fff;
    border: none;
    padding: 0.9rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    font-family: var(--font-sans);
    margin-top: 0.5rem;
}

.auth-submit:hover {
    background: var(--color-accent);
}

/* ?��?�?*/
.auth-divider {
    border: none;
    border-top: 1px solid #e8e8e8;
    margin: 2rem 0;
}

/* 底部??? */
.auth-links {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: #999;
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.auth-links a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-inline-form {
    margin: 0;
}

.auth-link-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
    font: inherit;
    cursor: pointer;
    transition: color 0.2s;
}

.auth-links a:hover {
    color: var(--color-text);
}

.auth-link-btn:hover {
    color: var(--color-text);
}

/* ?��?位錯誤�?帳�??�誤�?/
.auth-form-error {
    background: #fff0f0;
    border-left: 3px solid #c0392b;
    color: #c0392b;
    font-size: 0.88rem;
    padding: 0.7rem 1rem;
    border-radius: 0 4px 4px 0;
    margin-bottom: 1.5rem;
}

/* 表單?�出失�??��??�示 */
.auth-error-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--color-text);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.8rem 1.1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 2rem;
    letter-spacing: 0.02em;
}

.auth-error-bar-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    background: #c0392b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 900;
    line-height: 1;
}

/* select ?��?�?*/
.auth-input-select {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1.5px solid #d0d0d0;
    border-radius: 0;
    padding: 0.5rem 0;
    font-size: 1rem;
    color: var(--color-text);
    font-family: var(--font-sans);
    outline: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.auth-input-select:focus {
    border-bottom-color: var(--color-accent);
}

/* ==================== ?��?身份??==================== */
.register-select-page {
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 5rem;
}

.register-choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.register-choice {
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    padding: 2rem 1.5rem 1.8rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.25s;
    text-decoration: none;
    display: block;
    color: inherit;
    background: transparent;
}

/* ==================== 統�?表單�??（�?齊註?��?�?==================== */
.form-unified .profile-form-section {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 1.6rem;
}

.form-unified .profile-form-section + .profile-form-section {
    border-top: 1px solid #e7ebf0;
    padding-top: 1.25rem;
}

.form-unified .profile-form-section-title {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--color-accent);
    text-transform: uppercase;
    margin: 0 0 1.1rem;
    border: none;
    padding: 0;
}

.form-unified .profile-field > label,
.form-unified .auth-field > label,
.form-unified .form-unified-label {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #555;
    display: block;
    margin-bottom: 0.55rem;
}

.form-unified input[type="text"],
.form-unified input[type="email"],
.form-unified input[type="password"],
.form-unified input[type="number"],
.form-unified input[type="date"],
.form-unified input[type="tel"],
.form-unified input[type="url"],
.form-unified textarea,
.form-unified select {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1.5px solid #d0d0d0;
    border-radius: 0;
    padding: 0.55rem 0.4rem;
    font-size: 1rem;
    color: var(--color-text);
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.2s;
}

.form-unified input[type="text"]:focus,
.form-unified input[type="email"]:focus,
.form-unified input[type="password"]:focus,
.form-unified input[type="number"]:focus,
.form-unified input[type="date"]:focus,
.form-unified input[type="tel"]:focus,
.form-unified input[type="url"]:focus,
.form-unified textarea:focus,
.form-unified select:focus {
    border-bottom-color: var(--color-accent);
}

.form-unified textarea {
    min-height: 120px;
    resize: vertical;
}

.form-unified input::placeholder,
.form-unified textarea::placeholder {
    color: #bbb;
    font-size: 0.9rem;
}

.form-unified input[type="file"] {
    width: 100%;
    font-size: 0.9rem;
    color: #555;
    border: none;
    padding: 0.35rem 0;
}

.form-unified .media-upload {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-unified .media-upload-preview {
    width: 96px;
    height: 96px;
    border: 1px solid #d7dee7;
    border-radius: var(--radius-md);
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.form-unified .media-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.form-unified .media-upload-preview--contain img {
    object-fit: contain;
    padding: 6px;
    background: #fff;
}

.form-unified .media-upload-empty {
    font-size: 0.75rem;
    color: #9aa4b2;
}

.form-unified .media-upload-body {
    flex: 1;
    min-width: 240px;
}

.form-unified .media-upload-input {
    width: auto;
    max-width: 100%;
    border: none;
    border-radius: 0;
    padding: 0;
    font-size: 0.9rem;
    color: #404b57;
    background: transparent;
}

.form-unified .media-upload-input::file-selector-button {
    margin-right: 0.8rem;
    border: 1px solid #c9d3df;
    border-radius: var(--radius-sm);
    background: #eef3f9;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.84rem;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
}

.form-unified .media-upload-clear {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.55rem;
    font-size: 0.84rem;
    color: #5f6975;
}

.form-unified .media-upload-clear input[type="checkbox"] {
    width: 15px;
    height: 15px;
}

.form-unified .field-help,
.form-unified .auth-hint,
.form-unified .form-unified-help {
    color: #aaa;
    font-size: 0.78rem;
    margin-top: 0.35rem;
    display: block;
}

.form-unified .field-error,
.form-unified .auth-error,
.form-unified .errorlist {
    color: #c0392b;
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

.form-unified .errorlist {
    list-style: none;
    padding: 0;
}

.form-unified .profile-form-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    padding-top: 0.5rem;
}

.form-unified .profile-form-actions .auth-submit,
.form-unified .profile-form-actions .btn.btn-primary,
.form-unified .form-unified-submit {
    background: var(--color-text);
    color: #fff;
    border: none;
    padding: 0.9rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.form-unified .profile-form-actions .auth-submit:hover,
.form-unified .profile-form-actions .btn.btn-primary:hover,
.form-unified .form-unified-submit:hover {
    background: var(--color-accent);
}

.form-unified .expertise-checkbox-label,
.form-unified label.expertise-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.87rem;
    color: #333;
    letter-spacing: 0;
    font-weight: 400;
}

/* ==================== ?��?介紹編輯?��?統�?表單�?==================== */
.team-edit-selector {
    margin-bottom: 0.5rem;
}

.team-edit-selector-title {
    color: var(--color-accent);
}

.team-edit-selector-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.team-edit-selector-link {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.86rem;
    text-decoration: none;
    background: #e8edf3;
    color: #333;
    border: 1px solid transparent;
}

.team-edit-selector-link.is-active {
    background: var(--color-accent);
    color: #fff;
}

.team-edit-selector-link:hover {
    border-color: #c9d3df;
}

.team-edit-meta,
.team-edit-intro {
    color: #7f8c8d;
}

.team-edit-meta {
    margin-bottom: 0.5rem;
}

.team-edit-intro {
    margin-bottom: 1.25rem;
}

.team-edit-markdown-help {
    background: #e8f4f8;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.team-edit-markdown-help strong {
    color: var(--color-accent);
}

.team-edit-markdown-help ul {
    margin: 0.5rem 0 0 1.5rem;
    color: #555;
}

.team-edit-locked-notice {
    background: #f8fafc;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    border: 1px solid #d9e2ef;
    border-left: 4px solid #3b82f6;
    color: #334155;
    line-height: 1.7;
}

.team-edit-locked-notice strong {
    color: #1f2937;
}

.team-edit-field-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.team-edit-lock-badge {
    font-size: 0.75rem;
    background: #fef3c7;
    color: #92400e;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid #fcd34d;
}

.team-edit-unlock-btn {
    font-size: 0.75rem;
    background: transparent;
    border: 1px solid #d1d5db;
    color: #6b7280;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.team-edit-unlock-btn:hover {
    border-color: #9ca3af;
    color: #374151;
}

.team-edit-scraper-note {
    font-size: 0.75rem;
    color: #6b7280;
}

.team-edit-description-note {
    font-size: 0.85rem;
    color: #555;
    margin: 0 0 0.4rem;
}

.team-edit-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.register-choice:hover {
    border-color: var(--color-text);
    transform: translateY(-4px);
    color: inherit;
}

.register-choice-icon {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
}

.register-choice-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--color-accent);
    display: block;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

.register-choice-title {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--color-text);
    margin-bottom: 0.6rem;
    display: block;
}

.register-choice-desc {
    font-size: 0.85rem;
    color: #888;
    line-height: 1.6;
    display: block;
}

.register-choice-arrow {
    display: block;
    margin-top: 1.2rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #ccc;
    letter-spacing: 0.08em;
    transition: color 0.2s;
}

.register-choice:hover .register-choice-arrow {
    color: var(--color-text);
}

/* ?�請碼橫�? */
.invite-banner {
    margin-top: 2rem;
    padding: 1rem 1.5rem;
    border: 1.5px dashed #d0d0d0;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.invite-banner-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.2rem;
}

.invite-banner-desc {
    font-size: 0.82rem;
    color: #999;
}

.invite-banner-btn {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-accent);
    text-decoration: none;
    white-space: nowrap;
    border: 1.5px solid var(--color-accent);
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    transition: background 0.2s, color 0.2s;
}

.invite-banner-btn:hover {
    background: var(--color-accent);
    color: #fff;
}

@media (max-width: 600px) {
    .register-choice-grid {
        grid-template-columns: 1fr;
    }

    .auth-page,
    .auth-page-wide,
    .register-select-page {
        padding: 0 1rem 4rem;
    }
}

/* ==================== ?�?��??��? ==================== */

/* 工具?��?tabs + ?��?�?*/
.announcement-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

/* ?��?篩選 tabs ??pill �?? */
.announcement-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.announcement-tabs::-webkit-scrollbar { display: none; }

.announcement-tab {
    text-decoration: none;
    color: #333;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    border: 1.5px solid #ccc;
    background: transparent;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    white-space: nowrap;
}

.announcement-tab:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.announcement-tab.active {
    background: var(--color-text);
    border-color: var(--color-text);
    color: #ffffff;
    font-weight: 700;
}

/* ?��?�?*/
.announcement-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ?��?軸整�?*/
.announcement-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 每個�?份群�?*/
.timeline-group {
    display: flex;
    gap: 2.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e8e8e8;
}

.timeline-group:last-child {
    border-bottom: none;
}

/* 左側年�?標籤 */
.timeline-month-label {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 72px;
    padding-top: 0.1rem;
    flex-shrink: 0;
}

.timeline-year {
    font-size: 1.5rem;
    font-weight: 900;
    color: #c8c8c8;
    line-height: 1;
}

.timeline-month {
    font-size: 2.2rem;
    font-weight: 900;
    color: #c8c8c8;
    line-height: 1.1;
}

/* ?�側?��??�表 */
.timeline-items {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
}

/* ?��??��???*/
.timeline-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.9rem 0;
    border-bottom: 1px dashed #ebebeb;
}

.timeline-items .timeline-item:last-child {
    border-bottom: none;
}

/* ?��? + 類別?��?�?*/
.timeline-item-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ?��? */
.timeline-date {
    font-size: 0.82rem;
    color: #999;
    white-space: nowrap;
}

/* 類別徽�? */
.timeline-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
    white-space: nowrap;
}

.badge-maintenance {
    background-color: #fff3cd;
    color: #856404;
}

.badge-important {
    background-color: #f8d7da;
    color: #842029;
}

.badge-news {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* ?��?標�? */
.timeline-title {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: color 0.2s;
}

.timeline-title:hover {
    color: var(--color-accent);
}

/* ?�公?��?�?*/
.announcement-empty {
    color: #999;
    text-align: center;
    padding: 3rem 0;
    font-size: 0.95rem;
}

/* ?��???*/
@media (max-width: 600px) {
    .timeline-group {
        flex-direction: column;
        gap: 0.8rem;
    }

    .timeline-month-label {
        flex-direction: row;
        align-items: baseline;
        gap: 0.4rem;
        min-width: unset;
    }

    .timeline-year {
        font-size: 1.1rem;
    }

    .timeline-month {
        font-size: 1.5rem;
    }

    .announcement-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-input {
        width: 140px;
    }

    /* ?��??�容?��?機�? */
    .detail-title {
        font-size: 1.4rem;
    }

    .detail-top-bar {
        margin-top: 1.5rem;
    }

    .md-content {
        font-size: 0.93rem;
    }

    .detail-images {
        flex-direction: column;
    }
}

/* ==================== ?��??�容??==================== */

.announcement-detail-page {
    /* 沿用 .page-content ??max-width: 1100px，�??��?設�? */
}

/* ?�部：�???+ ?��? */
.detail-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2.8rem;
    margin-bottom: 1.4rem;
}

/* 類別?��?標籤（無?�景，�??��?�?*/
.detail-category-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.cat-maintenance { color: #b07800; }
.cat-important   { color: #c0392b; }
.cat-news        { color: var(--color-accent); }

.detail-date {
    font-size: 0.82rem;
    color: #aaa;
    letter-spacing: 0.04em;
}

/* 大�?�?*/
.detail-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--color-text);
    line-height: 1.4;
    margin-bottom: 2.2rem;
}

/* ?��?（Markdown 輸出�?*/
.md-content {
    font-size: 0.97rem;
    color: #333;
    line-height: 1.9;
}

.md-content p      { margin-bottom: 1.2em; }
.md-content h2     { font-size: 1.25rem; font-weight: 700; color: var(--color-text); margin: 2em 0 0.6em; }
.md-content h3     { font-size: 1.05rem; font-weight: 700; color: var(--color-text); margin: 1.6em 0 0.5em; }
.md-content ul,
.md-content ol     { padding-left: 1.6em; margin-bottom: 1.2em; }
.md-content li     { margin-bottom: 0.4em; }
.md-content strong { font-weight: 700; color: var(--color-text); }
.md-content a      { color: var(--color-accent); text-decoration: underline; }
.md-content blockquote {
    border-left: 3px solid #ccc;
    margin: 1.2em 0;
    padding: 0.4em 1em;
    color: #666;
}
.md-content code {
    background: #f0f0f0;
    padding: 0.1em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}
.md-content pre code {
    display: block;
    padding: 1em;
    overflow-x: auto;
    background: var(--color-bg);
}
.md-content hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 2em 0;
}

/* ?��? */
.detail-images {
    margin-top: 2.5rem;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.detail-images img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* 返�???? */
.detail-back {
    margin-top: 3rem;
}

.detail-back a {
    color: #999;
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.2s;
}

.detail-back a:hover {
    color: var(--color-accent);
}

/* ==================== 導航?��?�?& ?��? ==================== */

/* ?�示?��?（�??�、通知?�鐺�?*/
.nav-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #444;
    text-decoration: none;
    transition: background 0.18s, color 0.18s;
    flex-shrink: 0;
}

.nav-icon-btn:hover {
    background: #f0f3f8;
    color: var(--color-primary);
    text-decoration: none;
}

.nav-icon-btn svg {
    display: block;
    flex-shrink: 0;
}

.nav-notification-label {
    display: none;
}

/* ?�知?��??��?徽�? */
.nav-icon-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 9px;
    height: 9px;
    background: #e74c3c;
    border: 2px solid #fff;
    border-radius: 50%;
    pointer-events: none;
}

/* ?��??��? */
.nav-avatar-wrapper {
    position: relative;
}

.nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.18s, box-shadow 0.18s;
    flex-shrink: 0;
    font-family: var(--font-sans);
    background: transparent;
    padding: 0;
}

.nav-avatar-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    overflow: hidden;
    border-radius: 50%;
    color: #fff;
}

.nav-avatar-visual img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.nav-avatar--teacher .nav-avatar-visual { background: var(--color-primary); }
.nav-avatar--company .nav-avatar-visual { background: var(--color-accent); }
.nav-avatar--admin .nav-avatar-visual { background: #34495e; }

.nav-avatar-mobile-label,
.nav-avatar-chevron {
    display: none;
}

.nav-avatar:hover {
    opacity: 0.85;
    box-shadow: 0 0 0 3px rgba(0,91,172,0.18);
}

/* ?��?下�??�單 */
.avatar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid #e4e8f0;
    border-radius: var(--radius-sm);
    box-shadow: 0 6px 20px rgba(0,0,0,0.10);
    min-width: 210px;
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s, visibility 0.18s, transform 0.18s;
}

.nav-avatar-wrapper.open .avatar-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.avatar-dropdown-header {
    padding: 0.8rem 1rem 0.7rem;
}

.avatar-dropdown-role {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #aaa;
    margin-bottom: 0.2rem;
}

.avatar-dropdown-email {
    font-size: 0.82rem;
    color: #333;
    word-break: keep-all;
    white-space: nowrap;
    font-weight: 500;
}

.avatar-dropdown-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 0;
}

.avatar-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    color: #333;
    text-decoration: none;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: background 0.12s;
    line-height: 1.4;
}

.avatar-dropdown-item:hover {
    background: #f5f7fb;
    color: var(--color-primary);
    text-decoration: none;
}

.avatar-dropdown-logout {
    color: #c0392b;
}

.avatar-dropdown-logout:hover {
    background: #fdecea;
    color: #c0392b;
}

@media (max-width: 992px) {
    .nav-top-menu .nav-icon-btn {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.65rem;
        width: 100%;
        height: auto;
        padding: 0.7rem 1rem;
        border-radius: var(--radius-md);
        color: var(--color-text);
    }

    .nav-icon-btn > svg { display: none; }

    .nav-notification-label {
        display: block;
        font-size: 0.95rem;
        font-weight: 700;
    }

    .nav-icon-badge {
        position: static;
        width: 8px;
        height: 8px;
        border: 0;
        flex: 0 0 8px;
    }

    .nav-avatar-wrapper {
        width: 100%;
        margin-top: 0.35rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--color-border);
    }

    .nav-top-menu .nav-avatar {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.75rem;
        width: 100%;
        height: auto;
        padding: 0.65rem 0.75rem;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        color: var(--color-text);
        background: #fff;
        box-shadow: 0 5px 16px rgba(26, 50, 96, 0.07);
        text-align: left;
    }

    .nav-avatar:hover {
        opacity: 1;
        box-shadow: 0 5px 16px rgba(26, 50, 96, 0.12);
    }

    .nav-avatar-visual {
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
    }

    .nav-avatar-mobile-label {
        display: grid;
        min-width: 0;
        flex: 1;
        gap: 0.12rem;
    }

    .nav-avatar-mobile-label strong {
        color: var(--color-text);
        font-size: 0.9rem;
    }

    .nav-avatar-mobile-label small {
        overflow: hidden;
        color: var(--color-muted);
        font-size: 0.72rem;
        font-weight: 500;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .nav-avatar-chevron {
        display: block;
        width: 18px;
        height: 18px;
        fill: none;
        stroke: var(--color-muted);
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
        transition: transform 0.18s;
    }

    .nav-avatar-wrapper.open .nav-avatar-chevron { transform: rotate(180deg); }

    .nav-avatar-wrapper .avatar-dropdown {
        position: static;
        display: none;
        min-width: 0;
        width: 100%;
        margin-top: 0.4rem;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .nav-avatar-wrapper.open .avatar-dropdown {
        display: block;
        transform: none;
    }

    .avatar-dropdown-header { display: none; }
    .avatar-dropdown-item { padding: 0.7rem 0.9rem; }
}

/* ==================== 強制?��?�?Modal ==================== */
.fpw-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.fpw-card {
    background: #fff;
    border-radius: 12px;
    padding: 2.5rem 2.25rem 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.fpw-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 0.5rem;
}

.fpw-desc {
    font-size: 0.88rem;
    color: var(--color-muted);
    line-height: 1.6;
    margin: 0 0 1.25rem;
}

.fpw-messages { margin-bottom: 1rem; }

.fpw-msg {
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    border: 1px solid;
}

.fpw-msg--success { background: #f0fdf4; border-color: #86efac; color: #15803d; }
.fpw-msg--error   { background: #fef2f2; border-color: #fca5a5; color: #b91c1c; }

.fpw-form { display: flex; flex-direction: column; gap: 1rem; }

.fpw-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.fpw-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
}

.fpw-input {
    padding: 0.6rem 0.9rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.fpw-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.fpw-hint {
    font-size: 0.75rem;
    color: #94a3b8;
}

.fpw-btn {
    margin-top: 0.25rem;
    padding: 0.7rem 1rem;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.fpw-btn:hover { background: #2563eb; }
