/* ============================================
   �@�~�Բӭ��B�~�˦�
   ============================================ */

/* �@�̾Ǯռ��� */
.og-author-school {
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
    background: var(--bg-muted, #f3f4f6);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

/* ���ɫ��s */
.btn-share {
    background: var(--bg-card, #fff) !important;
}
.btn-share:hover {
    background: var(--primary, #3b82f6) !important;
    color: #fff !important;
}

/* ============================================
   ���װϼ˦�
   ============================================ */
.comments-section {
    margin-top: 20px;
}

/* ���ת��� */
.comment-form-wrapper {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.comment-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 80px;
    background: var(--bg-input, #f9fafb);
    color: var(--text-primary, #1f2937);
    transition: border-color 0.2s ease;
}

.comment-textarea:focus {
    outline: none;
    border-color: var(--primary, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.comment-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.comment-char-count {
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
}

.btn-comment-submit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary, #3b82f6);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-comment-submit:hover {
    background: var(--primary-dark, #2563eb);
    transform: translateY(-1px);
}

.btn-comment-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* �n�J���� */
.comment-login-prompt {
    text-align: center;
    padding: 24px;
    background: var(--bg-muted, #f3f4f6);
    border-radius: 12px;
    margin-bottom: 20px;
}

.comment-login-prompt a {
    color: var(--primary, #3b82f6);
    font-weight: 600;
}

/* ���צC�� */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comments-loading {
    text-align: center;
    padding: 24px;
    color: var(--text-muted, #6b7280);
}

.comments-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted, #6b7280);
}

.comments-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* ��h���� */
.comment-item {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 16px;
    transition: box-shadow 0.2s ease;
}

.comment-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.comment-author-info {
    display: flex;
    flex-direction: column;
}

.comment-author-name {
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    font-size: 0.95rem;
}

.comment-author-name a {
    color: inherit;
    text-decoration: none;
}

.comment-author-name a:hover {
    color: var(--primary, #3b82f6);
}

.comment-time {
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
}

.comment-actions {
    display: flex;
    gap: 8px;
}

.btn-comment-action {
    padding: 4px 8px;
    background: transparent;
    border: none;
    color: var(--text-muted, #6b7280);
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-comment-action:hover {
    background: var(--bg-muted, #f3f4f6);
    color: var(--danger, #ef4444);
}

.comment-content {
    color: var(--text-primary, #1f2937);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ���J��h */
.load-more-comments {
    text-align: center;
    padding: 16px;
}

.btn-load-more {
    padding: 10px 24px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    color: var(--text-primary, #1f2937);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-load-more:hover {
    background: var(--bg-muted, #f3f4f6);
    border-color: var(--primary, #3b82f6);
}

/* ============================================
   ���ɼu���˦�
   ============================================ */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.share-modal-content {
    position: relative;
    background: var(--bg-card, #fff);
    border-radius: 16px;
    padding: 24px;
    max-width: 420px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.share-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-muted, #f3f4f6);
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #6b7280);
    transition: all 0.2s ease;
}

.share-modal-close:hover {
    background: var(--danger, #ef4444);
    color: #fff;
}

.share-modal-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text-primary, #1f2937);
}

.share-work-title {
    font-size: 0.9rem;
    color: var(--text-muted, #6b7280);
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.share-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.share-options label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    margin-bottom: 8px;
}

/* ���ɳs�� */
.share-url-input {
    display: flex;
    gap: 8px;
}

.share-url-input input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--bg-input, #f9fafb);
    color: var(--text-primary, #1f2937);
}

.btn-copy-url {
    padding: 10px 16px;
    background: var(--primary, #3b82f6);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-copy-url:hover {
    background: var(--primary-dark, #2563eb);
}

.btn-copy-url.copied {
    background: var(--success, #22c55e);
}

/* QR Code */
.share-qrcode-section {
    text-align: center;
}

.share-qrcode {
    display: inline-block;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.share-qrcode img {
    width: 160px;
    height: 160px;
}

.share-qrcode-hint {
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
    margin: 8px 0 0;
}

/* ���s���� */
.share-social-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-share-social {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.2s ease;
}

.btn-share-social:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-share-fb {
    background: #1877f2;
}

.btn-share-line {
    background: #00b900;
}

/* ============================================
   �`��Ҧ�
   ============================================ */
:root[data-theme="dark"] .comment-form-wrapper,
:root[data-theme="dark"] .comment-item {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(71, 85, 105, 0.5);
}

:root[data-theme="dark"] .comment-textarea {
    background: rgba(51, 65, 85, 0.5);
    border-color: rgba(71, 85, 105, 0.5);
    color: #f1f5f9;
}

:root[data-theme="dark"] .comment-login-prompt {
    background: rgba(51, 65, 85, 0.5);
}

:root[data-theme="dark"] .share-modal-content {
    background: #1e293b;
}

:root[data-theme="dark"] .share-url-input input {
    background: rgba(51, 65, 85, 0.5);
    border-color: rgba(71, 85, 105, 0.5);
    color: #f1f5f9;
}

:root[data-theme="dark"] .share-qrcode {
    background: #fff;
}

/* ============================================
   �T����
   ============================================ */
@media (max-width: 768px) {
    .share-modal-content {
        padding: 20px;
        margin: 16px;
    }
    
    .share-qrcode img {
        width: 140px;
        height: 140px;
    }
}

/* ========== 試算表類專屬樣式 ========== */
.og-steps-sheet {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0;
    margin: 0;
    list-style: none;
    counter-reset: sheet-step;
}

.og-steps-sheet > li {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 20px;
    background: var(--bg-secondary, #f9fafb);
    border-radius: 10px;
    border-left: 4px solid #16a34a;
    counter-increment: sheet-step;
}

.og-steps-sheet > li strong {
    font-size: 1rem;
    color: var(--text-primary, #1f2937);
}

.og-step-sub {
    font-size: .875rem;
    color: var(--text-secondary, #6b7280);
    line-height: 1.6;
}

.og-step-note {
    font-size: .82rem;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 6px;
}

.og-step-note-warn {
    color: #d97706;
    background: #fffbeb;
    border-color: #fde68a;
}

.og-sheet-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 16px;
    background: #16a34a;
    color: #fff;
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
}

.og-sheet-link:hover {
    background: #15803d;
    color: #fff;
}

.og-guide-img {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border-color, #e5e7eb);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
}
