@font-face {
    font-family: 'Swis721';
    src: url('/fonts/fangzheng_GBK.TTF') format('truetype');
}

body {
    font-family: "Swis721", "SimHei" , sans-serif;
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: #f5f7fa;
    /* background-image: linear-gradient(to bottom, #f5f7fa 0%, #e4e8ed 100%); */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}

body.custom-bg::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    background-attachment: fixed;
    filter: blur(5px);
    z-index: -1;
}

body.custom-bg::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: -1;
}

.navbar, .search-box input, .autocomplete-items, .line-info, .about-content {
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.navbar {
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #007ACC 0%, #00A3FF 100%);
    padding: 15px 30px;
    border-bottom: 2px solid #007ACC;
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.navbar:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.navbar a {
    text-decoration: none;
    color: white;
    font-weight: bold;
    font-size: 18px;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.navbar a:hover {
    color: #ffeba7;
    transform: scale(1.05);
}

.navbar img {
    height: 40px;
    width: 120px;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.navbar img:hover {
    transform: scale(1.05);
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #007ACC;
    font-family: SimHei;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
    background: linear-gradient(to right, #007ACC, #00A3FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2.2em;
    animation: fadeIn 0.8s ease-in-out;
}

.search-box {
    display: flex;
    gap: 10px;
    margin: 30px 0;
    animation: slideUp 0.5s ease-out;
}

input,
select {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #d1d9e6;
    border-radius: 8px;
    font-size: 16px;
    background: #f0f4f8;
    transition: all 0.3s ease;
    box-shadow: inset 2px 2px 5px #d1d9e6, 
                inset -2px -2px 5px #ffffff;
}

input:focus,
select:focus {
    border-color: #6e8efb;
    box-shadow: 0 0 10px rgba(110, 142, 251, 0.5),
                inset 2px 2px 5px #d1d9e6, 
                inset -2px -2px 5px #ffffff;
    outline: none;
    background: white;
}



button {
    padding: 12px 25px;
    background: linear-gradient(135deg, #007ACC 0%, #00A3FF 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 4px 8px rgba(254, 180, 123, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 163, 255, 0.4);
    background: linear-gradient(135deg, #007ACC 0%, #00A3FF 100%);
}

button:active {
    transform: translateY(0);
}

.result {
    margin-top: 20px;
    animation: fadeIn 0.6s ease-out;
}

.station-name {
    font-size: 28px;
    margin-bottom: 20px;
    color: #2c3e50;
    font-weight: bold;
    text-align: center;
    position: relative;
    padding-bottom: 10px;
}

.station-name:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25%;
    width: 50%;
    height: 3px;
    background: linear-gradient(to right, #007ACC, #00A3FF);
    border-radius: 3px;
}

.line-info {
    padding: 20px;
    margin: 15px 0;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.line-info:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.line-info h3 {
    margin: 0;
    font-size: 22px;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.line-info:before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255,255,255,0.3) 0%,
        rgba(255,255,255,0) 60%
    );
    transform: rotate(30deg);
}

.autocomplete-items {
    border: 2px solid #d1d9e6;
    border-radius: 8px;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s ease-out;
    max-height: 300px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.7);
}

.autocomplete-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid #eaeef2;
    transition: all 0.2s ease;
    transform: translateX(0);
}

.autocomplete-item strong {
    color: #808080;
    margin-right: 8px;
}

.autocomplete-item:hover {
    background: rgba(255, 255, 255, 0.85);
    transform: translateX(5px);
    margin-right: 5px;
}

table {
    width: 100%;
    margin: 20px auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-collapse: separate;
    border-spacing: 0;
    animation: fadeIn 0.7s ease-out;
}

thead {
    background: linear-gradient(135deg, #007ACC 0%, #00A3FF 100%);
    color: white;
}

th, td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid #eaeef2;
}

th {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
}

tbody tr {
    background-color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.7);
}

tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.85);
    transform: scale(1.01);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.time-remaining {
    font-weight: bold;
    color: #4facfe;
}

tbody tr:hover .time-remaining {
    animation: pulse 1.5s infinite;
}

.arriving-soon {
    background: linear-gradient(135deg, #007ACC 0%, #00A3FF 100%) !important;
    color: white !important;
}

.arriving-soon td {
    color: white !important;
    border-bottom-color: rgba(255,255,255,0.2) !important;
}

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

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

@keyframes pulse {
    0% { color: #4facfe; }
    50% { color: #00f2fe; }
    100% { color: #4facfe; }
}

/* 响应式布局 */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .navbar {
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
    
    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        display: none;
    }

    tr {
        margin-bottom: 15px;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    td {
        text-align: right;
        padding-left: 50%;
        position: relative;
    }

    td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: calc(50% - 20px);
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        text-align: left;
        color: #6e8efb;
    }
}

.about-content {
    background-color: #;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: calc(100%);
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.about-content p {
    margin: 10px 0;
    padding: 5px 0;
}

/* 移动设备样式 */
.mobile-device {
    overflow-x: hidden;
    position: relative;  /* 改为 relative */
    max-width: 100%;
    margin: 0;
    padding: 10px;
}

.mobile-device .search-box {
    width: 100%;
    max-width: 340px;
    margin: 10px auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-device .search-box input {
    width: 100%;
    height: 40px;
    font-size: 16px;
    margin-bottom: 5px;
}

.mobile-device .search-box button {
    width: 100%;
    height: 40px;
    font-size: 16px;
}

/* 移动设备表格样式 */
.mobile-device table {
    width: 100%;
    margin: 10px auto;
    font-size: 14px;
    border-radius: 8px;
    display: table;  /* 确保表格正常显示 */
}

.mobile-device thead {
    display: table-header-group;  /* 显示表头 */
    background: linear-gradient(135deg, #007ACC 0%, #00A3FF 100%);
    color: white;
}

.mobile-device th {
    padding: 10px 5px;
    font-size: 14px;
    text-align: center;
    font-weight: bold;
    display: table-cell;  /* 确保表头单元格正常显示 */
}

.mobile-device tbody {
    display: table-row-group;
}

.mobile-device tr {
    display: table-row;
}

.mobile-device td {
    display: table-cell;
    padding: 10px 5px;
    font-size: 14px;
    text-align: center;
}

/* 移除之前的响应式表格布局 */
@media screen and (max-width: 480px) {
    .mobile-device table,
    .mobile-device thead,
    .mobile-device tbody,
    .mobile-device th,
    .mobile-device td,
    .mobile-device tr {
        display: revert;  /* 恢复默认表格布局 */
    }
    
    .mobile-device thead tr {
        display: table-row;  /* 显示表头行 */
    }
    
    .mobile-device tbody td::before {
        display: none;  /* 移除之前添加的标签 */
    }
}
.mobile-device .station-name {
    font-size: 20px;
    margin: 15px 0;
    text-align: center;
}

.mobile-device h1 {
    font-size: 22px;
    margin: 15px 0;
    padding: 0 10px;
    text-align: center;
}

.mobile-device .autocomplete-items {
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
    max-height: 200px;
    overflow-y: auto;
}

.mobile-device .line-info {
    width: 100%;
    max-width: 340px;
    margin: 10px auto;
    padding: 15px 10px;
}

.mobile-device .navbar {
    width: 100%;
    padding: 10px;
    height: auto;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-device .navbar a {
    font-size: 14px;
    padding: 8px 12px;
}


@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

.news-ticker {
    width: 100%;
    box-sizing: border-box;
    padding: 15px 30px;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden; /* 确保内容超出时隐藏 */
    white-space: nowrap; /* 确保文字不换行 */
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease; /* 恢复过渡动画 */
    min-height: 50px;
    z-index: 2;
}

.news-ticker::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 5%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7);
  pointer-events: none;
}

.news-ticker.expanded {
    min-height: 200px;
    padding: 20px;
    margin-bottom: 20px;
}

.news-ticker span {
    display: inline-block;
    padding-left: 100%;
    animation: scroll-left 20s linear infinite;
}

.news-ticker.expanded span {
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 10px;
    white-space: normal; /* 展开时允许换行 */
    animation: none; /* 展开时停止动画 */
    padding-left: 0; /* 展开时移除左边距 */
}

.dropdown-arrow {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 14px;
    transition: transform 0.3s ease;
    z-index: 2;
}

.news-ticker.expanded .dropdown-arrow {
    transform: rotate(180deg);
}

.expanded-news {
    display: block;
    margin-top: 15px;
}

.news-content {
    max-height: 150px;
    overflow-y: auto;
    margin-top: 10px;
}

.news-page {
    display: none;
    padding: 10px;
}

.news-page.active {
    display: block;
}

.news-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    gap: 20px;
}

.news-controls button {
    background: none;
    border: 1px solid #6e8efb;
    color: #6e8efb;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.news-controls button:hover {
    background: #6e8efb;
    color: white;
}

.page-indicator {
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

.blur-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.6); /* 半透明白色 */
    backdrop-filter: blur(8px); /* 毛玻璃模糊效果 */
    -webkit-backdrop-filter: blur(8px); /* Safari 支持 */
    z-index: 1; /* 确保在内容上，但在菜单下 */
    display: none; /* 默认隐藏 */
}

/* Dropdown Button */
.dropbtn {
    background-color: transparent;
    color: white;
    padding: 16px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* The container <div> - needed to position the dropdown content */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown Content (Hidden by Default) */
.dropdown-content {
    display: none;
    position: absolute;
    background: linear-gradient(135deg, #007ACC 0%, #00a3ff 100%); /* 与顶栏背景色统一 */
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 8px;
    overflow: hidden;
    top: 100%; /* Position below the button */
    left: 50%; /* Center horizontally */
    transform: translateX(-50%); /* Adjust for centering */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid #5d6bc4; /* 与顶栏边框统一 */
}

/* Links inside the dropdown */
.dropdown-content a {
    color: white; /* 链接颜色与顶栏文字颜色统一 */
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    font-size: 16px;
    font-weight: bold; /* 字体加粗 */
    transition: all 0.3s ease; /* 添加过渡效果 */
    text-shadow: 0 1px 2px rgba(0,0,0,0.2); /* 添加文字阴影 */
}

/* Change color of dropdown links on hover */
.dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.2); /* 悬停背景色 */
    color: #ffeba7; /* 悬停文字颜色 */
    transform: scale(1.05); /* 悬停放大效果 */
}

/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
    display: block;
}

/* Change the background color of the dropdown button when the dropdown content is shown */
.dropdown:hover .dropbtn {
    color: #ffeba7;
    transform: scale(1.05);
}

// ... existing code ...
