:root {
    --bg-gradient-start: #0f0c29;
    --bg-gradient-mid: #302b63;
    --bg-gradient-end: #24243e;
    --primary-color: #7f5af0;
    --primary-hover: #6246ea;
    --secondary-bg: rgba(255, 255, 255, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-main: #fffffe;
    --text-muted: #94a1b2;
    --success-color: #2cb67d;
    --danger-color: #ef4565;
    --warning-color: #ff8906;
    --info-color: #3da9fc;
    --card-radius: 16px;
    --transition-speed: 0.3s;
}

body {
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-mid), var(--bg-gradient-end));
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    font-family: 'Inter', 'Segoe UI', "PingFang SC", system-ui, sans-serif;
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 导航栏 */
nav {
    background: rgba(15, 12, 41, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo .icon {
    font-size: 28px;
    filter: drop-shadow(0 0 8px rgba(127, 90, 240, 0.5));
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0;
    background: linear-gradient(to right, #fff, #94a1b2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 16px;
}

.logout-btn {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px 20px;
    border-radius: 50px;
    background: var(--secondary-bg);
    border: 1px solid var(--glass-border);
    transition: all var(--transition-speed);
}

.logout-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(127, 90, 240, 0.3);
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 24px;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
}

h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    position: relative;
    padding-left: 16px;
}

h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 24px;
    width: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* 通用按钮 */
button {
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-speed);
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* 主按钮 */
.btn-primary {
    background: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(127, 90, 240, 0.4);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(127, 90, 240, 0.6);
}

/* 任务卡片网格 */
.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.task-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all var(--transition-speed);
    position: relative;
    overflow: hidden;
}

.task-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.task-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
}

.status-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background: rgba(44, 182, 125, 0.2);
    color: #2cb67d;
    border: 1px solid rgba(44, 182, 125, 0.3);
}

.status-inactive {
    background: rgba(148, 161, 178, 0.2);
    color: #94a1b2;
    border: 1px solid rgba(148, 161, 178, 0.3);
}

.task-info {
    flex-grow: 1;
    margin-bottom: 20px;
}

.task-info p {
    margin: 8px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-info strong {
    color: #d1d1d6;
    font-weight: 500;
    min-width: 40px;
}

/* 操作按钮组 - 修改为两行布局 */
.task-actions {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 第一行两个按钮 */
    gap: 10px;
    border-top: 1px solid var(--glass-border);
    padding-top: 20px;
}

.task-actions button {
    padding: 8px 0;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    width: 100%;
}

/* 按钮变体 */

/* Secondary (幽灵按钮 - 用于取消/编辑) */
.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(148, 161, 178, 0.3);
}
.btn-secondary:hover { 
    background: rgba(255, 255, 255, 0.08); 
    color: var(--text-main);
    border-color: var(--text-muted);
}

/* Success (运行) */
.btn-success {
    background: rgba(44, 182, 125, 0.15);
    color: #2cb67d;
    border: 1px solid rgba(44, 182, 125, 0.2);
}
.btn-success:hover { 
    background: #2cb67d; 
    color: white; 
}

/* Danger (删除) */
.btn-danger {
    background: rgba(239, 69, 101, 0.15);
    color: #ef4565;
    border: 1px solid rgba(239, 69, 101, 0.2);
}
.btn-danger:hover {
    background: #ef4565;
    color: white;
}

/* Warning (暂停) */
.btn-warning {
    background: rgba(255, 137, 6, 0.15);
    color: #ff8906;
    border: 1px solid rgba(255, 137, 6, 0.2);
}
.btn-warning:hover {
    background: #ff8906;
    color: white;
}

/* Info (启用) */
.btn-info {
    background: rgba(61, 169, 252, 0.15);
    color: #3da9fc;
    border: 1px solid rgba(61, 169, 252, 0.2);
}
.btn-info:hover {
    background: #3da9fc;
    color: white;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: #24243e;
    border: 1px solid var(--glass-border);
    margin: 8vh auto;
    padding: 32px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-main);
    padding: 0;
}
.modal-header h2::before { display: none; }

.close {
    color: var(--text-muted);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}
.close:hover { color: var(--text-main); }

/* 表单样式 */
.form-group { margin-bottom: 20px; }

label {
    display: block;
    margin-bottom: 8px;
    color: #d1d1d6;
    font-size: 0.9rem;
    font-weight: 500;
}

input[type="text"], input[type="password"], select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(127, 90, 240, 0.2);
}

/* 登录页专用 */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    padding: 48px;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.login-card h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    background: linear-gradient(to right, #fff, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-card .subtitle {
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 0.95rem;
}

.login-card .btn-primary {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
    height: 48px;
}

.cron-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.preset-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    transition: all 0.2s;
}

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

.help-text {
    display: block;
    margin-top: 8px;
    font-size: 0.8rem;
    color: #6c757d;
}

.alert {
    background: rgba(239, 69, 101, 0.2);
    color: #ef4565;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid rgba(239, 69, 101, 0.3);
    font-size: 0.9rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
}
