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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    margin: 0;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    min-height: 100vh;
    padding: 20px;
}

/* 主应用页面样式 */
/* 头部容器 */
.header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
    position: relative;
    height: 80px;
    background: white;
    border-radius: 16px;
    padding: 0 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 头部标题 */
.header h1 {
    text-align: center;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 2px;
}

/* 通用标题样式 */
h1 {
    text-align: center;
    color: #1f2937;
}

/* 主容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 提示信息 */
.note {
    background: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    padding: 14px 18px;
    margin: 20px;
    color: #4c1d95;
    font-size: 14px;
}

/* 内容区域 */
.tab-content {
    padding: 28px;
}

/* 页面头部 */
.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* 页面头部标题 */
.tab-header h2 {
    margin: 0;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 24px;
    font-weight: 700;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 表格单元格 */
th, td {
    padding: 16px 14px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

/* 表格表头 */
th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #475569;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #e2e8f0;
}

/* 表格行悬停效果 */
tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    transform: scale(1.001);
}

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

td {
    color: #475569;
    font-size: 14px;
}

/* PID列样式 - 只显示后8位，悬停显示完整 */
.pid-cell {
    position: relative;
    cursor: help;
}

.pid-cell .pid-short {
    display: inline;
}

.pid-cell .pid-full {
    display: none;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: #1f2937;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 1000;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pid-cell:hover .pid-full {
    display: block;
}

.pid-cell .pid-full::before {
    content: '';
    position: absolute;
    left: 10px;
    bottom: -4px;
    width: 8px;
    height: 8px;
    background: #1f2937;
    transform: rotate(45deg);
}

/* PID名称列样式 - 只显示前4个字符+省略号，悬停显示完整 */
.pid-name-cell {
    position: relative;
    cursor: help;
}

.pid-name-cell .pid-name-short {
    display: inline;
}

.pid-name-cell .pid-name-full {
    display: none;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: #1f2937;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 1000;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pid-name-cell:hover .pid-name-full {
    display: block;
}

.pid-name-cell .pid-name-full::before {
    content: '';
    position: absolute;
    left: 10px;
    bottom: -4px;
    width: 8px;
    height: 8px;
    background: #1f2937;
    transform: rotate(45deg);
}

/* 表单组 */
.form-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

/* 表单组样式 */
#trend .form-group {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    margin-bottom: 0;
}

/* 表单项目 */
#trend .form-group .form-item {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
}

/* 表单标签 */
#trend .form-group label {
    display: flex;
    align-items: center;
    width: auto;
    font-weight: 600;
    color: #475569;
    margin: 0;
    white-space: nowrap;
    font-size: 14px;
    height: 40px;
}

/* 表单输入框 */
#trend .form-group input,
#trend .form-group select {
    padding: 10px 14px;
    width: 220px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    height: 40px;
    box-sizing: border-box;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f8fafc;
    font-family: inherit;
    line-height: normal;
}

#trend .form-group select {
    width: 240px;
}

#trend .form-group input:focus,
#trend .form-group select:focus {
    outline: none;
    border-color: #6366f1;
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* 下拉菜单特殊样式 */
#trend .form-group .form-item:has(select) {
    position: relative;
}

#trend .form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #f8fafc;
    padding-right: 40px;
    cursor: pointer;
    color: #1f2937;
    font-weight: 500;
}

/* 使用伪元素添加箭头 */
#trend .form-group .form-item:has(select)::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
}

#trend .form-group select:hover {
    border-color: #a855f7;
    background-color: white;
}

#trend .form-group select:focus {
    background-color: white;
}

/* 日期输入框特殊样式 */
#trend .form-group input[type="date"] {
    width: 200px;
    cursor: pointer;
    position: relative;
    font-family: inherit;
    color: #1f2937;
}

/* 日期输入框图标优化 */
#trend .form-group input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    filter: invert(0.5) sepia(1) saturate(5) hue-rotate(220deg);
}

#trend .form-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* 表单按钮 */
#trend .form-group button {
    margin: 0;
    height: 40px;
    box-sizing: border-box;
}

/* 按钮样式 */
.btn {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* 按钮悬停效果 */
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn:active {
    transform: translateY(0);
}

/* 下载按钮 */
.btn-download {
    margin: 0;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-download:hover {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-download::before {
    content: '⬇';
    font-size: 16px;
}

/* 重置按钮 */
.btn-reset {
    background: white;
    color: #64748b;
    padding: 10px 24px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-right: 8px;
}

/* 重置按钮悬停效果 */
.btn-reset:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 统计卡片容器 */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

/* 统计卡片 */
.stat-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 24px;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1 0%, #a855f7 100%);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

/* 统计卡片标题 */
.stat-card h3 {
    margin: 0 0 12px 0;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 统计卡片数据 */
.stat-card p {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 图表容器 */
.chart-container {
    position: relative;
    margin: 24px 0;
    padding: 32px 28px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

/* 趋势图表 */
#trendChart {
    max-height: 420px;
    width: 100%;
}

/* 日期选择器弹出框样式优化 */
input[type="date"]::-webkit-datetime-edit {
    padding: 0;
    color: #1f2937;
    font-weight: 500;
}

input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}

input[type="date"]::-webkit-datetime-edit-text {
    color: #64748b;
    padding: 0 2px;
}

input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
    color: #1f2937;
    font-weight: 500;
}

input[type="date"]::-webkit-datetime-edit-month-field:focus,
input[type="date"]::-webkit-datetime-edit-day-field:focus,
input[type="date"]::-webkit-datetime-edit-year-field:focus {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    border-radius: 4px;
    outline: none;
}

/* 清除按钮样式 */
input[type="date"]::-webkit-clear-button {
    display: none;
}

/* 内部旋转按钮样式 */
input[type="date"]::-webkit-inner-spin-button {
    display: none;
}

/* 日期输入框占位符 */
input[type="date"]:invalid {
    color: #94a3b8;
}