:root {
    --primary: #6366f1;

    --card-bg: rgba(255, 255, 255, 0.55);

    --bg-color: #f0f2f5;

    --card-border: rgba(255, 255, 255, 0.5);
    --card-shadow: 0 8px 32px rgba(99, 102, 241, 0.10);

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --item-bg: #ffffff;
    --item-border: rgba(203, 213, 225, 0.5);
    --item-hover-bg: #ffffff;
    --item-hover-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);

    --notice-bg: rgba(239, 246, 255, 0.8);
    --notice-border: #6366f1;

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);

    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode {
    --card-bg: rgba(30, 41, 59, 0.35);

    --bg-color: #0f172a;

    --card-border: rgba(148, 163, 184, 0.12);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.30);

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --item-bg: rgba(51, 65, 85, 0.5);
    --item-border: rgba(71, 85, 105, 0.4);
    --item-hover-bg: rgba(51, 65, 85, 0.8);
    --item-hover-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);

    --notice-bg: rgba(30, 41, 59, 0.8);
    --notice-border: #818cf8;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
        'Noto Sans SC', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-color);
    overflow-x: hidden;
    font-size: 16px;
    transition: background 0.3s ease;
}

.wrapper {
    padding: 1.5rem;
    width: 100%;
    max-width: 640px;
    position: relative;
}

.theme-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--item-border);
}

.theme-btn {
    position: relative;
    border: 2px solid var(--item-border);
    background: var(--item-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 24px;
    transition: var(--transition);
    overflow: hidden;
    font-size: 0.9rem;
    line-height: 1;
    color: var(--text-muted);
    font-family: inherit;
}

.theme-btn:hover {
    background: var(--item-hover-bg);
    border-color: var(--primary);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.15);
}

.theme-btn .icon-moon,
.theme-btn .icon-sun {
    font-size: 1.1rem;
    transition: var(--transition);
}

.theme-btn .icon-moon {
    display: inline;
}

.theme-btn .icon-sun {
    display: none;
}

body:not(.dark-mode) .theme-btn .icon-moon {
    display: none;
}

body:not(.dark-mode) .theme-btn .icon-sun {
    display: inline;
}

.theme-label {
    font-size: 0.8rem;
    user-select: none;
}

.main {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    padding: 2rem;
    transition: var(--transition);
    animation: fadeInUp 0.6s ease-out;
}

.main:hover {
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15);
}

ul {
    list-style-type: none;
    margin-bottom: 1.25rem;
}

li {
    margin-bottom: 0.25rem;
    background: var(--item-bg);
    border: 1px solid var(--item-border);
    border-radius: 14px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--primary);
    opacity: 0;
    transition: var(--transition);
}

li:hover {
    transform: translateY(-2px);
    background: var(--item-hover-bg);
    border-color: var(--primary);
    box-shadow: var(--item-hover-shadow);
}

li:hover::before {
    opacity: 1;
}

li a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    padding: 0.5rem 0.5rem;
}

li a:hover {
    color: var(--primary);
}

.url-content {
    /*display: flex;*/
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 0.75rem;
}

.url-content span.name {
    flex-shrink: 0;
    min-width: 70px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.url-content span.middle {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: var(--transition);
    white-space: nowrap;
}

.status-normal {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-checking {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.notice {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--notice-bg);
    border-left: 4px solid var(--notice-border);
    padding: 0.85rem 1rem;
    border-radius: 12px;
    transition: var(--transition);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.notice:hover {
    background: var(--item-hover-bg);
}

#stats-container {
    background: var(--item-bg);
    border: 1px solid var(--item-border);
    border-radius: 14px;
    padding: 1.25rem;
    margin-top: 1.25rem;
    transition: var(--transition);
}

#stats-container:hover {
    border-color: var(--primary);
    box-shadow: var(--item-hover-shadow);
}

#last-checked-time {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.stats-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 1rem;
}

.stat-item {
    text-align: center;
    flex: 1;
    padding: 0.5rem;
    border-radius: 10px;
    transition: var(--transition);
}

.stat-item:hover {
    background: var(--item-hover-bg);
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    body {
        font-size: calc(14px + 0.390625vw);
    }

    .wrapper {
        padding: 1rem;
    }

    .main {
        padding: 1.5rem;
        border-radius: 20px;
    }

    li {
        margin-bottom: 0.2rem;
    }

    li a {
        padding: 0.7rem 0.85rem;
    }

    .url-content {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .url-content span.name {
        flex: 0 0 100%;
        font-size: 0.8rem;
        min-width: auto;
    }

    .url-content span.middle {
        font-size: 0.82rem;
        flex: 1 1 auto;
    }

    .status-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .notice {
        padding: 0.7rem 0.85rem;
        font-size: 0.8rem;
    }

    #stats-container {
        padding: 1rem;
        margin-top: 1rem;
    }

    #last-checked-time {
        font-size: 0.82rem;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .wrapper {
        padding: 0.75rem;
    }

    .main {
        padding: 1.25rem;
        border-radius: 16px;
    }

    li a {
        padding: 0.6rem 0.75rem;
    }

    .url-content span.middle {
        font-size: 0.78rem;
    }

    .status-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    .stat-value {
        font-size: 1.1rem;
    }
}

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

li:nth-child(1) {
    animation-delay: 0.05s;
}
li:nth-child(2) {
    animation-delay: 0.10s;
}
li:nth-child(3) {
    animation-delay: 0.15s;
}
li:nth-child(4) {
    animation-delay: 0.20s;
}
li:nth-child(5) {
    animation-delay: 0.25s;
}
li:nth-child(6) {
    animation-delay: 0.30s;
}
li:nth-child(7) {
    animation-delay: 0.35s;
}
li:nth-child(8) {
    animation-delay: 0.40s;
}
li:nth-child(9) {
    animation-delay: 0.45s;
}

li {
    animation: fadeInUp 0.5s ease-out backwards;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .status-checking {
        animation: none;
    }
}
