/* 
 * 激活码管理系统 - 优化版UI样式表
 * 设计目标：提升表格可读性、交互体验和整体美观度
 */

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "微软雅黑", "Segoe UI", Roboto, Arial, sans-serif;
}

body {
    background-color: #f0f2f5;
    padding: 24px;
    line-height: 1.5;
    color: #1f2937;
}

/* 容器样式 - 加宽适配新列宽 */
.container {
    max-width: 1800px;
    margin: 0 auto;
}

/* 卡片通用样式 */
.card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 20px;
    margin-bottom: 20px;
}

/* 头部导航 */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.top-nav h3 {
    font-size: 18px;
    color: #1f2937;
    font-weight: 600;
}

.nav-links a {
    color: #3b82f6;
    text-decoration: none;
    margin-left: 20px;
    font-size: 14px;
    font-weight: 500;
}

.nav-links a:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* 筛选栏样式 */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.filter-bar label {
    font-size: 14px;
    color: #4b5563;
    font-weight: 500;
    margin-right: 8px;
}

.filter-bar select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background-color: #f9fafb;
    min-width: 160px;
}

.filter-bar button {
    padding: 8px 16px;
    background-color: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.filter-bar button:hover {
    background-color: #2563eb;
}

/* 表格样式 - 核心优化 */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* 表头样式 */
.data-table thead th {
    background-color: #f3f4f6;
    color: #4b5563;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 12px;
    text-align: left;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

/* 单元格样式 */
.data-table tbody td {
    padding: 16px 12px;
    font-size: 14px;
    color: #1f2937;
    border-bottom: 1px solid #f3f4f6;
    text-align: left;
    vertical-align: middle;
}

/* 行交互效果 */
.data-table tbody tr {
    transition: background-color 0.2s;
}

.data-table tbody tr:hover {
    background-color: #f9fafb;
}

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

/* 列宽优化 - 按要求调整 */
/* 1. ID列：原60px → 100px */
.data-table th.id-col,
.data-table td.id-col {
    width: 100px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
}

/* 2. 所属软件列：原120px → 180px */
.data-table th.software-col,
.data-table td.software-col {
    width: 180px;
    font-size: 14px;
    color: #1f2937;
    font-weight: 500;
}

/* 3. 激活码列：200px */
.data-table th.code-col,
.data-table td.code-col {
    width: 200px;
    font-family: "Consolas", "Courier New", monospace;
    color: #1f2937;
}

/* 4. 绑定设备ID列：200px */
.data-table th.device-col,
.data-table td.device-col {
    width: 200px;
    color: #6b7280;
}

/* 5. 统一宽度列：生成时间/激活时间/有效天数/到期时间/剩余有效期/使用状态/封禁状态/操作 */
.data-table th.time-col,
.data-table td.time-col,
.data-table th.days-col,
.data-table td.days-col,
.data-table th.expire-col,
.data-table td.expire-col,
.data-table th.remain-col,
.data-table td.remain-col,
.data-table th.status-col,
.data-table td.status-col,
.data-table th.ban-col,
.data-table td.ban-col,
.data-table th.operate-col,
.data-table td.operate-col {
    width: 120px;
    text-align: center;
    color: #6b7280;
}

/* 6. 备注列 */
.data-table th.note-col,
.data-table td.note-col {
    width: 220px;
}

/* 状态标签样式 */
.status-normal {
    display: inline-block;
    padding: 4px 8px;
    background-color: #d1fae5;
    color: #065f46;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-banned {
    display: inline-block;
    padding: 4px 8px;
    background-color: #fee2e2;
    color: #991b1b;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* 备注输入框样式 - 优化版 */
.note-input {
    width: 160px;
    height: 32px;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: #f9fafb;
    transition: all 0.2s;
}

.note-input:focus {
    border-color: #3b82f6;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* 备注保存按钮样式 */
.btn-save-note {
    padding: 6px 12px;
    font-size: 12px;
    background-color: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 4px;
}

.btn-save-note:hover {
    background-color: #2563eb;
}

/* 操作按钮样式 - 优化版 */
.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin: 2px;
    font-weight: 500;
}

.btn-ban {
    background-color: #ef4444;
    color: #fff;
}

.btn-ban:hover {
    background-color: #dc2626;
}

.btn-unban {
    background-color: #10b981;
    color: #fff;
}

.btn-unban:hover {
    background-color: #059669;
}

.btn-delete {
    background-color: #f59e0b;
    color: #fff;
}

.btn-delete:hover {
    background-color: #d97706;
}

/* 空数据提示 */
.empty-tip {
    text-align: center;
    padding: 60px 0;
    color: #9ca3af;
    font-size: 16px;
}

/* 响应式适配 */
@media (max-width: 1400px) {
    .container {
        max-width: 100%;
        overflow-x: auto;
    }
    .data-table {
        font-size: 13px;
    }
    .data-table th, .data-table td {
        padding: 12px 8px;
    }
    .note-input {
        width: 140px;
    }
    /* 移动端列宽适配 */
    .data-table th.id-col,
    .data-table td.id-col {
        width: 100px;
    }
    .data-table th.software-col,
    .data-table td.software-col {
        width: 240px;
    }
    .data-table th.code-col,
    .data-table td.code-col,
    .data-table th.device-col,
    .data-table td.device-col {
        width: 200px;
    }
    .data-table th.time-col,
    .data-table td.time-col,
    .data-table th.days-col,
    .data-table td.days-col,
    .data-table th.expire-col,
    .data-table td.expire-col,
    .data-table th.remain-col,
    .data-table td.remain-col,
    .data-table th.status-col,
    .data-table td.status-col,
    .data-table th.ban-col,
    .data-table td.ban-col,
    .data-table th.operate-col,
    .data-table td.operate-col {
        width: 80px;
    }
}

@media (max-width: 768px) {
    .top-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .data-table {
        display: block;
        overflow-x: auto;
    }
    .data-table thead,
    .data-table tbody,
    .data-table th,
    .data-table td,
    .data-table tr {
        display: block;
    }
    .data-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    .data-table tr {
        margin-bottom: 16px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
    }
    .data-table td {
        border: none;
        position: relative;
        padding-left: 50%;
    }
    .data-table td:before {
        position: absolute;
        top: 16px;
        left: 12px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: #4b5563;
        content: attr(data-label);
    }
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 14px;
    color: #4b5563;
    font-weight: 500;
    margin-bottom: 8px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background-color: #f9fafb;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3b82f6;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    background-color: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.btn:hover {
    background-color: #2563eb;
}

/* 提示信息样式 */
.error-tip {
    padding: 12px;
    background-color: #fee2e2;
    color: #991b1b;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
.success-tip {
    padding: 12px;
    background-color: #d1fae5;
    color: #065f46;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* 首页样式 */
.welcome-section {
    text-align: center;
    padding: 60px 20px;
}
.welcome-section h1 {
    font-size: 24px;
    color: #1f2937;
    font-weight: 600;
    margin-bottom: 20px;
}
.welcome-section p {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 30px;
}
.footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    color: #6b7280;
    font-size: 14px;
}