/* ===== 现代化脚本管理系统样式 ===== */
:root {
    --primary-color: #4361ee;
    --primary-dark: #3a56d4;
    --secondary-color: #7209b7;
    --success-color: #4cc9f0;
    --warning-color: #f8961e;
    --danger-color: #f72585;
    --light-bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #2b2d42;
    --text-secondary: #8d99ae;
    --border-color: #e9ecef;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== 容器布局 ===== */
.container-main {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 20px;
}

/* ===== 头部样式 ===== */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDown 0.6s ease-out;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #1a1a1a !important;
}

.header h1::before {
    content: "⚡";
    font-size: 1.4rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info .badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    color: #1a1a1a !important;
    font-weight: 600;
}

/* ===== 卡片样式 ===== */
.card {
    background: var(--card-bg);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    margin-bottom: 2rem;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(to right, #f8f9fa, #e9ecef);
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.card-title {
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.card-body {
    padding: 2rem;
}

/* ===== 表单样式 ===== */
.form-card {
    animation: fadeInUp 0.5s ease-out;
}

.form-floating > label {
    color: var(--text-secondary);
}

.form-control {
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--light-bg);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
    background: white;
}

.form-control::placeholder {
    color: #adb5bd;
}

.input-group {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.input-group .form-control {
    border: none;
}

.input-group .btn {
    z-index: 1;
}

/* ===== 按钮样式 ===== */
.btn {
    padding: 0.8rem 1.8rem;
    border-radius: 10px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #6309a5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #ff9a00, #ff6b00);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ===== 表格样式 ===== */
.table-responsive {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table {
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    background: var(--card-bg);
}

.table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.table thead th {
    border: none;
    padding: 1.25rem;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.table thead th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
}

.table tbody tr {
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

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

.table tbody tr:hover {
    background: linear-gradient(to right, rgba(67, 97, 238, 0.03), transparent);
    transform: translateX(4px);
}

.table td {
    padding: 1.25rem;
    vertical-align: middle;
    border-top: 1px solid var(--border-color);
    position: relative;
}

/* 状态指示器 */
.status-indicator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 2px 0 0 2px;
}

.status-expired {
    background: linear-gradient(to bottom, var(--danger-color), #ff0a54);
}

.status-warning {
    background: linear-gradient(to bottom, var(--warning-color), #ff9500);
}

.status-safe {
    background: linear-gradient(to bottom, var(--success-color), #00b4d8);
}

.status-today {
    background: linear-gradient(to bottom, #ff9a00, #ff6b00);
}

/* 徽章样式 */
.badge {
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badge-danger {
    background: linear-gradient(135deg, var(--danger-color), #ff0a54);
    color: white;
    animation: pulse-danger 2s infinite;
}

.badge-warning {
    background: linear-gradient(135deg, var(--warning-color), #ff9500);
    color: white;
}

.badge-success {
    background: linear-gradient(135deg, var(--success-color), #00b4d8);
    color: white;
}

.badge-today {
    background: linear-gradient(135deg, #ff9a00, #ff6b00);
    color: white;
    animation: pulse 1.5s infinite;
}

/* 剩余天数显示 */
.days-count {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 700;
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: inline-block;
    min-width: 80px;
    text-align: center;
    background: rgba(0, 0, 0, 0.02);
}

.days-expired {
    color: var(--danger-color);
    background: rgba(247, 37, 133, 0.1);
}

.days-warning {
    color: var(--warning-color);
    background: rgba(248, 150, 30, 0.1);
}

.days-safe {
    color: var(--success-color);
    background: rgba(76, 201, 240, 0.1);
}

.days-today {
    color: #ff6b00;
    background: rgba(255, 107, 0, 0.1);
    animation: pulse-glow 2s infinite;
}

/* ===== 操作按钮组 ===== */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding-top: 25px !important;    /* 新增：上内边距，!important确保优先级 */
    padding-bottom: 25px !important; /* 新增：下内边距，!important确保优先级 */
}

/* ===== 消息提示 ===== */
.alert {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    animation: slideInRight 0.4s ease-out;
}

.alert::before {
    font-size: 1.2rem;
}

.alert-success {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: white;
}

.alert-danger {
    background: linear-gradient(135deg, #f87171, #ef4444);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

/* ===== 自定义模态框样式 ===== */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.custom-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.custom-modal {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    max-width: 450px;
    width: 100%;
    overflow: hidden;
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-modal-overlay.active .custom-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* 模态框头部 */
.modal-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #4361ee, #7209b7);
    color: white;
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: float 20s linear infinite;
    opacity: 0.2;
}

@keyframes float {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    animation: pulse 2s infinite;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.modal-title::before {
    content: '⚠️';
    font-size: 1.8rem;
}

/* 模态框内容 */
.modal-content {
    padding: 2rem;
    text-align: center;
}

.modal-message {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #495057;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

.modal-details {
    background: rgba(67, 97, 238, 0.05);
    border-radius: 12px;
    padding: 1rem;
    margin: 1.5rem 0;
    border-left: 4px solid #4361ee;
    text-align: left;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 0;
    color: #6c757d;
    font-size: 0.95rem;
}

.detail-item i {
    color: #4361ee;
    width: 20px;
    text-align: center;
}

/* 模态框底部按钮 */
.modal-footer {
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-btn {
    padding: 0.8rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.modal-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.modal-btn:hover::before {
    width: 300px;
    height: 300px;
}

.modal-btn-confirm {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    color: white;
    box-shadow: 0 6px 20px rgba(255, 65, 108, 0.3);
}

.modal-btn-confirm:hover {
    background: linear-gradient(135deg, #ff2b5e, #ff3333);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 65, 108, 0.4);
}

.modal-btn-cancel {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
}

.modal-btn-cancel:hover {
    background: linear-gradient(135deg, #5a6268, #343a40);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(108, 117, 125, 0.4);
}

/* 危险操作特殊样式 */
.danger-modal .modal-header {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
}

.danger-modal .modal-title::before {
    content: '🔥';
}

.danger-modal .modal-btn-confirm {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    animation: danger-pulse 1.5s infinite;
}

@keyframes danger-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 6px 20px rgba(255, 65, 108, 0.3);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 8px 25px rgba(255, 65, 108, 0.4);
    }
}

/* 成功操作特殊样式 */
.success-modal .modal-header {
    background: linear-gradient(135deg, #4ade80, #22c55e);
}

.success-modal .modal-title::before {
    content: '✅';
}

.success-modal .modal-btn-confirm {
    background: linear-gradient(135deg, #4ade80, #22c55e);
}

/* 警告操作特殊样式 */
.warning-modal .modal-header {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.warning-modal .modal-title::before {
    content: '⚠️';
}

.warning-modal .modal-btn-confirm {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

/* 加载状态 */
.modal-loading {
    display: none;
    text-align: center;
    padding: 2rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4361ee;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* ===== 动画效果 ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes pulse-danger {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(247, 37, 133, 0.4);
    }
    70% { 
        box-shadow: 0 0 0 10px rgba(247, 37, 133, 0);
    }
}

@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 0 0 15px rgba(255, 107, 0, 0.3);
    }
    50% { 
        box-shadow: 0 0 25px rgba(255, 107, 0, 0.5);
    }
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .container-main {
        padding: 0 15px;
        margin: 1rem auto;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .table-responsive {
        border-radius: 8px;
    }
    
    .table thead {
        display: none;
    }
    
    .table, .table tbody, .table tr, .table td {
        display: block;
        width: 100%;
    }
    
    .table tr {
        margin-bottom: 1rem;
        border-radius: 8px;
        box-shadow: var(--shadow);
        position: relative;
        padding: 1rem;
    }
    
    .table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border: none;
        padding: 0.75rem 1rem;
    }
    
    .table td::before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        width: calc(50% - 1rem);
        text-align: left;
        font-weight: 600;
        color: var(--primary-color);
    }
    
    .status-indicator {
        width: 100%;
        height: 4px;
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        border-radius: 8px 8px 0 0;
    }
    
    .action-buttons {
        justify-content: center;
        margin-top: 1rem;
        padding-top: 15px !important;    /* 移动端适配：减小内边距 */
        padding-bottom: 15px !important;
    }
    
    .days-count {
        min-width: 60px;
        font-size: 1rem;
    }
    
    .custom-modal {
        margin: 20px;
    }
    
    .modal-header {
        padding: 1.2rem 1.5rem;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .modal-btn {
        width: 100%;
    }
}

/* ===== 工具类 ===== */
.shadow-sm { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important; }
.shadow-md { box-shadow: var(--shadow) !important; }
.shadow-lg { box-shadow: var(--shadow-hover) !important; }

.rounded-xl { border-radius: var(--radius) !important; }

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===== 登录页面样式 ===== */
.login-container {
    max-width: 420px;
    margin: 5rem auto;
    animation: fadeIn 0.8s ease-out;
}

.login-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2.5rem 2rem;
    text-align: center;
}

.login-header h2 {
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.login-body {
    padding: 2.5rem;
}

.login-footer {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 在现有的style.css末尾添加 */

/* 筛选按钮样式 */
.status-filter-buttons .btn-group {
    flex-wrap: wrap;
}

.status-filter-buttons .btn-check:checked + .btn {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 计数徽章 */
.status-filter-buttons .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    min-width: 1.5rem;
}

/* 可见计数器 */
.visible-counter {
    background: linear-gradient(to right, rgba(67, 97, 238, 0.05), rgba(114, 9, 183, 0.05));
    padding: 0.75rem;
    border-radius: 8px;
    margin: 0.5rem 0;
    border-left: 3px solid var(--primary-color);
    animation: fadeIn 0.3s ease;
}

/* 空状态样式 */
.empty-state {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.empty-state i {
    animation: pulse 2s infinite;
}

/* 搜索框 */
#scriptSearch {
    border-radius: 20px !important;
    padding-left: 2rem;
}

#scriptSearch:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.25);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .status-filter-buttons {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .status-filter-buttons .btn-group {
        flex-wrap: nowrap;
        min-width: max-content;
    }
    
    .visible-counter {
        font-size: 0.85rem;
        padding: 0.5rem;
    }
}

/* 动画 */
@keyframes countUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.status-filter-buttons .badge {
    transition: all 0.3s ease;
}

.status-filter-buttons .badge.updated {
    animation: countUpdate 0.3s ease;
}

/* 状态摘要样式 */
#statusSummary span {
    font-weight: 600;
    margin: 0 0.25rem;
}

#statusSummary .text-danger {
    background: rgba(247, 37, 133, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

#statusSummary .text-warning {
    background: rgba(248, 150, 30, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

#statusSummary .text-success {
    background: rgba(76, 201, 240, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

/* 模态框详情项样式优化 */
.modal-details {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0d6efd;
}

.detail-item {
    display: flex;
    align-items: center;
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.detail-item i {
    width: 18px;
    text-align: center;
}

/* 模态框按钮样式优化 */
.modal-btn {
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    border: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.modal-btn-cancel {
    background: #6c757d;
    color: white;
}

.modal-btn-confirm {
    background: #dc3545;
    color: white;
}

.modal-btn-cancel:hover {
    background: #5a6268;
}

.modal-btn-confirm:hover {
    background: #bb2d3b;
}

/* 关闭多余的叉号 */
.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
}

.modal-close-btn:hover {
    color: #dc3545;
}