/* 全局樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00aef0;
    --primary-hover: #0088cc;
    --live-color: #f2529a;
    --live-hover: #e03d7a;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --dark-bg: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --border-color: #404040;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bilibili-pink: #fb7299;
    --bilibili-blue: #00aef0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 標題區域 */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
    background: var(--gradient);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

/* 服務計數器 */
.service-counter {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.counter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 120px;
    transition: all 0.3s ease;
}

.counter-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.counter-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    font-weight: 500;
}

.counter-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.counter-unit {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .service-counter {
        gap: 15px;
    }
    
    .counter-item {
        min-width: 100px;
        padding: 12px 15px;
    }
    
    .counter-value {
        font-size: 20px;
    }
}


.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo i {
    font-size: 3rem;
    color: var(--bilibili-pink);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--bilibili-pink), var(--bilibili-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    opacity: 0.9;
}

.domain {
    font-size: 1rem;
    color: var(--bilibili-blue);
    font-weight: 600;
    margin-top: 10px;
    padding: 8px 16px;
    background: rgba(0, 174, 240, 0.1);
    border: 2px solid var(--bilibili-blue);
    border-radius: 25px;
    display: inline-block;
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 10px rgba(0, 174, 240, 0.3);
    }
    to {
        box-shadow: 0 0 20px rgba(0, 174, 240, 0.6);
    }
}

/* 輸入區域 */
.input-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.url-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--dark-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 174, 240, 0.1);
}

.url-input::placeholder {
    color: var(--text-secondary);
}

.parse-btn {
    padding: 15px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.parse-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 174, 240, 0.3);
}

.parse-btn:active {
    transform: translateY(0);
}

.example-links {
    text-align: center;
}

.example-links p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.example-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.example-btn {
    padding: 8px 16px;
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.example-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* 結果區域 */
.result-section {
    background: var(--card-bg);
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--bilibili-blue));
    color: white;
}

.result-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
}

.copy-all-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.copy-all-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.result-content {
    padding: 30px;
}

.result-item {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.result-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 174, 240, 0.1);
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-url {
    background: var(--card-bg);
    padding: 12px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    word-break: break-all;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
}

.copy-btn {
    padding: 6px 12px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.copy-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

/* 功能特點區域 */
.features-section {
    margin-bottom: 40px;
}

.features-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.feature-card {
    background: var(--card-bg);
    padding: 30px 20px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.feature-card:hover::before {
    left: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.feature-card i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 頁腳 */
.footer {
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.footer p {
    margin-bottom: 5px;
}

.footer a {
    color: var(--text-primary) !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--bilibili-pink) !important;
    text-decoration: underline;
}

/* 確保技術支援超連結的樣式 */
.footer p a[href^="mailto:"] {
    color: var(--text-primary) !important;
}

.footer p a[href^="mailto:"]:hover {
    color: var(--bilibili-pink) !important;
}

.disclaimer {
    font-size: 0.9rem;
    opacity: 0.8;
}

.author-info {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 10px;
    color: var(--text-primary);
}

.author-info a {
    color: var(--text-primary) !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.author-info a:hover {
    color: var(--bilibili-pink) !important;
    text-decoration: underline;
}

/* 載入動畫 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.loading-spinner p {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* 提示框 */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 10000;
    max-width: 300px;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--error-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .parse-btn {
        width: 100%;
    }
    
    .example-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .result-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .toast {
        right: 15px;
        left: 15px;
        transform: translateY(100px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
    
    .language-switcher {
        position: relative;
        top: auto;
        right: auto;
        justify-content: center;
        margin-bottom: 20px;
        padding: 3px;
        background: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(15px);
    }
    
    .lang-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
        min-width: 50px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 30px 20px;
    }
    
    .logo {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .input-section {
        padding: 20px;
    }
    
    .result-content {
        padding: 20px;
    }
}

/* 動畫效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-section {
    animation: fadeInUp 0.5s ease;
}

.feature-card {
    animation: fadeInUp 0.5s ease;
}

/* 滾動條樣式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* 語言切換器 */
.language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 1000;
    padding: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 25px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.lang-btn {
    padding: 10px 18px;
    background: transparent;
    border: none;
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    min-width: 60px;
    text-align: center;
}

.lang-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lang-btn:hover {
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.lang-btn:hover::before {
    opacity: 1;
}

.lang-btn.active {
    background: linear-gradient(135deg, #00A1D6, #FB7299);
    color: white;
    box-shadow: 0 6px 20px rgba(0, 161, 214, 0.4);
    transform: translateY(-2px);
}

.lang-btn.active::before {
    opacity: 0;
}

.lang-btn.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* 新計數器設計 */
.stats-container {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.stat-box {
    background: linear-gradient(135deg, rgba(0, 174, 240, 0.1), rgba(138, 43, 226, 0.1));
    border: 2px solid rgba(0, 174, 240, 0.3);
    border-radius: 15px;
    padding: 20px 25px;
    text-align: center;
    min-width: 140px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.stat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 174, 240, 0.05), rgba(138, 43, 226, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 174, 240, 0.5);
    box-shadow: 0 10px 25px rgba(0, 174, 240, 0.2);
}

.stat-box:hover::before {
    opacity: 1;
}

.stat-number {
    font-size: 32px;
    font-weight: 800;
    color: #00aef0;
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(0, 174, 240, 0.3);
    position: relative;
    z-index: 1;
}

.stat-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Mirror 節點專用欄位樣式 */
.mirror-section {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 152, 0, 0.1));
    border: 2px solid rgba(255, 193, 7, 0.3);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.mirror-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.05), rgba(255, 152, 0, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mirror-section:hover::before {
    opacity: 1;
}

.mirror-input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.mirror-url-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 1rem;
    border: 2px solid rgba(255, 193, 7, 0.5);
    border-radius: 10px;
    background: var(--dark-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.mirror-url-input:focus {
    outline: none;
    border-color: #ffc107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

.mirror-url-input::placeholder {
    color: var(--text-secondary);
}

.mirror-parse-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: #000;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.mirror-parse-btn:hover {
    background: linear-gradient(135deg, #ffb300, #f57c00);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.3);
}

.mirror-parse-btn:active {
    transform: translateY(0);
}

.mirror-note {
    color: rgba(255, 193, 7, 0.9);
    font-size: 0.9rem;
    text-align: center;
    margin: 0;
    position: relative;
    z-index: 1;
    font-style: italic;
}

/* 使用說明區域樣式 */
.usage-section {
    margin-bottom: 40px;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.usage-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--text-primary);
    background: linear-gradient(45deg, var(--bilibili-pink), var(--bilibili-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.usage-notes {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.usage-note {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: var(--dark-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.usage-note::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 174, 240, 0.1), transparent);
    transition: left 0.5s ease;
}

.usage-note:hover::before {
    left: 100%;
}

.usage-note:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 174, 240, 0.1);
}

.usage-note i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 2px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.usage-note p {
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .stats-container {
        gap: 15px;
    }
    
    .stat-box {
        min-width: 110px;
        padding: 15px 20px;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .mirror-input-group {
        flex-direction: column;
    }
    
    .mirror-parse-btn {
        width: 100%;
    }
    
    .usage-notes {
        gap: 15px;
    }
    
    .usage-note {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .usage-note i {
        align-self: center;
    }
}
