body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 5px;
    background-color: #f4f4f4;
    min-height: 100vh;
    overflow: hidden; 
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    font-size: 2.5em;
    margin-bottom: 10px;
    margin-top: 0px;
    text-align: center;
    color: #1f59ef;
    margin-bottom: 20px;
}

.row {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.column {
    flex: 1;
    min-width: 300px;
}

.section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    position: relative;
}

.input-section {
    height: auto; 
    min-height: 200px;
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    resize: vertical; 
    min-height: 120px;
    max-height: 400px; 
    margin-bottom: 10px;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
}

button {
    width: 100%;
    padding: 10px;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.add-btn {
    background: #007bff;
}

.delete-btn {
    background: #dc3545;
}

.view-sub-btn {
    position: absolute;
    top: 40px;
    right: 20px;
    width: auto;
    padding: 8px 10px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    margin: 0;
    z-index: 1;
}

.view-sub-btn:hover {
    background: #218838;
}

#data {
    height: 465px; 
    background: #f8f9fa;
    padding: 5px 12px;
    border-radius: 4px;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #dee2e6;
    overflow-y: auto;
    margin: 0;
}

/* 订阅信息弹窗样式 */
.subscription-info {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 600px;
    max-width: 90vw;
}

.subscription-line {
    margin: 15px 0;
    position: relative;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.subscription-label {
    display: block;
    color: #666;
    margin-bottom: 5px;
    font-size: 14px;
}

.subscription-url {
    word-break: break-all;
    color: blue;
    cursor: pointer;
    padding: 5px;
    background: #fff;
    border-radius: 3px;
    font-family: monospace;
}

.subscription-url:hover {
    background: #e9ecef;
}

.subscription-note {
    color: #f7022c;
    margin: 20px 0;
    padding: 0 10px;
    font-size: 16px;
}

.copy-indicator {
    display: none;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #28a745;
    font-size: 12px;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.top-right {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 20px;
}

.top-right a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.top-right a:hover {
    text-decoration: underline;
}

.fa-github {
    font-size: 16px;
}

.alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.alert-box {
    background: white;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    min-width: 280px;
}

.alert-message {
    margin-bottom: 15px;
    font-size: 16px;
}

.alert-button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 40px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    width: auto;
}

.alert-button:hover {
    background-color: #218838;
}

.footer {
    text-align: center;
    font-size: 12px;
    color: #666;
}

.footer a {
    color: #666;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
        overflow-y: auto;
    }

    .container {
        max-width: 100%;
    }

    .row {
        flex-direction: column;
        gap: 10px;
    }

    .column {
        min-width: auto;
    }

    .section {
        padding: 15px;
        margin-bottom: 10px;
    }

    .input-section {
        min-height: 150px;
    }

    textarea {
        min-height: 100px;
        max-height: 200px;
    }

    #data {
        height: 300px;
    }

    .subscription-info {
        width: 80vw;
        padding: 10px;
    }

    .subscription-line {
        padding: 8px;
    }

    .subscription-url {
        color: blue;
        font-size: 12px;
    }

    .view-sub-btn {
        position: relative;  
        top: auto;
        right: auto;
        width: 100%;        
        height: 44px;      
        margin-top: 10px;   
        font-size: 14px;   
        display: flex;
        align-items: center;
        justify-content: center;
    }

    button {
        height: 44px;
        font-size: 14px;
        margin-top: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .section {
        padding: 15px;
        margin-bottom: 10px;
        position: relative;
        display: flex;
        flex-direction: column;
    }

    h1 {
        font-size: 1.8em;
        margin-bottom: 15px;
    }

    h2 {
        font-size: 1.2em;
        margin-bottom: 8px;
    }

    .top-right {
        position: static;
        display: flex;
        justify-content: flex-end;
        margin-bottom: 10px;
        gap: 15px;
    }

    button {
        height: 44px;
    }

    .footer {
        margin-top: 15px;
        padding: 10px 0;
        font-size: 10px;
    }
}

/* 针对更小屏幕的适配 */
@media screen and (max-width: 480px) {
    body {
        padding: 8px;
    }

    h1 {
        font-size: 1.5em;
    }

    .section {
        padding: 12px;
    }

    .top-right {
        font-size: 12px;
        gap: 10px;
    }

    .top-right a {
        font-size: 12px;
    }
}
