/* style.css - 极光玻璃主题，适用于 POE 市集监控 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-color: #00e0ff;
    --secondary-color: #ff66cc;
    --success-color: #a0ff66;
    --warning-color: #ffaa33;
    --light-color: #1a1f2e;
    --dark-color: #0a0c14;
    --border-radius: 24px;
    --box-shadow: 0 20px 40px rgba(0, 224, 255, 0.2);
    --danger-color: #ff4d6d;
    --info-color: #66b0ff;
    --bg-dark: #0d0f1a;
    --card-bg: rgba(20, 30, 50, 0.01);      /* 背景透明度，可调整最后一个值 */
    --blur-amount: 0.1px;                    /* 毛玻璃模糊半径，可修改 */
    --text-light: #e0f0ff;
    --text-muted: #aac0dd;
}

body {
    background: linear-gradient(145deg, rgba(255,249,240,0.3), rgba(255,240,231,0.3)), 
                url('night2.jpg') center/cover fixed;
    background-blend-mode: overlay;
    color: var(--text-light);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 头部 */
.app-header {
    padding: 20px;
    background: var(--card-bg);
    backdrop-filter: blur(var(--blur-amount));
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    position: relative;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.15);
    border-top: 1px solid rgba(255,255,255,0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header-title h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0;
}

.user-area {
    display: flex;
    gap: 10px;
    align-items: center;
}

.user-area button, .user-area span {
    padding: 8px 20px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--primary-color);
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.user-area button:hover {
    background: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
    box-shadow: 0 0 25px var(--primary-color);
}

/* 卡片通用样式 */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--blur-amount));
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    border-top: 1px solid rgba(255,255,255,0.2);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 50px rgba(0,224,255,0.3);
    border-color: rgba(0,224,255,0.4);
}

.card h2, .card h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 1.4rem;
}

/* 目标卡片内的统计数据 */
.target-stats {
    display: flex;
    gap: 20px;
    margin: 10px 0;
    font-size: 0.9rem;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 8px 12px;
}
.target-stats span {
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 5px;
}
.target-stats .stat-value {
    color: var(--primary-color);
    font-weight: bold;
}

/* 目标卡片 */
.target-item {
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(255,255,255,0.1);
}

.target-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.target-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.target-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

/* 表单元素 */
input, select, textarea {
    width: 100%;
    padding: 10px 15px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-light);
    border-radius: 30px;
    font-size: 1rem;
    transition: all 0.3s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px var(--primary-color);
    outline: none;
    background: rgba(0,0,0,0.5);
}

.btn {
    padding: 8px 16px;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-light);
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-primary {
    background: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
}
.btn-primary:hover {
    background: transparent;
    color: var(--primary-color);
    box-shadow: 0 0 25px var(--primary-color);
}
.btn-danger {
    border-color: var(--danger-color);
    color: var(--danger-color);
}
.btn-danger:hover {
    background: var(--danger-color);
    color: #000;
}
.btn-success {
    border-color: var(--success-color);
    color: var(--success-color);
}
.btn-success:hover {
    background: var(--success-color);
    color: #000;
}
.btn-sm {
    padding: 5px 12px;
    font-size: 0.85rem;
}

/* 开关 */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 8px;
}
.toggle-switch input {
    width: 40px;
    height: 20px;
    appearance: none;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    position: relative;
    outline: none;
    cursor: pointer;
    transition: 0.3s;
    margin: 0;
}
.toggle-switch input:checked {
    background: var(--primary-color);
}
.toggle-switch input::before {
    content: '';
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 1px;
    left: 1px;
    transition: 0.3s;
}
.toggle-switch input:checked::before {
    left: 21px;
}

/* 历史事件列表（底部全宽） */
.history-section {
    margin-top: 20px;
}
.event-list {
    max-height: 500px;
    overflow-y: auto;
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    padding: 5px;
}
.event-item {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.event-item:last-child {
    border-bottom: none;
}
.event-type {
    font-weight: bold;
    display: inline-block;
    width: 80px;
}
.event-type.listed { color: var(--success-color); }
.event-type.sold { color: var(--danger-color); }
.event-type.price_change { color: var(--warning-color); }

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal.active {
    display: flex;
}
.modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    border-radius: 32px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 30px 60px rgba(0,224,255,0.3);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-title {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}
.close-btn:hover {
    color: var(--primary-color);
}

/* 消息提示 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 40px;
    backdrop-filter: blur(16px);
    z-index: 2000;
    font-weight: 500;
    max-width: 300px;
    animation: slideIn 0.3s ease;
}
.message-success { background: rgba(160,255,102,0.3); color: #d0ffb0; border: 1px solid var(--success-color); }
.message-error { background: rgba(255,77,109,0.3); color: #ffb0b0; border: 1px solid var(--danger-color); }
.message-info { background: rgba(102,176,255,0.3); color: #b0e0ff; border: 1px solid var(--info-color); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 表单组 */
.form-group {
    margin-bottom: 15px;
}
label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-muted);
}

/* 强制底部筛选栏一行显示，超出时水平滚动（保证不换行且可查看所有选项） */
.history-section .card > div:first-child {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
    overflow-x: auto;
    padding-bottom: 5px; /* 为滚动条留出空间 */
}
/* 让 select 和按钮不缩小，避免换行 */
.history-section .card select,
.history-section .card button {
    flex-shrink: 0;
}
/* 屏幕较窄时允许滚动，但不会换行 */
@media (max-width: 700px) {
    .history-section .card > div:first-child {
        flex-wrap: nowrap;   /* 保证不换行 */
        overflow-x: auto;
    }
}
.history-section .card .history-filters {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    align-items: center;
    margin-bottom: 15px;
}
.history-section .card select {
    flex: 1 1 0;          /* 平均分配宽度 */
    min-width: 140px;     /* 保持最小宽度，避免过短 */
    width: auto;          /* 允许根据内容调整 */
}
.history-section .card button {
    flex-shrink: 0;
    white-space: nowrap;  /* 按钮文字不换行 */
}