/* 基本重置和页面背景 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f7f9;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

/* 页面容器 */
.container, .page-container {
    width: 100%;
    max-width: 700px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-top: 20px;
    box-sizing: border-box;
}

/* 页面主标题 */
.header h1 {
    font-size: 28px;
    color: #2c3e50;
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
}

.header .title-divider {
    height: 3px;
    background: linear-gradient(90deg, #4e73df 0%, #1cc88a 100%);
    border-radius: 2px;
    margin-bottom: 35px;
}

/* 卡片式布局 */
.card {
    background-color: #fff;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #e3e6f0;
}

.card h2, .card h3 {
    font-size: 20px;
    color: #4e73df;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #e3e6f0;
    padding-bottom: 10px;
}

/* 输入框和按钮组合 */
.input-group {
    display: flex;
    align-items: center;
}

.input-group .input-field {
    flex-grow: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    margin-right: -1px;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* 表单元素 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #5a5c69;
}

.input-field, .file-input-wrapper input[type="text"] {
    width: calc(100% - 24px);
    padding: 12px;
    border: 1px solid #d1d3e2;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-field:focus, .file-input-wrapper input[type="text"]:focus {
    border-color: #4e73df;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
    outline: none;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 25px;
    font-size: 17px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-right: 15px;
    margin-bottom: 0;
}

.btn:last-child {
    margin-right: 0;
}

.btn-primary {
    background-color: #4e73df;
    color: white;
}

.btn-primary:hover {
    background-color: #2e59d9;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #1cc88a; /* 辅助绿色 */
    color: white;
}

.btn-secondary:hover {
    background-color: #6e707e;
    transform: translateY(-2px);
}

/* 文件上传区域美化 */
.file-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #d1d3e2;
    border-radius: 6px;
    padding-left: 12px;
}

.file-input-wrapper input[type="file"] {
    display: none;
}

.file-input-label {
    padding: 10px 15px;
    background-color: #eaecf4;
    color: #5a5c69;
    border-right: 1px solid #d1d3e2;
    cursor: pointer;
    white-space: nowrap;
    font-size: 15px;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}

.file-name-display {
    padding: 10px;
    font-size: 15px;
    color: #858796;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-grow: 1;
}

.file-upload-group {
    display: flex;
    align-items: stretch;
}

.file-upload-group .file-input-area {
    flex-grow: 1;
}

/* 提示信息区域 */
.tips-card {
    background-color: #f8f9fc;
    border-left: 4px solid #1cc88a;
}

.tips-card h2 {
    color: #1cc88a;
    border-bottom-color: #d4eee5;
}

.tips-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.tips-list li {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    font-size: 15px;
    color: #5a5c69;
}

.tips-list li::before {
    content: '💡';
    margin-right: 10px;
    font-size: 18px;
    color: #f6c23e;
    line-height: 1.3;
}

/* 解析结果卡片样式 */
.result-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e3e6f0;
}

.result-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
}

.result-header h3 {
    font-size: 18px;
    color: #4e73df;
    margin: 0;
    font-weight: 600;
}

.result-item {
    display: flex;
    margin-bottom: 15px;
}

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

.label {
    flex-shrink: 0;
    width: 100px;
    font-weight: 600;
    color: #5a5c69;
}

.value {
    font-weight: 500;
    color: #333;
    flex-grow: 1;
}

.copy-container {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.long-url {
    flex-grow: 1;
    word-break: break-all;
    padding-right: 10px;
    color: #5a5c69;
}

.copy-button {
    padding: 6px 12px;
    font-size: 14px;
    margin-left: 5px;
    background-color: #1cc88a;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.copy-button:hover {
    background-color: #17a673;
}

/* 统计信息段落样式 */
.stats p {
    font-size: 16px;
    color: #5a5c69;
    line-height: 1.6;
    margin-bottom: 8px;
}

.stats p:last-child {
    margin-bottom: 0;
}

/* 按钮容器 */
.button-group {
    text-align: center;
    margin-top: 30px;
}

/* 页脚 */
.footer {
    text-align: center;
    margin-top: auto;
    padding: 30px 20px;
    font-size: 14px;
    color: #858796;
    width: 100%;
}
/* 加载动画的样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8); /* 半透明背景 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* 确保覆盖在其他元素之上 */
}

.loading-spinner {
    border: 1em solid #f3f3f3; /* 三边的颜色 */
    border-radius: 50%;
    width: 10%;
    aspect-ratio: 1 / 1; /* 宽高比为1:1 */
    animation: spin 2s linear infinite; /* 旋转动画 */
}
.loading-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* 精确居中 */
    width: 5%; /* 根据需要调整Logo大小 */
    height: auto;
    z-index: 10; /* 确保Logo在圆环上方 */
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
        border-top-color: #4e73df; /* 蓝色 */
    }
    50% {
        border-top-color: #1cc88a; /* 绿色 */
    }
    100% {
        transform: rotate(360deg);
        border-top-color: #4e73df; /* 蓝色 */
    }
}
/* ... (您已有的 CSS 样式) ... */

/* 模态框样式 */
.modal-overlay {
    display: none; /* 默认隐藏 */
    position: fixed; /* 固定定位，覆盖整个屏幕 */
    z-index: 1000; /* 确保在最上层 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* 如果内容过多则允许滚动 */
    background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色背景 */
    justify-content: center; /* Flexbox 水平居中 */
    align-items: center; /* Flexbox 垂直居中 */
}

.modal-content {
    background-color: #ffffff;
    margin: auto; /* 另一种居中方式，与 flex 一起使用可确保兼容性 */
    padding: 0; /* 内边距由 header, body, footer 控制 */
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px; /* 最大宽度 */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    animation: fadeInModal 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

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

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #dc3545; /* 错误提示的红色标题 */
    border-bottom: none; /* 移除卡片标题的下划线 */
    padding-bottom: 0;
}

.modal-close-btn {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    padding: 0 5px; /* 增加点击区域 */
}

.modal-close-btn:hover,
.modal-close-btn:focus {
    color: #333;
    text-decoration: none;
}

.modal-body {
    padding: 20px;
    font-size: 16px;
    color: #5a5c69;
    line-height: 1.6;
    max-height: 60vh; /* 限制内容最大高度，超出则滚动 */
    overflow-y: auto; /* 内容超出时显示垂直滚动条 */
}

.modal-body p {
    margin-top: 0;
    margin-bottom: 10px;
    word-wrap: break-word; /* 长单词或URL换行 */
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    text-align: right; /* 按钮靠右 */
}

.modal-footer .btn { /* 确保页脚按钮样式一致 */
    margin-left: 10px; /* 页脚按钮之间的间距 */
    margin-right: 0;
}
