/**
 * 摩研/摩築集團 - 員工入口樣式
 * @version 3.0.0
 * @date 2026-03-14
 *
 * 重構自 employee-portal.html 內嵌樣式
 * - 移除重複定義
 * - 新增面板轉場動畫
 * - 新增 skeleton loading
 */

/* ========== CSS 變數 ========== */
:root {
    --primary: #2C3E50;
    --secondary: #3498DB;
    --success: #27AE60;
    --warning: #F39C12;
    --danger: #E74C3C;
    --bg: #F5F7FA;
    /* 品牌色 */
    --brand-red: #667eea;
    --brand-red-dark: #764ba2;
    --brand-gold: #C9A962;
    --brand-gold-light: #D4BC7D;
    --brand-brown: #8B5A2B;
    /* 轉場動畫 */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ========== 基礎重置 ========== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-family: 'Microsoft JhengHei', 'Noto Sans TC', sans-serif;
    background: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-red-dark) 100%);
    color: #2C3E50;
    line-height: 1.6;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* iOS Safe Area */
@supports (padding: env(safe-area-inset-bottom)) {
    .main-container {
        padding-bottom: calc(40px + env(safe-area-inset-bottom));
    }
}

button, .menu-card, .stat-card, .quick-login-btn {
    touch-action: manipulation;
}

/* ========== 登入頁面 ========== */
.login-container {
    width: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-red-dark) 100%);
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.login-logo {
    font-size: 3rem;
    margin-bottom: 10px;
}

.login-title {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.login-subtitle {
    color: #7F8C8D;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.login-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #E0E0E0;
    border-radius: 12px;
    font-size: 1.1rem;
    margin-bottom: 20px;
    transition: border-color var(--transition-fast);
}

.login-input:focus {
    outline: none;
    border-color: var(--secondary);
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--secondary), #2980B9);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52,152,219,0.4);
}

.login-btn:disabled {
    background: #BDC3C7;
    cursor: wait;
}

.login-error {
    color: var(--danger);
    margin-top: 15px;
    font-size: 0.9rem;
    display: none;
}

.login-loading {
    color: var(--secondary);
    margin-top: 15px;
    font-size: 0.9rem;
    display: none;
}

/* 快速登入 */
.quick-login {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #E0E0E0;
}

.quick-login-title {
    font-size: 0.85rem;
    color: #7F8C8D;
    margin-bottom: 12px;
}

.quick-login-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.quick-login-btn {
    padding: 8px 16px;
    background: #F8F9FA;
    border: 1px solid #E0E0E0;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-login-btn:hover {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

/* ========== 主頁面 ========== */
.main-container {
    display: none;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
    background: linear-gradient(180deg, var(--bg) 0%, #E8EDF2 100%);
    padding-bottom: 40px;
}

.main-container.active {
    display: flex;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary), #34495E);
    color: white;
    padding: 15px 20px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.company-header {
    max-width: 800px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 0 12px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.company-header-icon {
    font-size: 1.8rem;
}

.company-header-name {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 3px;
    opacity: 0.95;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.user-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.user-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.user-rank {
    font-size: 0.85rem;
    opacity: 0.9;
}

.logout-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.logout-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Content */
.content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

/* ========== 統計卡片（合併重複定義）========== */
.quick-stats {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.quick-stats .stat-card {
    max-width: 200px;
    flex: 1;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 18px 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.04);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary), var(--success));
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.stat-card.highlight {
    border: 2px solid var(--warning);
}

.stat-card.highlight::before {
    background: linear-gradient(90deg, #F39C12, #E74C3C);
}

.stat-icon {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-value.loading {
    color: #BDC3C7;
}

.stat-label {
    font-size: 0.8rem;
    color: #7F8C8D;
    margin-top: 4px;
}

.stat-sub {
    font-size: 0.75rem;
    color: var(--success);
    margin-top: 2px;
}

/* ========== 菜單卡片（合併重複定義）========== */
.menu-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.menu-card {
    background: white;
    border-radius: 16px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0,0,0,0.04);
}

.menu-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.menu-card:active {
    transform: translateY(-2px) scale(0.99);
}

.menu-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

.menu-card.locked:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.menu-card.locked::after {
    content: 'Preparing';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: #BDC3C7;
    color: white;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.7rem;
}

.menu-card.locked .menu-arrow {
    display: none;
}

.menu-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.menu-icon.blue { background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%); }
.menu-icon.green { background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%); }
.menu-icon.orange { background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%); }
.menu-icon.purple { background: linear-gradient(135deg, #F3E5F5 0%, #E1BEE7 100%); }

.menu-content {
    flex: 1;
    min-width: 0;
}

.menu-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
}

.menu-desc {
    font-size: 0.8rem;
    color: #95A5A6;
    margin-top: 2px;
}

.menu-arrow {
    color: #CED6E0;
    font-size: 1.1rem;
}

/* ========== 分隔標題 ========== */
.section-divider {
    display: flex;
    align-items: center;
    margin: 15px 0 12px 0;
    color: #95A5A6;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #E0E0E0, transparent);
}

.section-divider span {
    padding: 0 12px;
}

/* ========== 公告區域 ========== */
.announcement-section {
    background: white;
    border-left: 3px solid #F39C12;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

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

.announcement-icon {
    font-size: 1.1rem;
}

.announcement-title {
    font-weight: 600;
    color: #7F8C8D;
    font-size: 0.85rem;
}

.announcement-badge {
    background: #E74C3C;
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    animation: pulse 2s infinite;
}

.announcement-content {
    font-size: 0.9rem;
    color: #7D6608;
    line-height: 1.5;
}

.announcement-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.announcement-list li {
    padding: 6px 0;
    border-bottom: 1px dashed #E0C068;
}

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

.announcement-time {
    font-size: 0.75rem;
    color: #B8860B;
}

/* ========== 面板系統（新增轉場動畫）========== */
.panel {
    display: none;
    background: white;
    border-radius: 14px;
    margin-bottom: 15px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.04);
    /* 轉場動畫準備 */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: panelSlideIn var(--transition-normal) ease-out;
}

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

.panel-header {
    background: linear-gradient(135deg, var(--primary), #34495E);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.panel-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.panel-close:hover {
    opacity: 1;
}

.panel-body {
    padding: 20px;
}

/* ========== 職等面板 ========== */
.rank-notice {
    background: #FFF3CD;
    border: 1px solid #FFECB5;
    color: #856404;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rank-display {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-red-dark) 100%);
    color: white;
    border-radius: 16px;
    margin-bottom: 20px;
}

.rank-badge-large {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 10px 30px;
    border-radius: 30px;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.rank-score {
    font-size: 2.5rem;
    font-weight: bold;
}

.rank-score-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 進度條 */
.progress-section {
    margin: 20px 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.progress-bar {
    height: 12px;
    background: #E0E0E0;
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--success));
    border-radius: 6px;
    transition: width var(--transition-slow);
}

/* 升級條件 */
.upgrade-requirements {
    background: #F8F9FA;
    border-radius: 12px;
    padding: 20px;
}

.upgrade-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 15px;
}

.requirement-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #E0E0E0;
}

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

.requirement-status {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 0.8rem;
}

.requirement-status.pass { background: #D5F5E3; color: var(--success); }
.requirement-status.fail { background: #FADBD8; color: var(--danger); }
.requirement-status.pending { background: #FEF9E7; color: #F39C12; }

/* ========== 薪資階梯 ========== */
.salary-ladder {
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.salary-ladder-title {
    background: linear-gradient(135deg, #27AE60, #2ECC71);
    color: white;
    padding: 12px 20px;
    font-weight: 600;
}

.salary-ladder-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #EEE;
}

.salary-ladder-row:last-child {
    border-bottom: none;
}

.salary-ladder-row.current {
    background: #E8F5E9;
}

.salary-ladder-rank {
    font-weight: 500;
}

.salary-ladder-score {
    font-size: 0.85rem;
    color: #666;
}

.salary-ladder-amount {
    font-weight: bold;
    color: var(--primary);
}

.salary-ladder-badge {
    background: var(--success);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: 8px;
}

/* 加薪進度 */
.salary-progress {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    border: 2px solid var(--success);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.salary-progress-title {
    font-weight: 600;
    color: var(--success);
    margin-bottom: 12px;
}

.salary-current {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.salary-current-label {
    font-size: 0.9rem;
    color: #555;
}

.salary-current-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--success);
}

.salary-next {
    background: white;
    border-radius: 10px;
    padding: 15px;
}

.salary-next-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.salary-next-label {
    font-size: 0.85rem;
    color: #666;
}

.salary-next-value {
    font-weight: bold;
    color: var(--primary);
}

.salary-next-bar {
    height: 8px;
    background: #E0E0E0;
    border-radius: 4px;
    overflow: hidden;
}

.salary-next-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #4CAF50);
    border-radius: 4px;
    transition: width var(--transition-slow);
}

.salary-next-hint {
    font-size: 0.85rem;
    color: #666;
    margin-top: 8px;
    text-align: center;
}

.salary-increase {
    background: var(--success);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-left: 5px;
}

/* 職級說明 */
.level-info {
    background: #FFF9E6;
    border: 2px solid var(--warning);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.level-info-title {
    font-weight: 600;
    color: #9A7D0A;
    margin-bottom: 8px;
}

.level-info-text {
    font-size: 0.9rem;
    color: #7D6608;
}

/* ========== 技能清單 ========== */
.skill-section {
    margin-top: 20px;
}

.skill-section-title {
    background: linear-gradient(135deg, var(--warning), #E67E22);
    color: white;
    padding: 15px 20px;
    border-radius: 12px 12px 0 0;
    font-weight: 600;
}

.skill-category {
    border: 1px solid #E0E0E0;
    border-top: none;
    background: white;
}

.skill-category:last-child {
    border-radius: 0 0 12px 12px;
}

.skill-category-header {
    padding: 15px 20px;
    background: #F8F9FA;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    border-bottom: 1px solid #E0E0E0;
    transition: background var(--transition-fast);
}

.skill-category-header:hover {
    background: #F0F0F0;
}

.skill-category-header .badge {
    background: var(--secondary);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
}

.skill-category-header .arrow {
    transition: transform var(--transition-normal);
    font-size: 0.8rem;
    color: #999;
}

.skill-category.collapsed .arrow {
    transform: rotate(-90deg);
}

.skill-category.collapsed .skill-items {
    display: none;
}

.skill-items {
    padding: 0;
}

.skill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px dashed #EEE;
    font-size: 0.9rem;
}

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

.skill-item-name {
    flex: 1;
    color: #555;
}

.skill-item-points {
    background: #E8F5E9;
    color: var(--success);
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ========== 薪資面板 ========== */
.salary-card {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
}

.salary-period {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

.salary-total {
    font-size: 2.5rem;
    font-weight: bold;
}

.salary-detail {
    background: white;
    border-radius: 12px;
    padding: 20px;
}

.salary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #E0E0E0;
}

.salary-row:last-child {
    border-bottom: none;
}

.salary-row.total {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--success);
    border-top: 2px solid #E0E0E0;
    margin-top: 10px;
    padding-top: 15px;
}

/* 薪資明細 */
.period-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #E0E0E0;
    border-radius: 10px;
    font-size: 1rem;
    margin-bottom: 20px;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.period-select:focus {
    outline: none;
    border-color: var(--secondary);
}

.salary-detail-card {
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.salary-detail-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 12px 16px;
    font-weight: 600;
}

.salary-detail-header.upper {
    background: linear-gradient(135deg, #11998e, #38ef7d);
}

.salary-detail-header.lower {
    background: linear-gradient(135deg, #f7971e, #ffd200);
    color: #333;
}

.salary-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #EEE;
}

.salary-detail-row:last-child {
    border-bottom: none;
}

.salary-detail-row.subtotal {
    background: #F8F9FA;
    font-weight: 600;
}

.salary-detail-row .label {
    color: #555;
}

.salary-detail-row .value {
    font-weight: 500;
}

.salary-no-data {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

/* 薪資面板內的出勤/日薪資訊 */
.salary-stats-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.salary-stat-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #F8F9FA, #E8EDF2);
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.05);
}

.salary-stat-icon {
    font-size: 1.6rem;
}

.salary-stat-info {
    flex: 1;
}

.salary-stat-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary);
}

.salary-stat-value.loading {
    color: #BDC3C7;
}

.salary-stat-label {
    font-size: 0.75rem;
    color: #7F8C8D;
    margin-top: 2px;
}

/* ========== 簽章確認 ========== */
.confirm-section {
    margin-top: 20px;
    padding: 20px;
    background: #FFF9E6;
    border: 2px solid var(--warning);
    border-radius: 12px;
}

.confirm-section.confirmed {
    background: #D5F5E3;
    border-color: var(--success);
}

.confirm-title {
    font-weight: 600;
    color: #9A7D0A;
    margin-bottom: 12px;
}

.confirm-section.confirmed .confirm-title {
    color: var(--success);
}

.confirm-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.confirm-checkbox input {
    width: 22px;
    height: 22px;
    cursor: pointer;
}

.confirm-checkbox label {
    font-size: 0.95rem;
    cursor: pointer;
}

.confirm-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--warning), #D68910);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.confirm-btn:disabled {
    background: #BDC3C7;
    cursor: not-allowed;
}

.confirm-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(243,156,18,0.4);
}

.confirm-result {
    text-align: center;
    padding: 15px;
}

.confirm-result .icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.confirm-result .text {
    font-weight: 600;
    color: var(--success);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.confirm-result .timestamp {
    font-size: 0.9rem;
    color: #666;
}

.confirm-result .signature {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ccc;
}

.confirm-result .signature-label {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 5px;
}

.confirm-result .signature-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    font-family: "Noto Serif TC", serif;
}

/* 待考核狀態 */
.pending-status {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #F39C12 0%, #E67E22 100%);
    color: white;
    border-radius: 16px;
    margin-bottom: 20px;
}

.pending-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.pending-text {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.pending-desc {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ========== 考核面板 ========== */
.eval-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.eval-item {
    background: #F8F9FA;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
}

.eval-item-name {
    font-size: 0.85rem;
    color: #7F8C8D;
    margin-bottom: 5px;
}

.eval-item-score {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary);
}

.eval-total-card {
    background: var(--primary);
    color: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.eval-total-score {
    font-size: 2.5rem;
    font-weight: bold;
}

.eval-total-grade {
    font-size: 1.1rem;
    margin-top: 5px;
}

.apply-section {
    background: #FFF9E6;
    border: 2px solid #F39C12;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.apply-title {
    color: #9A7D0A;
    font-weight: 600;
    margin-bottom: 10px;
}

.apply-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--warning), #D68910);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.apply-btn:hover {
    transform: translateY(-2px);
}

/* ========== 表單元素 ========== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #E0E0E0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--secondary);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* ========== 收貨單上傳 ========== */
.delivery-upload {
    border: 2px dashed #E67E22;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: #FEF9E7;
}

.delivery-upload:hover {
    background: #FEF5E7;
    border-color: #D35400;
}

.delivery-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.delivery-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #E67E22;
}

.delivery-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.delivery-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: #E74C3C;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    line-height: 18px;
    text-align: center;
}

.delivery-progress {
    display: none;
    margin: 15px 0;
    padding: 15px;
    background: #FEF9E7;
    border-radius: 12px;
    border: 1px solid #F5B041;
}

.delivery-progress.active {
    display: block;
}

/* ========== 學習資源 ========== */

/* 技能分數顯示卡 */
.skill-score-display {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.skill-score-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.skill-score-icon {
    font-size: 2.5rem;
}

.skill-score-info {
    flex: 1;
}

.skill-score-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 4px;
}

.skill-score-value {
    font-size: 2rem;
    font-weight: bold;
    color: white;
}

.skill-score-arrow {
    font-size: 1.5rem;
    color: rgba(255,255,255,0.7);
}

.resource-card {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #F8F9FA;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.resource-card:hover {
    background: #E8E8E8;
}

.resource-icon {
    width: 45px;
    height: 45px;
    background: var(--secondary);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 15px;
}

.resource-content {
    flex: 1;
}

.resource-title {
    font-weight: 500;
}

.resource-desc {
    font-size: 0.85rem;
    color: #7F8C8D;
}

/* ========== Toast 通知 ========== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 15px 30px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    display: none;
    z-index: 1000;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.show {
    display: block;
    animation: slideUp var(--transition-normal);
}

/* ========== 系統橫幅 ========== */
.system-banner {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.system-banner-icon {
    font-size: 1.1rem;
}

.system-banner-text {
    font-weight: 500;
}

/* ========== 公司選擇頁面 ========== */
.company-select-container {
    width: 100%;
    min-height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-red-dark) 100%);
}

.company-select-container.active {
    display: flex;
}

.company-select-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.company-select-title {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.company-select-subtitle {
    color: #7F8C8D;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.company-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.company-btn {
    width: 100%;
    padding: 20px;
    border: 3px solid #E0E0E0;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.company-btn:hover {
    border-color: var(--secondary);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(52,152,219,0.2);
}

.company-btn .company-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.company-btn .company-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary);
}

.company-btn .company-desc {
    font-size: 0.85rem;
    color: #7F8C8D;
    margin-top: 5px;
}

.company-btn.moreyan:hover {
    border-color: #667eea;
}

.company-btn.moreyan:hover .company-name {
    color: #667eea;
}

.company-btn.mozhu:hover {
    border-color: #D35400;
}

.company-btn.mozhu:hover .company-name {
    color: #D35400;
}

/* 公司標籤 */
.company-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
}

.company-badge.moreyan {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.company-badge.mozhu {
    background: rgba(211, 84, 0, 0.2);
    color: #D35400;
}

/* 測試版標籤 */
.test-badge {
    display: inline-block;
    background: #E74C3C;
    color: white;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.7rem;
    margin-left: 5px;
    animation: pulse 2s infinite;
}

/* ========== Skeleton Loading（新增）========== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1em;
    width: 100%;
    margin-bottom: 0.5em;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
}

.skeleton-card {
    height: 80px;
    border-radius: 16px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

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

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

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

/* ========== 響應式設計 ========== */
@media (max-width: 480px) {
    .login-box {
        padding: 30px 20px;
    }

    .eval-grid {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .user-info {
        justify-content: center;
    }

    .salary-stats-row {
        flex-direction: column;
    }
}

@media (min-width: 768px) {
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
