/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: #f3f4f6;
    color: #1f2937;
    line-height: 1.6;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 导航链接样式 */
.nav-link {
    transition: all 0.2s ease-in-out;
    position: relative;
}

.nav-link.active {
    background-color: #4f46e5;
    color: white;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}

.nav-link:not(.active):hover {
    background-color: #f3f4f6;
    color: #4f46e5;
}

.nav-link i {
    transition: transform 0.2s ease;
}

.nav-link:hover i {
    transform: scale(1.1);
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 按钮样式 */
button {
    transition: all 0.2s ease;
    font-weight: 500;
}

button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

/* 输入框样式 */
input, select, textarea {
    transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* 表格样式 */
table {
    border-collapse: collapse;
    width: 100%;
}

th, td {
    padding: 12px 16px;
    text-align: left;
}

tr {
    transition: background-color 0.2s ease;
}

tr:hover {
    background-color: #f9fafb;
}

/* 状态标签样式 */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background-color: #10b981;
    color: white;
}

.status-paused {
    background-color: #f59e0b;
    color: white;
}

.status-expiring {
    background-color: #ef4444;
    color: white;
}

.status-available {
    background-color: #10b981;
    color: white;
}

.status-occupied {
    background-color: #3b82f6;
    color: white;
}

.status-maintenance {
    background-color: #f59e0b;
    color: white;
}

/* 模态框动画 */
#modal {
    animation: fadeIn 0.2s ease;
}

#modal > div {
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-link span {
        display: none;
    }
    
    nav {
        width: 60px;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
}

/* 深色模式切换 */
.dark-mode {
    background-color: #1f2937;
    color: #f3f4f6;
}

.dark-mode .bg-white {
    background-color: #374151;
}

/* 计时管理界面样式 */
.timer-card {
    transition: all 0.3s ease;
}

.timer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 正方形卡片容器 - 强制保持1:1比例 */
.square-card {
    width: 100%;
    aspect-ratio: 1 / 1 !important;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    max-height: 280px;
    position: relative;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.square-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* 确保卡片内容不溢出 */
.square-card > div:first-child {
    flex-shrink: 0;
    max-height: 56px;
    padding: 10px 12px;
}

.square-card > div:last-child {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    padding: 12px;
}

/* 确保卡片内部内容不会破坏正方形比例 */
.square-card * {
    max-width: 100%;
}

/* 操作按钮容器 */
.square-card .flex.space-x-2 {
    margin-top: auto;
    gap: 8px;
}

/* 操作按钮优化 */
.square-card button.btn-action {
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.025em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.square-card button.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.square-card button.btn-action:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 按钮点击波纹效果 */
.square-card button.btn-action::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.square-card button.btn-action:active::after {
    width: 200px;
    height: 200px;
}

/* 暂停按钮 */
.square-card button.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.square-card button.bg-warning:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

/* 继续按钮 */
.square-card button.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.square-card button.bg-success:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

/* 结束按钮 */
.square-card button.bg-button-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.square-card button.bg-button-danger:hover {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
}

/* 开始计时按钮 */
.square-card button.bg-button-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
}

.square-card button.bg-button-primary:hover {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

/* 按钮图标优化 */
.square-card button.btn-action i {
    font-size: 0.9em;
    vertical-align: middle;
}

/* 计时器显示区域 */
.square-card .timer-display {
    font-size: 1.5rem !important;
    line-height: 1.2;
    margin: 8px 0;
    font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 费用显示 */
.square-card .cost-display {
    font-size: 1.25rem !important;
    line-height: 1.2;
    margin: 4px 0;
    font-weight: 700;
    letter-spacing: -0.025em;
    text-shadow: 0 1px 2px rgba(79, 70, 229, 0.2);
}

/* 计时器容器优化 */
.square-card .text-center.mb-3 {
    padding: 12px 8px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* 费用和用户信息容器优化 */
.square-card .flex.justify-between.items-center.mb-3 {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 空闲状态费率显示优化 */
.square-card .bg-gray-50 {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 费用显示动画效果 */
.cost-display.updated {
    animation: costUpdate 0.3s ease;
}

@keyframes costUpdate {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* 计时管理网格优化 */
#timer-devices-grid {
    gap: 16px;
    padding: 4px;
}

/* 卡片头部优化 */
.square-card > div:first-child {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0e7ff 100%);
    border-bottom: 2px solid #e5e7eb;
}

/* 状态标识优化 */
.square-card .status-badge {
    backdrop-filter: blur(4px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.square-card .status-badge:hover {
    transform: scale(1.05);
}

/* 不同状态的颜色优化 */
.square-card .status-badge.bg-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.square-card .status-badge.bg-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.square-card .status-badge.bg-button-primary {
    background: rgba(79, 70, 229, 0.15);
    border: 1px solid rgba(79, 70, 229, 0.3);
}

.square-card .status-badge.bg-gray-100 {
    background: rgba(156, 163, 175, 0.15);
    border: 1px solid rgba(156, 163, 175, 0.3);
}

/* 设备名称样式优化 */
.square-card h4 {
    font-weight: 700;
    letter-spacing: -0.025em;
}

.square-card p {
    letter-spacing: 0.01em;
}

/* 确保网格列足够宽以支持正方形卡片 */
@media (max-width: 640px) {
    #timer-devices-grid.grid.grid-cols-2 {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .square-card .timer-display {
        font-size: 1.25rem !important;
    }
    
    .square-card .cost-display {
        font-size: 1rem !important;
    }
    
    .square-card button.btn-action {
        font-size: 0.75rem;
        padding: 6px 8px;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    #timer-devices-grid.grid.md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(170px, 1fr));
        gap: 14px;
    }
    
    .square-card .timer-display {
        font-size: 1.35rem !important;
    }
    
    .square-card .cost-display {
        font-size: 1.1rem !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    #timer-devices-grid.grid.lg\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(190px, 1fr));
        gap: 16px;
    }
}

@media (min-width: 1025px) and (max-width: 1280px) {
    #timer-devices-grid.grid.xl\:grid-cols-5 {
        grid-template-columns: repeat(5, minmax(200px, 1fr));
        gap: 16px;
    }
}

@media (min-width: 1281px) {
    #timer-devices-grid.grid.xl\:grid-cols-5 {
        grid-template-columns: repeat(5, minmax(220px, 1fr));
        gap: 20px;
    }
}

/* 超大屏幕优化 */
@media (min-width: 1536px) {
    #timer-devices-grid.grid.xl\:grid-cols-5 {
        grid-template-columns: repeat(6, minmax(240px, 1fr));
        gap: 24px;
    }
}

/* 横屏模式优化 */
@media (max-height: 600px) and (orientation: landscape) {
    .square-card {
        min-height: 240px;
        max-height: 240px;
    }
    
    .square-card .timer-display {
        font-size: 1.25rem !important;
    }
    
    .square-card .cost-display {
        font-size: 1rem !important;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .square-card button.btn-action {
        padding: 12px 16px;
        font-size: 0.875rem;
    }
    
    .square-card .status-badge {
        padding: 8px 12px;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .square-card {
        border: 2px solid #000;
    }
    
    .square-card .timer-display {
        text-shadow: none;
        -webkit-text-fill-color: #000;
        background: none;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    .square-card,
    .square-card .status-badge,
    .square-card button.btn-action,
    .cost-display.updated {
        transition: none;
        animation: none;
    }
}

/* 计时器显示区域 */
.timer-display {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 2px;
    font-size: 1.5rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.status-available {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-occupied {
    background-color: #d1fae5;
    color: #065f46;
}

.status-paused {
    background-color: #fef3c7;
    color: #92400e;
}

.status-maintenance {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* 按钮动画效果 */
.btn-action {
    transition: all 0.2s ease;
}

.btn-action:hover {
    transform: scale(1.05);
}

.btn-action:active {
    transform: scale(0.95);
}

/* 费用显示动画 */
.cost-display {
    transition: all 0.3s ease;
}

.cost-display.updated {
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.dark-mode .border-gray-200 {
    border-color: #4b5563;
}

.dark-mode .text-gray-600 {
    color: #d1d5db;
}

.dark-mode .text-gray-700 {
    color: #e5e7eb;
}

.dark-mode .text-gray-800 {
    color: #f9fafb;
}

.dark-mode .bg-gray-100 {
    background-color: #111827;
}

.dark-mode .bg-gray-200 {
    background-color: #374151;
}

.dark-mode .shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

/* 数据表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.data-table td {
    border-bottom: 1px solid #e5e7eb;
}

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

/* 卡片网格样式 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* 统计卡片样式 */
.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 进度条样式 */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.tag-primary {
    background-color: #4f46e5;
    color: white;
}

.tag-success {
    background-color: #10b981;
    color: white;
}

.tag-warning {
    background-color: #f59e0b;
    color: white;
}

.tag-danger {
    background-color: #ef4444;
    color: white;
}

.tag-info {
    background-color: #3b82f6;
    color: white;
}

/* 表单组样式 */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* 按钮组样式 */
.btn-group {
    display: flex;
    gap: 0.5rem;
}

/* 徽章样式 */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background-color: #4f46e5;
    color: white;
}

.badge-success {
    background-color: #10b981;
    color: white;
}

.badge-warning {
    background-color: #f59e0b;
    color: white;
}

.badge-danger {
    background-color: #ef4444;
    color: white;
}

.badge-info {
    background-color: #3b82f6;
    color: white;
}

/* 浮动操作按钮 */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background-color: #4f46e5;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 100;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 卡片头部样式 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
}

/* 卡片内容样式 */
.card-body {
    padding: 1rem 0;
}

/* 卡片底部样式 */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* 列表组样式 */
.list-group {
    list-style: none;
}

.list-group-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.list-group-item:hover {
    background-color: #f9fafb;
}

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

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.page-item {
    list-style: none;
}

.page-link {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
}

.page-link:hover {
    background-color: #f9fafb;
    border-color: #4f46e5;
}

.page-link.active {
    background-color: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

/* 下拉菜单样式 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    font-size: 0.875rem;
    color: #374151;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    clear: both;
    font-weight: 400;
    color: #374151;
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: #f9fafb;
    color: #4f46e5;
}

/* 折叠面板样式 */
.collapse {
    display: none;
}

.collapse.show {
    display: block;
}

.collapse-header {
    cursor: pointer;
    padding: 0.75rem 1rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
}

.collapse-header:hover {
    background-color: #f3f4f6;
}

.collapse-body {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
}

/* 加载状态样式 */
.loading-state {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.loading-state .loading {
    margin-right: 0.5rem;
}

/* 空状态样式 */
.empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 1rem;
    text-align: center;
}

.empty-state i {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

/* 错误状态样式 */
.error-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 1rem;
    text-align: center;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.375rem;
}

.error-state i {
    font-size: 3rem;
    color: #ef4444;
    margin-bottom: 1rem;
}

.error-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #dc2626;
    margin-bottom: 0.5rem;
}

.error-state p {
    color: #b91c1c;
    margin-bottom: 1.5rem;
}

/* 成功状态样式 */
.success-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 1rem;
    text-align: center;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 0.375rem;
}

.success-state i {
    font-size: 3rem;
    color: #10b981;
    margin-bottom: 1rem;
}

.success-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #059669;
    margin-bottom: 0.5rem;
}

.success-state p {
    color: #065f46;
    margin-bottom: 1.5rem;
}

/* 警告状态样式 */
.warning-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 1rem;
    text-align: center;
    background-color: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 0.375rem;
}

.warning-state i {
    font-size: 3rem;
    color: #f59e0b;
    margin-bottom: 1rem;
}

.warning-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #d97706;
    margin-bottom: 0.5rem;
}

.warning-state p {
    color: #92400e;
    margin-bottom: 1.5rem;
}

/* 信息状态样式 */
.info-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 1rem;
    text-align: center;
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.375rem;
}

.info-state i {
    font-size: 3rem;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.info-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2563eb;
    margin-bottom: 0.5rem;
}

.info-state p {
    color: #1d4ed8;
    margin-bottom: 1.5rem;
}

/* 动画类 */
.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-in {
    animation: slideIn 0.5s ease;
}

.bounce-in {
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 响应式工具类 */
@media (max-width: 640px) {
    .sm\\:hidden {
        display: none;
    }
}

@media (max-width: 768px) {
    .md\\:hidden {
        display: none;
    }
}

@media (max-width: 1024px) {
    .lg\\:hidden {
        display: none;
    }
}

@media (max-width: 1280px) {
    .xl\\:hidden {
        display: none;
    }
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .container {
        width: 100%;
        max-width: none;
    }
}

/* ========== 分类标签页样式 ========== */
.category-tabs-container {
    background: white;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    position: relative;
    overflow: hidden;
}

.category-tab:hover {
    border-color: var(--category-color, #4f46e5);
    background: linear-gradient(135deg, 
        rgba(79, 70, 229, 0.05) 0%, 
        rgba(79, 70, 229, 0.02) 100%);
    color: var(--category-color, #4f46e5);
}

.category-tab.active {
    border-color: var(--category-color, #4f46e5);
    background: linear-gradient(135deg, 
        rgba(79, 70, 229, 0.1) 0%, 
        rgba(79, 70, 229, 0.05) 100%);
    color: var(--category-color, #4f46e5);
    font-weight: 600;
}

.category-tab.active::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--category-color, #4f46e5);
}

.category-tab i {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.category-tab:hover i {
    transform: scale(1.1);
}

.category-tab .device-count {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: #f3f4f6;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.2s ease;
}

.category-tab.active .device-count,
.category-tab:hover .device-count {
    background: var(--category-color, #4f46e5);
    color: white;
}

.category-tab .active-indicator {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-indicator 2s infinite;
}

@keyframes pulse-indicator {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* 分类颜色变体 */
.category-tab[style*="#f59e0b"] {
    --category-color: #f59e0b;
}

.category-tab[style*="#10b981"] {
    --category-color: #10b981;
}

.category-tab[style*="#ef4444"] {
    --category-color: #ef4444;
}

.category-tab[style*="#8b5cf6"] {
    --category-color: #8b5cf6;
}

.category-tab[style*="#ec4899"] {
    --category-color: #ec4899;
}

.category-tab[style*="#06b6d4"] {
    --category-color: #06b6d4;
}

/* 响应式分类标签 */
@media (max-width: 768px) {
    .category-tabs {
        gap: 6px;
    }
    
    .category-tab {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .category-tab span:not(.device-count):not(.active-indicator) {
        display: none;
    }
    
    .category-tab .device-count {
        display: flex;
    }
}

@media (max-width: 480px) {
    .category-tabs-container {
        padding: 8px;
    }
    
    .category-tab {
        padding: 6px 10px;
    }
    
    .category-tab i {
        font-size: 14px;
    }
    
    .category-tab .device-count {
        min-width: 20px;
        height: 20px;
        font-size: 11px;
    }
}

/* 分类标签页动画 */
.category-tabs {
    animation: fadeInUp 0.3s ease;
}

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

/* ========== 排序控制样式 ========== */
.sort-controls-container {
    background: white;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sort-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sort-option-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
}

.sort-option-btn:hover {
    border-color: #4f46e5;
    background: rgba(79, 70, 229, 0.05);
    color: #4f46e5;
}

.sort-option-btn.active {
    border-color: #4f46e5;
    background: #4f46e5;
    color: white;
}

.sort-option-btn i {
    font-size: 14px;
}

.sort-order-btn,
.drag-mode-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
}

.sort-order-btn:hover,
.drag-mode-btn:hover {
    border-color: #4f46e5;
    color: #4f46e5;
}

.drag-mode-btn.active {
    border-color: #10b981;
    background: #10b981;
    color: white;
}

/* ========== 拖拽排序样式 ========== */
.drag-mode-active .draggable-card {
    cursor: grab;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.drag-mode-active .draggable-card:active {
    cursor: grabbing;
}

.draggable-card.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.draggable-card.drag-over {
    border: 2px dashed #4f46e5;
    background: rgba(79, 70, 229, 0.05);
    transform: scale(1.02);
}

.drag-handle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
    z-index: 10;
}

.drag-handle i {
    font-size: 12px;
}

.drag-index {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 11px;
}

.drag-mode-active .timer-card {
    padding-top: 32px;
}

/* 拖拽动画 */
@keyframes dragPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(79, 70, 229, 0);
    }
}

.drag-mode-active .draggable-card:hover {
    animation: dragPulse 1.5s infinite;
}

/* 拖拽提示 */
.drag-mode-active::before {
    content: '拖拽卡片调整顺序';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 12px;
    background: #4f46e5;
    color: white;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    animation: fadeInDown 0.3s ease 0.5s forwards;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 响应式排序控制 */
@media (max-width: 768px) {
    .sort-controls-container {
        padding: 10px 12px;
    }
    
    .sort-option-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .sort-option-btn span {
        display: none;
    }
    
    .sort-option-btn i {
        font-size: 14px;
    }
    
    .sort-order-btn,
    .drag-mode-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .drag-mode-btn span {
        display: none;
    }
}

@media (max-width: 480px) {
    .sort-controls-container {
        padding: 8px 10px;
    }
    
    .sort-options {
        gap: 4px;
    }
    
    .sort-option-btn {
        padding: 5px 8px;
    }
}

/* 排序控制动画 */
.sort-controls-container {
    animation: fadeInUp 0.3s ease;
}

/* 设备卡片排序过渡 */
.timer-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.2s ease;
}