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

html,
body {
    width: 100%;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: #fff;
    color: #1f2933;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
}

body {
    overflow: auto;
}

#app {
    width: 100%;
    max-width: 389px;
    min-height: 100vh;
    margin: 0 auto;
    background: #fff;
    overflow: hidden;
}

.list-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #fff;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
}

.notice-bar {
    height: 24px;
    line-height: 24px;
    overflow: hidden;
    background: #fff8e9;
    border: 1px solid #f3dfb6;
    border-left: none;
    border-right: none;
    color: #ff8a28;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
}

.notice-bar span {
    display: inline-block;
    min-width: 100%;
    padding-left: 100%;
    animation: notice-scroll 14s linear infinite;
}

@keyframes notice-scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

.search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px 8px;
    background: #fff;
}

.search-box {
    position: relative;
    flex: 1;
    height: 42px;
    min-width: 0;
}

.search-box input {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    outline: none;
    border-radius: 22px;
    background: #f2f2f2;
    padding: 0 16px 0 38px;
    color: #555;
    font-size: 14px;
}

.search-box input::placeholder {
    color: #7a7f86;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 14px;
    height: 14px;
    border: 1.8px solid #39414d;
    border-radius: 50%;
    transform: translateY(-50%);
}

.search-icon::after {
    content: "";
    position: absolute;
    right: -5px;
    bottom: -4px;
    width: 6px;
    height: 1.8px;
    border-radius: 2px;
    background: #39414d;
    transform: rotate(45deg);
}

.search-btn {
    width: 56px;
    height: 42px;
    border: 0;
    border-radius: 22px;
    background: #20c44a;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(32, 196, 74, 0.22);
}

.filter-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: 42px;
    align-items: center;
    background: #fff;
    border-top: 1px solid #f1f1f1;
    border-bottom: 1px solid #e6e6e6;
}

.filter-tabs button {
    height: 100%;
    border: 0;
    background: #fff;
    color: #2e3035;
    font-size: 16px;
    line-height: 42px;
}

.filter-tabs button.active {
    color: #14a83c;
    font-weight: 700;
}

.filter-tabs span {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #c9c9c9;
}

.selection-tip {
    height: 48px;
    padding-top: 6px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
    color: #ff4f83;
    font-size: 14px;
    line-height: 18px;
}

.filter-menu {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 126px;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border: 1px solid #e6e6e6;
    border-radius: 0 0 8px 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.filter-menu[hidden] {
    display: none;
}

.filter-menu button {
    min-height: 34px;
    border: 1px solid #dde5dd;
    border-radius: 18px;
    background: #f8faf8;
    color: #30343b;
    font-size: 13px;
}

.filter-menu button.active {
    border-color: #20c44a;
    background: #20c44a;
    color: #fff;
}

.swiper {
    height: calc(100vh - 174px);
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.swiper::-webkit-scrollbar {
    display: none;
}

.swiper-wrapper {
    width: auto;
    height: auto !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: start;
    align-content: start;
    padding: 8px 10px 210px;
    transform: none !important;
    transition: none !important;
}

.swiper .swiper-slide,
.gallery-card {
    width: auto !important;
    height: auto !important;
    display: block !important;
    overflow: hidden;
    background: #e9f5df;
    border: 1px solid #d9e8cd;
    border-radius: 4px;
    flex-shrink: 1;
}

.gallery-card.is-hidden {
    display: none !important;
}

.slide-media {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: #f3f3f3;
    overflow: hidden;
}

.slide-tile {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
    cursor: zoom-in;
}

.card-info {
    min-height: 66px;
    padding: 8px 8px 7px;
    background: #e9f5df;
    border-top: 1px solid #d8e6cc;
}

.card-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
}

.card-title-line {
    margin-bottom: 12px;
    color: #111;
    font-size: 14px;
    font-weight: 600;
}

.card-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-area {
    flex: 0 0 auto;
    margin-left: 6px;
}

.card-status-line {
    color: #687282;
    font-size: 14px;
}

.card-status {
    flex: 0 0 auto;
    color: #0c9a16;
    font-weight: 700;
    text-align: right;
}

.idle-time {
    color: #ff4b4b;
    font-weight: 500;
}

.online {
    color: #07940c;
}

.footer-box {
    display: none;
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 90;
    width: 100%;
    max-width: 389px;
    transform: translateX(-50%);
    padding: 0 10px calc(env(safe-area-inset-bottom, 0px) + 8px);
    pointer-events: none;
}

.footer-card {
    padding: 14px 16px 12px;
    border-radius: 22px 22px 0 0;
    background: rgba(35, 35, 35, 0.68);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
    color: #fff;
    pointer-events: auto;
}

.footer-tips {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    text-align: center;
}

.footer-tips p {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    line-height: 1.7;
}

.footer-title {
    margin-bottom: 12px;
    text-align: center;
    color: #fff;
    font-size: 17px;
    font-weight: 800;
}

.footer-title .highlight {
    color: #ff7a2a;
}

.footer-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.download-btn {
    flex: 1;
    height: 48px;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.download-btn.downc {
    border-color: #0788ff;
    background: #0788ff;
    box-shadow: 0 5px 16px rgba(7, 136, 255, 0.25);
}

.download-btn.downd {
    background: rgba(255, 255, 255, 0.1);
}

.footer-info {
    display: flex;
    justify-content: center;
    gap: 18px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 11px;
}

.image-preview {
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.96);
    padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
    cursor: zoom-out;
}

.image-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.download-loading {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

.download-loading .loading-content {
    min-width: 150px;
    padding: 22px 30px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    text-align: center;
}

.download-loading .loading-text {
    font-size: 16px;
    font-weight: 600;
}

@media screen and (min-width: 520px) {
    #app {
        box-shadow: 0 0 18px rgba(0, 0, 0, 0.12);
    }
}
