/**
 * 火车票模块样式
 */

/* ====== 搜索区域 ====== */
.train-search-box {
    background: linear-gradient(135deg, #2C5F8A, #1a8a6e);
    padding: 20px 16px 24px;
    margin: 0;
}
.train-search-title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}
.train-search-title i {
    margin-right: 8px;
}
.train-search-form {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.train-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}
.train-row:last-child {
    margin-bottom: 0;
}
.train-input-wrap {
    flex: 1;
    position: relative;
}
.train-input-wrap label {
    display: block;
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
}
.train-input-wrap input {
    width: 100%;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 15px;
    color: #333;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}
.train-input-wrap input:focus {
    border-color: #2C5F8A;
}
.train-swap-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 16px 8px 0;
    border: 1px solid #e8e8e8;
    border-radius: 50%;
    color: #2C5F8A;
    cursor: pointer;
    transition: transform 0.3s;
    flex-shrink: 0;
}
.train-swap-btn:active {
    transform: rotate(180deg);
}
.train-search-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #2C5F8A, #1a8a6e);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin: 16px 0 0 12px;
    white-space: nowrap;
    flex-shrink: 0;
}
.train-search-btn:active {
    opacity: 0.9;
}

/* ====== 车站下拉 ====== */
.train-station-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}
.train-station-header {
    padding: 8px 12px;
    font-size: 11px;
    color: #999;
    border-bottom: 1px solid #f0f0f0;
}
.train-station-item {
    padding: 10px 12px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f5f5f5;
}
.train-station-item:last-child {
    border-bottom: none;
}
.train-station-item:active {
    background: #f0f7ff;
}

/* ====== 空状态 ====== */
.train-empty-state {
    text-align: center;
    padding: 60px 20px;
}
.train-empty-state p {
    font-size: 14px;
    color: #999;
    margin: 12px 0 0;
}

/* ====== 加载动画 ====== */
.train-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e8e8e8;
    border-top-color: #2C5F8A;
    border-radius: 50%;
    animation: train-spin 0.8s linear infinite;
    margin: 0 auto;
}
@keyframes train-spin {
    to { transform: rotate(360deg); }
}

/* ====== 结果头部 ====== */
.train-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

/* ====== 车次卡片 ====== */
.train-card {
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: box-shadow 0.2s;
}
.train-card:active {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.train-card-top {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}
.train-card-left {
    display: flex;
    align-items: center;
    margin-right: 12px;
    min-width: 50px;
}
.train-no {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}
.train-type-label {
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
    color: #fff;
}
.train-type-g { background: #2C5F8A; }
.train-type-d { background: #1a8a6e; }
.train-type-c { background: #5b8ff9; }
.train-type-z { background: #722ed1; }
.train-type-t { background: #fa541c; }
.train-type-k { background: #fa8c16; }
.train-type-normal { background: #8c8c8c; }

.train-card-center {
    flex: 1;
    display: flex;
    align-items: center;
}
.train-time-block {
    display: flex;
    flex-direction: column;
}
.train-time {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}
.train-station-name {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}
.train-pass-tag {
    display: inline-block;
    width: 14px;
    height: 14px;
    line-height: 14px;
    text-align: center;
    font-size: 9px;
    background: #e6f7ff;
    color: #2C5F8A;
    border-radius: 2px;
    margin-right: 2px;
}
.train-duration {
    flex: 1;
    text-align: center;
    padding: 0 8px;
    position: relative;
}
.train-duration-text {
    font-size: 12px;
    color: #999;
}
.train-duration-line {
    height: 1px;
    background: #e0e0e0;
    margin: 4px 0;
    position: relative;
}
.train-duration-line::after {
    content: '';
    position: absolute;
    right: -2px;
    top: -3px;
    width: 0;
    height: 0;
    border-left: 5px solid #e0e0e0;
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
}
.train-next-day {
    font-size: 10px;
    color: #ff4d4f;
}

/* ====== 座位信息 ====== */
.train-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.train-seats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}
.train-seat-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    background: #f0f7ff;
    color: #2C5F8A;
    border-radius: 4px;
}
.train-seat-none {
    background: #fff7e6;
    color: #fa8c16;
}
.train-status-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}
.status-pause {
    background: #fff2e8;
    color: #fa541c;
}
.status-presale {
    background: #e6f7ff;
    color: #1890ff;
}
.status-stopped {
    background: #fff1f0;
    color: #ff4d4f;
}

/* ====== 车次详情 ====== */
.train-detail-section {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}
.train-detail-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}
.train-detail-title i {
    margin-right: 6px;
    color: #2C5F8A;
}

/* ====== 票价网格 ====== */
.train-price-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.train-price-item {
    flex: 1;
    min-width: 80px;
    background: #f0f7ff;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}
.train-price-disabled {
    background: #f5f5f5;
    opacity: 0.6;
}
.train-price-name {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}
.train-price-value {
    font-size: 20px;
    font-weight: 700;
    color: #2C5F8A;
}
.train-price-stock {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}
.train-price-sub {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

/* ====== 经停站列表 ====== */
.train-stops-list {
    padding-left: 4px;
}
.train-stop-item {
    display: flex;
    align-items: stretch;
    min-height: 40px;
}
.train-stop-dot-col {
    width: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}
.train-stop-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d9d9d9;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #d9d9d9;
    flex-shrink: 0;
    margin-top: 4px;
}
.dot-first, .dot-last {
    background: #2C5F8A;
    box-shadow: 0 0 0 1px #2C5F8A;
    width: 12px;
    height: 12px;
}
.train-stop-line {
    width: 2px;
    flex: 1;
    background: #e8e8e8;
    margin: 2px 0;
}
.train-stop-info {
    flex: 1;
    padding: 2px 0 12px 8px;
}
.train-stop-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}
.stop-highlight-from .train-stop-name,
.stop-highlight-to .train-stop-name {
    color: #2C5F8A;
    font-weight: 600;
}
.stop-tag {
    display: inline-block;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
    color: #fff;
}
.tag-from { background: #52c41a; }
.tag-to { background: #ff4d4f; }
.train-stop-times {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}
