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: 2em;
    margin-bottom: 10px;
    margin-top: 0px;
    text-align: center;
    color: #0b9275;
    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: #2c89eb;
}

.add-btn:hover {
    background: #0c6acf;
}

.delete-btn {
    background: #dd5260;
}

.delete-btn:hover {
    background: #ba081a;
}

.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: #0245ff;
    cursor: pointer;
    padding: 5px;
    background: #c3c3c3;
    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;
    align-items: center;
    flex-direction: row;
    gap: 16px;
    z-index: 10;
}

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 4px;
    display: flex;
    align-items: center;
    height: 28px;
}

#theme-icon i {
    font-size: 22px;
    color: #333;
    transition: color 0.2s;
}

body.dark-theme #theme-icon i {
    color: #162f30;
}

.top-right a {
    color: #666;
    text-decoration: none;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 4px;
    height: 28px;
}

.top-right a:hover {
    text-decoration: underline;
}

/* 夜间模式样式 */
body.dark-theme {
    background: #181818;
    color: #eee;
}
body.dark-theme .container {
    background: transparent;
}
body.dark-theme .section {
    background: #232323;
    color: #eee;
}
body.dark-theme textarea,
body.dark-theme input {
    background: #222;
    color: #eee;
    border-color: #444;
}
body.dark-theme button,
body.dark-theme .add-btn,
body.dark-theme .delete-btn,
body.dark-theme .view-sub-btn {
    color: #eee;
}
body.dark-theme #data,
body.dark-theme .subscription-line {
    background: #232323;
    color: #eee;
    border-color: #444;
}
body.dark-theme .subscription-info {
    background: #232323;
    color: #eee;
}

.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;
    color: black;
}

.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: 14px;
    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;
    }
}

.change-password-btn {
    color: #666;
    text-decoration: none;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 4px;
    height: 28px;
    white-space: nowrap;
}

.change-password-btn:hover {
    text-decoration: underline;
}

/* 自定义小月亮图标，内部填充黑色 */
#theme-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}
#theme-icon .custom-moon {
    display: block;
    width: 22px;
    height: 22px;
}

/* 夜间模式下图标变为太阳 */
body.dark-theme #theme-icon .custom-moon {
    display: none;
}
body.dark-theme #theme-icon .custom-sun {
    display: block;
    width: 22px;
    height: 22px;
    color: #fff;
}

#theme-icon .custom-sun {
    display: none;
}
