/* 统一样式文件 - style.css */

/* ===== 基础样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS变量定义 - 间距系统 */
:root {
    /* 间距变量 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;
    
    /* 表格相关 */
    --table-row-height: 36px;
    --table-padding: var(--spacing-md);
    
    /* 状态列 */
    --status-column-gap: var(--spacing-md);
    
    /* 切换开关 */
    --toggle-switch-width: 44px;
    --toggle-switch-height: 24px;
    --toggle-slider-size: 20px;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
}

/* ===== 布局样式 ===== */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    overflow-x: hidden;
}

header {
    background-color: #4285f4;
    color: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 24px;
}

.header-right {
    display: flex;
    align-items: center;
}

.header-right span {
    margin-right: 20px;
}

footer {
    background-color: white;
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    color: #666;
    font-size: 0.9em;
    margin-top: 20px;
}

/* ===== 文本样式 ===== */
h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

h2 {
    color: #4285f4;
    margin-bottom: 15px;
    font-size: 1.8em;
}

h3 {
    margin: 20px 0 10px 0;
    color: #666;
    font-size: 1.2em;
}

.welcome {
    font-size: 1.2em;
    opacity: 0.9;
}

/* ===== 卡片样式 ===== */
.status {
    background-color: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.api-section {
    background-color: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stats {
    background-color: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
    text-decoration: none;
    color: inherit;
    padding: 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background-color: #f0f0f0;
}

.stat-item.active {
    background-color: #e3f2fd;
    border: 1px solid #4285f4;
    box-shadow: 0 2px 4px rgba(66, 133, 244, 0.2);
}

.stat-item.active .stat-number {
    color: #1967d2;
}

.stat-item.active .stat-label {
    color: #4285f4;
    font-weight: bold;
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #4285f4;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.status-card {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #4285f4;
}

.status-card h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #666;
}

.status-card .status-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #4285f4;
}

/* ===== 按钮样式 ===== */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background-color: #4285f4;
    color: white;
}

.btn-primary:hover {
    background-color: #3367d6;
}

.btn-success {
    background-color: #34a853;
    color: white;
}

.btn-success:hover {
    background-color: #2d9d48;
}

.btn-danger {
    background-color: #f44336;
    color: white;
}

.btn-danger:hover {
    background-color: #d32f2f;
}

.admin-link {
    display: inline-block;
    background-color: #34a853;
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    margin: 20px 0;
    transition: background-color 0.3s;
}

.admin-link:hover {
    background-color: #2d9d48;
}

/* ===== 表单样式 ===== */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-form {
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

/* ===== 搜索栏样式 ===== */
.search-bar {
    background-color: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 10px;
}

.search-bar input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-bar input:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

/* ===== 表格样式 ===== */
.table-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    margin: 20px 0;
    width: 100%;
    box-sizing: border-box;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
    table-layout: fixed;
}

/* 桌面设备表格样式 */
th, td {
    padding: 12px;
    text-align: left;
    vertical-align: middle;
    position: relative;
}

/* 只给行添加底部边框，而不是每个单元格 */
tr {
    border-bottom: 1px solid #e0e0e0;
}

/* 最后一行没有边框 */
tbody tr:last-child {
    border-bottom: none;
}

th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #555;
    white-space: nowrap;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 10;
}

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

/* 列宽优化 */
th:nth-child(1), /* ID */
td:nth-child(1) {
    width: 60px;
    text-align: center;
    white-space: nowrap;
    font-size: 13px;
}

th:nth-child(2), /* 硬件指纹 */
td:nth-child(2) {
    width: 120px;
    max-width: 140px;
    word-break: break-all;
    font-size: 13px;
}

th:nth-child(3), /* 授权码 */
td:nth-child(3) {
    width: 80px;
    text-align: center;
    white-space: nowrap;
    font-size: 13px;
}

th:nth-child(4), /* 交易哈希 */
td:nth-child(4) {
    width: 100px;
    word-break: break-all;
    font-size: 12px;
}

th:nth-child(5), /* 创建时间 */
td:nth-child(5) {
    width: 120px;
    font-family: monospace;
    white-space: nowrap;
    font-size: 12px;
}

th:nth-child(6), /* 到期时间 */
td:nth-child(6) {
    width: 130px;
    white-space: nowrap;
}

th:nth-child(7), /* 状态 */
td:nth-child(7) {
    width: 90px;
    white-space: nowrap;
}

th:nth-child(8), /* 验证次数 */
td:nth-child(8) {
    width: 80px;
    text-align: center;
    white-space: nowrap;
    font-size: 13px;
}

th:nth-child(9), /* 注册IP */
td:nth-child(9) {
    width: 110px;
    white-space: nowrap;
    font-size: 12px;
    text-align: center;
}

th:nth-child(10), /* 最新IP */
td:nth-child(10) {
    width: 110px;
    white-space: nowrap;
    font-size: 12px;
    text-align: center;
}

th:nth-child(11), /* 操作 */
td:nth-child(11) {
    width: 70px;
    text-align: center;
    white-space: nowrap;
}

/* 硬件指纹样式 */
.hardware-id {
    position: relative;
}

.tooltip-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.truncated-text {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.truncated-text:hover {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 2px 4px;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 交易哈希样式 */
.tx-hash {
    font-family: monospace;
}

/* 日期时间样式 */
.date-time {
    font-family: monospace;
    font-size: 14px;
}

/* 到期时间输入框样式 */
.expire-date .edit-input {
    width: 100%;
    padding: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

/* 状态列样式 */
.status-column {
    display: flex;
    align-items: center;
    gap: var(--status-column-gap);
    position: relative;
    width: 100%;
    height: auto;
    min-height: var(--table-row-height);
    padding: var(--spacing-xs) 0;
}

/* 确保状态文本能正确显示 */
.status-text {
    display: inline-block;
    vertical-align: middle;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
    white-space: nowrap;
    flex-grow: 0;
    flex-basis: auto;
    margin: 0;
    padding: 0;
    line-height: 1;
}

/* 确保切换开关不会遮挡文本 */
.toggle-switch {
    flex-shrink: 0;
    flex-grow: 0;
    flex-basis: auto;
    margin: 0;
    padding: 0;
    line-height: 1;
    align-self: center;
}

/* 验证次数样式 */
.check-count {
    font-weight: bold;
    color: #4285f4;
}

/* 注册IP和最新IP样式 */
.reg-ip,
.last-ip {
    font-family: monospace;
    font-size: 13px;
    white-space: nowrap;
    color: #555;
}

/* 操作列样式 */
.action-column {
    display: flex;
    gap: 5px;
    justify-content: center;
}

/* 删除按钮样式 */
.btn-delete {
    padding: 4px 8px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s;
}

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

/* 按钮搜索样式 */
.btn-search {
    background-color: #4285f4;
    color: white;
}

.btn-search:hover {
    background-color: #3367d6;
}

/* 按钮登出样式 */
.btn-logout {
    background-color: #f44336;
    color: white;
}

.btn-logout:hover {
    background-color: #d32f2f;
}

/* ===== 修改密码样式 ===== */
.password-change-section {
    background-color: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.password-change-section h3 {
    margin-bottom: 15px;
    color: #4285f4;
    font-size: 18px;
}

.password-form {
    max-width: 600px;
}

.password-form .form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.password-form .form-group {
    flex: 1;
    margin-bottom: 15px;
}

.password-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
    font-size: 14px;
}

.password-form .form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.password-form .form-group input:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.password-form .btn {
    padding: 10px 20px;
    font-size: 14px;
}

/* 响应式修改密码表单 */
@media (max-width: 768px) {
    .password-form .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* 响应式表格 - 大屏手机 */
@media (max-width: 1024px) {
    .table-container {
        overflow-x: auto;
    }
    
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 8px;
    }
    
    /* 简化列宽 */
    th:nth-child(2), /* 硬件指纹 */
    td:nth-child(2) {
        width: 110px;
    }
    
    th:nth-child(5), /* 创建时间 */
    td:nth-child(5) {
        width: 140px;
        font-size: 12px;
    }
    
    /* 简化状态列 */
    .status-column {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* 响应式表格 - 优化所有移动设备 */
@media (max-width: 768px) {
    /* 隐藏表头 */
    .table-container thead {
        display: none;
    }
    
    /* 将表格转换为卡片式布局 */
    .table-container table,
    .table-container tbody,
    .table-container tr,
    .table-container td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* 移除表格的最小宽度限制，避免水平滚动 */
    table {
        min-width: auto !important;
    }
    
    /* 调整tr样式，作为卡片容器 */
    .table-container tr {
        background-color: white;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        margin-bottom: 15px;
        overflow: hidden;
    }
    
    /* 调整td样式，作为卡片内容 */
    .table-container td {
        display: flex;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 10px 15px;
        border-bottom: 1px solid #e0e0e0;
        text-align: left;
        position: relative;
        font-size: 13px;
        flex-wrap: wrap;
    }
    
    /* 最后一个td去除边框 */
    .table-container td:last-child {
        border-bottom: none;
    }
    
    /* 添加数据标签 */
    .table-container td:before {
        content: attr(data-label);
        font-weight: bold;
        color: #555;
        text-align: left;
        flex-basis: 40%;
        min-width: 90px;
        white-space: nowrap;
        margin-right: 10px;
        padding-top: 2px;
    }
    
    /* 为每个td添加数据标签 */
    .table-container td:nth-child(1):before { content: 'ID'; }
    .table-container td:nth-child(2):before { content: '硬件指纹'; }
    .table-container td:nth-child(3):before { content: '授权码'; }
    .table-container td:nth-child(4):before { content: '交易哈希'; }
    .table-container td:nth-child(5):before { content: '创建时间'; }
    .table-container td:nth-child(6):before { content: '到期时间'; }
    .table-container td:nth-child(7):before { content: '状态'; }
    .table-container td:nth-child(8):before { content: '验证次数'; }
    .table-container td:nth-child(9):before { content: '注册IP'; }
    .table-container td:nth-child(10):before { content: '最新IP'; }
    .table-container td:nth-child(11):before { content: '操作'; }
    
    /* 调整td内容区域 */
    .table-container td > * {
        flex: 1;
        min-width: 0;
    }
    
    /* 调整硬件指纹样式 */
    .table-container .hardware-id {
        width: 100%;
        flex: 1;
    }
    
    .table-container .tooltip-container {
        width: auto;
        flex: 1;
        text-align: left;
    }
    
    /* 调整状态列样式 */
    .table-container .status-column {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 10px;
        flex: 1;
        text-align: left;
        width: 100%;
    }
    
    /* 调整操作列样式 */
    .table-container .action-column {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        gap: 10px;
        flex: 1;
        text-align: left;
        width: 100%;
        margin-top: 5px;
    }
    
    /* 调整日期时间输入框 */
    .table-container .expire-date {
        width: 100%;
    }
    
    .table-container .expire-date .edit-input {
        width: 100%;
        font-size: 13px;
        padding: 6px;
    }
    
    /* 调整日期时间样式 */
    .table-container .date-time {
        font-size: 12px;
        font-family: monospace;
    }
    
    /* 调整交易哈希样式 */
    .table-container .tx-hash {
        font-size: 12px;
        word-break: break-all;
        width: 100%;
        display: block;
        line-height: 1.4;
    }
    
    /* 交易哈希容器调整 */
    .table-container td:nth-child(4) /* 交易哈希 */ {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* 交易哈希标签调整 */
    .table-container td:nth-child(4):before {
        flex-basis: auto;
        margin-bottom: 5px;
        display: block;
        margin-right: 0;
        min-width: auto;
    }
    
    /* 交易哈希内容调整 */
    .table-container td:nth-child(4) > * {
        width: 100%;
        min-width: 0;
        word-break: break-all;
        font-size: 12px;
        line-height: 1.4;
    }
    
    /* 调整检查次数样式 */
    .table-container .check-count {
        font-weight: bold;
        color: #4285f4;
    }
    
    /* 调整IP地址样式 */
    .table-container .reg-ip,
    .table-container .last-ip {
        font-family: monospace;
        font-size: 12px;
        word-break: break-all;
        width: 100%;
        display: block;
        line-height: 1.4;
    }
    
    /* IP地址容器调整 */
    .table-container td:nth-child(9), /* 注册IP */
    .table-container td:nth-child(10) /* 最新IP */ {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* IP地址标签调整 */
    .table-container td:nth-child(9):before,
    .table-container td:nth-child(10):before {
        flex-basis: auto;
        margin-bottom: 5px;
        display: block;
        margin-right: 0;
        min-width: auto;
    }
    
    /* 调整td内容区域 */
    .table-container td:nth-child(9) > *,
    .table-container td:nth-child(10) > * {
        width: 100%;
        min-width: 0;
        word-break: break-all;
        font-size: 12px;
        line-height: 1.4;
    }
    
    /* 调整表格容器样式，确保不出现水平滚动 */
    .table-container {
        margin: 15px 0;
        overflow: visible !important;
    }
    
    /* 调整按钮样式 */
    .table-container .btn {
        padding: 6px 12px;
        font-size: 12px;
        min-height: auto;
        min-width: auto;
    }
    
    /* 调整删除按钮样式 */
    .table-container .btn-delete {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    /* 调整空状态样式 */
    .table-container tr:has(td[colspan="11"]) {
        box-shadow: none;
        background-color: transparent;
        margin-bottom: 0;
    }
    
    .table-container tr:has(td[colspan="11"]) td {
        padding: 40px;
        text-align: center;
        background-color: white;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    /* 调整空状态td:before */
    .table-container tr:has(td[colspan="11"]) td:before {
        content: none;
    }
}

/* 响应式表格 - 大屏手机优化 */
@media (max-width: 1024px) {
    /* 确保表格容器不出现水平滚动 */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 调整表格基本样式 */
    table {
        font-size: 14px;
        min-width: auto;
    }
    
    th, td {
        padding: 8px;
    }
    
    /* 简化列宽，适应较小屏幕 */
    th:nth-child(2), /* 硬件指纹 */
    td:nth-child(2) {
        width: 120px;
    }
    
    th:nth-child(4), /* 交易哈希 */
    td:nth-child(4) {
        width: 130px;
    }
    
    th:nth-child(5), /* 创建时间 */
    td:nth-child(5) {
        width: 130px;
        font-size: 12px;
    }
    
    /* 简化状态列 */
    .status-column {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* ===== 编辑样式 ===== */
.edit-input {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    width: 100%;
}

.edit-input:focus {
    outline: none;
    border-color: #4285f4;
}

/* ===== 现代化切换开关样式 ===== */
.toggle-switch {
    position: relative;
    display: inline-block !important;
    width: var(--toggle-switch-width) !important;
    height: var(--toggle-switch-height) !important;
    vertical-align: middle;
    z-index: 1;
    overflow: visible;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    outline: none;
    cursor: pointer;
}

.toggle-switch * {
    box-sizing: border-box;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
}

/* 新的滑块样式 */
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: var(--toggle-switch-width) !important;
    height: var(--toggle-switch-height) !important;
    background-color: #e0e0e0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: calc(var(--toggle-switch-height) / 2);
    display: block !important;
    z-index: 2;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 新的滑块按钮样式 */
.toggle-slider:before {
    position: absolute;
    content: "";
    height: var(--toggle-slider-size);
    width: var(--toggle-slider-size);
    left: calc((var(--toggle-switch-height) - var(--toggle-slider-size)) / 2);
    top: calc((var(--toggle-switch-height) - var(--toggle-slider-size)) / 2);
    background-color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    display: block !important;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
}

/* 激活状态样式 */
input:checked + .toggle-slider {
    background-color: #4caf50 !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(76, 175, 80, 0.3);
}

/* 激活状态下的滑块按钮 */
input:checked + .toggle-slider:before {
    transform: translateX(calc(var(--toggle-switch-width) - var(--toggle-slider-size))) !important;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3), 0 1px 3px rgba(0, 0, 0, 0.15);
    background-color: white;
}

/* 悬停效果 */
.toggle-switch:hover .toggle-slider {
    background-color: #d0d0d0;
}

.toggle-switch:hover input:checked + .toggle-slider {
    background-color: #45a049 !important;
}

/* 焦点效果 */
.toggle-switch input:focus + .toggle-slider {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(0, 150, 136, 0.3);
}

/* 禁用状态 */
.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

.toggle-switch input:disabled + .toggle-slider:before {
    cursor: not-allowed;
    background-color: #fafafa;
}

/* ===== 状态文本样式 ===== */
.status-active {
    color: #4caf50;
    font-weight: bold;
}

.status-disabled {
    color: #f44336;
    font-weight: bold;
}

.status-expired {
    color: #ff9800;
    font-weight: bold;
}

/* ===== 分页样式 ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: white;
    margin-top: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination a, .pagination span {
    margin: 0 5px;
    padding: 8px 12px;
    text-decoration: none;
    color: #4285f4;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.pagination a:hover {
    background-color: #f0f0f0;
}

.pagination .current {
    background-color: #4285f4;
    color: white;
    border-color: #4285f4;
}

.pagination .disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* ===== 代码块样式 ===== */
pre {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 10px 0;
    border: 1px solid #e9ecef;
}

code {
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
}

/* ===== 列表样式 ===== */
ul {
    margin: 10px 0 10px 20px;
}

li {
    margin: 5px 0;
}

/* ===== 消息样式 ===== */
.info-box {
    background-color: #e3f2fd;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    border-left: 4px solid #2196f3;
}

.success-message {
    background-color: #e8f5e8;
    color: #2e7d32;
    padding: 12px 20px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease-out;
    position: relative;
    border-left: 4px solid #4caf50;
}

.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 12px 20px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease-out;
    position: relative;
    border-left: 4px solid #f44336;
}

/* 添加滑入动画 */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 确保消息在容器底部正确显示 */
.container {
    position: relative;
    min-height: 100vh;
}

/* 为消息添加过渡效果 */
.success-message,
.error-message {
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

/* 消息消失时的动画 */
.success-message.fade-out,
.error-message.fade-out {
    opacity: 0;
    transform: translateY(10px);
}

.error {
    background-color: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

/* ===== 详情页面样式 ===== */
.detail-section {
    background-color: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.detail-section h2 {
    margin-bottom: 20px;
    color: #4285f4;
    font-size: 20px;
}

.back-link {
    margin-bottom: 20px;
}

.detail-info {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.detail-row {
    display: flex;
    flex-direction: row;
    margin-bottom: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
    align-items: center;
    gap: 16px;
}

.detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-label {
    font-weight: bold;
    color: #555;
    min-width: 100px;
    flex-shrink: 0;
    font-size: 14px;
    text-align: left;
}

.detail-value {
    flex: 1;
    color: #333;
    font-size: 14px;
    word-break: break-all;
}

/* 代码样式 */
.detail-value code {
    background-color: #f1f3f4;
    padding: 4px 8px;
    border-radius: 3px;
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 13px;
    color: #d32f2f;
    word-break: break-all;
}

/* 详情行操作样式 */
.detail-row.detail-action {
    background-color: rgba(0, 0, 0, 0.02);
    padding: 12px;
    border-radius: 6px;
    border-bottom: none;
    margin-bottom: 12px;
    gap: 12px;
}

/* 状态控制样式 */
.status-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 详情按钮样式 */
.btn-detail {
    background-color: #2196f3;
    color: white;
    padding: 4px 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-detail:hover {
    background-color: #1976d2;
}

/* 操作列样式优化 */
.action-column {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 加载状态样式 */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* 响应式详情页面 */
@media (max-width: 768px) {
    .detail-section {
        padding: 16px;
    }
    
    .detail-info {
        padding: 16px;
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 0;
    }
    
    .detail-label {
        min-width: auto;
        width: 100%;
    }
    
    .detail-value {
        width: 100%;
    }
    
    .status-control {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .action-column {
        flex-direction: column;
        gap: 5px;
    }
}

/* 详情页面中编辑输入框样式 */
.detail-row .edit-input {
    width: 100%;
    max-width: 250px;
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.detail-row .edit-input:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

/* 应用程序数据表格样式 */
.detail-section .table-container {
    margin-top: 16px;
}

.detail-section table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 13px;
}

.detail-section th,
.detail-section td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

.detail-section th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #555;
    white-space: nowrap;
    font-size: 12px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.detail-section tr:hover {
    background-color: #f5f5f5;
}

/* 应用程序数据表格列宽 */
.detail-section th:nth-child(1), /* ID */
.detail-section td:nth-child(1) {
    width: 60px;
    text-align: center;
    white-space: nowrap;
    font-size: 12px;
}

.detail-section th:nth-child(2), /* 账号 */
.detail-section td:nth-child(2) {
    width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-section th:nth-child(3), /* 密码 */
.detail-section td:nth-child(3) {
    width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-section th:nth-child(4), /* 服务器 */
.detail-section td:nth-child(4) {
    width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-section th:nth-child(5), /* 结余 */
.detail-section td:nth-child(5) {
    width: 100px;
    text-align: right;
    white-space: nowrap;
    font-family: monospace;
}

.detail-section th:nth-child(6), /* 净值 */
.detail-section td:nth-child(6) {
    width: 100px;
    text-align: right;
    white-space: nowrap;
    font-family: monospace;
}

.detail-section th:nth-child(7), /* 上传时间 */
.detail-section td:nth-child(7) {
    width: 140px;
    white-space: nowrap;
    font-family: monospace;
    font-size: 12px;
}

.detail-section th:nth-child(8), /* IP地址 */
.detail-section td:nth-child(8) {
    width: 120px;
    white-space: nowrap;
    font-family: monospace;
    font-size: 12px;
}

/* 应用程序数据表格响应式设计 */
@media (max-width: 1024px) {
    .detail-section table {
        font-size: 12px;
    }
    
    .detail-section th,
    .detail-section td {
        padding: 6px;
    }
    
    /* 调整列宽 */
    .detail-section th:nth-child(2),
    .detail-section td:nth-child(2) {
        width: 100px;
    }
    
    .detail-section th:nth-child(3),
    .detail-section td:nth-child(3) {
        width: 120px;
    }
    
    .detail-section th:nth-child(4),
    .detail-section td:nth-child(4) {
        width: 120px;
    }
}

@media (max-width: 768px) {
    .detail-section .table-container {
        overflow-x: auto;
    }
    
    .detail-section table {
        min-width: 600px;
        font-size: 11px;
    }
    
    .detail-section th,
    .detail-section td {
        padding: 5px;
    }
}

/* 信息提示框样式 */
.info-box {
    background-color: #e3f2fd;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    border-left: 4px solid #2196f3;
    color: #1565c0;
    font-size: 14px;
}

/* ===== 加载状态 ===== */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ===== 辅助样式 ===== */
.action-buttons {
    display: flex;
    gap: 5px;
}

.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

/* ===== 响应式样式 ===== */
/* 大屏手机 (768px以下) */
@media (max-width: 768px) {
    /* 基础布局优化 */
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    h2 {
        font-size: 1.5em;
    }
    
    h3 {
        font-size: 1.1em;
    }
    
    /* 头部优化 */
    header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 15px;
        margin-bottom: 15px;
    }
    
    header h1 {
        font-size: 20px;
    }
    
    .header-right {
        flex-direction: column;
        gap: 10px;
    }
    
    /* 卡片布局优化 */
    .status-grid,
    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 15px;
    }
    
    .status-card,
    .stat-item {
        padding: 15px;
    }
    
    .status-card h3,
    .stat-item .stat-label {
        font-size: 12px;
    }
    
    .status-card .status-number,
    .stat-item .stat-number {
        font-size: 2em;
    }
    
    /* 表单优化 */
    .login-container {
        margin: 50px auto;
        padding: 20px;
    }
    
    .password-change-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    /* 搜索栏优化 */
    .search-bar {
        flex-direction: column;
        padding: 15px;
        margin-bottom: 15px;
    }
    
    /* 表格优化 */
    .table-container {
        overflow-x: auto;
        margin: 15px 0;
    }
    
    table {
        font-size: 13px;
    }
    
    th, td {
        padding: 8px 6px;
        font-size: 13px;
    }
    
    /* 操作按钮优化 */
    .btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .btn-delete {
        padding: 3px 6px;
        font-size: 11px;
    }
    
    /* API文档优化 */
    .api-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    pre {
        padding: 10px;
        font-size: 12px;
        overflow-x: auto;
    }
    
    ul {
        margin-left: 15px;
    }
}

/* 中等屏幕手机 (480px以下) */
@media (max-width: 480px) {
    /* 基础布局优化 */
    .container {
        padding: 8px;
    }
    
    /* 卡片布局优化 */
    .status-grid,
    .stats {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
    }
    
    /* 表格列宽优化 */
    th:nth-child(2), /* 硬件指纹 */
    td:nth-child(2) {
        width: 120px;
    }
    
    th:nth-child(4), /* 交易哈希 */
    td:nth-child(4) {
        width: 120px;
    }
    
    /* 操作列优化 */
    .action-column {
        flex-direction: column;
        gap: 3px;
    }
    
    /* 头部优化 */
    header {
        padding: 12px;
    }
    
    header h1 {
        font-size: 18px;
    }
}

/* 小屏幕手机 (320px以下) */
@media (max-width: 320px) {
    /* 基础样式优化 */
    body {
        font-size: 14px;
    }
    
    /* 表单优化 */
    .form-group input {
        padding: 10px;
        font-size: 14px;
    }
    
    /* 表格优化 */
    table {
        min-width: 600px;
    }
    
    /* 按钮优化 */
    .btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .admin-link {
        padding: 10px 20px;
        font-size: 1em;
    }
}

/* 优化移动端触摸体验 */
@media (hover: none) {
    /* 移除悬停效果，因为移动端没有悬停 */
    tr:hover {
        background-color: transparent;
    }
    
    /* 增强按钮的可点击区域 */
    .btn {
        min-height: 36px;
        min-width: 72px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 表单元素增强 */
    input, button, select, textarea {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        cursor: pointer;
    }
}

/* 强制表格水平滚动 */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* 优化iOS滚动体验 */
}

/* 优化iOS设备上的字体渲染 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* 优化横屏显示 */
@media (orientation: landscape) {
    .status-grid,
    .stats {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .table-container {
        overflow-x: auto;
    }
}
