/* ===============================
        表格樣式
   =============================== */

/* 表格基本樣式 */
.sys-table {
	width: 100%;
	border-collapse: collapse;
    overflow-x: auto;
}

/* 表格標題行 */
.sys-table thead tr {
	background: rgba(0, 217, 255, 0.1);
	border-bottom: 2px solid rgba(0, 217, 255, 0.3);
}

/* 表格標題 */
.sys-table th {
	padding: 12px 15px;
	text-align: center;
	font-size: 0.85rem;
	font-weight: 600;
	color: #00d9ff;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* 排序連結 */
.sort-link {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	color: #00d9ff;
	text-decoration: none;
	transition: all 0.2s ease;
	cursor: pointer;
}

.sort-link:hover {
	color: #fff;
}

.sort-link i {
	font-size: 0.75rem;
	opacity: 0.6;
	transition: all 0.2s ease;
}

.sort-link:hover i {
	opacity: 1;
}

/* 表格內容行 */
.sys-table tbody tr {
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
	transition: all 0.2s ease;
}

.sys-table tbody.sorting {
	opacity: 0.7;
	transition: opacity 0.3s ease;
}

.sys-table tbody tr:hover {
	background: rgba(0, 217, 255, 0.05);
}

/* 表格儲存格 */
.sys-table td {
	padding: 15px;
	font-size: 0.9rem;
	color: rgba(255, 255, 255, 0.85);
	text-align: center;
}

/* 時間欄位 */
.td-time {
	color: rgba(255, 255, 255, 0.7);
	white-space: nowrap;
}

.td-time i {
	margin-right: 5px;
	color: #00d9ff;
}

/* 訊息欄位 */
.td-message {
	max-width: 300px;
}

/* 位置欄位 */
.td-location {
	color: rgba(255, 255, 255, 0.6);
	font-size: 0.85rem;
}

/* 標籤樣式 */
.td-badge {
	display: inline-block;
	padding: 4px 12px;
	width: fit-content;
	border-radius: 12px;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin: auto;
}

.td-badge.error {
	background: rgba(254, 84, 97, 0.2);
	color: #fe5461;
	border: 1px solid rgba(254, 84, 97, 0.3);
}

/* 分頁 */
.pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 15px;
	margin-top: 25px;
	padding-top: 20px;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.page-info {
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.9rem;
}




/* ========================================
   表格特殊欄位樣式
   ======================================== */

.td-model {
	font-family: 'Courier New', monospace;
	font-size: 0.9rem;
	color: rgba(255, 255, 255, 0.9);
	background: rgba(255, 255, 255, 0.05);
	padding: 4px 8px;
	border-radius: 4px;
	display: inline-block;
}

.td-id {
	font-family: 'Courier New', monospace;
	font-size: 0.85rem;
	color: rgba(255, 255, 255, 0.7);
}

.td-description {
	color: rgba(255, 255, 255, 0.8);
	line-height: 1.4;
}

.td-actions {
	display: flex;
	gap: 8px;
	justify-content: center;
}

/* ========================================
   Badge 樣式
   ======================================== */

.td-badge {
	color: white;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 0.85rem;
	font-weight: 500;
	display: inline-block;
}

/* 操作類型 Badge 樣式 */
.td-badge.action-create {background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);}
.td-badge.action-update {background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);}
.td-badge.action-delete {background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);}
.td-badge.action-view {background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);}
.td-badge.action-download {background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);}
.td-badge.action-upload {background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);}
.td-badge.action-export {background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);}
.td-badge.action-import {background: linear-gradient(135deg, #fccb90 0%, #d57eeb 100%);}
.td-badge.action-other {background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);}


/* 狀態 Badge 樣式 */
.td-badge.status-new {background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);}
.td-badge.status-investigating {background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);}
.td-badge.status-resolved {background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);}
.td-badge.status-ignored {background: linear-gradient(135deg, #a8a8a8 0%, #6c6c6c 100%);}
.td-badge.count {background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);}
.td-badge.count i {margin-right: 4px;}


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

/* 平板 (992px 以下) */
@media (max-width: 992px) {
	.sys-table-wrapper {
		margin: -20px;
		padding: 20px;
	}

	.sys-table th,
	.sys-table td {
		padding: 12px;
		font-size: 0.9rem;
	}
}

/* 手機 (768px 以下) - 卡片式佈局 */
@media (max-width: 768px) {
	.sys-table-wrapper {
		margin: -15px;
		padding: 15px;
	}

	/* 隱藏表格標題 */
	.sys-table thead {
		display: none;
	}

	/* 表格改為區塊顯示 */
	.sys-table,
	.sys-table tbody,
	.sys-table tr {
		display: block;
		width: 100%;
	}

	/* 每一行變成卡片 */
	.sys-table tbody tr {
		background: rgba(255, 255, 255, 0.02);
		border: 1px solid rgba(255, 255, 255, 0.1);
		border-radius: 12px;
		padding: 15px;
		margin-bottom: 15px;
		display: grid;
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.sys-table tbody tr:hover {
		background: rgba(0, 217, 255, 0.05);
		border-color: rgba(0, 217, 255, 0.3);
	}

	/* 儲存格樣式 - 左右佈局 */
	.sys-table td {
		display: grid;
		grid-template-columns: 90px 1fr;
		grid-template-areas: "label content";
		align-items: center;
		padding: 10px 0;
		border: none;
		font-size: 0.9rem;
		gap: 15px;
		border-bottom: 1px solid rgba(255, 255, 255, 0.05);
	}

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

	/* 在每個儲存格前添加標籤 - 左側 */
	.sys-table td::before {
		content: attr(data-label);
		grid-area: label;
		font-weight: 600;
		color: #00d9ff;
		font-size: 0.85rem;
		text-align: left;
	}

	/* 確保內容不換行 */
	.sys-table td {
		align-items: start;
	}

	/* 時間欄位 */
	.td-time {
		white-space: normal;
		display: flex;
		align-items: center;
		gap: 5px;
	}

	.td-time::before {
		content: '時間';
	}

	.td-time i {
		flex-shrink: 0;
	}

	/* 錯誤類型 */
	.sys-table td:nth-child(2)::before {
		content: '類型';
	}

	/* 訊息 */
	.td-message {
		max-width: 100%;
		word-break: break-word;
	}

	.td-message::before {
		content: '訊息';
		align-self: flex-start;
	}

	/* 用戶 */
	.sys-table td:nth-child(4)::before {
		content: '用戶';
	}

	/* IP 地址 */
	.sys-table td:nth-child(5)::before {
		content: 'IP';
	}

	/* 位置 - 在手機上顯示 */
	.td-location {
		display: grid !important;
		word-break: break-word;
	}

	.td-location::before {
		content: '位置';
		align-self: flex-start;
	}

	/* 分頁 */
	.pagination {
		flex-direction: column;
		gap: 10px;
	}

	.pagination .btn {
		width: 100%;
		justify-content: center;
	}

	.td-description {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
}

/* 小手機 (480px 以下) */
@media (max-width: 480px) {
	.sys-table tbody tr {
		padding: 12px;
		gap: 8px;
	}

	.sys-table td {
		grid-template-columns: 75px 1fr;
		padding: 8px 0;
		font-size: 0.85rem;
		gap: 12px;
	}

	.sys-table td::before {
		font-size: 0.8rem;
	}

	.td-badge {
		font-size: 0.7rem;
		padding: 3px 10px;
	}
}


