/* GraceDownloads 插件样式 */

#grace-downloads-panel {
    background: #fff;
    border: 1px solid #E9E9E6;
    padding: 15px;
    margin-top: 20px;
    border-radius: 3px;
}

#grace-downloads-panel h2 {
    font-size: 1em;
    border-bottom: 1px solid #E9E9E6;
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 15px;
}

.grace-downloads-section {
    margin-bottom: 20px;
}

.grace-list {
    list-style: none;
    padding: 0;
    margin-bottom: 15px;
    min-height: 40px; /* 拖拽区域 */
    border: 1px dashed #ccc;
    padding: 5px;
    border-radius: 3px;
}

.grace-list li {
    display: flex;
    align-items: center;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-bottom: 5px;
    background: #f9f9f9;
    cursor: move;
}

.grace-list li .item-info {
    flex-grow: 1;
}

.grace-list li .item-title {
    font-weight: bold;
    display: block;
}

.grace-list li .item-url {
    color: #666;
    font-size: 0.9em;
    margin-left: 0;
}

.grace-list li .item-actions {
    white-space: nowrap;
}

.grace-list li .item-actions .btn {
    margin-left: 5px;
}

/* 模态框 */
.grace-modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.grace-modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 5px;
    position: relative;
}

.grace-modal-close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.grace-form-group {
    margin-bottom: 15px;
}

.grace-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.grace-form-group input[type="text"],
.grace-form-group input[type="url"],
.grace-form-group select {
    width: 100%;
    height: 34px; /* 统一高度 */
    padding: 6px 12px; /* 调整内边距 */
    box-sizing: border-box; /* 确保 padding 不会影响总宽度 */
}

/* Dragula 拖拽样式 */

/* --- 新版前端样式 --- */

/* 预览区域 */
.grace-previews-frontend-new {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 0;
    margin-bottom: 1em;
}

.grace-pr-header {
    background-color: #f8f9fa;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
}

.grace-pr-title {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
}

.grace-pr-body {
    padding: 16px;
}

.grace-pr-list .grace-pr-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid var(--item-color, #ddd);
    border-radius: 6px;
    text-decoration: none !important;
    color: #333;
    transition: all 0.2s ease-in-out;
}

.grace-pr-list .grace-pr-item:not(:last-child) {
    margin-bottom: 10px;
}

.grace-pr-list .grace-pr-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--item-color, #3498db);
}

.grace-pr-item-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.grace-pr-type-icon svg {
    width: 22px;
    height: 22px;
    color: var(--item-color, #333);
}

.grace-pr-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background-color: #f0f0f0;
    transition: background-color 0.2s;
}

.grace-pr-item:hover .grace-pr-action-btn {
    background-color: var(--item-color, #3498db);
}

.grace-pr-item:hover .grace-pr-action-btn svg {
    color: #fff;
}

/* 下载区域 */
.grace-downloads-frontend-new {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5em;
}

.grace-dl-header {
    background-color: #f8f9fa;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
}

.grace-dl-title {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    text-decoration: none !important;
}

.grace-dl-body {
    padding: 16px;
}

.grace-dl-notice {
    padding: 12px 16px;
    background-color: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 4px;
}

.grace-dl-list .grace-dl-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid var(--item-color, #ddd);
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
}

.grace-dl-list .grace-dl-item:not(:last-child) {
    margin-bottom: 10px;
}

.grace-dl-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.grace-dl-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.grace-dl-item-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.grace-dl-type-icon {
    color: var(--item-color, #333);
}
.grace-dl-type-icon svg {
    width: 22px;
    height: 22px;
}

.grace-dl-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.grace-dl-pass-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--item-color, #2ecc71);
    color: #fff;
    padding: 0 12px;
    border-radius: 6px;
    gap: 8px;
    height: 36px;
    box-sizing: border-box;
    cursor: pointer;
}

.grace-dl-pass-text {
    font-size: 0.9em;
    font-weight: 500;
}

.grace-dl-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    border: none;
    background: none;
    position: relative;
}

.grace-dl-copy-btn {
    color: #fff;
}

.grace-dl-copy-btn .grace-icon-check {
    display: none;
}
.grace-dl-copy-btn.copied .grace-icon-copy {
    display: none;
}
.grace-dl-copy-btn.copied .grace-icon-check {
    display: inline-block;
}

.grace-dl-download-btn {
    background-color: var(--item-color, #3498db);
    color: #fff;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    transition: background-color 0.2s;
}

.grace-dl-download-btn:hover {
    opacity: 0.85;
}

.grace-dl-pass-wrapper + .grace-dl-download-btn {
    background-color: transparent;
    color: var(--item-color, #333);
    border: 1px solid var(--item-color, #ddd);
    width: 36px;
    height: 36px;
    border-radius: 6px;
}

.grace-dl-tooltip {
    display: none;
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    white-space: nowrap;
}

.grace-dl-copy-btn.copied .grace-dl-tooltip {
    display: block;
}

.gu-mirror {
    background: #f0f8ff !important;
    opacity: 0.8;
}

.gu-transit {
    opacity: 0.5;
}

/* 链接类型徽章样式 */
.item-type {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.8em;
    font-weight: normal;
    background-color: #20a8d8; /* 一个温和的蓝色 */
    color: #fff;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
}
