newechoes/src/styles/articles-table.css

101 lines
1.9 KiB
CSS
Raw Normal View History

/* 表格样式 - 与全局主题配色协调 */
table {
width: 100%;
margin-bottom: 1.5rem;
border-collapse: separate;
border-spacing: 0;
border-radius: 0.5rem;
overflow-x: auto;
display: block;
max-width: 100%;
}
thead {
background-color: var(--color-primary-700);
color: white;
}
thead th {
padding: 0.75rem 1rem;
font-weight: 600;
text-align: left;
border-bottom: 2px solid var(--color-primary-800);
border-right: 1px solid var(--color-primary-600);
}
thead th:last-child {
border-right: none;
}
tbody tr {
background-color: white;
transition: background-color 0.2s ease;
}
tbody tr:nth-child(odd) {
background-color: var(--color-gray-50);
}
tbody tr:hover {
background-color: var(--color-primary-50);
}
tbody td {
padding: 0.75rem 1rem;
border-bottom: 1px solid var(--color-gray-200);
border-right: 1px solid var(--color-gray-200);
vertical-align: top;
white-space: nowrap;
max-width: 300px;
overflow: hidden;
text-overflow: ellipsis;
}
tbody td:last-child {
border-right: none;
}
tbody tr:last-child td {
border-bottom: none;
}
[data-theme='dark'] thead {
background-color: var(--color-primary-900);
}
[data-theme='dark'] thead th {
border-bottom: 2px solid var(--color-primary-800);
border-right: 1px solid var(--color-primary-800);
}
[data-theme='dark'] thead th:last-child {
border-right: none;
}
[data-theme='dark'] tbody tr {
background-color: var(--color-gray-800);
color: var(--color-gray-100);
}
[data-theme='dark'] tbody tr:nth-child(odd) {
background-color: var(--color-gray-900);
}
[data-theme='dark'] tbody tr:hover {
background-color: var(--color-gray-700);
}
[data-theme='dark'] tbody td {
border-bottom: 1px solid var(--color-gray-700);
border-right: 1px solid var(--color-gray-700);
}
[data-theme='dark'] tbody td:last-child {
border-right: none;
}
[data-theme='dark'] td:empty::before {
color: var(--color-gray-600);
}